diff --git a/dist/mathlive.js b/dist/mathlive.js index 75f8acdee..501f352d1 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1 +1 @@ -var global,factory;global=this,factory=function(){const t=0,e=1,s=2,i=3,a=4,o=5,n=6,r=7,l=8,c=9,h=10,p=11,d=12;function m(t,e){e=e||0;const s=t.charCodeAt(e);if(55296<=s&&s<=56319&&e=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function u(u,y){if((y=y||0)<0)return 0;if(y>=u.length-1)return u.length;let g=f(m(u,y));for(let k=y+1;k=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new g("literal","#")}}else"^"===this.peek()?t=new g(this.get()):"_"===this.peek()?t=new g(this.get()):"~"===this.peek()?(this.get(),t=new g("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new g("$$")):t=new g("$")):t=new g("literal",this.get());return t}}var x={tokenize:function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const o=new b(i);for(;!o.end();){const t=o.makeToken();t&&e.push(t)}return e}},k={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const v=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,w={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},S={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},A={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function M(t,e,s){if("string"==typeof t){const s=t.match(/([0-9.]*)\s*([a-z]*)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}let i=1;if("pt"===e?i=1:"mm"===e?i=7227/2540:"cm"===e?i=7227/254:"ex"===e?i=35271/8192:"px"===e?i=.75:"em"===e?i=S.ptPerEm:"bp"===e?i=1.00375:"dd"===e?i=1238/1157:"pc"===e?i=12:"in"===e?i=72.27:"mu"===e&&(i=10/18),s){const e=Math.pow(10,s);return Math.round(t/S.ptPerEm*i*e)/e}return t/S.ptPerEm*i}var C={toEm:M,toPx:function(t,e){return M(t,e)*(4/3)*S.ptPerEm},METRICS:S,SIGMAS:w,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in A?i=A[t[0]].charCodeAt(0):v.test(t[0])&&(i=77);const a=k[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const _=[{},{},{}];let T;for(const t in w)if(w.hasOwnProperty(t))for(T=0;T<3;T++)_[T][t]=w[t][T];for(T=0;T<3;T++)_[T].emPerEx=w.xHeight[T]/w.quad[T];class L{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=_[e>0?e-1:0]}sup(){return q[P[this.id]]}sub(){return q[R[this.id]]}fracNum(){return q[O[this.id]]}fracDen(){return q[K[this.id]]}cramp(){return q[N[this.id]]}cls(){return I[this.size]}adjustTo(t){let e=B[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const D=0,F=2,E=4,z=6,q=[new L(D,0,1,!1),new L(1,0,1,!0),new L(F,1,1,!1),new L(3,1,1,!0),new L(E,2,.7,!1),new L(5,2,.7,!0),new L(z,3,.5,!1),new L(7,3,.5,!0)],I=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],B=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],P=[E,5,E,5,z,7,z,7],R=[5,5,5,5,7,7,7,7],O=[F,3,E,5,z,7,z,7],K=[3,3,5,5,7,7,7,7],N=[1,1,3,3,5,5,7,7];var $={DISPLAY:q[D],TEXT:q[F],SCRIPT:q[E],SCRIPTSCRIPT:q[z],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:q[D],textstyle:q[F],scriptstyle:q[E],scriptscriptstyle:q[z]}[t]:t}};class W{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=$.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new W(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(this,t),"string"==typeof t.mathstyle&&(this.mathstyle=$.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=$.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var V={Context:W};function H(t){let e="";if("number"==typeof t)e+=Math.floor(1e5*t)/1e5;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=H(s);else t&&(e+=t.toString());return e}class U{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=0;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color",""));let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return it[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-.\/:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-.\/:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return it[e]}(this.body,e)),t.cssClass&&(this.classes+=" "+t.cssClass),t.fontShape&&(this.classes+=" "+{it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||""),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+{ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||"",this.classes+=" "+{uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||"")}if(at[e]?this.classes+=" "+at[e]:this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=H(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=H(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=H(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=H(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=H(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?X[t+"+"+i]||0:G[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=Y(s)}}const a=this.tag||"span";if(0===a.length)s=i||"";else{if(s="<"+a,this.cssId&&(s+=' id="'+this.cssId+'" '),this.svgOverlay&&(this.style||(this.style={}),this.style.position="relative"),this.attributes)for(const t in this.attributes)this.attributes.hasOwnProperty(t)&&(s+=" "+t+'="'+this.attributes[t]+'"');const e=this.classes.split(" ");this.type&&(/command|placeholder|error/.test(this.type)&&e.push({command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type]),this.caret&&"command"===this.type&&e.push("ML__command-caret"));let o="";if((o=e.length>1?e.filter(function(t,e,s){return t.length>0&&s.indexOf(t)===e}).join(" "):e[0]).length>0&&(s+=' class="'+o+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=H(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&Z[-t]?i=Z[-t]+i:j[t]?i=j[t]+i:(this.style||(this.style={}),this.style["margin-left"]=H(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)this.style.hasOwnProperty(s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+=i,s+=""):s+=i,s=s+""}return""===s&&(s=""),this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;t0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new U(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=-t.depth-o;o+=t.height+t.depth;const s=tt([r,t]);s.setTop(e),l.push(s)}const c=tt(l,"vlist");return c.depth=Math.max(a,Q(c)||0),c.height=Math.max(-o,J(c)||0),c},makeHlist:st,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=st(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:J,depth:Q,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let nt="";const rt={},lt={},ct={},ht="CRYPTIC",pt="COMMON",dt="SUPERCOMMON",mt={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function ut(t,...e){const s="string"==typeof t?mt[t]:t;for(const t of e)rt[t]&&(rt[t].frequency=s),lt[t]&&(lt[t]=Object.assign({},lt[t]),lt[t].frequency=s)}function ft(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=mt[a]),rt[t]={type:s===At?Mt:s,baseFontFamily:e,value:i,category:nt,frequency:a}}function yt(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);ft(t,"","mord",t)}}const gt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function bt(t,e){const s=String.fromCodePoint(e);if("math"===t&>[s])return gt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in rt)if(rt.hasOwnProperty(t)&&rt[t].value===s){i=t;break}}else for(const t in Rt)if(Rt.hasOwnProperty(t)&&Rt[t]===s){i=t;break}return i||s}const xt={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},kt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function vt(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in xt)if(xt.hasOwnProperty(t)&&xt[t]===e){e=t;break}for(let t=0;t=kt[t].start&&et.body).join("")}function qt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=Et(e),o={category:nt,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)ct[e]=o}function It(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:nt,baseFontFamily:s.fontFamily,params:Et(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)lt[e]=a}nt="Environments",qt("math","",{frequency:0},function(){return{mathstyle:"textstyle"}}),qt("displaymath","",{frequency:8},function(){return{mathstyle:"displaystyle"}}),qt("array","{columns:colspec}",{frequency:pt},function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}}),qt("eqnarray","",{},function(){return{}}),qt("equation","",{},function(){return{colFormat:[{align:"c"}]}}),qt("subequations","",{},function(){return{colFormat:[{align:"c"}]}}),qt("multline","",{},function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}}),qt(["align","aligned"],"",{},function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),It("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),ut(3,"\\textcolor"),It("\\overline","{:auto}",null,function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\overline"),It("\\underline","{:auto}",null,function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\underline"),It("\\overset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\overset"),It("\\underset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\underset"),It(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}}),ut(pt,"\\stackrel"),ut(0,"\\stackbin"),It("\\rlap","{:auto}",null,function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}}),ut(270,"\\rlap"),It("\\llap","{:auto}",null,function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}}),ut(18,"\\llap"),It("\\mathrlap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathrlap"),It("\\mathllap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathllap"),It("\\boxed","{content:math}",null,function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}}),ut(1236,"\\boxed"),It("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}}),ut(ht,"\\colorbox"),It("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}}),ut(ht,"\\fcolorbox"),It("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}}),ut(ht,"\\bbox"),It("\\enclose","{notation:string}[style:string]{body:auto}",null,function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=C.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=C.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i}),ut(ht,"\\enclose"),It("\\cancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}}),It("\\bcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}}),It("\\xcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}}),ut(ht,"\\cancel","\\bcancel","\\xcancel"),nt="Styling",It("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:zt(e[0])})),It("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),It(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),It("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),It("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:zt(e[0])})),It("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),It("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),It("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),It("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:zt(e[0])})),It("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),It("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmss",fontSeries:"m",fontShape:"n"})),It("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),It("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"bb"})),It(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({fontFamily:"frak"})),It("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cal",fontSeries:"m",fontShape:"n"})),It("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"scr",fontSeries:"m",fontShape:"n"})),ut(dt,"\\mathbb"),ut(1081,"\\Bbb"),ut(0,"\\mathcal"),ut(pt,"\\mathfrak"),ut(271,"\\frak"),ut(pt,"\\mathscr"),ut("UNCOMMON","\\mathsf"),ut(pt,"\\mathtt"),ut(pt,"\\boldsymbol"),It("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),It("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),It("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),It("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:zt(e[0])})),It("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:zt(e[0]),body:e[1],type:"group"})),It("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),It("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),ut(pt,"\\textrm"),ut(pt,"\\textit"),ut(pt,"\\textsf"),ut(pt,"\\texttt"),ut(433,"\\textnormal"),ut(pt,"\\textbf"),ut(421,"\\textup"),ut(819,"\\emph"),ut(49,"\\em"),nt="Operators",It("\\sqrt","[index:auto]{radicand:auto}",null,function(t,e){return{type:"surd",body:e[1],index:e[0]}}),ut(dt,"\\sqrt"),nt="Fractions",It(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s}),It(["\\over","\\atop","\\choose"],"",{infix:!0},function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}}),ut(21,"\\over"),ut(12,"\\atop"),ut(1968,"\\choose"),It(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}}),ut(15,"\\overwithdelims"),ut(pt,"\\atopwithdelims"),nt="Fractions",It("\\pdiff","{numerator}{denominator}",null,function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}}),nt="Quantifiers",ft("\\forall","",Mt,"∀",dt),ft("\\exists","",Mt,"∃",dt),ft("\\nexists",St,Mt,"∄",dt),ft("\\mid","",_t,"∣",pt),ft("\\top","",Mt,"⊤","RARE"),ft("\\bot","",Mt,"⊥","RARE"),nt="Variable Sized Symbols",It(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}}),It(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}}),ut(dt,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),ut(pt,"\\bigoplus","\\smallint","\\iint","\\oint"),ut("RARE","\\bigwedge","\\bigvee"),ut(756,"\\coprod"),ut(723,"\\bigsqcup"),ut(1241,"\\bigotimes"),ut(150,"\\bigodot"),ut(174,"\\biguplus"),ut(878,"\\iiint"),ut(97,"\\intop"),nt="Various",ft("\\sharp","",Mt,"♯",pt),ft("\\flat","",Mt,"♭",590),ft("\\natural","",Mt,"♮",278),ft("\\#","",Mt,"#","RARE"),ft("\\&","",Mt,"&","RARE"),ft("\\clubsuit","",Mt,"♣",172),ft("\\heartsuit","",Mt,"♡","ARCANE"),ft("\\spadesuit","",Mt,"♠","ARCANE"),ft("\\diamondsuit","",Mt,"♢",ht),ft("\\differencedelta","",_t,"∆",pt),nt="Letters and Letter Like Forms",It("\\unicode","{charcode:number}",null,function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}}),ft("\\backslash","",Mt,"\\"),ft("?","",Mt,"?"),ft("!","",Mt,"!"),ft("\\nabla","",Mt,"∇",dt),ft("\\partial","",Mt,"∂",dt),ft("\\ell","",Mt,"ℓ",pt),ft("\\imaginaryI","",Mt,"i"),ft("\\imaginaryJ","",Mt,"j"),It(["\\Re","\\Im"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}}),ft("\\hbar","",Mt,"ℏ",pt),ft("\\hslash",St,Mt,"ℏ",pt),ft("\\differentialD","cmr",Mt,"d"),ft("\\rd","cmr",Mt,"d"),ft("\\capitalDifferentialD","cmr",Mt,"D"),ft("\\rD","cmr",Mt,"D"),ft("\\exponentialE","cmr",Mt,"e"),ft("\\Finv",St,Mt,"Ⅎ",3),ft("\\Game",St,Mt,"⅁",1),ft("\\wp","",Mt,"℘",1306),ft("\\eth",St,Mt,"ð",77),ft("\\mho",St,Mt,"℧",138),ft("\\Bbbk",St,Mt,"k"),ft("\\doubleStruckCapitalN","bb",Mt,"N"),ft("\\N","bb",Mt,"N"),ft("\\doubleStruckCapitalR","bb",Mt,"R"),ft("\\R","bb",Mt,"R"),ft("\\doubleStruckCapitalQ","bb",Mt,"Q"),ft("\\Q","bb",Mt,"Q"),ft("\\doubleStruckCapitalC","bb",Mt,"C"),ft("\\C","bb",Mt,"C"),ft("\\doubleStruckCapitalZ","bb",Mt,"Z"),ft("\\Z","bb",Mt,"Z"),ft("\\doubleStruckCapitalP","bb",Mt,"P"),ft("\\P","bb",Mt,"P"),ft("\\scriptCapitalE","scr",Mt,"E"),ft("\\scriptCapitalH","scr",Mt,"H"),ft("\\scriptCapitalL","scr",Mt,"L"),ft("\\gothicCapitalC","frak",Mt,"C"),ft("\\gothicCapitalH","frak",Mt,"H"),ft("\\gothicCapitalI","frak",Mt,"I"),ft("\\gothicCapitalR","frak",Mt,"R"),ft("\\pounds","",Mt,"£",509),ft("\\yen",St,Mt,"¥",57),ft("\\euro","",Mt,"€",4),nt="Crosses",ft("\\textdagger","",Ct,"†"),ft("\\dagger","",Ct,"†",pt),ft("\\dag","",Ct,"†",pt),ft("\\ddag","",Ct,"‡",500),ft("\\textdaggerdbl","",Ct,"‡"),ft("\\ddagger","",Ct,"‡",353),ft("\\maltese",St,Mt,"✠",24),nt="Arrows",ft("\\longrightarrow","",_t,"⟶",dt),ft("\\rightarrow","",_t,"→",dt),ft("\\Longrightarrow","",_t,"⟹",dt),ft("\\Rightarrow","",_t,"⇒",dt),ft("\\longmapsto","",_t,"⟼",pt),ft("\\mapsto","",_t,"↦",pt),ft("\\Longleftrightarrow","",_t,"⟺",pt),ft("\\rightleftarrows",St,_t,"⇄",pt),ft("\\leftarrow","",_t,"←",pt),ft("\\curvearrowleft",St,_t,"↶",pt),ft("\\uparrow","",_t,"↑",pt),ft("\\downarrow","",_t,"↓",pt),ft("\\hookrightarrow","",_t,"↪",pt),ft("\\rightharpoonup","",_t,"⇀",pt),ft("\\rightleftharpoons","",_t,"⇌",pt),ft("\\Leftarrow","",_t,"⇐",1695),ft("\\longleftrightarrow","",_t,"⟷",1599),ft("\\longleftarrow","",_t,"⟵",878),ft("\\Longleftarrow","",_t,"⟸",296),ft("\\searrow","",_t,"↘",1609),ft("\\nearrow","",_t,"↗",1301),ft("\\swarrow","",_t,"↙",167),ft("\\nwarrow","",_t,"↖",108),ft("\\Uparrow","",_t,"⇑",257),ft("\\Downarrow","",_t,"⇓",556),ft("\\updownarrow","",_t,"↕",192),ft("\\Updownarrow","",_t,"⇕",161),ft("\\hookleftarrow","",_t,"↩",115),ft("\\leftharpoonup","",_t,"↼",93),ft("\\leftharpoondown","",_t,"↽",42),ft("\\rightharpoondown","",_t,"⇁",80),ft("\\leftrightarrows",St,_t,"⇆",765),ft("\\dashrightarrow",St,_t,"⇢",311),ft("\\dashleftarrow",St,_t,"⇠",5),ft("\\leftleftarrows",St,_t,"⇇",8),ft("\\Lleftarrow",St,_t,"⇚",7),ft("\\twoheadleftarrow",St,_t,"↞",32),ft("\\leftarrowtail",St,_t,"↢",25),ft("\\looparrowleft",St,_t,"↫",6),ft("\\leftrightharpoons",St,_t,"⇋",205),ft("\\circlearrowleft",St,_t,"↺",105),ft("\\Lsh",St,_t,"↰",11),ft("\\upuparrows",St,_t,"⇈",15),ft("\\downharpoonleft",St,_t,"⇃",21),ft("\\multimap",St,_t,"⊸",108),ft("\\leftrightsquigarrow",St,_t,"↭",31),ft("\\twoheadrightarrow",St,_t,"↠",835),ft("\\rightarrowtail",St,_t,"↣",195),ft("\\looparrowright",St,_t,"↬",37),ft("\\curvearrowright",St,_t,"↷",209),ft("\\circlearrowright",St,_t,"↻",63),ft("\\Rsh",St,_t,"↱",18),ft("\\downdownarrows",St,_t,"⇊",6),ft("\\upharpoonright",St,_t,"↾",579),ft("\\downharpoonright",St,_t,"⇂",39),ft("\\rightsquigarrow",St,_t,"⇝",674),ft("\\leadsto",St,_t,"⇝",709),ft("\\Rrightarrow",St,_t,"⇛",62),ft("\\restriction",St,_t,"↾",29),ft("\\upharpoonleft",St,_t,"↿",ht),ft("\\rightrightarrows",St,_t,"⇉",ht),nt="Negated Arrows",ft("\\nrightarrow",St,_t,"↛",324),ft("\\nRightarrow",St,_t,"⇏",107),ft("\\nleftrightarrow",St,_t,"↮",36),ft("\\nLeftrightarrow",St,_t,"⇎",20),ft("\\nleftarrow",St,_t,"↚",7),ft("\\nLeftarrow",St,_t,"⇍",5),nt="Negated Relations",ft("\\nless",St,_t,"≮",146),ft("\\nleqslant",St,_t,"",58),ft("\\lneq",St,_t,"⪇",54),ft("\\lneqq",St,_t,"≨",36),ft("\\nleqq",St,_t,"",18),ft("\\unlhd",St,Ct,"⊴",253),ft("\\unrhd",St,Ct,"⊵",66),ft("\\lvertneqq",St,_t,"",6),ft("\\lnsim",St,_t,"⋦",4),ft("\\lnapprox",St,_t,"⪉",ht),ft("\\nprec",St,_t,"⊀",71),ft("\\npreceq",St,_t,"⋠",57),ft("\\precnsim",St,_t,"⋨",4),ft("\\precnapprox",St,_t,"⪹",2),ft("\\nsim",St,_t,"≁",40),ft("\\nshortmid",St,_t,"",1),ft("\\nmid",St,_t,"∤",417),ft("\\nvdash",St,_t,"⊬",266),ft("\\nvDash",St,_t,"⊭",405),ft("\\ngtr",St,_t,"≯",90),ft("\\ngeqslant",St,_t,"",23),ft("\\ngeqq",St,_t,"",12),ft("\\gneq",St,_t,"⪈",29),ft("\\gneqq",St,_t,"≩",35),ft("\\gvertneqq",St,_t,"",6),ft("\\gnsim",St,_t,"⋧",3),ft("\\gnapprox",St,_t,"⪊",ht),ft("\\nsucc",St,_t,"⊁",44),ft("\\nsucceq",St,_t,"⋡",ht),ft("\\succnsim",St,_t,"⋩",4),ft("\\succnapprox",St,_t,"⪺",ht),ft("\\ncong",St,_t,"≆",128),ft("\\nshortparallel",St,_t,"",6),ft("\\nparallel",St,_t,"∦",54),ft("\\nVDash",St,_t,"⊯",5),ft("\\nsupseteqq",St,_t,"",1),ft("\\supsetneq",St,_t,"⊋",286),ft("\\varsupsetneq",St,_t,"",2),ft("\\supsetneqq",St,_t,"⫌",49),ft("\\varsupsetneqq",St,_t,"",3),ft("\\nVdash",St,_t,"⊮",179),ft("\\precneqq",St,_t,"⪵",11),ft("\\succneqq",St,_t,"⪶",3),ft("\\nsubseteqq",St,_t,"",16),nt="Various",ft("\\checkmark",St,Mt,"✓",1025),ft("\\diagup",St,Mt,"╱",440),ft("\\diagdown",St,Mt,"╲",175),ft("\\measuredangle",St,Mt,"∡",271),ft("\\sphericalangle",St,Mt,"∢",156),ft("\\backprime",St,Mt,"‵",104),ft("\\backdoubleprime",St,Mt,"‶",ht),nt="Shapes",ft("\\ast","",Ct,"∗",dt),ft("\\star","",Ct,"⋆",pt),ft("\\diamond","",Ct,"⋄",1356),ft("\\Diamond",St,Mt,"◊",695),ft("\\lozenge",St,Mt,"◊",422),ft("\\blacklozenge",St,Mt,"⧫",344),ft("\\bigstar",St,Mt,"★",168),nt="Hebrew",ft("\\aleph","",Mt,"ℵ",1381),ft("\\beth",St,Mt,"ℶ",54),ft("\\daleth",St,Mt,"ℸ",43),ft("\\gimel",St,Mt,"ℷ",36),nt="Fences",ft("\\lbrace","",Tt,"{",dt),ft("\\rbrace","",Lt,"}",dt),ft("\\langle","",Tt,"⟨",pt),ft("\\rangle","",Lt,"⟩",pt),ft("\\lfloor","",Tt,"⌊",pt),ft("\\rfloor","",Lt,"⌋",pt),ft("\\lceil","",Tt,"⌈",pt),ft("\\rceil","",Lt,"⌉",pt),ft("\\vert","",Mt,"∣",dt),ft("\\mvert","",_t,"∣"),ft("\\lvert","",Tt,"∣",496),ft("\\rvert","",Lt,"∣",496),ft("\\|","",Mt,"∥"),ft("\\Vert","",Mt,"∥",dt),ft("\\mVert","",Mt,"∥"),ft("\\lVert","",Tt,"∥",287),ft("\\rVert","",Lt,"∥",ht),ft("\\lbrack","",Tt,"[",574),ft("\\rbrack","",Lt,"]",213),ft("\\{","",Tt,"{"),ft("\\}","",Lt,"}"),ft("(","",Tt,"("),ft(")","",Lt,")"),ft("[","",Tt,"["),ft("]","",Lt,"]"),ft("\\ulcorner",St,Tt,"┌",296),ft("\\urcorner",St,Lt,"┐",310),ft("\\llcorner",St,Tt,"└",137),ft("\\lrcorner",St,Lt,"┘",199),ft("\\lgroup","",Tt,"⟮",24),ft("\\rgroup","",Lt,"⟯",24),ft("\\lmoustache","",Tt,"⎰",ht),ft("\\rmoustache","",Lt,"⎱",ht),It(["\\middle"],"{:delim}",null,function(t,e){return{type:"delim",delim:e[0]}}),nt="Sizing";const Bt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function Pt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}It(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,function(t,e){return{type:"sizeddelim",size:Bt[t].size,cls:Bt[t].mclass,delim:e[0]}}),nt="Relations",ft("=","",_t,"=",dt),ft("\\ne","",_t,"≠",dt),ft("\\neq","",_t,"≠",pt),ft("<","",_t,"<",dt),ft("\\lt","",_t,"<",pt),ft(">","",_t,">",dt),ft("\\gt","",_t,">",pt),ft("\\le","",_t,"≤",pt),ft("\\ge","",_t,"≥",pt),ft("\\leqslant",St,_t,"⩽",dt),ft("\\geqslant",St,_t,"⩾",dt),ft("\\leq","",_t,"≤",pt),ft("\\geq","",_t,"≥",pt),ft("\\ll","",_t,"≪"),ft("\\gg","",_t,"≫",pt),ft("\\coloneq","",_t,"≔",5),ft("\\measeq","",_t,"≝"),ft("\\eqdef","",_t,"≞"),ft("\\questeq","",_t,"≟"),ft(":","",_t,":"),ft("\\cong","",_t,"≅",pt),ft("\\equiv","",_t,"≡",pt),ft("\\prec","",_t,"≺",pt),ft("\\preceq","",_t,"⪯",pt),ft("\\succ","",_t,"≻",pt),ft("\\succeq","",_t,"⪰",1916),ft("\\perp","",_t,"⊥",pt),ft("\\parallel","",_t,"∥",pt),ft("\\propto","",_t,"∝",pt),ft("\\Colon","",_t,"∷"),ft("\\smile","",_t,"⌣",pt),ft("\\frown","",_t,"⌢",pt),ft("\\sim","",_t,"∼",pt),ft("\\gtrsim",St,_t,"≳",pt),ft("\\approx","",_t,"≈",dt),ft("\\approxeq",St,_t,"≊",147),ft("\\thickapprox",St,_t,"≈",377),ft("\\lessapprox",St,_t,"⪅",146),ft("\\gtrapprox",St,_t,"⪆",95),ft("\\precapprox",St,_t,"⪷",50),ft("\\succapprox",St,_t,"⪸",ht),ft("\\thicksim",St,_t,"∼",779),ft("\\succsim",St,_t,"≿",251),ft("\\precsim",St,_t,"≾",104),ft("\\backsim",St,_t,"∽",251),ft("\\eqsim",St,_t,"≂",62),ft("\\backsimeq",St,_t,"⋍",91),ft("\\simeq","",_t,"≃",ht),ft("\\lesssim",St,_t,"≲",ht),ft("\\nleq",St,_t,"≰",369),ft("\\ngeq",St,_t,"≱",164),ft("\\smallsmile",St,_t,"⌣",31),ft("\\smallfrown",St,_t,"⌢",71),ft("\\bowtie","",_t,"⋈",558),ft("\\asymp","",_t,"≍",755),ft("\\sqsubseteq","",_t,"⊑",1255),ft("\\sqsupseteq","",_t,"⊒",183),ft("\\leqq",St,_t,"≦",1356),ft("\\eqslantless",St,_t,"⪕",15),ft("\\lll",St,_t,"⋘",157),ft("\\lessgtr",St,_t,"≶",281),ft("\\lesseqgtr",St,_t,"⋚",134),ft("\\lesseqqgtr",St,_t,"⪋",ht),ft("\\risingdotseq",St,_t,"≓",8),ft("\\fallingdotseq",St,_t,"≒",99),ft("\\subseteqq",St,_t,"⫅",82),ft("\\Subset",St,_t,"⋐"),ft("\\sqsubset",St,_t,"⊏",309),ft("\\preccurlyeq",St,_t,"≼",549),ft("\\curlyeqprec",St,_t,"⋞",14),ft("\\vDash",St,_t,"⊨",646),ft("\\Vvdash",St,_t,"⊪",20),ft("\\bumpeq",St,_t,"≏",13),ft("\\Bumpeq",St,_t,"≎",12),ft("\\geqq",St,_t,"≧",972),ft("\\eqslantgtr",St,_t,"⪖",13),ft("\\ggg",St,_t,"⋙",127),ft("\\gtrless",St,_t,"≷",417),ft("\\gtreqless",St,_t,"⋛",190),ft("\\gtreqqless",St,_t,"⪌",91),ft("\\supseteqq",St,_t,"⫆",6),ft("\\Supset",St,_t,"⋑",34),ft("\\sqsupset",St,_t,"⊐",71),ft("\\succcurlyeq",St,_t,"≽",442),ft("\\curlyeqsucc",St,_t,"⋟",10),ft("\\Vdash",St,_t,"⊩",276),ft("\\shortmid",St,_t,"∣",67),ft("\\shortparallel",St,_t,"∥",17),ft("\\between",St,_t,"≬",110),ft("\\pitchfork",St,_t,"⋔",66),ft("\\varpropto",St,_t,"∝",203),ft("\\backepsilon",St,_t,"∍",176),ft("\\llless",St,_t,"⋘",ht),ft("\\gggtr",St,_t,"⋙",ht),ft("\\lhd",St,Ct,"⊲",447),ft("\\rhd",St,Ct,"⊳",338),ft("\\Join","",_t,"⋈",35),ft("\\doteq","",_t,"≐",1450),ft("\\doteqdot",St,_t,"≑",60),ft("\\Doteq",St,_t,"≑",ht),ft("\\eqcirc",St,_t,"≖",6),ft("\\circeq",St,_t,"≗",31),ft("\\lessdot",St,Ct,"⋖",88),ft("\\gtrdot",St,Ct,"⋗",45),ft("\\~","",_t,"~"),nt="Logic",ft("\\leftrightarrow","",_t,"↔",dt),ft("\\Leftrightarrow","",_t,"⇔",dt),ft("\\to","",_t,"→",dt),ft("\\models","",_t,"⊨",pt),ft("\\vdash","",_t,"⊢",pt),ft("\\therefore",St,_t,"∴",1129),ft("\\because",St,_t,"∵",388),ft("\\implies","",_t,"⟹",1858),ft("\\gets","",_t,"←",150),ft("\\dashv","",_t,"⊣",299),ft("\\impliedby","",_t,"⟸",ht),ft("\\biconditional","",_t,"⟷",ht),ft("\\roundimplies","",_t,"⥰",ht),nt="Operators",ft("+","",Ct,"+",dt),ft("-","",Ct,"−",dt),ft("−","",Ct,"−",dt),ft("\\pm","",Ct,"±",pt),ft("\\mp","",Ct,"∓",pt),ft("*","",Ct,"∗",pt),ft("\\times","",Ct,"×",pt),ft("\\div","",Ct,"÷",pt),ft("\\surd","",Mt,"√",pt),ft("\\divides","",Ct,"∣",ht),ft("\\ltimes",St,Ct,"⋉",576),ft("\\rtimes",St,Ct,"⋊",946),ft("\\leftthreetimes",St,Ct,"⋋",34),ft("\\rightthreetimes",St,Ct,"⋌",14),ft("\\intercal",St,Ct,"⊺",478),ft("\\dotplus",St,Ct,"∔",81),ft("\\centerdot",St,Ct,"⋅",271),ft("\\doublebarwedge",St,Ct,"⩞",5),ft("\\divideontimes",St,Ct,"⋇",51),ft("\\cdot","",Ct,"⋅",ht),nt="Others",ft("\\infty","",Mt,"∞",dt),ft("\\prime","",At,"′",dt),ft("\\doubleprime","",Mt,"″"),ft("\\angle","",Mt,"∠",pt),ft("`","",Mt,"‘"),ft("\\$","",Mt,"$"),ft("\\%","",Mt,"%"),ft("\\_","",Mt,"_"),nt="Greek",ft("\\alpha","",At,"α",pt),ft("\\beta","",At,"β",pt),ft("\\gamma","",At,"γ",pt),ft("\\delta","",At,"δ",pt),ft("\\epsilon","",At,"ϵ",pt),ft("\\varepsilon","",At,"ε"),ft("\\zeta","",At,"ζ",pt),ft("\\eta","",At,"η",pt),ft("\\theta","",At,"θ",pt),ft("\\vartheta","",At,"ϑ",pt),ft("\\iota","",At,"ι",pt),ft("\\kappa","",At,"κ",pt),ft("\\varkappa",St,At,"ϰ",pt),ft("\\lambda","",At,"λ",pt),ft("\\mu","",At,"μ",pt),ft("\\nu","",At,"ν",pt),ft("\\xi","",At,"ξ",pt),ft("\\omicron","",At,"o"),ft("\\pi","",At,"π",pt),ft("\\varpi","",At,"ϖ",pt),ft("\\rho","",At,"ρ",pt),ft("\\varrho","",At,"ϱ",pt),ft("\\sigma","",At,"σ",pt),ft("\\varsigma","",At,"ς",pt),ft("\\tau","",At,"τ",pt),ft("\\phi","",At,"ϕ",pt),ft("\\varphi","",At,"φ",pt),ft("\\upsilon","",At,"υ",pt),ft("\\chi","",At,"χ",pt),ft("\\psi","",At,"ψ",pt),ft("\\omega","",At,"ω",pt),ft("\\Gamma","",At,"Γ",pt),ft("\\Delta","",At,"Δ",pt),ft("\\Theta","",At,"Θ",pt),ft("\\Lambda","",At,"Λ",pt),ft("\\Xi","",At,"Ξ",pt),ft("\\Pi","",At,"Π",pt),ft("\\Sigma","",At,"Σ",pt),ft("\\Upsilon","",At,"Υ",pt),ft("\\Phi","",At,"Φ",pt),ft("\\Psi","",At,"Ψ",pt),ft("\\Omega","",At,"Ω",pt),ft("\\digamma",St,At,"ϝ",248),nt="Others",ft("\\emptyset","",Mt,"∅",dt),ft("\\varnothing",St,Mt,"∅",dt),nt="Set Operators",ft("\\cap","",Ct,"∩",dt),ft("\\cup","",Ct,"∪",dt),ft("\\setminus","",Ct,"∖",pt),ft("\\smallsetminus",St,Ct,"∖",254),ft("\\complement",St,Mt,"∁",200),nt="Set Relations",ft("\\in","",_t,"∈",dt),ft("\\notin","",_t,"∉",dt),ft("\\not","",_t,"̸",pt),ft("\\ni","",_t,"∋",pt),ft("\\owns","",_t,"∋",18),ft("\\subset","",_t,"⊂",dt),ft("\\supset","",_t,"⊃",dt),ft("\\subseteq","",_t,"⊆",dt),ft("\\supseteq","",_t,"⊇",dt),ft("\\subsetneq",St,_t,"⊊",1945),ft("\\varsubsetneq",St,_t,"",198),ft("\\subsetneqq",St,_t,"⫋",314),ft("\\varsubsetneqq",St,_t,"",55),ft("\\nsubset",St,_t,"⊄",ht),ft("\\nsupset",St,_t,"⊅",ht),ft("\\nsubseteq",St,_t,"⊈",950),ft("\\nsupseteq",St,_t,"⊉",49),nt="Spacing",ft("\\ ","",Dt," "),ft("~","",Dt," "),ft("\\space","",Dt," "),ft("\\!","",Dt,null),ft("\\,","",Dt,null),ft("\\:","",Dt,null),ft("\\;","",Dt,null),ft("\\enskip","",Dt,null),ft("\\enspace","",Dt,null,672),ft("\\quad","",Dt,null,pt),ft("\\qquad","",Dt,null,pt),It(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},function(t,e){return{type:"spacing",width:e[0]||0}}),It(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:Pt(e[0])||e[0],captureSelection:!0,baseFontFamily:"cmr"};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s}),It(["\\operatorname","\\operatorname*"],"{operator:string}",null,function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s}),nt="Punctuation",ft("\\colon","","mpunct",":",pt),ft("\\cdotp","","mpunct","⋅",pt),ft("\\ldots","","minner","…",pt),ft("\\cdots","","minner","⋯",pt),ft("\\ddots","","minner","⋱",pt),ft("\\mathellipsis","","minner","…",91),ft("\\vdots","",Mt,"⋮",pt),ft("\\ldotp","","mpunct",".",18),ft(",","","mpunct",","),ft(";","","mpunct",";"),nt="Logical Operators",ft("\\wedge","",Ct,"∧",dt),ft("\\vee","",Ct,"∨",dt),ft("\\lnot","",Mt,"¬",pt),ft("\\neg","",Mt,"¬",dt),ft("\\land","",Ct,"∧",659),ft("\\lor","",Ct,"∨",364),ft("\\barwedge",St,Ct,"⊼",21),ft("\\veebar",St,Ct,"⊻",43),ft("\\nor",St,Ct,"⊻",7),ft("\\curlywedge",St,Ct,"⋏",58),ft("\\curlyvee",St,Ct,"⋎",57),nt="Boxes",ft("\\square",St,Mt,"□",pt),ft("\\Box",St,Mt,"□",pt),ft("\\blacksquare",St,Mt,"■",1679),ft("\\boxminus",St,Ct,"⊟",79),ft("\\boxplus",St,Ct,"⊞",276),ft("\\boxtimes",St,Ct,"⊠",457),ft("\\boxdot",St,Ct,"⊡",120),nt="Circles",ft("\\circ","",Ct,"∘",dt),ft("\\bigcirc","",Ct,"◯",903),ft("\\bullet","",Ct,"∙",pt),ft("\\circleddash",St,Ct,"⊝",pt),ft("\\circledast",St,Ct,"⊛",339),ft("\\oplus","",Ct,"⊕",pt),ft("\\ominus","",Ct,"⊖",1568),ft("\\otimes","",Ct,"⊗",pt),ft("\\odot","",Ct,"⊙",pt),ft("\\circledcirc",St,Ct,"⊚",93),ft("\\oslash","",Ct,"⊘",497),ft("\\circledS",St,Mt,"Ⓢ",31),ft("\\circledR",St,Mt,"®",1329),nt="Triangles",ft("\\triangle","",Mt,"△",pt),ft("\\triangleq",St,_t,"≜",pt),ft("\\bigtriangleup","",Ct,"△",1773),ft("\\vartriangle",St,_t,"△",762),ft("\\triangledown",St,Mt,"▽",520),ft("\\bigtriangledown","",Ct,"▽",661),ft("\\triangleleft","",Ct,"◃",534),ft("\\vartriangleleft",St,_t,"⊲",281),ft("\\trianglelefteq",St,_t,"⊴",176),ft("\\ntriangleleft",St,_t,"⋪",13),ft("\\ntrianglelefteq",St,_t,"⋬",22),ft("\\triangleright","",Ct,"▹",516),ft("\\vartriangleright",St,_t,"⊳",209),ft("\\trianglerighteq",St,_t,"⊵",45),ft("\\ntriangleright",St,_t,"⋫",15),ft("\\ntrianglerighteq",St,_t,"⋭",6),ft("\\blacktriangle",St,Mt,"▲",360),ft("\\blacktriangledown",St,Mt,"▼",159),ft("\\blacktriangleleft",St,_t,"◀",101),ft("\\blacktriangleright",St,_t,"▶",271),nt="Others",ft("\\/","",At,"/"),ft("|","","textord","∣"),nt="Big Operators",ft("\\sqcup","",Ct,"⊔",1717),ft("\\sqcap","",Ct,"⊓",735),ft("\\uplus","",Ct,"⊎",597),ft("\\wr","",Ct,"≀",286),ft("\\Cap",St,Ct,"⋒",2),ft("\\Cup",St,Ct,"⋓",2),ft("\\doublecap",St,Ct,"⋒",1),ft("\\doublecup",St,Ct,"⋓",1),ft("\\amalg","",Ct,"⨿",ht),ft("\\And","",Ct,"&"),nt="Accents",It(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}}),ut(pt,"\\bar","\\ddot","\\acute","\\tilde","\\check"),ut(1548,"\\breve"),ut(735,"\\grave"),ut(dt,"\\vec"),nt="Letters and Letter Like Forms",ft("\\imath","",Mt,"ı"),ft("\\jmath","",Mt,"ȷ"),nt="Others",ft("\\degree","",Mt,"°",46),nt="Others",ft("'","",Mt,"′"),ft('"',"",Mt,"”"),nt="Others",It("\\^","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\`","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}}),It("\\'","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\~","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}}),It("\\c","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}});const Rt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},Ot="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),Kt="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var Nt={matchCodepoint:bt,commandAllowed:function(t,e){return!(!lt[e]||"text"===t&&!lt[e].allowedInText)||!!{text:Rt,math:rt}[t][e]},unicodeToMathVariant:vt,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=kt[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=rt[t]:Rt[t]&&(i={value:Rt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?rt[e]&&rt[e].value?rt[e].value:e:Rt[e]?Rt[e]:e},getEnvironmentInfo:function(t){let e=ct[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in lt)lt.hasOwnProperty(s)&&s.startsWith(t)&&!lt[s].infix&&e.push({match:s,frequency:lt[s].frequency});for(const s in rt)rt.hasOwnProperty(s)&&s.startsWith(t)&&e.push({match:s,frequency:rt[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:mt,TEXT_SYMBOLS:Rt,MATH_SYMBOLS:rt,ENVIRONMENTS:ct,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:lt,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?\/.,~<>`|'$%#&^_" ]/,LETTER:Ot,LETTER_AND_DIGITS:Kt};const $t=ot.makeSymbol,Wt=ot.makeStyleWrap,Vt=ot.makeSpan,Ht=ot.makeVlist;function Ut(t,e,s,i,a,o){const n=$t("Size"+s+"-Regular",Nt.getValue("math",e)),r=Wt(t,Vt(n,"delimsizing size"+s),a.mathstyle,$.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Gt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Vt($t(e,Nt.getValue("math",t)),"delimsizinginner"+s)}function jt(t,e,s,i,a,o){let n,r,l,c;n=l=c=Nt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const p=C.getCharacterMetrics(Nt.getValue("math",n),h),d=p.height+p.depth,m=C.getCharacterMetrics(Nt.getValue("math",l),h),u=m.height+m.depth,f=C.getCharacterMetrics(Nt.getValue("math",c),h),y=f.height+f.depth;let g=0,b=1;if(null!==r){const t=C.getCharacterMetrics(Nt.getValue("math",r),h);g=t.height+t.depth,b=2}const x=d+y+g,k=Math.ceil((s-x)/(b*u)),v=x+k*b*u;let w=a.mathstyle.metrics.axisHeight;i&&(w*=a.mathstyle.sizeMultiplier);const S=v/2-w,A=[];if(A.push(Gt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Jt=[0,1.2,1.8,2.4,3],Qt=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],te=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"stack"}],ee=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function se(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return ie(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Yt.includes(e)?Qt:Zt.includes(e)?ee:te;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(Nt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=$t("AMS-Regular",Nt.getValue("math",e)),r=Wt(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ut(t,e,r.size,i,a,o):jt(t,e,s,i,a,o)}function ie(t,e,s){return ot.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo($.TEXT)+" nulldelimiter "+(s||""))}var ae={makeSizedDelim:function(t,e,s,i,a){return"."===e?ie(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Zt.includes(e)||Yt.includes(e)?Ut(t,e,s,!1,i,a):Xt.includes(e)?jt(t,e,Jt[s],!1,i,a):null)},makeCustomSizedDelim:se,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return ie(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/C.METRICS.ptPerEm;let l=i+n,c=s-n,h=901*(c=Math.max(l,c))/500;return l=2*c-r,se(t,e,h=Math.max(h,l),!0,a,o)}};const oe=ot.makeSpan,ne=ot.makeOrd,re=ot.makeInner,le=ot.makeHlist,ce=ot.makeVlist,he=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,pe=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/;class de{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",pe.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":he.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&(this.type="",delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=ne(ye(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(o<(m+=r)&&(o=m),m=0),d.height=a,d.depth=o,l+=a,d.pos=l,l+=o+m,h.push(d)}const d=l/2+a.metrics.axisHeight,m=[];for(let e=0;e0&&m.push(ce(t,s,"individualShift"))}const u=[];let f=!1,y=!1,g=0,b=!this.lFence;for(const s of e){if(s.align&&g>=m.length)break;if(s.align&&g0?3*c:7*S.defaultRuleThickness,d=e.metrics.denom1):(c>0?(h=e.metrics.num2,p=c):(h=e.metrics.num3,p=3*S.defaultRuleThickness),d=e.metrics.denom2);const m=o?o.depth:0,u=l?l.height:0;let f;if(0===c){const t=h-m-(u-d);tot.height(s)+ot.depth(s)+o&&(o=(o+l-ot.height(s)-ot.depth(s))/2),r.setTop(r.height-ot.height(s)-(o+i));const c=oe("",t.mathstyle.adjustTo($.TEXT)+" sqrt-line");let h;if(c.applyStyle(this.getStyle()),c.height=i,h=0===ot.height(s)&&0===ot.depth(s)?oe():ce(t,[s,o,c,i]),!this.index)return this.bind(t,ne([r,h],"sqrt"));const p=t.clone({mathstyle:$.SCRIPTSCRIPT}),d=oe(ye(p,this.index),e.adjustTo($.SCRIPTSCRIPT)),m=Math.max(r.height,h.height),u=Math.max(r.depth,h.depth),f=ce(t,[d],"shift",-(.6*(m-u)));return this.bind(t,ne([oe(f,"root"),r,h],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=ye(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,ne(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=ot.skew(s));const a=Math.min(ot.height(s),e.metrics.xHeight),o=ot.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=oe(oe(o),"accent-body"+n);return(r=ce(t,[s,-a,r])).children[1].setLeft(2*i),ne(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=ye(t.cramp(),this.body),i=S.defaultRuleThickness/e.sizeMultiplier,a=oe("",t.mathstyle.adjustTo($.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=ce(t,[s,3*i,a,i]);else{const e=oe(s);o=ce(t,[i,a,3*i,e],"top",ot.height(e))}return ne(o,this.position)}decomposeOverunder(t){const e=ye(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?oe(ye(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?oe(ye(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return fe(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=oe(ye(t,this.body),"inner");return ne([e,oe("","fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=ne("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===$.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";(s=ot.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op"))).type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=ot.makeOp(ye(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===$.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}applySizing(t){const e={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[this.size]*t.mathstyle.sizeMultiplier;t.size=this.size,t.sizeMultiplier=e}decomposeBox(t){const e=ne(ye(t,this.body));e.setStyle("position","relative");const s=ne(e),i=this.padding?this.padding:S.fboxsep;return s.setStyle("padding",i,"em"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",S.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),s.height=e.height,s.depth=e.depth,s.setStyle("position","relative"),s.setStyle("height",s.height+s.depth,"em"),this.bind(t,s)}decomposeEnclose(t){const e=ne(ye(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(ot.height(e)+ot.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=oe("​","mspace "+t)}else"sizing"===this.type?this.applySizing(t):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?((s=this.makeSpan(t,this.body)).classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&this.caret&&((s=this.makeSpan(t,"​")).caret=this.caret);if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=ye(t.sup(),this.superscript);a=oe(e,i.adjustTo(i.sup()))}if(this.subscript){const e=ye(t.sub(),this.subscript);o=oe(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=ot.height(e)-i.metrics.supDrop,l=ot.depth(e)+i.metrics.subDrop),n=i===$.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=$.TEXT.sizeMultiplier*i.sizeMultiplier,h=.5/S.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=S.defaultRuleThickness;if(r-ot.depth(a)-(ot.height(o)-l)<4*s){l=4*s-(r-a.depth)+ot.height(o);const t=.8*i.metrics.xHeight-(r-ot.depth(a));t>0&&(r+=t,l-=t)}p=ce(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-ot.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,ot.height(o)-.8*i.metrics.xHeight),(p=ce(t,[o],"shift",l)).children[0].setRight(h),this.isCharacterBox()&&p.children[0].setLeft(-ot.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),(p=ce(t,[a],"shift",-r)).children[0].setRight(h));const d=oe(p,"msubsup");return this.caret&&(d.caret=this.caret),ot.makeSpanOfType(s,[e,d])}attachLimits(t,e,s,i){const a=this.superscript?oe(ye(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?oe(ye(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return fe(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"boolean"!=typeof t.generateID&&(t.generateID.overrideID?e=t.generateID.overrideID:(e=t.generateID.seed.toString(36),t.generateID.seed+=1));return e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=ot.makeSpanOfType(s,e);return i.applyStyle(this.getStyle()),t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function me(t){const e=oe("​","arraycolsep");return e.setWidth(t,"em"),e}function ue(t,e,s,i){const a=[];for(const o of e){const e=oe(ye(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return ce(t,a,"individualShift")}function fe(t,e,s,i,a,o,n){if(!a&&!o)return e;e=oe(e);let r=0,l=0;a&&(r=Math.max(S.bigOpSpacing1,S.bigOpSpacing3-a.depth)),o&&(l=Math.max(S.bigOpSpacing2,S.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=S.bigOpSpacing5+ot.height(o)+ot.depth(o)+l+ot.depth(e)+s;(c=ce(t,[S.bigOpSpacing5,o,l,e,r,a,S.bigOpSpacing5],"bottom",n)).children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=ot.height(e)-s;(c=ce(t,[S.bigOpSpacing5,o,l,e],"top",a)).children[0].setLeft(-i)}else if(!o&&a){const o=ot.depth(e)+s;(c=ce(t,[e,r,a,S.bigOpSpacing5],"bottom",o)).children[1].setLeft(i)}return ot.makeSpanOfType(n,c,"op-limits")}function ye(t,e){t instanceof V.Context||(t=new V.Context(t));const s=!t.generateID||!t.generateID.groupNumbers;let i=[];if(Array.isArray(e)){if(0===e.length)return i;if(1===e.length)(i=e[0].decompose(t))&&s&&e[0].isSelected&&i.forEach(t=>t.selected(!0));else{let a="none",o=e[1].type,n=[],r=null,l=null;for(let c=0;ct.selected(!0)):(n.length>0&&(i=[...i,...n],n=[]),i=i.concat(a))}a=e[c].getFinalBaseElement().type,o=e[c+1]?e[c+1].getInitialBaseElement().type:"none"}n.length>0&&(i=[...i,...n],n=[])}}else e&&(i=e.decompose(t))&&s&&e.isSelected&&i.forEach(t=>t.selected(!0));if(!i||0===i.length)return null;const a={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of i)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=a[t.size]/a[t.parentSize];for(const t of i)t.height*=e,t.depth*=e}return i}var ge={MathAtom:de,decompose:ye,makeRoot:function(t,e){const s=new de(t=t||"math","root");return s.body=e||[],0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new de("","first")),s},GREEK_REGEX:he};const be={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},xe={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ke={stringToColor:function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},colorToString:function(t){let e=t.toUpperCase();for(const t in xe)if(xe[t]===e){e=t;break}for(const t in be)if(be[t]===e){e=t;break}return e},AREA_COLORS:["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],LINE_COLORS:["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"]};const ve=ge.MathAtom;class we{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ke.stringToColor(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?C.toEm(t,"pt"):this.parseKeyword("mm")?C.toEm(t,"mm"):this.parseKeyword("cm")?C.toEm(t,"cm"):this.parseKeyword("ex")?C.toEm(t,"ex"):this.parseKeyword("px")?C.toEm(t,"px"):this.parseKeyword("em")?C.toEm(t,"em"):this.parseKeyword("bp")?C.toEm(t,"bp"):this.parseKeyword("dd")?C.toEm(t,"dd"):this.parseKeyword("pc")?C.toEm(t,"pc"):this.parseKeyword("in")?C.toEm(t,"in"):this.parseKeyword("mu")?C.toEm(t,"mu"):C.toEm(t,"pt")}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new ve("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new ve("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=Nt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(!(c=this.end())&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const p=new ve(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return p.array=n,p.rowGaps=r,p.env={...e},p.env.name=t,p}scanImplicitGroup(t){const e=this.style;t||(t=(t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value)));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(Se)){const t=new ve(this.parseMode,"sizing");t.size={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[this.get().value],this.mathList.push(t)}else if(this.hasImplicitCommand(Ae)){this.parseMode="math";const t=new ve("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=Nt.getInfo("\\"+s.value,"math",this.macros);o=e?[new ve(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new ve(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new ve(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new ve(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=Nt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright")){const t=new ve(this.parseMode,"leftright");return t.rightDelim=this.scanDelim()||".",t}const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim()||".",i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new ve(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasToken("^")||this.hasToken("_")||this.hasLiteral("'");){let e;if(this.hasToken("^")?e="superscript":this.hasToken("_")&&(e="subscript"),this.parseToken("^")||this.parseToken("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new ve(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ke.stringToColor(e);if(t)(i=i||{}).backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)(i=i||{}).padding=C.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&((i=i||{}).border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new ve("text",""," ",this.style));else if("placeholder"===t.type)e=new ve(this.parseMode,"placeholder",t.value);else if("command"===t.type){if("placeholder"===t.value)e=new ve(this.parseMode,"placeholder",this.scanArg("string"));else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),(e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t))).latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&((e=new ve(this.parseMode,"spacing",null,this.style)).width=s),e.latex="\\"+t.value}else if(!(e=this.scanMacro(t.value))){const s=Nt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e?i.push(e):t.placeholder?i.push([new ve(this.parseMode,"placeholder",t.placeholder)]):i.push(this.placeholder()),"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new ve(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||((e=new ve(this.parseMode,"error","\\"+t.value)).latex="\\"+t.value)}}else if("literal"===t.type){const s=Nt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=Nt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new ve(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new ve(this.parseMode,"group",Me(x.tokenize(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var Le={pathFromString:Te,pathToString:_e,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)a=(a=(i+=1)>=t.length||i>=e.length)||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return Te(_e(t)).path}};const De={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left[ #0 \\right]"],"math:Alt-Shift-BracketLeft":["insert","\\left{ #0 \\right}"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":"speakParent","!mac:Ctrl-Alt-Up":"speakParent","mac:Ctrl-Meta-Down":"speakGroup","!mac:Ctrl-Alt-Down":"speakGroup","mac:Ctrl-Meta-Left":"speakLeftSibling","!mac:Ctrl-Alt-Left":"speakLeftSibling","mac:Ctrl-Meta-Right":"speakRightSibling","!mac:Ctrl-Alt-Right":"speakRightSibling","mac:Ctrl-Meta-Shift-Down":"speakAllWithSynchronizedHighlighting","!mac:Ctrl-Alt-Shift-Down":"speakAllWithSynchronizedHighlighting"},Fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},Ee={"''":"^{\\doubleprime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi","π":"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:"\\imaginaryI",jj:"\\imaginaryJ",ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial","∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt","∆":"\\differentialD","∂":"\\differentialD",sin:"\\sin",cos:"\\cos",tan:"\\tan",tanh:"\\tanh",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:"\\eta",gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:"\\mu",nu:"\\nu","µ":"\\mu",phi:"\\phi",Phi:"\\Phi",varphi:"\\varphi",psi:"\\psi",Psi:"\\Psi",rho:"\\rho",sigma:"\\sigma",Sigma:"\\Sigma",tau:"\\tau",vartheta:"\\vartheta",upsilon:"\\upsilon",xi:"\\xi",Xi:"\\Xi",zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\mod",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"digit",value:"\\operatorname{mm}"},cm:{after:"digit",value:"\\operatorname{cm}"},km:{after:"digit",value:"\\operatorname{km}"},kg:{after:"digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}"};function ze(t,e){if("string"==typeof e)return e;if(!t)return e?e.value:void 0;let s=!1,i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,p=!1,d=!1,m=!1,u=!1;const f=t[t.length-1];return s=!f||"first"===f.type,f&&(i=!(u="text"===f.mode)&&"mord"===f.type&&Nt.LETTER.test(f.body),a=!u&&"mord"===f.type&&/[0-9]+$/.test(f.body),o=!u&&f.isFunction,n="genfrac"===f.type,r="surd"===f.type,l="mbin"===f.type,c="mrel"===f.type,h="mpunct"===f.type||"minner"===f.type,p=f.array,d="mopen"===f.type,m="mclose"===f.type||"leftright"===f.type),"object"==typeof e&&(e=/nothing/.test(e.after)&&s||/letter/.test(e.after)&&i||/digit/.test(e.after)&&a||/function/.test(e.after)&&o||/frac/.test(e.after)&&n||/surd/.test(e.after)&&r||/binop/.test(e.after)&&l||/relop/.test(e.after)&&c||/punct/.test(e.after)&&h||/array/.test(e.after)&&p||/openfence/.test(e.after)&&d||/closefence/.test(e.after)&&m||/text/.test(e.after)&&u||(/space/.test(e.after),0)?e.value:null),e}function qe(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function Ie(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function Be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===qe("mac")||o===qe("win")||o===qe("ios")||o===qe("android")||o===qe("chromeos")||o===qe("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===qe("mac")||"ios"===qe("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var Pe={KEYBOARD_SHORTCUTS:De,INLINE_SHORTCUTS:Ee,stringify:Be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(Ee).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s){let i="";s&&s.overrideDefaultInlineShortcuts||(i=ze(t,Ee[e]));const a=s&&s.inlineShortcuts?s.inlineShortcuts:null;let o;return a&&(o=ze(t,a[e])),o||i},selectorForKeystroke:function(t,e){for(const s of[qe("mac")+":"+t+":"+e,qe("win")+":"+t+":"+e,qe("ios")+":"+t+":"+e,qe("android")+":"+t+":"+e,qe("chromeos")+":"+t+":"+e,qe("other")+":"+t+":"+e,qe("mac")+":"+e,qe("win")+":"+e,qe("ios")+":"+e,qe("android")+":"+e,qe("chromeos")+":"+e,t+":"+e,e])if(De[s])return De[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=Fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=Ie(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const t in De)if(De.hasOwnProperty(t)&&s.test(Ie(De[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}return Be(e)}};function Re(t,e){this.root=ge.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Oe(t){const e=Object.assign(new Re(t.config,t.target),t);return e.path=Le.clone(t.path),e}function Ke(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function $e(t,e){let s;return"object"!=typeof e&&(e=Ne(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Qe()),s}function We(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i}function Ve(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new ge.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function He(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!$e(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Ue(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Ge(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Ge(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some(function(s){return s===e||Ge(t[s],e)}))return!0;if(t.array)for(let s=We(t.array);s>=0;s--)if(Ge($e(t.array,s),e))return!0}return!1}function je(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ze(t,e){return t?t.length<=1?t:(e&&"ASCIIMath"===e.format||(t=t.replace(/\\\\([^\s\n])/g,"\\$1")),e&&"ASCIIMath"===e.format||!/\\/.test(t)?Xe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e):t):""}function Xe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ye(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/))&&(t="\\sqrt{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/))&&(t="\\sqrt[3]{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^abs(.*)/))&&(t="\\left|"+(s=Ye(s[1],{...e,noWrap:!0})).match+"\\right|",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^["”“](.*?)["”“](.*)/))&&(t="\\text{"+s[1]+"}",t+=Xe(s[2],e),i=!0),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ye(t.substring(1),e),t=t[0],t+=s.match,t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i)if((s=Ye(t,{...e,noWrap:!0})).match&&"/"===s.rest[0]){const a=Ye(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+Xe(a.rest,e)),i=!0}else s.match&&/^(\(|\{|\[)$/.test(t[0])?(t="\\left"+t[0]+s.match+"\\right"+{"(":")","{":"}","[":"]"}[t[0]]+Xe(s.rest,e),i=!0):s.match&&(t=s.match,t+=Xe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/))&&(t=" "+Xe(s[2],e),i=!0),t}function Ye(t,e){let s="",i=t=t.trim();const a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(s=e.noWrap&&"("===a&&")"===o?Xe(t.substring(1,r-1),e):"\\mleft"+a+Xe(t.substring(1,r-1),e)+"\\mright"+o,i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=Pe.forString(null,t,e);if(s)return{match:s=(s=s.replace("_{#?}","")).replace("^{#?}",""),rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/))return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/))return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/))&&(i=t.substring(a[1].length),s=a[1])}return{match:s,rest:i}}function Je(t,e){let s=Pe.forString(null,t,e);return s?(s=(s=s.replace("_{#?}","")).replace("^{#?}",""),s+=" "):s=t,s}function Qe(){return new ge.MathAtom("","first")}Re.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},Re.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new Re;i.path=Le.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},Re.prototype.forEach=function(t){this.root.forEach(t)},Re.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},Re.prototype.setRange=function(t,e,s){s=s||{};const i=Le.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(Le.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(Le.clone(t),i)}let a=Le.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=Le.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(n-=1),this.setPath(a,n)},Re.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},Re.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},Re.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},Re.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},Re.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},Re.prototype.insertFirstAtom=function(){this.siblings()},Re.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=$e(this.parent().array,this.relation()):"string"==typeof(t=this.parent()[this.relation()]||[])&&(t=[]),0!==t.length&&"first"===t[0].type||t.unshift(Qe()),t},Re.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},Re.prototype.isCollapsed=function(){return 0===this.extent},Re.prototype.setExtent=function(t){this.extent=t},Re.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},Re.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},Re.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&Nt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&Nt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(e>=(s-=1))return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Ue(t[e]);)e-=1;for(;Ue(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},Re.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},Re.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},Re.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},Re.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},Re.prototype.extractArgBeforeInsertionPoint=function(){const t=[],e=this.siblings();if(e.length<=1)return[];let s=this.startOffset();if("text"===e[s].mode)for(;s>=1&&"text"===e[s].mode;)t.unshift(e[s]),s--;else for(;s>=1&&("mord"===e[s].type||"surd"===e[s].type||"leftright"===e[s].type);)t.unshift(e[s]),s--;return t},Re.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},Re.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=We(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if($e(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=We(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},Re.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,-1))?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},Re.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,1))?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},Re.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Oe(this),a=e+(s=this.extent+t);if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},Re.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Oe(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if((n=this.wordBoundaryOffset(n,t))<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},Re.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},Re.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Oe(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===i.length){if(e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return!1}return this.setPath(i[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),!0},Re.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},Re.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries}),s+=1,i=this.ancestor(s);return e},Re.prototype.simplifyParen=function(t){t&&this.config.removeExtraneousParentheses&&t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=je(t.numer),t.denom=je(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=je(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=je(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=je(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=je(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=je(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=je(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=We(t.array);e>=0;e--)this.simplifyParen($e(t.array,e))})},Re.prototype.insert=function(t,e){e=e||{};const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const n=[this.getSelectedAtoms()];void 0!==e.placeholder&&(n["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const r=this.siblings(),l=this.startOffset();if(l+10&&r[l]&&"placeholder"===r[l].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ze(t,{...this.config,format:"ASCIIMath"}),o=Ce.parseTokens(x.tokenize(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)Nt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new ge.MathAtom("command","command",e))}else""===t?o=[new ge.MathAtom("command","command","\\")]:(t=Ze(t,this.config),n[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),n[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-n[0].length),Array.isArray(n[0])&&0===n[0].length&&(n[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=Ce.parseTokens(x.tokenize(t),"text",n,e.macros,!1));if(function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},Re.prototype._insertSmartFence=function(t,e){if(!this.config.smartFence)return!1;const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=Nt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;return s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i,this.insert(s,{mode:"math",format:"latex",style:e}),a&&this.move(-1),!0}let a;for(const e in Nt.RIGHT_DELIM)Nt.RIGHT_DELIM.hasOwnProperty(e)&&t===Nt.RIGHT_DELIM[e]&&(a=e);if(a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},Re.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},Re.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new ge.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},Re.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},Re.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},Re.prototype.delete_=function(t){this.contentWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else{if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(1)}}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.contentDidChange()},Re.prototype.moveToNextPlaceholder_=function(){this.leap(1)},Re.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},Re.prototype.moveToNextChar_=function(){this.move(1)},Re.prototype.moveToPreviousChar_=function(){this.move(-1)},Re.prototype.moveUp_=function(){this.up()},Re.prototype.moveDown_=function(){this.down()},Re.prototype.moveToNextWord_=function(){this.skip(1)},Re.prototype.moveToPreviousWord_=function(){this.skip(-1)},Re.prototype.moveToGroupStart_=function(){this.setSelection(0)},Re.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},Re.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},Re.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},Re.prototype.deleteNextChar_=function(){this.delete_(1)},Re.prototype.deletePreviousChar_=function(){this.delete_(-1)},Re.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},Re.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},Re.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},Re.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},Re.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},Re.prototype.transpose_=function(){},Re.prototype.extendToNextChar_=function(){this.extend(1)},Re.prototype.extendToPreviousChar_=function(){this.extend(-1)},Re.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendUp_=function(){this.up({extend:!0})},Re.prototype.extendDown_=function(){this.down({extend:!0})},Re.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},Re.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},Re.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},Re.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},Re.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Qe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Qe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Qe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},Re.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Qe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Qe()]):("nolimits"===this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Qe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},Re.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];return t?(this.parent()[t]||(this.parent()[t]=[Qe()]),this.setSelection(1,"end",t),!0):(this.moveToSuperscript_(),!1)},Re.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},Re.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Oe(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},Re.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Ne(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ke(e.array,i);this.selectionWillChange(),this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom(),this.selectionDidChange()}}},Re.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=Nt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},Re.prototype.addRowAfter_=function(){this.convertParentToArray(),this._addCell("after row")},Re.prototype.addRowBefore_=function(){this.convertParentToArray(),this._addCell("before row")},Re.prototype.addColumnAfter_=function(){this.convertParentToArray(),this._addCell("after column")},Re.prototype.addColumnBefore_=function(){this.convertParentToArray(),this._addCell("before column")},Re.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="md"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="up"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var ts={EditableMathlist:Re,parseMathString:Ze};const es={Escape:"Esc"," ":"Spacebar",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},ss={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function is(t){let e;"Unidentified"===t.key&&t.target&&(e=ss[t.target.value]||t.target.value),e||(e=es[t.key]||t.code)||(e=ss[t.key.toLowerCase()]||t.key);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),t.altKey&&s.push("Alt"),t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function as(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),t()})}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",function(s){return"function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode?n=!1:(n=!0,o=!1,t.blur(),t.focus()),!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(is(s),s))},!0),c.addEventListener("keypress",function(t){o||(i&&a&&e.keystroke(is(i),i),a=t,r(l))},!0),c.addEventListener("keyup",function(){o||!i||a||l()},!0),c.addEventListener("paste",function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)},!0),c.addEventListener("copy",function(t){e.copy&&e.copy(t)},!0),c.addEventListener("cut",function(t){e.cut&&e.cut(t)},!0),c.addEventListener("blur",function(){i=null,a=null},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{n?(t.blur(),t.focus(),n=!1,o=!1,r(l)):o||r(l)})}var os={delegateKeyboardEvents:as,select:as.select,keyboardEventToString:is,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}},ns={UndoManager:class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}])}}};const rs={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},ls={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
equal to","\\supseteq":"superset of or
equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
natural numbers","\\Z":"set of
integers","\\Q":"set of
rational numbers","\\C":"set of
complex numbers","\\R":"set of
real numbers","\\P":"set of
prime numbers","\\lesseqqgtr":"less than, equal to or
greater than","\\gnapprox":"greater than and
not approximately","\\lnapprox":"lesser than and
not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function cs(t){let e=ls[t]||"";return Array.isArray(e)&&(e=e.join("
")),e}function hs(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&(t.popover.style.left=s.x-t.popover.offsetWidth/2+"px",t.popover.style.top=s.y+5+"px"),t.popover.classList.add("is-visible")}function ps(t){t.popover.classList.remove("is-visible")}var ds={getNote:cs,SAMPLES:rs,NOTES:ls,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void ps(t);const i=e,a=function(t,e){const s=Ce.parseTokens(x.tokenize(t),"math",null,e.config.macros),i=ge.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=ot.makeSpan(i,"ML__base"),o=ot.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const n=ot.makeSpan("","ML__strut--bottom");return n.setStyle("height",a.height+a.depth,"em"),n.setStyle("vertical-align",-a.depth,"em"),ot.makeSpan([o,n,a],"ML__mathlive").toMarkup()}(rs[i]||e,t),o=cs(i),n=Pe.forCommand(i);let r=s?'
':"";r+='',r+='
'+a+"
",o&&(r+='
'+o+"
"),n&&(r+='
'+n+"
"),r+="
",hs(t,r+=s?'
':"");let l=t.popover.getElementsByClassName("ML__popover_content");l&&l.length>0&&t._attachButtonHandlers(l[0],["complete",{acceptSuggestion:!0}]),(l=t.popover.getElementsByClassName("ML__popover__prev-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"previousSuggestion"),(l=t.popover.getElementsByClassName("ML__popover__next-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"nextSuggestion")},showPopover:hs,hidePopover:ps,updatePopoverPosition:function t(e,s){if(e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&(e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",e.popover.style.top=t.y+5+"px")}else ps(e)}};function ms(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0],c=function(t,e,s){let i=0;for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,i[0][l]);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=ms(this,this.array[i][e],t);i1&&(s+=" "),s+=ms(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):(s+="."===this.leftDelim?"":this.leftDelim||"",this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=ms(this,this.body,t),s+=this.rightDelim&&"?"!==this.rightDelim&&"."!==this.rightDelim?this.rightDelim:"",this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${ms(this,this.shift,t)}em]`),s+=`{${ms(this,this.width,t)}em}{${ms(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${ms(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${ms(this,this.overscript||this.underscript,t)}}{${ms(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+ms(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+ms(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+this.body+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,this.padding||this.border||this.backgroundcolor){let e=ms(this,this.padding,t);this.border&&(e&&(e+=","),e+="border:"+ms(this,this.border,t)),this.backgroundcolor&&(e&&(e+=","),e+=ms(this,this.backgroundcolor,t)),s+=`[${e}]`}s+=`{${ms(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${ms(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ms(this,this.framecolor,t)}}`),this.backgroundcolor&&(s+=`{${ms(this,this.backgroundcolor,t)}}`),s+=`{${ms(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)this.notation.hasOwnProperty(e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+this.backgroundcolor+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+this.strokeColor+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${ms(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"sizing":s={size1:"\\tiny ",size2:"\\scriptsize ",size3:"\\footnotesize ",size4:"\\small ",size5:"\\normalsize ",size6:"\\large ",size7:"\\Large ",size8:"\\LARGE ",size9:"\\huge ",size10:"\\Huge "}[this.size]||"";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=ms(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=ms(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},us.merge=function(t,e){if(t&&e){const s=us._locale;us.locale=t,us.strings[t]={...us.strings[t],...e},us.locale=s}else if(t&&!e){e=t;for(const t of e)e.hasOwnProperty(t)&&us.merge(t,e[t])}},Object.defineProperty(us,"locale",{set(t){us._locale=t},get:()=>us._locale}),us.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Rückgängig machen"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le Presse-papiers","tooltip.redo":"Refaire","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const fs={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ys={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},gs={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let bs={};const xs={math:"\n
\n
    \n
  • x
  • \n
  • n
  • \n
  • \n \n
  • \n
  • e
  • \n
  • i
  • \n
  • \n
\n
    \n
  • <
  • \n
  • >
  • \n
  • \n \n
  • \n
  • x ²
  • \n
  • x
  • \n
  • \n
\n
    \n
  • (
  • \n
  • )
  • \n
  • \n \n
  • \n
  • \n
  • \n
\n \n
    \n
  • \n
  • \n
  • \n \n
  • \n \n
\n
\n ","lower-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ∞≠
  • \n
  • ,
  • \n
  •  
  • \n \n
\n
","upper-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ∞≠
  • \n
  • ;
  • \n
  •  
  • \n \n
\n
",symbols:"\n
\n
    \n \n
  • {
  • \n
  • }
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • [
  • \n
  • ]
  • \n
  • \n
  • \n
  • \n
  • !
  • \n
  • o
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n\n
  • \n
\n
    \n \n
  • abc
  • \n
  • \n
  • :
  • \n
  • \n
  • \n
  • \n
  • ±
  • \n \n
\n
","lower-greek":"\n
\n
  • φ
  • \n
  • ς
  • \n
  • ϵ
  • \n
  • ρ
  • \n
  • τ
  • \n
  • υ
  • \n
  • θ
  • \n
  • ι
  • \n
  • ο
  • \n
  • π
  • \n
\n
  • α
  • \n
  • σ
  • \n
  • δ
  • \n
  • ϕ
  • \n
  • γ
  • \n
  • η
  • \n
  • ξ
  • \n
  • κ
  • \n
  • λ
  • \n
\n
  • \n
  • ζ
  • \n
  • χ
  • \n
  • ψ
  • \n
  • ω
  • \n
  • β
  • \n
  • ν
  • \n
  • μ
  • \n
  • \n
\n
    \n
  •  
  • \n
  • ,
  • \n
  • ε
  • \n
  • ϑ
  • \n
  • ϰ
  • \n
  • ϖ
  • \n
  • ϱ
  • \n \n
\n
","upper-greek":"\n
\n
  • Φ
  • \n
  • Σ
  • \n
  • Ɛ
  • \n
  • Ρ
  • \n
  • Τ
  • \n
  • Υ
  • \n
  • Θ
  • \n
  • Ι
  • \n
  • Ο
  • \n
  • Π
\n
  • Α
  • \n
  • Σ
  • \n
  • Δ
  • \n
  • Φ
  • \n
  • Γ
  • \n
  • Η
  • \n
  • Ξ
  • \n
  • Κ
  • \n
  • Λ
\n
  • \n
  • Ζ
  • \n
  • Χ
  • \n
  • Ψ
  • \n
  • Ω
  • \n
  • Β
  • \n
  • Ν
  • \n
  • Μ
  • \n
\n
    \n
  •  
  • \n
  • .
  • \n
  •  
  • \n \n
\n
","lower-command":"\n
\n
\n
\n
\n
    \n
  • 01#
  • \n
  • {
  • \n
  • }
  • \n
  • ^
  • \n
  • _
  • \n
  •  
  • \n \n
\n
","upper-command":"\n
\n
\n
\n
\n
    \n
  • \n
  • [
  • \n
  • ]
  • \n
  • (
  • \n
  • )
  • \n
  •  
  • \n \n
\n
","symbols-command":"\n
\n
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 0
\n
  • !
  • @
  • #
  • $
  • %
  • ^
  • &
  • *
  • +
  • =
\n
    \n
  • \\
  • \n
  • |
  • \n
  • /
  • \n
  • `
  • \n
  • ;
  • \n
  • :
  • \n
  • ?
  • \n
  • '
  • \n
  • \"
  • \n
  • \n
\n
    \n
  • abc
  • \n
  • <
  • \n
  • >
  • \n
  • ~
  • \n
  • ,
  • \n
  • .
  • \n
  •  
  • \n \n
\n
",functions:"\n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • (
  • \n
  • )
  • \n
  • \n
  • \n
  •  
  • \n \n
\n
",style:"\n
\n
    \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n\n
  • \n
  • \n
  • \n
  • \n
\n
"};function ks(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=Ce.parseTokens(x.tokenize(t),"math",e,s.config.macros),a=ge.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=ot.makeSpan(a,"ML__base"),n=ot.makeSpan("","ML__strut");n.setStyle("height",o.height,"em");const r=ot.makeSpan("","ML__strut--bottom");return r.setStyle("height",o.height+o.depth,"em"),r.setStyle("vertical-align",-o.depth,"em"),ot.makeSpan([n,r,o],"ML__mathlive").toMarkup()}function vs(t,e,s){let i="
";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},fs,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
"+e[t].label+"
"}}return i+="
",""}function ws(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ys[n]&&(a.setAttribute("data-shifted",ys[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ys[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=bs[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function Ss(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e,n=(o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ")).match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}else;n=(o=o.replace(new RegExp(n[1]+n[2]+n[3]),a)).match(/()/)}return o}var As={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';gs["foreground-color"]=[];for(const t of ke.LINE_COLORS)gs["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});gs["background-color"]=[];for(const t of ke.AREA_COLORS)gs["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});bs={},bs=Object.assign({},gs);for(const t in bs)bs.hasOwnProperty(t)&&(bs[t]=bs[t].slice());const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),bs[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},xs,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},fs,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=vs(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=Ss(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,ws(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e/g,">")}function Ls(t,e){return t&&e.generateID?' extid="'+t+'"':""}function Ds(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,Fs(t)&&(n=t.index,t.index+=1),Es(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=Ps(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,Fs(t)){const e=Ps(t.atoms[n].superscript,0,0,s).mathML,i=Ps(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ps(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function Fs(t){return t.index"+t,a+=Ps(o.subscript,0,0,s).mathML,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ps(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function qs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].latex,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&Fs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ps(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function Is(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Rs(t.atoms[l],s),a+=Ps(t.atoms,l+1,c,s).mathML,a+=Rs(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,zs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Bs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=Rs(t.atoms[t.index],s);a+=e,t.index+=1,zs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,/^(.*)<\/mo>$/.test(e)?o="mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ps(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Rs(t,e){let s="";const i=function(t){if(!t)return"";if("string"==typeof t)return Ts(t);if(!Array.isArray(t)&&"string"==typeof t.body)return Ts(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return Ts(e)}(t.body);return i&&(s=""+i+""),s}ge.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",p={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";p&&(p=' mathvariant="'+p+'"');const d=this.latex?this.latex.trim():null;let m;switch(this.type){case"group":case"root":c=Ps(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(_s[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ps(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(_s[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ps(this.numer,0,0,t).mathML||" ",c+=Ps(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ps(this.numer,0,0,t).mathML+"",c+=""+Ps(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ps(this.body,0,0,t).mathML,c+=Ps(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ps(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ps(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(_s[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ps(this.body,0,0,t).mathML,c+=""+(_s[d]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ps(l,0,0,t).mathML,c+=Ps(n,0,0,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):r?(c+=""+Ps(l,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):n&&(c+=""+Ps(l,t).mathML,c+=Ps(n,0,0,t).mathML,c+="");break;case"mord":c=e[d]||d||("string"==typeof this.body?this.body:""),(m=d?d.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null)?c="&#x"+m[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.latex),c=""+Ts(c)+"";break;case"mbin":case"mrel":case"textord":case"minner":c=d&&e[d]?""+e[d]+"":d&&_s[d]?""+_s[d]+"":Rs(this,t);break;case"mpunct":c='"+(_s[d]||d)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===d?this.body:d||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ps(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ps(this.body,0,0,t).mathML+"";break;case"sizing":break;case"space":c+=" "}return c},ge.toMathML=function(t,e){return Ps(t,0,0,e).mathML};const Os={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ks={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ns={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},$s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ws(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Vs(t){return t&&$s[t]||-1}function Hs(t){return/=|=>/.test(t)?"right":"left"}function Us(t){if("f"===t||"g"===t)return!0;const e=Ns[t];return!!e&&!!/%[^01_^]?/.test(e)}function Gs(t){t=(t||"").trim();let e=Os[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=Nt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function js(t){if(!t)return null;const e=Gs(ti(t)),s=[Vs(e),Hs(e)];return s[0]<=0?null:s}function Zs(t){return null!==js(t)}const Xs={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ys={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Js={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Qs={",":"list",";":"list2"};function ti(t){if(Array.isArray(t)){let e="";for(const s of t)e+=ti(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=ti(s);return e}return""}function ei(t){return parseFloat(t.num)}function si(t){return"object"==typeof t&&void 0!==t.num}function ii(t){let e=0;return si(t)&&(e="object"==typeof t.num?void 0!==t.num.re?xi(t.num.re):0:parseFloat(t.num)),e}function ai(t){let e=0;return si(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?xi(t.num.im):0),e}function oi(t){return t&&void 0!==t.sup}function ni(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||ti(a)===s),i}function ri(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function li(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function ci(t){if(si(t)){const e=ii(t),s=ai(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return ri("negate",t)}function hi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function pi(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||((s=t.atoms[t.index+1])&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=bi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(ti(s.superscript))?(t.index+=1,(s=t.atoms[t.index+1])&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=bi(s.superscript,e)):t.ast.sup=bi(s.superscript,e))):t.index+=1,t}function di(t,e){const s=t.ast;if(ui(t,"!!"))return t.index+=1,t.ast=ri("factorial2",s),t=di(t=pi(t,e),e);if(ui(t,"++"))return t.index+=1,t.ast=ri("increment",s),t=di(t=pi(t,e),e);if(ui(t,"--"))return t.index+=1,t.ast=ri("decrement",s),t=di(t=pi(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ys[i.latex.trim()]&&(t.ast=ri(Ys[i.latex.trim()],s),t=di(t=pi(t,e),e)),t}function mi(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"mclose"===o.type&&ti(o)===s&&(hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i));else if("textord"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"textord"===o.type&&ti(o)===s&&(t.index+=1,t=di(t=pi(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if((o=t.atoms[t.index+1])&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=yi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=di(t=pi(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=di(t=pi(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=bi(o.body,i),hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=Nt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=Nt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=mi(t,e,s))return i&&(t.index+=1),t.ast={fn:Xs[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ui(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===ti(t.atoms[t.index])+ti(t.atoms[t.index+1])}function fi(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ni(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,ni(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ni(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function yi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];const a=Gs(ti(i));if(fi(e))e.ast=ri(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=ci(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=ri("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.index1?ri("list0",s):s[0]||void 0}({atoms:gi(t)},e)}function xi(t){return parseFloat(parseFloat(t).toPrecision(15))}ge.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},n="",r={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],l="";"b"===this.fontSeries&&(l+="bold"),"it"===this.fontShape&&(l+="italic");const c=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/))?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=Ce.parseTokens(x.tokenize(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=Ce.parseTokens(x.tokenize(i),"math",null,t.macros),o=ri("divide",bi(s,t),bi(i,t))):o.fn="divide":o.group=bi(this.body,t);break;case"genfrac":o=ri("divide",bi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?li(1):bi(this.denom,t));break;case"surd":o=this.index?ri("pow",bi(this.body,t),ri("divide",1,bi(this.index,t))):ri("sqrt",bi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":(e=c?c.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0)?n=String.fromCodePoint(parseInt(e[1],16)):(n=Gs(ti(this))).length>0&&"\\"===n.charAt(0)&&"string"==typeof this.body&&(n=this.body),(a=Nt.mathVariantToUnicode(n,r,l).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))!==n?(o={sym:a},r="normal"):o={sym:n};break;case"minner":case"mop":break;case"box":o=bi(this.body,t);break;case"enclose":break;case"array":"cardinality"===this.env.name?o=ri("card",bi(this.array,t)):/matrix|pmatrix|bmatrix/.test(this.env.name)&&(o=ri("array",bi(this.array,t)));break;case"spacing":case"space":case"sizing":case"mathstyle":break;default:o=void 0}return o&&r&&"normal"!==r&&(o.variant=r),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},ge.toAST=function(t,e){return bi(t,e)};const ki={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket '};function vi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function wi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function Si(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function Ai(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function Mi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):((s=document.createElement("div")).setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function Ci(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function _i(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=Mi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=Mi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,Si(window,"focus",this),Si(window,"blur",this),Si(this.element,"focus",this),Si(this.element,"blur",this),Si(this.textarea,"cut",this),Si(this.textarea,"copy",this),Si(this.textarea,"paste",this),os.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this)}),Si(this.element,"touchstart:active mousedown",this),Si(window,"resize",this);const o={...e};o.onSelectionDidChange=_i.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=_i.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.smartFence=this.config.smartFence,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new ts.EditableMathlist(o,this),this.undoManager=new ns.UndoManager(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}let Ti,Li;ge.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1;for(let o=0;o'+o+'. End fraction.';break;case"surd":if(n=ge.toSpeakableFragment(t.body,e),t.index){let s=ge.toSpeakableFragment(t.index,e);const a=(s=s.trim()).replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else vi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=ki[t.leftDelim]||t.leftDelim,i+=ge.toSpeakableFragment(t.body,e),i+=ki[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=ge.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=ki[a]||(o?ki[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=ds.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=ge.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(s=s.trim())+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(s=s.trim())+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=ge.toSpeakableFragment(t.superscript,e);a=a.trim();let o=ge.toSpeakableFragment(t.subscript,e);i+=' the integral from '+s(o=o.trim())+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){const e=ki[t.body]||ki[t.latex.trim()];i+=e||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=ge.toSpeakableFragment(t.body,e),vi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=ge.toSpeakableFragment(t.superscript,e);const a=(s=s.trim()).replace(/<[^>]*>/g,"");if(vi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);s=s.trim(),vi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},ge.toSpeakableText=function(t,e){if(e||(e={textToSpeechMarkup:"",textToSpeechRules:"mathlive"}),e.speechMode="math",window.sre&&"sre"===e.textToSpeechRules){e.generateID=!0;const s=ge.toMathML(t,e);return s?(e.textToSpeechMarkup&&(e.textToSpeechRulesOptions=e.textToSpeechRulesOptions||{},e.textToSpeechRulesOptions.markup=e.textToSpeechMarkup,"ssml"===e.textToSpeechRulesOptions.markup&&(e.textToSpeechRulesOptions.markup="ssml_step"),e.textToSpeechRulesOptions.rate=e.speechEngineRate),e.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(e.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(s)):""}let s=ge.toSpeakableFragment(t,e);if("ssml"===e.textToSpeechMarkup){let t="";e.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===e.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s},_i.prototype.handleEvent=function(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}},_i.prototype.revertToOriginalContent=_i.prototype.$revertToOriginalContent=function(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,Ai(this.textarea,"cut",this),Ai(this.textarea,"copy",this),Ai(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,Ci(this.popover),Ci(this.keystrokeCaption),Ci(this.virtualKeyboard),Ci(document.getElementById("mathlive-alternate-keys-panel")),Ai(this.element,"touchstart:active mousedown",this),Ai(this.element,"focus",this),Ai(this.element,"blur",this),Ai(window,"resize",this),Ai(window,"focus",this),Ai(window,"blur",this)},_i.prototype._resetKeystrokeBuffer=function(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)},_i.prototype._getCaretPosition=function(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach(function(e){s=s||t(e)}),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right+window.scrollX,y:e.bottom+window.scrollY}}return null},_i.prototype._pathFromPoint=function(t,e,s){let i;(s=s||{}).bias=s.bias||0;const a=function t(e,s,i){let a={element:null},o=!0;if(e.getAttribute("data-atom-id")){a.element=e;const t=e.getBoundingClientRect(),n=Math.max(t.left-s,s-t.right),r=Math.max(t.top-i,i-t.bottom);a.distance=n*n+r*r,o=s>=t.left&&s<=t.right}else a.distance=Number.POSITIVE_INFINITY;return o&&e.children&&Array.from(e.children).forEach(function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)}),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter(function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o});if(e&&e.length>0)if(i=Le.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tvoid 0)),t._resetKeystrokeBuffer()):"delete"===e?a=Fi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Fi(t,"",t.mathlist.sibling(0)):"line"===e?(a=Fi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+ge.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Fi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}_i.prototype._onPointerDown=function(t){let e;const s=this;let i=!1,a=!1,o=!1;function n(t){Ai(s.field,"touchmove",r),Ai(s.field,"touchend touchleave",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,t.preventDefault(),t.stopPropagation()}function r(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;if(Date.now()=p.left&&l<=p.right&&c>=p.top&&c<=p.bottom){if(this.hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,t.buttons&&1!==t.buttons)return;(e=this._pathFromPoint(l,c,{bias:0}))&&(t.shiftKey?(this.mathlist.setRange(this.mathlist.path,e),(e=Le.clone(this.mathlist.path))[e.length-1].offset-=1):this.mathlist.setPath(e,0),o=!0,3===t.detail||Di>2?(Ai(this.field,"touchmove",r),Ai(this.field,"touchend",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,3!==t.detail&&3!==Di||this.mathlist.selectAll_()):i||(i=!0,Si(window,"blur",n),t.touches?(Si(t.target,"touchmove",r),Si(t.target,"touchend",n)):(Si(window,"mousemove",r),Si(window,"mouseup",n)),2!==t.detail&&2!==Di||(a=!0,this.mathlist.selectGroup_())))}else Ti=null;o&&this._render(),t.preventDefault()},_i.prototype._onSelectionDidChange=function(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}this.style={},ds.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)},_i.prototype._onContentDidChange=function(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)},_i.prototype._nextAtomSpeechText=function(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Fi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Fi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o},_i.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)},_i.prototype._onFocus=function(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),ds.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._render())},_i.prototype._onBlur=function(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),ds.updatePopoverPosition(this),this._render(),this.config.onBlur&&this.config.onBlur(this))},_i.prototype._onResize=function(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),ds.updatePopoverPosition(this)},_i.prototype.toggleKeystrokeCaption_=function(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")},_i.prototype._showKeystroke=function(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(Pe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout(function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")},3e3)}},_i.prototype.perform=_i.prototype.$perform=function(t){if(!t)return!1;let e,s=!1,i=[],a=!1;return Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]?(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),a=!0,s=!0):"function"==typeof this[e]&&(a=this[e](...i),s=!0),this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||this._resetKeystrokeBuffer(),a&&this._render(),s},_i.prototype.performWithFeedback_=function(t){return this.focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)):("deletePreviousChar"===t||"deleteNextChar"===t||"deletePreviousWord"===t||"deleteNextWord"===t||"deleteToGroupStart"===t||"deleteToGroupEnd"===t||"deleteToMathFieldStart"===t||"deleteToMathFieldEnd"===t)&&this.deleteKeypressSound?(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)),this.perform(t)},_i.prototype.convertLastAtomsToText_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"math"!==a.mode||!/mord|textord|mpunct/.test(a.type)||a.superscript||a.subscript||e&&!e(a))||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()},_i.prototype.convertLastAtomsToMath_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a))||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()},_i.prototype.removeIsolatedSpace_=function(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}},_i.prototype.getTextBeforeAnchor_=function(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);(s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))))||(t=i.body+t),e-=1}return t},_i.prototype.smartMode_=function(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(this.mathlist.isCollapsed()){const e=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[\/^_\\]/.test(s))return!0;const i={")":"(","}":"{","]":"["}[s];if(i&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===i)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(e))return!1;if(/(^|[^a-zA-Z])[a-zA-Z][ ]$/.test(e))return this.convertLastAtomsToMath_(1),!1;if(/\.\S$/.test(e)){const t=this.mathlist.sibling(0);return t.body="⋅",t.fontFamily="cmr",t.latex="\\cdot",t.mode="math",t.type="mord",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/\.[0-9]$/.test(e))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/[(][a-z][,;]$/.test(e))return this.convertLastAtomsToMath_(2),this.removeIsolatedSpace_(),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(e)&&!/dxd$/.test(e))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(e))return this.convertLastAtomsToText_(1),!0;if(/\?|\./.test(s))return!0}}return!1},_i.prototype._onKeystroke=function(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=os.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=Pe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const n=this.mathlist.parent();if("moveAfterParent"===a&&n&&"leftright"===n.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.mathlist._insertSmartFence(".")&&(a="",this._render()),"math"===this.mode&&"Spacebar"===t){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(os.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist._insertSmartFence(s,a)||this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a}),this.removeIsolatedSpace_(),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._render(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1},_i.prototype._onTypedText=function(t,e){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=os.charToEvent(e);if(!this.$keystroke(os.keyboardEventToString(s),s))return}let s="",i=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},a=y.splitGraphemes(t);for(const t of a)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),a=Nt.suggest(e+t);i=a.length>1,0===a.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),ds.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),a[0].match!==e+t&&this.mathlist.insertSuggestion(a[0].match,-a[0].match.length+e.length+1),s=a[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist._insertSmartFence(t,e)||this.mathlist.insert(t,{mode:"math",style:e})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._render(),ds.showPopoverWithLatex(this,s,i)},_i.prototype._hash=function(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;s{t.caret="",t.isSelected=!1});const e=this.hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const s=ge.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=ot.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=ot.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=ot.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=ot.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+ge.toMathML(this.mathlist.root,this.config)+"";const r=this.field.querySelectorAll(".ML__selected");if(r&&r.length>0){const t={top:1/0,bottom:-1/0,left:1/0,right:-1/0};r.forEach(e=>{if(e.classList.contains("ML__selected")){const s=e.getBoundingClientRect();s.leftt.right&&(t.right=s.right),s.bottom>t.bottom&&(t.bottom=s.bottom),s.top0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&Ms[a]?Ms[a]:a&&Cs[a]?Cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=Cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?e.body:e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":case"sizing":break;case"space":i=" "}if(e.subscript){i+="_";const a=t(e.subscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}if(e.superscript){i+="^";const a=t(e.superscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}return i}(t,this.config));return s},_i.prototype.text=_i.prototype.$text=function(t){return this.formatMathlist(this.mathlist.root,t)},_i.prototype.selectedText=_i.prototype.$selectedText=function(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=ge.makeRoot(e[0].mode,e);return this.formatMathlist(s,t)},_i.prototype.selectionIsCollapsed=_i.prototype.$selectionIsCollapsed=function(){return this.mathlist.isCollapsed()},_i.prototype.selectionDepth=_i.prototype.$selectionDepth=function(){return this.mathlist.path.length},_i.prototype._superscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype._subscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype.selectionAtStart=_i.prototype.$selectionAtStart=function(){return 0===this.mathlist.startOffset()},_i.prototype.selectionAtEnd=_i.prototype.$selectionAtEnd=function(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.groupIsSelected=function(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.latex=_i.prototype.$latex=function(t,e){if(t){return t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._render()),t}return this.mathlist.root.toLatex()},_i.prototype.el=_i.prototype.$el=function(){return this.element},_i.prototype.undo_=_i.prototype.undo=function(){return this.complete_(),this.undoManager.undo(this.config),!0},_i.prototype.redo_=_i.prototype.redo=function(){return this.complete_(),this.undoManager.redo(this.config),!0},_i.prototype.scrollIntoView_=_i.prototype.scrollIntoView=function(){return!1},_i.prototype.scrollToStart_=_i.prototype.scrollToStart=function(){return!0},_i.prototype.scrollToEnd_=_i.prototype.scrollToEnd=function(){return!0},_i.prototype.enterCommandMode_=function(){this.switchMode_("command")},_i.prototype.copyToClipboard_=function(){return this.focus(),this.mathlist.isCollapsed()&&this.select(),document.execCommand("copy"),!1},_i.prototype.cutToClipboard_=function(){return this.focus(),document.execCommand("cut"),!0},_i.prototype.pasteFromClipboard_=function(){return this.focus(),document.execCommand("paste"),!0},_i.prototype.insert_=_i.prototype.insert=_i.prototype.$insert=function(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.style.fontFamily||(this.style.fontFamily="math"),this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),!0}return!1},_i.prototype.switchMode_=function(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=!0,e&&this.insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),ds.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._render()},_i.prototype.complete_=function(t){if(t=t||{},ds.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(Nt.commandAllowed(t,e)){const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1},_i.prototype._updateSuggestion=function(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);if(0===e.length)ds.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),ds.showPopoverWithLatex(this,e[s].match,e.length>1)}this._render()},_i.prototype.nextSuggestion_=function(){return this.suggestionIndex+=1,this._updateSuggestion(),!1},_i.prototype.previousSuggestion_=function(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1},_i.prototype._attachButtonHandlers=function(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),Si(t,"mousedown touchstart:passive",function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout(function(){t.classList.contains("pressed")&&s.perform(JSON.parse(l))},300))}}),Si(t,"mouseleave touchcancel",function(){t.classList.remove("pressed")}),Si(t,"touchmove:passive",function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,As.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1},_i.prototype.hideAlternateKeys_=function(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",Ci(t)),!1},_i.prototype.performAlternateKeys_=function(t){return this.hideAlternateKeys_(),this.perform(t)},_i.prototype.switchKeyboardLayer_=function(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){const i=[];for(let t=1;t<=s;t++)i.push(e[t]);t=ge.toSpeakableText(i,this.config)}return this._speak(t),!1},_i.prototype.speakGroup_=function(){return this._speak(ge.toSpeakableText(this.mathlist.siblings(),this.config)),!1},_i.prototype.speakAll_=function(){return this._speak(ge.toSpeakableText(this.mathlist.root,this.config)),!1},_i.prototype.speakAllWithSynchronizedHighlighting_=function(){window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0});const t=this.config;t.textToSpeechMarkup=window.sre&&"sre"===t.textToSpeechRules?"ssml_step":"ssml";const e=ge.toSpeakableText(this.mathlist.root,t);return this._speakWithSynchronizedHighlighting(e),!1};var zi={MathField:_i};function qi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(-1===(r=n.indexOf(e,c))){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(-1===(r=qi(s,n,c+e.length))){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Ri(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))(s=document.createDocumentFragment()).appendChild(Pi(t,void 0,e,!0));else{const i=Bi(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;tvoid 0)}})}else;else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Hi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}})}})}function Ui(t){let e=t;if("string"==typeof t&&!(e=document.getElementById(t)))throw Error(`The element with ID "${t}" could not be found.`);return e}function Gi(t,e){Ki&&((e=e||{}).renderToMarkup=e.renderToMarkup||Ni,e.renderToMathML=e.renderToMathML||$i,e.renderToSpeakableText=e.renderToSpeakableText||Wi,e.macros=e.macros||Nt.MACROS,Ki.renderMathInElement(Ui(t),e))}function ji(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:Ni,latexToMathML:$i,latexToSpeakableText:Wi,latexToAST:function(t,e){if(!ge.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,Nt.MACROS);const s=Ce.parseTokens(x.tokenize(t),"math",null,e.macros);return ge.toAST(s,e)},makeMathField:function(t,e){if(!zi)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Vi,e.handleReadAloud=e.handleReadAloud||Hi,new zi.MathField(Ui(t),e)},renderMathInDocument:function(t){Gi(document.body,t)},renderMathInElement:Gi,revertToOriginalContent:function(t,e){(t=(t=Ui(t)).children[1])instanceof zi.MathField?t.revertToOriginalContent():(ji(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Ui(t)).children[1])instanceof zi.MathField?t.originalContent:(ji(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Hi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e)=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function u(u,y){if((y=y||0)<0)return 0;if(y>=u.length-1)return u.length;let g=f(m(u,y));for(let k=y+1;k=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new g("literal","#")}}else"^"===this.peek()?t=new g(this.get()):"_"===this.peek()?t=new g(this.get()):"~"===this.peek()?(this.get(),t=new g("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new g("$$")):t=new g("$")):t=new g("literal",this.get());return t}}var x={tokenize:function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const o=new b(i);for(;!o.end();){const t=o.makeToken();t&&e.push(t)}return e}},k={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const v=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,w={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},S={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},A={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function M(t,e,s){if("string"==typeof t){const s=t.match(/([0-9.]*)\s*([a-z]*)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}let i=1;if("pt"===e?i=1:"mm"===e?i=7227/2540:"cm"===e?i=7227/254:"ex"===e?i=35271/8192:"px"===e?i=.75:"em"===e?i=S.ptPerEm:"bp"===e?i=1.00375:"dd"===e?i=1238/1157:"pc"===e?i=12:"in"===e?i=72.27:"mu"===e&&(i=10/18),s){const e=Math.pow(10,s);return Math.round(t/S.ptPerEm*i*e)/e}return t/S.ptPerEm*i}var C={toEm:M,toPx:function(t,e){return M(t,e)*(4/3)*S.ptPerEm},METRICS:S,SIGMAS:w,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in A?i=A[t[0]].charCodeAt(0):v.test(t[0])&&(i=77);const a=k[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const _=[{},{},{}];let T;for(const t in w)if(w.hasOwnProperty(t))for(T=0;T<3;T++)_[T][t]=w[t][T];for(T=0;T<3;T++)_[T].emPerEx=w.xHeight[T]/w.quad[T];class L{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=_[e>0?e-1:0]}sup(){return z[P[this.id]]}sub(){return z[R[this.id]]}fracNum(){return z[O[this.id]]}fracDen(){return z[K[this.id]]}cramp(){return z[N[this.id]]}cls(){return I[this.size]}adjustTo(t){let e=B[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const D=0,F=2,E=4,q=6,z=[new L(D,0,1,!1),new L(1,0,1,!0),new L(F,1,1,!1),new L(3,1,1,!0),new L(E,2,.7,!1),new L(5,2,.7,!0),new L(q,3,.5,!1),new L(7,3,.5,!0)],I=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],B=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],P=[E,5,E,5,q,7,q,7],R=[5,5,5,5,7,7,7,7],O=[F,3,E,5,q,7,q,7],K=[3,3,5,5,7,7,7,7],N=[1,1,3,3,5,5,7,7];var $={DISPLAY:z[D],TEXT:z[F],SCRIPT:z[E],SCRIPTSCRIPT:z[q],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:z[D],textstyle:z[F],scriptstyle:z[E],scriptscriptstyle:z[q]}[t]:t}};class W{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=$.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new W(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(this,t),"string"==typeof t.mathstyle&&(this.mathstyle=$.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=$.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var V={Context:W};function H(t){let e="";if("number"==typeof t)e+=Math.floor(1e5*t)/1e5;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=H(s);else t&&(e+=t.toString());return e}class U{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=0;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color",""));let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return it[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-.\/:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-.\/:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return it[e]}(this.body,e)),t.cssClass&&(this.classes+=" "+t.cssClass),t.fontShape&&(this.classes+=" "+{it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||""),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+{ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||"",this.classes+=" "+{uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||"")}if(at[e]?this.classes+=" "+at[e]:this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=H(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=H(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=H(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=H(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=H(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?X[t+"+"+i]||0:G[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=Y(s)}}const a=this.tag||"span";if(0===a.length)s=i||"";else{if(s="<"+a,this.cssId&&(s+=' id="'+this.cssId+'" '),this.svgOverlay&&(this.style||(this.style={}),this.style.position="relative"),this.attributes)for(const t in this.attributes)this.attributes.hasOwnProperty(t)&&(s+=" "+t+'="'+this.attributes[t]+'"');const e=this.classes.split(" ");this.type&&(/command|placeholder|error/.test(this.type)&&e.push({command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type]),this.caret&&"command"===this.type&&e.push("ML__command-caret"));let o="";if((o=e.length>1?e.filter(function(t,e,s){return t.length>0&&s.indexOf(t)===e}).join(" "):e[0]).length>0&&(s+=' class="'+o+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=H(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&Z[-t]?i=Z[-t]+i:j[t]?i=j[t]+i:(this.style||(this.style={}),this.style["margin-left"]=H(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)this.style.hasOwnProperty(s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+=i,s+=""):s+=i,s=s+""}return""===s&&(s=""),this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;t0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new U(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=-t.depth-o;o+=t.height+t.depth;const s=tt([r,t]);s.setTop(e),l.push(s)}const c=tt(l,"vlist");return c.depth=Math.max(a,Q(c)||0),c.height=Math.max(-o,J(c)||0),c},makeHlist:st,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=st(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:J,depth:Q,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let nt="";const rt={},lt={},ct={},ht="CRYPTIC",pt="COMMON",dt="SUPERCOMMON",mt={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function ut(t,...e){const s="string"==typeof t?mt[t]:t;for(const t of e)rt[t]&&(rt[t].frequency=s),lt[t]&&(lt[t]=Object.assign({},lt[t]),lt[t].frequency=s)}function ft(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=mt[a]),rt[t]={type:s===At?Mt:s,baseFontFamily:e,value:i,category:nt,frequency:a}}function yt(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);ft(t,"","mord",t)}}const gt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function bt(t,e){const s=String.fromCodePoint(e);if("math"===t&>[s])return gt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in rt)if(rt.hasOwnProperty(t)&&rt[t].value===s){i=t;break}}else for(const t in Rt)if(Rt.hasOwnProperty(t)&&Rt[t]===s){i=t;break}return i||s}const xt={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},kt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function vt(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in xt)if(xt.hasOwnProperty(t)&&xt[t]===e){e=t;break}for(let t=0;t=kt[t].start&&et.body).join("")}function zt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=Et(e),o={category:nt,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)ct[e]=o}function It(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:nt,baseFontFamily:s.fontFamily,params:Et(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)lt[e]=a}nt="Environments",zt("math","",{frequency:0},function(){return{mathstyle:"textstyle"}}),zt("displaymath","",{frequency:8},function(){return{mathstyle:"displaystyle"}}),zt("array","{columns:colspec}",{frequency:pt},function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}}),zt("eqnarray","",{},function(){return{}}),zt("equation","",{},function(){return{colFormat:[{align:"c"}]}}),zt("subequations","",{},function(){return{colFormat:[{align:"c"}]}}),zt("multline","",{},function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}}),zt(["align","aligned"],"",{},function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),It("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),ut(3,"\\textcolor"),It("\\overline","{:auto}",null,function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\overline"),It("\\underline","{:auto}",null,function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\underline"),It("\\overset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\overset"),It("\\underset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\underset"),It(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}}),ut(pt,"\\stackrel"),ut(0,"\\stackbin"),It("\\rlap","{:auto}",null,function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}}),ut(270,"\\rlap"),It("\\llap","{:auto}",null,function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}}),ut(18,"\\llap"),It("\\mathrlap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathrlap"),It("\\mathllap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathllap"),It("\\boxed","{content:math}",null,function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}}),ut(1236,"\\boxed"),It("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}}),ut(ht,"\\colorbox"),It("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}}),ut(ht,"\\fcolorbox"),It("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}}),ut(ht,"\\bbox"),It("\\enclose","{notation:string}[style:string]{body:auto}",null,function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=C.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=C.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i}),ut(ht,"\\enclose"),It("\\cancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}}),It("\\bcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}}),It("\\xcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}}),ut(ht,"\\cancel","\\bcancel","\\xcancel"),nt="Styling",It("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:qt(e[0])})),It("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),It(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),It("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),It("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:qt(e[0])})),It("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),It("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),It("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),It("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:qt(e[0])})),It("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),It("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmss",fontSeries:"m",fontShape:"n"})),It("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),It("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"bb"})),It(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({fontFamily:"frak"})),It("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cal",fontSeries:"m",fontShape:"n"})),It("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"scr",fontSeries:"m",fontShape:"n"})),ut(dt,"\\mathbb"),ut(1081,"\\Bbb"),ut(0,"\\mathcal"),ut(pt,"\\mathfrak"),ut(271,"\\frak"),ut(pt,"\\mathscr"),ut("UNCOMMON","\\mathsf"),ut(pt,"\\mathtt"),ut(pt,"\\boldsymbol"),It("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),It("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),It("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),It("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:qt(e[0])})),It("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:qt(e[0]),body:e[1],type:"group"})),It("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),It("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),ut(pt,"\\textrm"),ut(pt,"\\textit"),ut(pt,"\\textsf"),ut(pt,"\\texttt"),ut(433,"\\textnormal"),ut(pt,"\\textbf"),ut(421,"\\textup"),ut(819,"\\emph"),ut(49,"\\em"),nt="Operators",It("\\sqrt","[index:auto]{radicand:auto}",null,function(t,e){return{type:"surd",body:e[1],index:e[0]}}),ut(dt,"\\sqrt"),nt="Fractions",It(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s}),It(["\\over","\\atop","\\choose"],"",{infix:!0},function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}}),ut(21,"\\over"),ut(12,"\\atop"),ut(1968,"\\choose"),It(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}}),ut(15,"\\overwithdelims"),ut(pt,"\\atopwithdelims"),nt="Fractions",It("\\pdiff","{numerator}{denominator}",null,function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}}),nt="Quantifiers",ft("\\forall","",Mt,"∀",dt),ft("\\exists","",Mt,"∃",dt),ft("\\nexists",St,Mt,"∄",dt),ft("\\mid","",_t,"∣",pt),ft("\\top","",Mt,"⊤","RARE"),ft("\\bot","",Mt,"⊥","RARE"),nt="Variable Sized Symbols",It(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}}),It(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}}),ut(dt,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),ut(pt,"\\bigoplus","\\smallint","\\iint","\\oint"),ut("RARE","\\bigwedge","\\bigvee"),ut(756,"\\coprod"),ut(723,"\\bigsqcup"),ut(1241,"\\bigotimes"),ut(150,"\\bigodot"),ut(174,"\\biguplus"),ut(878,"\\iiint"),ut(97,"\\intop"),nt="Various",ft("\\sharp","",Mt,"♯",pt),ft("\\flat","",Mt,"♭",590),ft("\\natural","",Mt,"♮",278),ft("\\#","",Mt,"#","RARE"),ft("\\&","",Mt,"&","RARE"),ft("\\clubsuit","",Mt,"♣",172),ft("\\heartsuit","",Mt,"♡","ARCANE"),ft("\\spadesuit","",Mt,"♠","ARCANE"),ft("\\diamondsuit","",Mt,"♢",ht),ft("\\differencedelta","",_t,"∆",pt),nt="Letters and Letter Like Forms",It("\\unicode","{charcode:number}",null,function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}}),ft("\\backslash","",Mt,"\\"),ft("?","",Mt,"?"),ft("!","",Mt,"!"),ft("\\nabla","",Mt,"∇",dt),ft("\\partial","",Mt,"∂",dt),ft("\\ell","",Mt,"ℓ",pt),ft("\\imaginaryI","",Mt,"i"),ft("\\imaginaryJ","",Mt,"j"),It(["\\Re","\\Im"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}}),ft("\\hbar","",Mt,"ℏ",pt),ft("\\hslash",St,Mt,"ℏ",pt),ft("\\differentialD","cmr",Mt,"d"),ft("\\rd","cmr",Mt,"d"),ft("\\capitalDifferentialD","cmr",Mt,"D"),ft("\\rD","cmr",Mt,"D"),ft("\\exponentialE","cmr",Mt,"e"),ft("\\Finv",St,Mt,"Ⅎ",3),ft("\\Game",St,Mt,"⅁",1),ft("\\wp","",Mt,"℘",1306),ft("\\eth",St,Mt,"ð",77),ft("\\mho",St,Mt,"℧",138),ft("\\Bbbk",St,Mt,"k"),ft("\\doubleStruckCapitalN","bb",Mt,"N"),ft("\\N","bb",Mt,"N"),ft("\\doubleStruckCapitalR","bb",Mt,"R"),ft("\\R","bb",Mt,"R"),ft("\\doubleStruckCapitalQ","bb",Mt,"Q"),ft("\\Q","bb",Mt,"Q"),ft("\\doubleStruckCapitalC","bb",Mt,"C"),ft("\\C","bb",Mt,"C"),ft("\\doubleStruckCapitalZ","bb",Mt,"Z"),ft("\\Z","bb",Mt,"Z"),ft("\\doubleStruckCapitalP","bb",Mt,"P"),ft("\\P","bb",Mt,"P"),ft("\\scriptCapitalE","scr",Mt,"E"),ft("\\scriptCapitalH","scr",Mt,"H"),ft("\\scriptCapitalL","scr",Mt,"L"),ft("\\gothicCapitalC","frak",Mt,"C"),ft("\\gothicCapitalH","frak",Mt,"H"),ft("\\gothicCapitalI","frak",Mt,"I"),ft("\\gothicCapitalR","frak",Mt,"R"),ft("\\pounds","",Mt,"£",509),ft("\\yen",St,Mt,"¥",57),ft("\\euro","",Mt,"€",4),nt="Crosses",ft("\\textdagger","",Ct,"†"),ft("\\dagger","",Ct,"†",pt),ft("\\dag","",Ct,"†",pt),ft("\\ddag","",Ct,"‡",500),ft("\\textdaggerdbl","",Ct,"‡"),ft("\\ddagger","",Ct,"‡",353),ft("\\maltese",St,Mt,"✠",24),nt="Arrows",ft("\\longrightarrow","",_t,"⟶",dt),ft("\\rightarrow","",_t,"→",dt),ft("\\Longrightarrow","",_t,"⟹",dt),ft("\\Rightarrow","",_t,"⇒",dt),ft("\\longmapsto","",_t,"⟼",pt),ft("\\mapsto","",_t,"↦",pt),ft("\\Longleftrightarrow","",_t,"⟺",pt),ft("\\rightleftarrows",St,_t,"⇄",pt),ft("\\leftarrow","",_t,"←",pt),ft("\\curvearrowleft",St,_t,"↶",pt),ft("\\uparrow","",_t,"↑",pt),ft("\\downarrow","",_t,"↓",pt),ft("\\hookrightarrow","",_t,"↪",pt),ft("\\rightharpoonup","",_t,"⇀",pt),ft("\\rightleftharpoons","",_t,"⇌",pt),ft("\\Leftarrow","",_t,"⇐",1695),ft("\\longleftrightarrow","",_t,"⟷",1599),ft("\\longleftarrow","",_t,"⟵",878),ft("\\Longleftarrow","",_t,"⟸",296),ft("\\searrow","",_t,"↘",1609),ft("\\nearrow","",_t,"↗",1301),ft("\\swarrow","",_t,"↙",167),ft("\\nwarrow","",_t,"↖",108),ft("\\Uparrow","",_t,"⇑",257),ft("\\Downarrow","",_t,"⇓",556),ft("\\updownarrow","",_t,"↕",192),ft("\\Updownarrow","",_t,"⇕",161),ft("\\hookleftarrow","",_t,"↩",115),ft("\\leftharpoonup","",_t,"↼",93),ft("\\leftharpoondown","",_t,"↽",42),ft("\\rightharpoondown","",_t,"⇁",80),ft("\\leftrightarrows",St,_t,"⇆",765),ft("\\dashrightarrow",St,_t,"⇢",311),ft("\\dashleftarrow",St,_t,"⇠",5),ft("\\leftleftarrows",St,_t,"⇇",8),ft("\\Lleftarrow",St,_t,"⇚",7),ft("\\twoheadleftarrow",St,_t,"↞",32),ft("\\leftarrowtail",St,_t,"↢",25),ft("\\looparrowleft",St,_t,"↫",6),ft("\\leftrightharpoons",St,_t,"⇋",205),ft("\\circlearrowleft",St,_t,"↺",105),ft("\\Lsh",St,_t,"↰",11),ft("\\upuparrows",St,_t,"⇈",15),ft("\\downharpoonleft",St,_t,"⇃",21),ft("\\multimap",St,_t,"⊸",108),ft("\\leftrightsquigarrow",St,_t,"↭",31),ft("\\twoheadrightarrow",St,_t,"↠",835),ft("\\rightarrowtail",St,_t,"↣",195),ft("\\looparrowright",St,_t,"↬",37),ft("\\curvearrowright",St,_t,"↷",209),ft("\\circlearrowright",St,_t,"↻",63),ft("\\Rsh",St,_t,"↱",18),ft("\\downdownarrows",St,_t,"⇊",6),ft("\\upharpoonright",St,_t,"↾",579),ft("\\downharpoonright",St,_t,"⇂",39),ft("\\rightsquigarrow",St,_t,"⇝",674),ft("\\leadsto",St,_t,"⇝",709),ft("\\Rrightarrow",St,_t,"⇛",62),ft("\\restriction",St,_t,"↾",29),ft("\\upharpoonleft",St,_t,"↿",ht),ft("\\rightrightarrows",St,_t,"⇉",ht),nt="Negated Arrows",ft("\\nrightarrow",St,_t,"↛",324),ft("\\nRightarrow",St,_t,"⇏",107),ft("\\nleftrightarrow",St,_t,"↮",36),ft("\\nLeftrightarrow",St,_t,"⇎",20),ft("\\nleftarrow",St,_t,"↚",7),ft("\\nLeftarrow",St,_t,"⇍",5),nt="Negated Relations",ft("\\nless",St,_t,"≮",146),ft("\\nleqslant",St,_t,"",58),ft("\\lneq",St,_t,"⪇",54),ft("\\lneqq",St,_t,"≨",36),ft("\\nleqq",St,_t,"",18),ft("\\unlhd",St,Ct,"⊴",253),ft("\\unrhd",St,Ct,"⊵",66),ft("\\lvertneqq",St,_t,"",6),ft("\\lnsim",St,_t,"⋦",4),ft("\\lnapprox",St,_t,"⪉",ht),ft("\\nprec",St,_t,"⊀",71),ft("\\npreceq",St,_t,"⋠",57),ft("\\precnsim",St,_t,"⋨",4),ft("\\precnapprox",St,_t,"⪹",2),ft("\\nsim",St,_t,"≁",40),ft("\\nshortmid",St,_t,"",1),ft("\\nmid",St,_t,"∤",417),ft("\\nvdash",St,_t,"⊬",266),ft("\\nvDash",St,_t,"⊭",405),ft("\\ngtr",St,_t,"≯",90),ft("\\ngeqslant",St,_t,"",23),ft("\\ngeqq",St,_t,"",12),ft("\\gneq",St,_t,"⪈",29),ft("\\gneqq",St,_t,"≩",35),ft("\\gvertneqq",St,_t,"",6),ft("\\gnsim",St,_t,"⋧",3),ft("\\gnapprox",St,_t,"⪊",ht),ft("\\nsucc",St,_t,"⊁",44),ft("\\nsucceq",St,_t,"⋡",ht),ft("\\succnsim",St,_t,"⋩",4),ft("\\succnapprox",St,_t,"⪺",ht),ft("\\ncong",St,_t,"≆",128),ft("\\nshortparallel",St,_t,"",6),ft("\\nparallel",St,_t,"∦",54),ft("\\nVDash",St,_t,"⊯",5),ft("\\nsupseteqq",St,_t,"",1),ft("\\supsetneq",St,_t,"⊋",286),ft("\\varsupsetneq",St,_t,"",2),ft("\\supsetneqq",St,_t,"⫌",49),ft("\\varsupsetneqq",St,_t,"",3),ft("\\nVdash",St,_t,"⊮",179),ft("\\precneqq",St,_t,"⪵",11),ft("\\succneqq",St,_t,"⪶",3),ft("\\nsubseteqq",St,_t,"",16),nt="Various",ft("\\checkmark",St,Mt,"✓",1025),ft("\\diagup",St,Mt,"╱",440),ft("\\diagdown",St,Mt,"╲",175),ft("\\measuredangle",St,Mt,"∡",271),ft("\\sphericalangle",St,Mt,"∢",156),ft("\\backprime",St,Mt,"‵",104),ft("\\backdoubleprime",St,Mt,"‶",ht),nt="Shapes",ft("\\ast","",Ct,"∗",dt),ft("\\star","",Ct,"⋆",pt),ft("\\diamond","",Ct,"⋄",1356),ft("\\Diamond",St,Mt,"◊",695),ft("\\lozenge",St,Mt,"◊",422),ft("\\blacklozenge",St,Mt,"⧫",344),ft("\\bigstar",St,Mt,"★",168),nt="Hebrew",ft("\\aleph","",Mt,"ℵ",1381),ft("\\beth",St,Mt,"ℶ",54),ft("\\daleth",St,Mt,"ℸ",43),ft("\\gimel",St,Mt,"ℷ",36),nt="Fences",ft("\\lbrace","",Tt,"{",dt),ft("\\rbrace","",Lt,"}",dt),ft("\\langle","",Tt,"⟨",pt),ft("\\rangle","",Lt,"⟩",pt),ft("\\lfloor","",Tt,"⌊",pt),ft("\\rfloor","",Lt,"⌋",pt),ft("\\lceil","",Tt,"⌈",pt),ft("\\rceil","",Lt,"⌉",pt),ft("\\vert","",Mt,"∣",dt),ft("\\mvert","",_t,"∣"),ft("\\lvert","",Tt,"∣",496),ft("\\rvert","",Lt,"∣",496),ft("\\|","",Mt,"∥"),ft("\\Vert","",Mt,"∥",dt),ft("\\mVert","",Mt,"∥"),ft("\\lVert","",Tt,"∥",287),ft("\\rVert","",Lt,"∥",ht),ft("\\lbrack","",Tt,"[",574),ft("\\rbrack","",Lt,"]",213),ft("\\{","",Tt,"{"),ft("\\}","",Lt,"}"),ft("(","",Tt,"("),ft(")","",Lt,")"),ft("[","",Tt,"["),ft("]","",Lt,"]"),ft("\\ulcorner",St,Tt,"┌",296),ft("\\urcorner",St,Lt,"┐",310),ft("\\llcorner",St,Tt,"└",137),ft("\\lrcorner",St,Lt,"┘",199),ft("\\lgroup","",Tt,"⟮",24),ft("\\rgroup","",Lt,"⟯",24),ft("\\lmoustache","",Tt,"⎰",ht),ft("\\rmoustache","",Lt,"⎱",ht),It(["\\middle"],"{:delim}",null,function(t,e){return{type:"delim",delim:e[0]}}),nt="Sizing";const Bt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function Pt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}It(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,function(t,e){return{type:"sizeddelim",size:Bt[t].size,cls:Bt[t].mclass,delim:e[0]}}),nt="Relations",ft("=","",_t,"=",dt),ft("\\ne","",_t,"≠",dt),ft("\\neq","",_t,"≠",pt),ft("<","",_t,"<",dt),ft("\\lt","",_t,"<",pt),ft(">","",_t,">",dt),ft("\\gt","",_t,">",pt),ft("\\le","",_t,"≤",pt),ft("\\ge","",_t,"≥",pt),ft("\\leqslant",St,_t,"⩽",dt),ft("\\geqslant",St,_t,"⩾",dt),ft("\\leq","",_t,"≤",pt),ft("\\geq","",_t,"≥",pt),ft("\\ll","",_t,"≪"),ft("\\gg","",_t,"≫",pt),ft("\\coloneq","",_t,"≔",5),ft("\\measeq","",_t,"≝"),ft("\\eqdef","",_t,"≞"),ft("\\questeq","",_t,"≟"),ft(":","",_t,":"),ft("\\cong","",_t,"≅",pt),ft("\\equiv","",_t,"≡",pt),ft("\\prec","",_t,"≺",pt),ft("\\preceq","",_t,"⪯",pt),ft("\\succ","",_t,"≻",pt),ft("\\succeq","",_t,"⪰",1916),ft("\\perp","",_t,"⊥",pt),ft("\\parallel","",_t,"∥",pt),ft("\\propto","",_t,"∝",pt),ft("\\Colon","",_t,"∷"),ft("\\smile","",_t,"⌣",pt),ft("\\frown","",_t,"⌢",pt),ft("\\sim","",_t,"∼",pt),ft("\\gtrsim",St,_t,"≳",pt),ft("\\approx","",_t,"≈",dt),ft("\\approxeq",St,_t,"≊",147),ft("\\thickapprox",St,_t,"≈",377),ft("\\lessapprox",St,_t,"⪅",146),ft("\\gtrapprox",St,_t,"⪆",95),ft("\\precapprox",St,_t,"⪷",50),ft("\\succapprox",St,_t,"⪸",ht),ft("\\thicksim",St,_t,"∼",779),ft("\\succsim",St,_t,"≿",251),ft("\\precsim",St,_t,"≾",104),ft("\\backsim",St,_t,"∽",251),ft("\\eqsim",St,_t,"≂",62),ft("\\backsimeq",St,_t,"⋍",91),ft("\\simeq","",_t,"≃",ht),ft("\\lesssim",St,_t,"≲",ht),ft("\\nleq",St,_t,"≰",369),ft("\\ngeq",St,_t,"≱",164),ft("\\smallsmile",St,_t,"⌣",31),ft("\\smallfrown",St,_t,"⌢",71),ft("\\bowtie","",_t,"⋈",558),ft("\\asymp","",_t,"≍",755),ft("\\sqsubseteq","",_t,"⊑",1255),ft("\\sqsupseteq","",_t,"⊒",183),ft("\\leqq",St,_t,"≦",1356),ft("\\eqslantless",St,_t,"⪕",15),ft("\\lll",St,_t,"⋘",157),ft("\\lessgtr",St,_t,"≶",281),ft("\\lesseqgtr",St,_t,"⋚",134),ft("\\lesseqqgtr",St,_t,"⪋",ht),ft("\\risingdotseq",St,_t,"≓",8),ft("\\fallingdotseq",St,_t,"≒",99),ft("\\subseteqq",St,_t,"⫅",82),ft("\\Subset",St,_t,"⋐"),ft("\\sqsubset",St,_t,"⊏",309),ft("\\preccurlyeq",St,_t,"≼",549),ft("\\curlyeqprec",St,_t,"⋞",14),ft("\\vDash",St,_t,"⊨",646),ft("\\Vvdash",St,_t,"⊪",20),ft("\\bumpeq",St,_t,"≏",13),ft("\\Bumpeq",St,_t,"≎",12),ft("\\geqq",St,_t,"≧",972),ft("\\eqslantgtr",St,_t,"⪖",13),ft("\\ggg",St,_t,"⋙",127),ft("\\gtrless",St,_t,"≷",417),ft("\\gtreqless",St,_t,"⋛",190),ft("\\gtreqqless",St,_t,"⪌",91),ft("\\supseteqq",St,_t,"⫆",6),ft("\\Supset",St,_t,"⋑",34),ft("\\sqsupset",St,_t,"⊐",71),ft("\\succcurlyeq",St,_t,"≽",442),ft("\\curlyeqsucc",St,_t,"⋟",10),ft("\\Vdash",St,_t,"⊩",276),ft("\\shortmid",St,_t,"∣",67),ft("\\shortparallel",St,_t,"∥",17),ft("\\between",St,_t,"≬",110),ft("\\pitchfork",St,_t,"⋔",66),ft("\\varpropto",St,_t,"∝",203),ft("\\backepsilon",St,_t,"∍",176),ft("\\llless",St,_t,"⋘",ht),ft("\\gggtr",St,_t,"⋙",ht),ft("\\lhd",St,Ct,"⊲",447),ft("\\rhd",St,Ct,"⊳",338),ft("\\Join","",_t,"⋈",35),ft("\\doteq","",_t,"≐",1450),ft("\\doteqdot",St,_t,"≑",60),ft("\\Doteq",St,_t,"≑",ht),ft("\\eqcirc",St,_t,"≖",6),ft("\\circeq",St,_t,"≗",31),ft("\\lessdot",St,Ct,"⋖",88),ft("\\gtrdot",St,Ct,"⋗",45),ft("\\~","",_t,"~"),nt="Logic",ft("\\leftrightarrow","",_t,"↔",dt),ft("\\Leftrightarrow","",_t,"⇔",dt),ft("\\to","",_t,"→",dt),ft("\\models","",_t,"⊨",pt),ft("\\vdash","",_t,"⊢",pt),ft("\\therefore",St,_t,"∴",1129),ft("\\because",St,_t,"∵",388),ft("\\implies","",_t,"⟹",1858),ft("\\gets","",_t,"←",150),ft("\\dashv","",_t,"⊣",299),ft("\\impliedby","",_t,"⟸",ht),ft("\\biconditional","",_t,"⟷",ht),ft("\\roundimplies","",_t,"⥰",ht),nt="Operators",ft("+","",Ct,"+",dt),ft("-","",Ct,"−",dt),ft("−","",Ct,"−",dt),ft("\\pm","",Ct,"±",pt),ft("\\mp","",Ct,"∓",pt),ft("*","",Ct,"∗",pt),ft("\\times","",Ct,"×",pt),ft("\\div","",Ct,"÷",pt),ft("\\surd","",Mt,"√",pt),ft("\\divides","",Ct,"∣",ht),ft("\\ltimes",St,Ct,"⋉",576),ft("\\rtimes",St,Ct,"⋊",946),ft("\\leftthreetimes",St,Ct,"⋋",34),ft("\\rightthreetimes",St,Ct,"⋌",14),ft("\\intercal",St,Ct,"⊺",478),ft("\\dotplus",St,Ct,"∔",81),ft("\\centerdot",St,Ct,"⋅",271),ft("\\doublebarwedge",St,Ct,"⩞",5),ft("\\divideontimes",St,Ct,"⋇",51),ft("\\cdot","",Ct,"⋅",ht),nt="Others",ft("\\infty","",Mt,"∞",dt),ft("\\prime","",At,"′",dt),ft("\\doubleprime","",Mt,"″"),ft("\\angle","",Mt,"∠",pt),ft("`","",Mt,"‘"),ft("\\$","",Mt,"$"),ft("\\%","",Mt,"%"),ft("\\_","",Mt,"_"),nt="Greek",ft("\\alpha","",At,"α",pt),ft("\\beta","",At,"β",pt),ft("\\gamma","",At,"γ",pt),ft("\\delta","",At,"δ",pt),ft("\\epsilon","",At,"ϵ",pt),ft("\\varepsilon","",At,"ε"),ft("\\zeta","",At,"ζ",pt),ft("\\eta","",At,"η",pt),ft("\\theta","",At,"θ",pt),ft("\\vartheta","",At,"ϑ",pt),ft("\\iota","",At,"ι",pt),ft("\\kappa","",At,"κ",pt),ft("\\varkappa",St,At,"ϰ",pt),ft("\\lambda","",At,"λ",pt),ft("\\mu","",At,"μ",pt),ft("\\nu","",At,"ν",pt),ft("\\xi","",At,"ξ",pt),ft("\\omicron","",At,"o"),ft("\\pi","",At,"π",pt),ft("\\varpi","",At,"ϖ",pt),ft("\\rho","",At,"ρ",pt),ft("\\varrho","",At,"ϱ",pt),ft("\\sigma","",At,"σ",pt),ft("\\varsigma","",At,"ς",pt),ft("\\tau","",At,"τ",pt),ft("\\phi","",At,"ϕ",pt),ft("\\varphi","",At,"φ",pt),ft("\\upsilon","",At,"υ",pt),ft("\\chi","",At,"χ",pt),ft("\\psi","",At,"ψ",pt),ft("\\omega","",At,"ω",pt),ft("\\Gamma","",At,"Γ",pt),ft("\\Delta","",At,"Δ",pt),ft("\\Theta","",At,"Θ",pt),ft("\\Lambda","",At,"Λ",pt),ft("\\Xi","",At,"Ξ",pt),ft("\\Pi","",At,"Π",pt),ft("\\Sigma","",At,"Σ",pt),ft("\\Upsilon","",At,"Υ",pt),ft("\\Phi","",At,"Φ",pt),ft("\\Psi","",At,"Ψ",pt),ft("\\Omega","",At,"Ω",pt),ft("\\digamma",St,At,"ϝ",248),nt="Others",ft("\\emptyset","",Mt,"∅",dt),ft("\\varnothing",St,Mt,"∅",dt),nt="Set Operators",ft("\\cap","",Ct,"∩",dt),ft("\\cup","",Ct,"∪",dt),ft("\\setminus","",Ct,"∖",pt),ft("\\smallsetminus",St,Ct,"∖",254),ft("\\complement",St,Mt,"∁",200),nt="Set Relations",ft("\\in","",_t,"∈",dt),ft("\\notin","",_t,"∉",dt),ft("\\not","",_t,"̸",pt),ft("\\ni","",_t,"∋",pt),ft("\\owns","",_t,"∋",18),ft("\\subset","",_t,"⊂",dt),ft("\\supset","",_t,"⊃",dt),ft("\\subseteq","",_t,"⊆",dt),ft("\\supseteq","",_t,"⊇",dt),ft("\\subsetneq",St,_t,"⊊",1945),ft("\\varsubsetneq",St,_t,"",198),ft("\\subsetneqq",St,_t,"⫋",314),ft("\\varsubsetneqq",St,_t,"",55),ft("\\nsubset",St,_t,"⊄",ht),ft("\\nsupset",St,_t,"⊅",ht),ft("\\nsubseteq",St,_t,"⊈",950),ft("\\nsupseteq",St,_t,"⊉",49),nt="Spacing",ft("\\ ","",Dt," "),ft("~","",Dt," "),ft("\\space","",Dt," "),ft("\\!","",Dt,null),ft("\\,","",Dt,null),ft("\\:","",Dt,null),ft("\\;","",Dt,null),ft("\\enskip","",Dt,null),ft("\\enspace","",Dt,null,672),ft("\\quad","",Dt,null,pt),ft("\\qquad","",Dt,null,pt),It(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},function(t,e){return{type:"spacing",width:e[0]||0}}),It(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:Pt(e[0])||e[0],captureSelection:!0,baseFontFamily:"cmr"};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s}),It(["\\operatorname","\\operatorname*"],"{operator:string}",null,function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s}),nt="Punctuation",ft("\\colon","","mpunct",":",pt),ft("\\cdotp","","mpunct","⋅",pt),ft("\\ldots","","minner","…",pt),ft("\\cdots","","minner","⋯",pt),ft("\\ddots","","minner","⋱",pt),ft("\\mathellipsis","","minner","…",91),ft("\\vdots","",Mt,"⋮",pt),ft("\\ldotp","","mpunct",".",18),ft(",","","mpunct",","),ft(";","","mpunct",";"),nt="Logical Operators",ft("\\wedge","",Ct,"∧",dt),ft("\\vee","",Ct,"∨",dt),ft("\\lnot","",Mt,"¬",pt),ft("\\neg","",Mt,"¬",dt),ft("\\land","",Ct,"∧",659),ft("\\lor","",Ct,"∨",364),ft("\\barwedge",St,Ct,"⊼",21),ft("\\veebar",St,Ct,"⊻",43),ft("\\nor",St,Ct,"⊻",7),ft("\\curlywedge",St,Ct,"⋏",58),ft("\\curlyvee",St,Ct,"⋎",57),nt="Boxes",ft("\\square",St,Mt,"□",pt),ft("\\Box",St,Mt,"□",pt),ft("\\blacksquare",St,Mt,"■",1679),ft("\\boxminus",St,Ct,"⊟",79),ft("\\boxplus",St,Ct,"⊞",276),ft("\\boxtimes",St,Ct,"⊠",457),ft("\\boxdot",St,Ct,"⊡",120),nt="Circles",ft("\\circ","",Ct,"∘",dt),ft("\\bigcirc","",Ct,"◯",903),ft("\\bullet","",Ct,"∙",pt),ft("\\circleddash",St,Ct,"⊝",pt),ft("\\circledast",St,Ct,"⊛",339),ft("\\oplus","",Ct,"⊕",pt),ft("\\ominus","",Ct,"⊖",1568),ft("\\otimes","",Ct,"⊗",pt),ft("\\odot","",Ct,"⊙",pt),ft("\\circledcirc",St,Ct,"⊚",93),ft("\\oslash","",Ct,"⊘",497),ft("\\circledS",St,Mt,"Ⓢ",31),ft("\\circledR",St,Mt,"®",1329),nt="Triangles",ft("\\triangle","",Mt,"△",pt),ft("\\triangleq",St,_t,"≜",pt),ft("\\bigtriangleup","",Ct,"△",1773),ft("\\vartriangle",St,_t,"△",762),ft("\\triangledown",St,Mt,"▽",520),ft("\\bigtriangledown","",Ct,"▽",661),ft("\\triangleleft","",Ct,"◃",534),ft("\\vartriangleleft",St,_t,"⊲",281),ft("\\trianglelefteq",St,_t,"⊴",176),ft("\\ntriangleleft",St,_t,"⋪",13),ft("\\ntrianglelefteq",St,_t,"⋬",22),ft("\\triangleright","",Ct,"▹",516),ft("\\vartriangleright",St,_t,"⊳",209),ft("\\trianglerighteq",St,_t,"⊵",45),ft("\\ntriangleright",St,_t,"⋫",15),ft("\\ntrianglerighteq",St,_t,"⋭",6),ft("\\blacktriangle",St,Mt,"▲",360),ft("\\blacktriangledown",St,Mt,"▼",159),ft("\\blacktriangleleft",St,_t,"◀",101),ft("\\blacktriangleright",St,_t,"▶",271),nt="Others",ft("\\/","",At,"/"),ft("|","","textord","∣"),nt="Big Operators",ft("\\sqcup","",Ct,"⊔",1717),ft("\\sqcap","",Ct,"⊓",735),ft("\\uplus","",Ct,"⊎",597),ft("\\wr","",Ct,"≀",286),ft("\\Cap",St,Ct,"⋒",2),ft("\\Cup",St,Ct,"⋓",2),ft("\\doublecap",St,Ct,"⋒",1),ft("\\doublecup",St,Ct,"⋓",1),ft("\\amalg","",Ct,"⨿",ht),ft("\\And","",Ct,"&"),nt="Accents",It(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}}),ut(pt,"\\bar","\\ddot","\\acute","\\tilde","\\check"),ut(1548,"\\breve"),ut(735,"\\grave"),ut(dt,"\\vec"),nt="Letters and Letter Like Forms",ft("\\imath","",Mt,"ı"),ft("\\jmath","",Mt,"ȷ"),nt="Others",ft("\\degree","",Mt,"°",46),nt="Others",ft("'","",Mt,"′"),ft('"',"",Mt,"”"),nt="Others",It("\\^","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\`","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}}),It("\\'","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\~","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}}),It("\\c","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}});const Rt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},Ot="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),Kt="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var Nt={matchCodepoint:bt,commandAllowed:function(t,e){return!(!lt[e]||"text"===t&&!lt[e].allowedInText)||!!{text:Rt,math:rt}[t][e]},unicodeToMathVariant:vt,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=kt[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=rt[t]:Rt[t]&&(i={value:Rt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?rt[e]&&rt[e].value?rt[e].value:e:Rt[e]?Rt[e]:e},getEnvironmentInfo:function(t){let e=ct[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in lt)lt.hasOwnProperty(s)&&s.startsWith(t)&&!lt[s].infix&&e.push({match:s,frequency:lt[s].frequency});for(const s in rt)rt.hasOwnProperty(s)&&s.startsWith(t)&&e.push({match:s,frequency:rt[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:mt,TEXT_SYMBOLS:Rt,MATH_SYMBOLS:rt,ENVIRONMENTS:ct,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:lt,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?\/.,~<>`|'$%#&^_" ]/,LETTER:Ot,LETTER_AND_DIGITS:Kt};const $t=ot.makeSymbol,Wt=ot.makeStyleWrap,Vt=ot.makeSpan,Ht=ot.makeVlist;function Ut(t,e,s,i,a,o){const n=$t("Size"+s+"-Regular",Nt.getValue("math",e)),r=Wt(t,Vt(n,"delimsizing size"+s),a.mathstyle,$.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Gt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Vt($t(e,Nt.getValue("math",t)),"delimsizinginner"+s)}function jt(t,e,s,i,a,o){let n,r,l,c;n=l=c=Nt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const p=C.getCharacterMetrics(Nt.getValue("math",n),h),d=p.height+p.depth,m=C.getCharacterMetrics(Nt.getValue("math",l),h),u=m.height+m.depth,f=C.getCharacterMetrics(Nt.getValue("math",c),h),y=f.height+f.depth;let g=0,b=1;if(null!==r){const t=C.getCharacterMetrics(Nt.getValue("math",r),h);g=t.height+t.depth,b=2}const x=d+y+g,k=Math.ceil((s-x)/(b*u)),v=x+k*b*u;let w=a.mathstyle.metrics.axisHeight;i&&(w*=a.mathstyle.sizeMultiplier);const S=v/2-w,A=[];if(A.push(Gt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Jt=[0,1.2,1.8,2.4,3],Qt=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],te=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"stack"}],ee=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function se(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return ie(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Yt.includes(e)?Qt:Zt.includes(e)?ee:te;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(Nt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=$t("AMS-Regular",Nt.getValue("math",e)),r=Wt(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ut(t,e,r.size,i,a,o):jt(t,e,s,i,a,o)}function ie(t,e,s){return ot.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo($.TEXT)+" nulldelimiter "+(s||""))}var ae={makeSizedDelim:function(t,e,s,i,a){return"."===e?ie(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Zt.includes(e)||Yt.includes(e)?Ut(t,e,s,!1,i,a):Xt.includes(e)?jt(t,e,Jt[s],!1,i,a):null)},makeCustomSizedDelim:se,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return ie(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/C.METRICS.ptPerEm;let l=i+n,c=s-n,h=901*(c=Math.max(l,c))/500;return l=2*c-r,se(t,e,h=Math.max(h,l),!0,a,o)}};const oe=ot.makeSpan,ne=ot.makeOrd,re=ot.makeInner,le=ot.makeHlist,ce=ot.makeVlist,he=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,pe=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/;class de{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",pe.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":he.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&(this.type="",delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=ne(ye(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(o<(m+=r)&&(o=m),m=0),d.height=a,d.depth=o,l+=a,d.pos=l,l+=o+m,h.push(d)}const d=l/2+a.metrics.axisHeight,m=[];for(let e=0;e0&&m.push(ce(t,s,"individualShift"))}const u=[];let f=!1,y=!1,g=0,b=!this.lFence;for(const s of e){if(s.align&&g>=m.length)break;if(s.align&&g0?3*c:7*S.defaultRuleThickness,d=e.metrics.denom1):(c>0?(h=e.metrics.num2,p=c):(h=e.metrics.num3,p=3*S.defaultRuleThickness),d=e.metrics.denom2);const m=o?o.depth:0,u=l?l.height:0;let f;if(0===c){const t=h-m-(u-d);tot.height(s)+ot.depth(s)+o&&(o=(o+l-ot.height(s)-ot.depth(s))/2),r.setTop(r.height-ot.height(s)-(o+i));const c=oe("",t.mathstyle.adjustTo($.TEXT)+" sqrt-line");let h;if(c.applyStyle(this.getStyle()),c.height=i,h=0===ot.height(s)&&0===ot.depth(s)?oe():ce(t,[s,o,c,i]),!this.index)return this.bind(t,ne([r,h],"sqrt"));const p=t.clone({mathstyle:$.SCRIPTSCRIPT}),d=oe(ye(p,this.index),e.adjustTo($.SCRIPTSCRIPT)),m=Math.max(r.height,h.height),u=Math.max(r.depth,h.depth),f=ce(t,[d],"shift",-(.6*(m-u)));return this.bind(t,ne([oe(f,"root"),r,h],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=ye(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,ne(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=ot.skew(s));const a=Math.min(ot.height(s),e.metrics.xHeight),o=ot.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=oe(oe(o),"accent-body"+n);return(r=ce(t,[s,-a,r])).children[1].setLeft(2*i),ne(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=ye(t.cramp(),this.body),i=S.defaultRuleThickness/e.sizeMultiplier,a=oe("",t.mathstyle.adjustTo($.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=ce(t,[s,3*i,a,i]);else{const e=oe(s);o=ce(t,[i,a,3*i,e],"top",ot.height(e))}return ne(o,this.position)}decomposeOverunder(t){const e=ye(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?oe(ye(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?oe(ye(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return fe(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=oe(ye(t,this.body),"inner");return ne([e,oe("","fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=ne("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===$.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";(s=ot.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op"))).type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=ot.makeOp(ye(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===$.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}applySizing(t){const e={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[this.size]*t.mathstyle.sizeMultiplier;t.size=this.size,t.sizeMultiplier=e}decomposeBox(t){const e=ne(ye(t,this.body));e.setStyle("position","relative");const s=ne(e),i=this.padding?this.padding:S.fboxsep;return s.setStyle("padding",i,"em"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",S.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),s.height=e.height,s.depth=e.depth,s.setStyle("position","relative"),s.setStyle("height",s.height+s.depth,"em"),this.bind(t,s)}decomposeEnclose(t){const e=ne(ye(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(ot.height(e)+ot.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=oe("​","mspace "+t)}else"sizing"===this.type?this.applySizing(t):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?((s=this.makeSpan(t,this.body)).classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&this.caret&&((s=this.makeSpan(t,"​")).caret=this.caret);if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=ye(t.sup(),this.superscript);a=oe(e,i.adjustTo(i.sup()))}if(this.subscript){const e=ye(t.sub(),this.subscript);o=oe(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=ot.height(e)-i.metrics.supDrop,l=ot.depth(e)+i.metrics.subDrop),n=i===$.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=$.TEXT.sizeMultiplier*i.sizeMultiplier,h=.5/S.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=S.defaultRuleThickness;if(r-ot.depth(a)-(ot.height(o)-l)<4*s){l=4*s-(r-a.depth)+ot.height(o);const t=.8*i.metrics.xHeight-(r-ot.depth(a));t>0&&(r+=t,l-=t)}p=ce(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-ot.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,ot.height(o)-.8*i.metrics.xHeight),(p=ce(t,[o],"shift",l)).children[0].setRight(h),this.isCharacterBox()&&p.children[0].setLeft(-ot.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),(p=ce(t,[a],"shift",-r)).children[0].setRight(h));const d=oe(p,"msubsup");return this.caret&&(d.caret=this.caret),ot.makeSpanOfType(s,[e,d])}attachLimits(t,e,s,i){const a=this.superscript?oe(ye(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?oe(ye(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return fe(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"boolean"!=typeof t.generateID&&(t.generateID.overrideID?e=t.generateID.overrideID:(e=t.generateID.seed.toString(36),t.generateID.seed+=1));return e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=ot.makeSpanOfType(s,e);return i.applyStyle(this.getStyle()),t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function me(t){const e=oe("​","arraycolsep");return e.setWidth(t,"em"),e}function ue(t,e,s,i){const a=[];for(const o of e){const e=oe(ye(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return ce(t,a,"individualShift")}function fe(t,e,s,i,a,o,n){if(!a&&!o)return e;e=oe(e);let r=0,l=0;a&&(r=Math.max(S.bigOpSpacing1,S.bigOpSpacing3-a.depth)),o&&(l=Math.max(S.bigOpSpacing2,S.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=S.bigOpSpacing5+ot.height(o)+ot.depth(o)+l+ot.depth(e)+s;(c=ce(t,[S.bigOpSpacing5,o,l,e,r,a,S.bigOpSpacing5],"bottom",n)).children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=ot.height(e)-s;(c=ce(t,[S.bigOpSpacing5,o,l,e],"top",a)).children[0].setLeft(-i)}else if(!o&&a){const o=ot.depth(e)+s;(c=ce(t,[e,r,a,S.bigOpSpacing5],"bottom",o)).children[1].setLeft(i)}return ot.makeSpanOfType(n,c,"op-limits")}function ye(t,e){t instanceof V.Context||(t=new V.Context(t));const s=!t.generateID||!t.generateID.groupNumbers;let i=[];if(Array.isArray(e)){if(0===e.length)return i;if(1===e.length)(i=e[0].decompose(t))&&s&&e[0].isSelected&&i.forEach(t=>t.selected(!0));else{let a="none",o=e[1].type,n=[],r=null,l=null;for(let c=0;ct.selected(!0)):(n.length>0&&(i=[...i,...n],n=[]),i=i.concat(a))}a=e[c].getFinalBaseElement().type,o=e[c+1]?e[c+1].getInitialBaseElement().type:"none"}n.length>0&&(i=[...i,...n],n=[])}}else e&&(i=e.decompose(t))&&s&&e.isSelected&&i.forEach(t=>t.selected(!0));if(!i||0===i.length)return null;const a={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of i)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=a[t.size]/a[t.parentSize];for(const t of i)t.height*=e,t.depth*=e}return i}var ge={MathAtom:de,decompose:ye,makeRoot:function(t,e){const s=new de(t=t||"math","root");return s.body=e||[],0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new de("","first")),s},GREEK_REGEX:he};const be={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},xe={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ke={stringToColor:function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},colorToString:function(t){let e=t.toUpperCase();for(const t in xe)if(xe[t]===e){e=t;break}for(const t in be)if(be[t]===e){e=t;break}return e},AREA_COLORS:["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],LINE_COLORS:["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"]};const ve=ge.MathAtom;class we{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ke.stringToColor(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?C.toEm(t,"pt"):this.parseKeyword("mm")?C.toEm(t,"mm"):this.parseKeyword("cm")?C.toEm(t,"cm"):this.parseKeyword("ex")?C.toEm(t,"ex"):this.parseKeyword("px")?C.toEm(t,"px"):this.parseKeyword("em")?C.toEm(t,"em"):this.parseKeyword("bp")?C.toEm(t,"bp"):this.parseKeyword("dd")?C.toEm(t,"dd"):this.parseKeyword("pc")?C.toEm(t,"pc"):this.parseKeyword("in")?C.toEm(t,"in"):this.parseKeyword("mu")?C.toEm(t,"mu"):C.toEm(t,"pt")}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new ve("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new ve("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=Nt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(!(c=this.end())&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const p=new ve(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return p.array=n,p.rowGaps=r,p.env={...e},p.env.name=t,p}scanImplicitGroup(t){const e=this.style;t||(t=(t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value)));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(Se)){const t=new ve(this.parseMode,"sizing");t.size={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[this.get().value],this.mathList.push(t)}else if(this.hasImplicitCommand(Ae)){this.parseMode="math";const t=new ve("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=Nt.getInfo("\\"+s.value,"math",this.macros);o=e?[new ve(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new ve(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new ve(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new ve(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=Nt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright")){const t=new ve(this.parseMode,"leftright");return t.rightDelim=this.scanDelim()||".",t}const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim()||".",i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new ve(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasToken("^")||this.hasToken("_")||this.hasLiteral("'");){let e;if(this.hasToken("^")?e="superscript":this.hasToken("_")&&(e="subscript"),this.parseToken("^")||this.parseToken("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new ve(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ke.stringToColor(e);if(t)(i=i||{}).backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)(i=i||{}).padding=C.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&((i=i||{}).border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new ve("text",""," ",this.style));else if("placeholder"===t.type)e=new ve(this.parseMode,"placeholder",t.value);else if("command"===t.type){if("placeholder"===t.value)e=new ve(this.parseMode,"placeholder",this.scanArg("string"));else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),(e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t))).latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&((e=new ve(this.parseMode,"spacing",null,this.style)).width=s),e.latex="\\"+t.value}else if(!(e=this.scanMacro(t.value))){const s=Nt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e?i.push(e):t.placeholder?i.push([new ve(this.parseMode,"placeholder",t.placeholder)]):i.push(this.placeholder()),"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new ve(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||((e=new ve(this.parseMode,"error","\\"+t.value)).latex="\\"+t.value)}}else if("literal"===t.type){const s=Nt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=Nt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new ve(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new ve(this.parseMode,"group",Me(x.tokenize(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var Le={pathFromString:Te,pathToString:_e,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)a=(a=(i+=1)>=t.length||i>=e.length)||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return Te(_e(t)).path}};const De={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left[ #0 \\right]"],"math:Alt-Shift-BracketLeft":["insert","\\left{ #0 \\right}"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":"speakParent","!mac:Ctrl-Alt-Up":"speakParent","mac:Ctrl-Meta-Down":"speakGroup","!mac:Ctrl-Alt-Down":"speakGroup","mac:Ctrl-Meta-Left":"speakLeftSibling","!mac:Ctrl-Alt-Left":"speakLeftSibling","mac:Ctrl-Meta-Right":"speakRightSibling","!mac:Ctrl-Alt-Right":"speakRightSibling","mac:Ctrl-Meta-Shift-Down":"speakAllWithSynchronizedHighlighting","!mac:Ctrl-Alt-Shift-Down":"speakAllWithSynchronizedHighlighting"},Fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},Ee={"''":"^{\\doubleprime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi","π":"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:"\\imaginaryI",jj:"\\imaginaryJ",ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial","∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt","∆":"\\differentialD","∂":"\\differentialD",sin:"\\sin",cos:"\\cos",tan:"\\tan",tanh:"\\tanh",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:"\\eta",gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:"\\mu",nu:"\\nu","µ":"\\mu",phi:"\\phi",Phi:"\\Phi",varphi:"\\varphi",psi:"\\psi",Psi:"\\Psi",rho:"\\rho",sigma:"\\sigma",Sigma:"\\Sigma",tau:"\\tau",vartheta:"\\vartheta",upsilon:"\\upsilon",xi:"\\xi",Xi:"\\Xi",zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\mod",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"digit",value:"\\operatorname{mm}"},cm:{after:"digit",value:"\\operatorname{cm}"},km:{after:"digit",value:"\\operatorname{km}"},kg:{after:"digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}"};function qe(t,e){if("string"==typeof e)return e;if(!t)return e?e.value:void 0;let s=!1,i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,p=!1,d=!1,m=!1,u=!1,f=!1;const y=t[t.length-1];return s=!y||"first"===y.type,y&&(i=!(u="text"===y.mode)&&"mord"===y.type&&Nt.LETTER.test(y.body),a=!u&&"mord"===y.type&&/[0-9]+$/.test(y.body),o=!u&&y.isFunction,n="genfrac"===y.type,r="surd"===y.type,l="mbin"===y.type,c="mrel"===y.type,h="mpunct"===y.type||"minner"===y.type,p=y.array,d="mopen"===y.type,m="mclose"===y.type||"leftright"===y.type,f="space"===y.type),"object"==typeof e&&(e=/nothing/.test(e.after)&&s||/letter/.test(e.after)&&i||/digit/.test(e.after)&&a||/function/.test(e.after)&&o||/frac/.test(e.after)&&n||/surd/.test(e.after)&&r||/binop/.test(e.after)&&l||/relop/.test(e.after)&&c||/punct/.test(e.after)&&h||/array/.test(e.after)&&p||/openfence/.test(e.after)&&d||/closefence/.test(e.after)&&m||/text/.test(e.after)&&u||/space/.test(e.after)&&f?e.value:null),e}function ze(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function Ie(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function Be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ze("mac")||o===ze("win")||o===ze("ios")||o===ze("android")||o===ze("chromeos")||o===ze("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===ze("mac")||"ios"===ze("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var Pe={KEYBOARD_SHORTCUTS:De,INLINE_SHORTCUTS:Ee,stringify:Be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(Ee).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s){let i="";s&&s.overrideDefaultInlineShortcuts||(i=qe(t,Ee[e]));const a=s&&s.inlineShortcuts?s.inlineShortcuts:null;let o;return a&&(o=qe(t,a[e])),o||i},selectorForKeystroke:function(t,e){for(const s of[ze("mac")+":"+t+":"+e,ze("win")+":"+t+":"+e,ze("ios")+":"+t+":"+e,ze("android")+":"+t+":"+e,ze("chromeos")+":"+t+":"+e,ze("other")+":"+t+":"+e,ze("mac")+":"+e,ze("win")+":"+e,ze("ios")+":"+e,ze("android")+":"+e,ze("chromeos")+":"+e,t+":"+e,e])if(De[s])return De[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=Fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=Ie(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const t in De)if(De.hasOwnProperty(t)&&s.test(Ie(De[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}return Be(e)}};function Re(t,e){this.root=ge.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Oe(t){const e=Object.assign(new Re(t.config,t.target),t);return e.path=Le.clone(t.path),e}function Ke(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function $e(t,e){let s;return"object"!=typeof e&&(e=Ne(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Qe()),s}function We(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i}function Ve(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new ge.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function He(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!$e(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Ue(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Ge(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Ge(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some(function(s){return s===e||Ge(t[s],e)}))return!0;if(t.array)for(let s=We(t.array);s>=0;s--)if(Ge($e(t.array,s),e))return!0}return!1}function je(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ze(t,e){return t?t.length<=1?t:(e&&"ASCIIMath"===e.format||(t=t.replace(/\\\\([^\s\n])/g,"\\$1")),e&&"ASCIIMath"===e.format||!/\\/.test(t)?Xe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e):t):""}function Xe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ye(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/))&&(t="\\sqrt{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/))&&(t="\\sqrt[3]{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^abs(.*)/))&&(t="\\left|"+(s=Ye(s[1],{...e,noWrap:!0})).match+"\\right|",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^["”“](.*?)["”“](.*)/))&&(t="\\text{"+s[1]+"}",t+=Xe(s[2],e),i=!0),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ye(t.substring(1),e),t=t[0],t+=s.match,t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i)if((s=Ye(t,{...e,noWrap:!0})).match&&"/"===s.rest[0]){const a=Ye(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+Xe(a.rest,e)),i=!0}else s.match&&/^(\(|\{|\[)$/.test(t[0])?(t="\\left"+t[0]+s.match+"\\right"+{"(":")","{":"}","[":"]"}[t[0]]+Xe(s.rest,e),i=!0):s.match&&(t=s.match,t+=Xe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/))&&(t=" "+Xe(s[2],e),i=!0),t}function Ye(t,e){let s="",i=t=t.trim();const a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(s=e.noWrap&&"("===a&&")"===o?Xe(t.substring(1,r-1),e):"\\mleft"+a+Xe(t.substring(1,r-1),e)+"\\mright"+o,i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=Pe.forString(null,t,e);if(s)return{match:s=(s=s.replace("_{#?}","")).replace("^{#?}",""),rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/))return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/))return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/))&&(i=t.substring(a[1].length),s=a[1])}return{match:s,rest:i}}function Je(t,e){let s=Pe.forString(null,t,e);return s?(s=(s=s.replace("_{#?}","")).replace("^{#?}",""),s+=" "):s=t,s}function Qe(){return new ge.MathAtom("","first")}Re.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},Re.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new Re;i.path=Le.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},Re.prototype.forEach=function(t){this.root.forEach(t)},Re.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},Re.prototype.setRange=function(t,e,s){s=s||{};const i=Le.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(Le.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(Le.clone(t),i)}let a=Le.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=Le.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(n-=1),this.setPath(a,n)},Re.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},Re.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},Re.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},Re.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},Re.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},Re.prototype.insertFirstAtom=function(){this.siblings()},Re.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=$e(this.parent().array,this.relation()):"string"==typeof(t=this.parent()[this.relation()]||[])&&(t=[]),0!==t.length&&"first"===t[0].type||t.unshift(Qe()),t},Re.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},Re.prototype.isCollapsed=function(){return 0===this.extent},Re.prototype.setExtent=function(t){this.extent=t},Re.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},Re.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},Re.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&Nt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&Nt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(e>=(s-=1))return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Ue(t[e]);)e-=1;for(;Ue(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},Re.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},Re.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},Re.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},Re.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},Re.prototype.extractArgBeforeInsertionPoint=function(){const t=[],e=this.siblings();if(e.length<=1)return[];let s=this.startOffset();if("text"===e[s].mode)for(;s>=1&&"text"===e[s].mode;)t.unshift(e[s]),s--;else for(;s>=1&&("mord"===e[s].type||"surd"===e[s].type||"leftright"===e[s].type);)t.unshift(e[s]),s--;return t},Re.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},Re.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=We(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if($e(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=We(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},Re.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,-1))&&$e(e)?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},Re.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,1))&&$e(e)?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},Re.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Oe(this),a=e+(s=this.extent+t);if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},Re.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Oe(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if((n=this.wordBoundaryOffset(n,t))<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},Re.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},Re.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Oe(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===i.length){if(e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return!1}return this.setPath(i[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),!0},Re.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},Re.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries}),s+=1,i=this.ancestor(s);return e},Re.prototype.simplifyParen=function(t){t&&this.config.removeExtraneousParentheses&&t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=je(t.numer),t.denom=je(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=je(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=je(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=je(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=je(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=je(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=je(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=We(t.array);e>=0;e--)this.simplifyParen($e(t.array,e))})},Re.prototype.insert=function(t,e){e=e||{};const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const n=[this.getSelectedAtoms()];void 0!==e.placeholder&&(n["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const r=this.siblings(),l=this.startOffset();if(l+10&&r[l]&&"placeholder"===r[l].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ze(t,{...this.config,format:"ASCIIMath"}),o=Ce.parseTokens(x.tokenize(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)Nt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new ge.MathAtom("command","command",e))}else""===t?o=[new ge.MathAtom("command","command","\\")]:(t=Ze(t,this.config),n[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),n[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-n[0].length),Array.isArray(n[0])&&0===n[0].length&&(n[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=Ce.parseTokens(x.tokenize(t),"text",n,e.macros,!1));if(function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},Re.prototype._insertSmartFence=function(t,e){if(!this.config.smartFence)return!1;const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=Nt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;return s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i,this.insert(s,{mode:"math",format:"latex",style:e}),a&&this.move(-1),!0}let a;for(const e in Nt.RIGHT_DELIM)Nt.RIGHT_DELIM.hasOwnProperty(e)&&t===Nt.RIGHT_DELIM[e]&&(a=e);if(a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},Re.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},Re.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new ge.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},Re.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},Re.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},Re.prototype.delete_=function(t){this.contentWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else{if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(1)}}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.contentDidChange()},Re.prototype.moveToNextPlaceholder_=function(){this.leap(1)},Re.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},Re.prototype.moveToNextChar_=function(){this.move(1)},Re.prototype.moveToPreviousChar_=function(){this.move(-1)},Re.prototype.moveUp_=function(){this.up()},Re.prototype.moveDown_=function(){this.down()},Re.prototype.moveToNextWord_=function(){this.skip(1)},Re.prototype.moveToPreviousWord_=function(){this.skip(-1)},Re.prototype.moveToGroupStart_=function(){this.setSelection(0)},Re.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},Re.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},Re.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},Re.prototype.deleteNextChar_=function(){this.delete_(1)},Re.prototype.deletePreviousChar_=function(){this.delete_(-1)},Re.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},Re.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},Re.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},Re.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},Re.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},Re.prototype.transpose_=function(){},Re.prototype.extendToNextChar_=function(){this.extend(1)},Re.prototype.extendToPreviousChar_=function(){this.extend(-1)},Re.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendUp_=function(){this.up({extend:!0})},Re.prototype.extendDown_=function(){this.down({extend:!0})},Re.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},Re.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},Re.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},Re.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},Re.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Qe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Qe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Qe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},Re.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Qe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Qe()]):("nolimits"===this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Qe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},Re.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];return t?(this.parent()[t]||(this.parent()[t]=[Qe()]),this.setSelection(1,"end",t),!0):(this.moveToSuperscript_(),!1)},Re.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},Re.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Oe(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},Re.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Ne(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ke(e.array,i);this.selectionWillChange(),this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom(),this.selectionDidChange()}}},Re.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=Nt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},Re.prototype.addRowAfter_=function(){this.convertParentToArray(),this._addCell("after row")},Re.prototype.addRowBefore_=function(){this.convertParentToArray(),this._addCell("before row")},Re.prototype.addColumnAfter_=function(){this.convertParentToArray(),this._addCell("after column")},Re.prototype.addColumnBefore_=function(){this.convertParentToArray(),this._addCell("before column")},Re.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="md"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="up"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var ts={EditableMathlist:Re,parseMathString:Ze};const es={Escape:"Esc"," ":"Spacebar",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},ss={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function is(t){let e;"Unidentified"===t.key&&t.target&&(e=ss[t.target.value]||t.target.value),e||(e=es[t.key]||t.code)||(e=ss[t.key.toLowerCase()]||t.key);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),t.altKey&&s.push("Alt"),t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function as(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),t()})}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",function(s){return"function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode?n=!1:(n=!0,o=!1,t.blur(),t.focus()),!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(is(s),s))},!0),c.addEventListener("keypress",function(t){o||(i&&a&&e.keystroke(is(i),i),a=t,r(l))},!0),c.addEventListener("keyup",function(){o||!i||a||l()},!0),c.addEventListener("paste",function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)},!0),c.addEventListener("copy",function(t){e.copy&&e.copy(t)},!0),c.addEventListener("cut",function(t){e.cut&&e.cut(t)},!0),c.addEventListener("blur",function(){i=null,a=null},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{n?(t.blur(),t.focus(),n=!1,o=!1,r(l)):o||r(l)})}var os={delegateKeyboardEvents:as,select:as.select,keyboardEventToString:is,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}},ns={UndoManager:class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}])}}};const rs={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},ls={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function cs(t){let e=ls[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function hs(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&(t.popover.style.left=s.x-t.popover.offsetWidth/2+"px",t.popover.style.top=s.y+5+"px"),t.popover.classList.add("is-visible")}function ps(t){t.popover.classList.remove("is-visible")}var ds={getNote:cs,SAMPLES:rs,NOTES:ls,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void ps(t);const i=e,a=function(t,e){const s=Ce.parseTokens(x.tokenize(t),"math",null,e.config.macros),i=ge.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=ot.makeSpan(i,"ML__base"),o=ot.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const n=ot.makeSpan("","ML__strut--bottom");return n.setStyle("height",a.height+a.depth,"em"),n.setStyle("vertical-align",-a.depth,"em"),ot.makeSpan([o,n,a],"ML__mathlive").toMarkup()}(rs[i]||e,t),o=cs(i),n=Pe.forCommand(i);let r=s?'
    ':"";r+='',r+='
    '+a+"
    ",o&&(r+='
    '+o+"
    "),n&&(r+='
    '+n+"
    "),r+="
    ",hs(t,r+=s?'
    ':"");let l=t.popover.getElementsByClassName("ML__popover_content");l&&l.length>0&&t._attachButtonHandlers(l[0],["complete",{acceptSuggestion:!0}]),(l=t.popover.getElementsByClassName("ML__popover__prev-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"previousSuggestion"),(l=t.popover.getElementsByClassName("ML__popover__next-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"nextSuggestion")},showPopover:hs,hidePopover:ps,updatePopoverPosition:function t(e,s){if(e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&(e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",e.popover.style.top=t.y+5+"px")}else ps(e)}};function ms(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0],c=function(t,e,s){let i=0;for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,i[0][l]);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=ms(this,this.array[i][e],t);i1&&(s+=" "),s+=ms(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):(s+="."===this.leftDelim?"":this.leftDelim||"",this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=ms(this,this.body,t),s+=this.rightDelim&&"?"!==this.rightDelim&&"."!==this.rightDelim?this.rightDelim:"",this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${ms(this,this.shift,t)}em]`),s+=`{${ms(this,this.width,t)}em}{${ms(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${ms(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${ms(this,this.overscript||this.underscript,t)}}{${ms(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+ms(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+ms(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+this.body+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,this.padding||this.border||this.backgroundcolor){let e=ms(this,this.padding,t);this.border&&(e&&(e+=","),e+="border:"+ms(this,this.border,t)),this.backgroundcolor&&(e&&(e+=","),e+=ms(this,this.backgroundcolor,t)),s+=`[${e}]`}s+=`{${ms(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${ms(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ms(this,this.framecolor,t)}}`),this.backgroundcolor&&(s+=`{${ms(this,this.backgroundcolor,t)}}`),s+=`{${ms(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)this.notation.hasOwnProperty(e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+this.backgroundcolor+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+this.strokeColor+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${ms(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"sizing":s={size1:"\\tiny ",size2:"\\scriptsize ",size3:"\\footnotesize ",size4:"\\small ",size5:"\\normalsize ",size6:"\\large ",size7:"\\Large ",size8:"\\LARGE ",size9:"\\huge ",size10:"\\Huge "}[this.size]||"";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=ms(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=ms(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},us.merge=function(t,e){if(t&&e){const s=us._locale;us.locale=t,us.strings[t]={...us.strings[t],...e},us.locale=s}else if(t&&!e){e=t;for(const t of e)e.hasOwnProperty(t)&&us.merge(t,e[t])}},Object.defineProperty(us,"locale",{set(t){us._locale=t},get:()=>us._locale}),us.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Rückgängig machen"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le Presse-papiers","tooltip.redo":"Refaire","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const fs={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ys={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},gs={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let bs={};const xs={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ks(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=Ce.parseTokens(x.tokenize(t),"math",e,s.config.macros),a=ge.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=ot.makeSpan(a,"ML__base"),n=ot.makeSpan("","ML__strut");n.setStyle("height",o.height,"em");const r=ot.makeSpan("","ML__strut--bottom");return r.setStyle("height",o.height+o.depth,"em"),r.setStyle("vertical-align",-o.depth,"em"),ot.makeSpan([n,r,o],"ML__mathlive").toMarkup()}function vs(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},fs,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",""}function ws(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ys[n]&&(a.setAttribute("data-shifted",ys[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ys[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=bs[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function Ss(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e,n=(o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ")).match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}else;n=(o=o.replace(new RegExp(n[1]+n[2]+n[3]),a)).match(/()/)}return o}var As={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';gs["foreground-color"]=[];for(const t of ke.LINE_COLORS)gs["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});gs["background-color"]=[];for(const t of ke.AREA_COLORS)gs["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});bs={},bs=Object.assign({},gs);for(const t in bs)bs.hasOwnProperty(t)&&(bs[t]=bs[t].slice());const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),bs[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},xs,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},fs,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=vs(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=Ss(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,ws(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e/g,">")}function Ls(t,e){return t&&e.generateID?' extid="'+t+'"':""}function Ds(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,Fs(t)&&(n=t.index,t.index+=1),Es(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=Ps(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,Fs(t)){const e=Ps(t.atoms[n].superscript,0,0,s).mathML,i=Ps(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ps(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function Fs(t){return t.index"+t,a+=Ps(o.subscript,0,0,s).mathML,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ps(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function zs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].latex,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&Fs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ps(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function Is(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Rs(t.atoms[l],s),a+=Ps(t.atoms,l+1,c,s).mathML,a+=Rs(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,qs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Bs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=Rs(t.atoms[t.index],s);a+=e,t.index+=1,qs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,/^(.*)<\/mo>$/.test(e)?o="mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ps(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Rs(t,e){let s="";const i=function(t){if(!t)return"";if("string"==typeof t)return Ts(t);if(!Array.isArray(t)&&"string"==typeof t.body)return Ts(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return Ts(e)}(t.body);return i&&(s=""+i+""),s}ge.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",p={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";p&&(p=' mathvariant="'+p+'"');const d=this.latex?this.latex.trim():null;let m;switch(this.type){case"group":case"root":c=Ps(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(_s[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ps(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(_s[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ps(this.numer,0,0,t).mathML||" ",c+=Ps(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ps(this.numer,0,0,t).mathML+"",c+=""+Ps(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ps(this.body,0,0,t).mathML,c+=Ps(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ps(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ps(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(_s[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ps(this.body,0,0,t).mathML,c+=""+(_s[d]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ps(l,0,0,t).mathML,c+=Ps(n,0,0,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):r?(c+=""+Ps(l,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):n&&(c+=""+Ps(l,t).mathML,c+=Ps(n,0,0,t).mathML,c+="");break;case"mord":c=e[d]||d||("string"==typeof this.body?this.body:""),(m=d?d.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null)?c="&#x"+m[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.latex),c=""+Ts(c)+"";break;case"mbin":case"mrel":case"textord":case"minner":c=d&&e[d]?""+e[d]+"":d&&_s[d]?""+_s[d]+"":Rs(this,t);break;case"mpunct":c='"+(_s[d]||d)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===d?this.body:d||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ps(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ps(this.body,0,0,t).mathML+"";break;case"sizing":break;case"space":c+=" "}return c},ge.toMathML=function(t,e){return Ps(t,0,0,e).mathML};const Os={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ks={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ns={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},$s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ws(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Vs(t){return t&&$s[t]||-1}function Hs(t){return/=|=>/.test(t)?"right":"left"}function Us(t){if("f"===t||"g"===t)return!0;const e=Ns[t];return!!e&&!!/%[^01_^]?/.test(e)}function Gs(t){t=(t||"").trim();let e=Os[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=Nt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function js(t){if(!t)return null;const e=Gs(ti(t)),s=[Vs(e),Hs(e)];return s[0]<=0?null:s}function Zs(t){return null!==js(t)}const Xs={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ys={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Js={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Qs={",":"list",";":"list2"};function ti(t){if(Array.isArray(t)){let e="";for(const s of t)e+=ti(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=ti(s);return e}return""}function ei(t){return parseFloat(t.num)}function si(t){return"object"==typeof t&&void 0!==t.num}function ii(t){let e=0;return si(t)&&(e="object"==typeof t.num?void 0!==t.num.re?xi(t.num.re):0:parseFloat(t.num)),e}function ai(t){let e=0;return si(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?xi(t.num.im):0),e}function oi(t){return t&&void 0!==t.sup}function ni(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||ti(a)===s),i}function ri(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function li(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function ci(t){if(si(t)){const e=ii(t),s=ai(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return ri("negate",t)}function hi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function pi(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||((s=t.atoms[t.index+1])&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=bi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(ti(s.superscript))?(t.index+=1,(s=t.atoms[t.index+1])&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=bi(s.superscript,e)):t.ast.sup=bi(s.superscript,e))):t.index+=1,t}function di(t,e){const s=t.ast;if(ui(t,"!!"))return t.index+=1,t.ast=ri("factorial2",s),t=di(t=pi(t,e),e);if(ui(t,"++"))return t.index+=1,t.ast=ri("increment",s),t=di(t=pi(t,e),e);if(ui(t,"--"))return t.index+=1,t.ast=ri("decrement",s),t=di(t=pi(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ys[i.latex.trim()]&&(t.ast=ri(Ys[i.latex.trim()],s),t=di(t=pi(t,e),e)),t}function mi(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"mclose"===o.type&&ti(o)===s&&(hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i));else if("textord"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"textord"===o.type&&ti(o)===s&&(t.index+=1,t=di(t=pi(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if((o=t.atoms[t.index+1])&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=yi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=di(t=pi(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=di(t=pi(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=bi(o.body,i),hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=Nt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=Nt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=mi(t,e,s))return i&&(t.index+=1),t.ast={fn:Xs[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ui(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===ti(t.atoms[t.index])+ti(t.atoms[t.index+1])}function fi(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ni(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,ni(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ni(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function yi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];const a=Gs(ti(i));if(fi(e))e.ast=ri(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=ci(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=ri("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>gi(t)))),e=[t])}return e}function bi(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=yi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?ri("text",...s):s[0]||void 0}({atoms:gi(t)},e)}function xi(t){return parseFloat(parseFloat(t).toPrecision(15))}ge.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},n="",r={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],l="";"b"===this.fontSeries&&(l+="bold"),"it"===this.fontShape&&(l+="italic");const c=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/))?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=Ce.parseTokens(x.tokenize(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=Ce.parseTokens(x.tokenize(i),"math",null,t.macros),o=ri("divide",bi(s,t),bi(i,t))):o.fn="divide":o.group=bi(this.body,t);break;case"genfrac":o=ri("divide",bi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?li(1):bi(this.denom,t));break;case"surd":o=this.index?ri("pow",bi(this.body,t),ri("divide",1,bi(this.index,t))):ri("sqrt",bi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":(e=c?c.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0)?n=String.fromCodePoint(parseInt(e[1],16)):(n=Gs(ti(this))).length>0&&"\\"===n.charAt(0)&&"string"==typeof this.body&&(n=this.body),(a=Nt.mathVariantToUnicode(n,r,l).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))!==n?(o={sym:a},r="normal"):o={sym:n};break;case"minner":case"mop":break;case"box":o=bi(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=ri("card",bi(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>bi(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(bi(e[0],t));let i=bi(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"sizing":case"mathstyle":break;default:o=void 0}return o&&r&&"normal"!==r&&(o.variant=r),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},ge.toAST=function(t,e){return bi(t,e)};const ki={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket '};function vi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function wi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function Si(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function Ai(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function Mi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):((s=document.createElement("div")).setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function Ci(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function _i(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=Mi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=Mi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,Si(window,"focus",this),Si(window,"blur",this),Si(this.element,"focus",this),Si(this.element,"blur",this),Si(this.textarea,"cut",this),Si(this.textarea,"copy",this),Si(this.textarea,"paste",this),os.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this)}),Si(this.element,"touchstart:active mousedown",this),Si(window,"resize",this);const o={...e};o.onSelectionDidChange=_i.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=_i.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.smartFence=this.config.smartFence,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new ts.EditableMathlist(o,this),this.undoManager=new ns.UndoManager(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}let Ti,Li;ge.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1;for(let o=0;o'+o+'. End fraction.';break;case"surd":if(n=ge.toSpeakableFragment(t.body,e),t.index){let s=ge.toSpeakableFragment(t.index,e);const a=(s=s.trim()).replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else vi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=ki[t.leftDelim]||t.leftDelim,i+=ge.toSpeakableFragment(t.body,e),i+=ki[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=ge.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=ki[a]||(o?ki[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=ds.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=ge.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(s=s.trim())+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(s=s.trim())+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=ge.toSpeakableFragment(t.superscript,e);a=a.trim();let o=ge.toSpeakableFragment(t.subscript,e);i+=' the integral from '+s(o=o.trim())+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){const e=ki[t.body]||ki[t.latex.trim()];i+=e||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=ge.toSpeakableFragment(t.body,e),vi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=ge.toSpeakableFragment(t.superscript,e);const a=(s=s.trim()).replace(/<[^>]*>/g,"");if(vi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);s=s.trim(),vi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},ge.toSpeakableText=function(t,e){if(e||(e={textToSpeechMarkup:"",textToSpeechRules:"mathlive"}),e.speechMode="math",window.sre&&"sre"===e.textToSpeechRules){e.generateID=!0;const s=ge.toMathML(t,e);return s?(e.textToSpeechMarkup&&(e.textToSpeechRulesOptions=e.textToSpeechRulesOptions||{},e.textToSpeechRulesOptions.markup=e.textToSpeechMarkup,"ssml"===e.textToSpeechRulesOptions.markup&&(e.textToSpeechRulesOptions.markup="ssml_step"),e.textToSpeechRulesOptions.rate=e.speechEngineRate),e.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(e.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(s)):""}let s=ge.toSpeakableFragment(t,e);if("ssml"===e.textToSpeechMarkup){let t="";e.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===e.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s},_i.prototype.handleEvent=function(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}},_i.prototype.revertToOriginalContent=_i.prototype.$revertToOriginalContent=function(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,Ai(this.textarea,"cut",this),Ai(this.textarea,"copy",this),Ai(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,Ci(this.popover),Ci(this.keystrokeCaption),Ci(this.virtualKeyboard),Ci(document.getElementById("mathlive-alternate-keys-panel")),Ai(this.element,"touchstart:active mousedown",this),Ai(this.element,"focus",this),Ai(this.element,"blur",this),Ai(window,"resize",this),Ai(window,"focus",this),Ai(window,"blur",this)},_i.prototype._resetKeystrokeBuffer=function(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)},_i.prototype._getCaretPosition=function(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach(function(e){s=s||t(e)}),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right+window.scrollX,y:e.bottom+window.scrollY}}return null},_i.prototype._pathFromPoint=function(t,e,s){let i;(s=s||{}).bias=s.bias||0;const a=function t(e,s,i){let a={element:null},o=!0;if(e.getAttribute("data-atom-id")){a.element=e;const t=e.getBoundingClientRect(),n=Math.max(t.left-s,s-t.right),r=Math.max(t.top-i,i-t.bottom);a.distance=n*n+r*r,o=s>=t.left&&s<=t.right}else a.distance=Number.POSITIVE_INFINITY;return o&&e.children&&Array.from(e.children).forEach(function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)}),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter(function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o});if(e&&e.length>0)if(i=Le.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tvoid 0)),t._resetKeystrokeBuffer()):"delete"===e?a=Fi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Fi(t,"",t.mathlist.sibling(0)):"line"===e?(a=Fi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+ge.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Fi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}_i.prototype._onPointerDown=function(t){let e;const s=this;let i=!1,a=!1,o=!1;function n(t){Ai(s.field,"touchmove",r),Ai(s.field,"touchend touchleave",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,t.preventDefault(),t.stopPropagation()}function r(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;if(Date.now()=p.left&&l<=p.right&&c>=p.top&&c<=p.bottom){if(this.hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,t.buttons&&1!==t.buttons)return;(e=this._pathFromPoint(l,c,{bias:0}))&&(t.shiftKey?(this.mathlist.setRange(this.mathlist.path,e),(e=Le.clone(this.mathlist.path))[e.length-1].offset-=1):this.mathlist.setPath(e,0),o=!0,3===t.detail||Di>2?(Ai(this.field,"touchmove",r),Ai(this.field,"touchend",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,3!==t.detail&&3!==Di||this.mathlist.selectAll_()):i||(i=!0,Si(window,"blur",n),t.touches?(Si(t.target,"touchmove",r),Si(t.target,"touchend",n)):(Si(window,"mousemove",r),Si(window,"mouseup",n)),2!==t.detail&&2!==Di||(a=!0,this.mathlist.selectGroup_())))}else Ti=null;o&&this._render(),t.preventDefault()},_i.prototype._onSelectionDidChange=function(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}this.style={},ds.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)},_i.prototype._onContentDidChange=function(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)},_i.prototype._nextAtomSpeechText=function(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Fi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Fi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o},_i.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)},_i.prototype._onFocus=function(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),ds.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._render())},_i.prototype._onBlur=function(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),ds.updatePopoverPosition(this),this._render(),this.config.onBlur&&this.config.onBlur(this))},_i.prototype._onResize=function(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),ds.updatePopoverPosition(this)},_i.prototype.toggleKeystrokeCaption_=function(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")},_i.prototype._showKeystroke=function(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(Pe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout(function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")},3e3)}},_i.prototype.perform=_i.prototype.$perform=function(t){if(!t)return!1;let e,s=!1,i=[],a=!1;return Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]?(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),a=!0,s=!0):"function"==typeof this[e]&&(a=this[e](...i),s=!0),this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||this._resetKeystrokeBuffer(),a&&this._render(),s},_i.prototype.performWithFeedback_=function(t){return this.focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)):("deletePreviousChar"===t||"deleteNextChar"===t||"deletePreviousWord"===t||"deleteNextWord"===t||"deleteToGroupStart"===t||"deleteToGroupEnd"===t||"deleteToMathFieldStart"===t||"deleteToMathFieldEnd"===t)&&this.deleteKeypressSound?(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)),this.perform(t)},_i.prototype.convertLastAtomsToText_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"math"!==a.mode||!/mord|textord|mpunct/.test(a.type)||a.superscript||a.subscript||e&&!e(a))||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()},_i.prototype.convertLastAtomsToMath_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a))||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()},_i.prototype.removeIsolatedSpace_=function(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}},_i.prototype.getTextBeforeAnchor_=function(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);(s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))))||(t=i.body+t),e-=1}return t},_i.prototype.smartMode_=function(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(this.mathlist.isCollapsed()){const e=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[\/^_\\]/.test(s))return!0;const i={")":"(","}":"{","]":"["}[s];if(i&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===i)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(e))return!1;if(/(^|[^a-zA-Z])[a-zA-Z][ ]$/.test(e))return this.convertLastAtomsToMath_(1),!1;if(/\.\S$/.test(e)){const t=this.mathlist.sibling(0);return t.body="⋅",t.fontFamily="cmr",t.latex="\\cdot",t.mode="math",t.type="mord",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/\.[0-9]$/.test(e))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/[(][a-z][,;]$/.test(e))return this.convertLastAtomsToMath_(2),this.removeIsolatedSpace_(),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(e)&&!/dxd$/.test(e))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(e))return this.convertLastAtomsToText_(1),!0;if(/\?|\./.test(s))return!0}}return!1},_i.prototype._onKeystroke=function(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=os.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=Pe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const n=this.mathlist.parent();if("moveAfterParent"===a&&n&&"leftright"===n.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.mathlist._insertSmartFence(".")&&(a="",this._render()),"math"===this.mode&&"Spacebar"===t){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(os.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist._insertSmartFence(s,a)||this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a}),this.removeIsolatedSpace_(),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._render(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1},_i.prototype._onTypedText=function(t,e){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=os.charToEvent(e);if(!this.$keystroke(os.keyboardEventToString(s),s))return}let s="",i=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},a=y.splitGraphemes(t);for(const t of a)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),a=Nt.suggest(e+t);i=a.length>1,0===a.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),ds.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),a[0].match!==e+t&&this.mathlist.insertSuggestion(a[0].match,-a[0].match.length+e.length+1),s=a[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist._insertSmartFence(t,e)||this.mathlist.insert(t,{mode:"math",style:e})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._render(),ds.showPopoverWithLatex(this,s,i)},_i.prototype._hash=function(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;s{t.caret="",t.isSelected=!1});const e=this.hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const s=ge.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=ot.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=ot.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=ot.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=ot.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+ge.toMathML(this.mathlist.root,this.config)+"";const r=this.field.querySelectorAll(".ML__selected");if(r&&r.length>0){const t={top:1/0,bottom:-1/0,left:1/0,right:-1/0};r.forEach(e=>{if(e.classList.contains("ML__selected")){const s=e.getBoundingClientRect();s.leftt.right&&(t.right=s.right),s.bottom>t.bottom&&(t.bottom=s.bottom),s.top0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&Ms[a]?Ms[a]:a&&Cs[a]?Cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=Cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?e.body:e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":case"sizing":break;case"space":i=" "}if(e.subscript){i+="_";const a=t(e.subscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}if(e.superscript){i+="^";const a=t(e.superscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}return i}(t,this.config));return s},_i.prototype.text=_i.prototype.$text=function(t){return this.formatMathlist(this.mathlist.root,t)},_i.prototype.selectedText=_i.prototype.$selectedText=function(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=ge.makeRoot(e[0].mode,e);return this.formatMathlist(s,t)},_i.prototype.selectionIsCollapsed=_i.prototype.$selectionIsCollapsed=function(){return this.mathlist.isCollapsed()},_i.prototype.selectionDepth=_i.prototype.$selectionDepth=function(){return this.mathlist.path.length},_i.prototype._superscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype._subscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype.selectionAtStart=_i.prototype.$selectionAtStart=function(){return 0===this.mathlist.startOffset()},_i.prototype.selectionAtEnd=_i.prototype.$selectionAtEnd=function(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.groupIsSelected=function(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.latex=_i.prototype.$latex=function(t,e){if(t){return t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._render()),t}return this.mathlist.root.toLatex()},_i.prototype.el=_i.prototype.$el=function(){return this.element},_i.prototype.undo_=_i.prototype.undo=function(){return this.complete_(),this.undoManager.undo(this.config),!0},_i.prototype.redo_=_i.prototype.redo=function(){return this.complete_(),this.undoManager.redo(this.config),!0},_i.prototype.scrollIntoView_=_i.prototype.scrollIntoView=function(){return!1},_i.prototype.scrollToStart_=_i.prototype.scrollToStart=function(){return!0},_i.prototype.scrollToEnd_=_i.prototype.scrollToEnd=function(){return!0},_i.prototype.enterCommandMode_=function(){this.switchMode_("command")},_i.prototype.copyToClipboard_=function(){return this.focus(),this.mathlist.isCollapsed()&&this.select(),document.execCommand("copy"),!1},_i.prototype.cutToClipboard_=function(){return this.focus(),document.execCommand("cut"),!0},_i.prototype.pasteFromClipboard_=function(){return this.focus(),document.execCommand("paste"),!0},_i.prototype.insert_=_i.prototype.insert=_i.prototype.$insert=function(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.style.fontFamily||(this.style.fontFamily="math"),this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),!0}return!1},_i.prototype.switchMode_=function(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=!0,e&&this.insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),ds.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._render()},_i.prototype.complete_=function(t){if(t=t||{},ds.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(Nt.commandAllowed(t,e)){const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1},_i.prototype._updateSuggestion=function(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);if(0===e.length)ds.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),ds.showPopoverWithLatex(this,e[s].match,e.length>1)}this._render()},_i.prototype.nextSuggestion_=function(){return this.suggestionIndex+=1,this._updateSuggestion(),!1},_i.prototype.previousSuggestion_=function(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1},_i.prototype._attachButtonHandlers=function(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),Si(t,"mousedown touchstart:passive",function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout(function(){t.classList.contains("pressed")&&s.perform(JSON.parse(l))},300))}}),Si(t,"mouseleave touchcancel",function(){t.classList.remove("pressed")}),Si(t,"touchmove:passive",function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,As.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1},_i.prototype.hideAlternateKeys_=function(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",Ci(t)),!1},_i.prototype.performAlternateKeys_=function(t){return this.hideAlternateKeys_(),this.perform(t)},_i.prototype.switchKeyboardLayer_=function(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){const i=[];for(let t=1;t<=s;t++)i.push(e[t]);t=ge.toSpeakableText(i,this.config)}return this._speak(t),!1},_i.prototype.speakGroup_=function(){return this._speak(ge.toSpeakableText(this.mathlist.siblings(),this.config)),!1},_i.prototype.speakAll_=function(){return this._speak(ge.toSpeakableText(this.mathlist.root,this.config)),!1},_i.prototype.speakAllWithSynchronizedHighlighting_=function(){window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0});const t=this.config;t.textToSpeechMarkup=window.sre&&"sre"===t.textToSpeechRules?"ssml_step":"ssml";const e=ge.toSpeakableText(this.mathlist.root,t);return this._speakWithSynchronizedHighlighting(e),!1};var qi={MathField:_i};function zi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(-1===(r=n.indexOf(e,c))){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(-1===(r=zi(s,n,c+e.length))){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Ri(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))(s=document.createDocumentFragment()).appendChild(Pi(t,void 0,e,!0));else{const i=Bi(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;tvoid 0)}})}else;else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Hi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}})}})}function Ui(t){let e=t;if("string"==typeof t&&!(e=document.getElementById(t)))throw Error(`The element with ID "${t}" could not be found.`);return e}function Gi(t,e){Ki&&((e=e||{}).renderToMarkup=e.renderToMarkup||Ni,e.renderToMathML=e.renderToMathML||$i,e.renderToSpeakableText=e.renderToSpeakableText||Wi,e.macros=e.macros||Nt.MACROS,Ki.renderMathInElement(Ui(t),e))}function ji(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:Ni,latexToMathML:$i,latexToSpeakableText:Wi,latexToAST:function(t,e){if(!ge.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,Nt.MACROS);const s=Ce.parseTokens(x.tokenize(t),"math",null,e.macros);return ge.toAST(s,e)},makeMathField:function(t,e){if(!qi)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Vi,e.handleReadAloud=e.handleReadAloud||Hi,new qi.MathField(Ui(t),e)},renderMathInDocument:function(t){Gi(document.body,t)},renderMathInElement:Gi,revertToOriginalContent:function(t,e){(t=(t=Ui(t)).children[1])instanceof qi.MathField?t.revertToOriginalContent():(ji(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Ui(t)).children[1])instanceof qi.MathField?t.originalContent:(ji(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Hi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e)=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function u(u,y){if((y=y||0)<0)return 0;if(y>=u.length-1)return u.length;let g=f(m(u,y));for(let k=y+1;k=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new g("literal","#")}}else"^"===this.peek()?t=new g(this.get()):"_"===this.peek()?t=new g(this.get()):"~"===this.peek()?(this.get(),t=new g("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new g("$$")):t=new g("$")):t=new g("literal",this.get());return t}}var x={tokenize:function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const o=new b(i);for(;!o.end();){const t=o.makeToken();t&&e.push(t)}return e}},k={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const v=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,w={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},S={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},A={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function M(t,e,s){if("string"==typeof t){const s=t.match(/([0-9.]*)\s*([a-z]*)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}let i=1;if("pt"===e?i=1:"mm"===e?i=7227/2540:"cm"===e?i=7227/254:"ex"===e?i=35271/8192:"px"===e?i=.75:"em"===e?i=S.ptPerEm:"bp"===e?i=1.00375:"dd"===e?i=1238/1157:"pc"===e?i=12:"in"===e?i=72.27:"mu"===e&&(i=10/18),s){const e=Math.pow(10,s);return Math.round(t/S.ptPerEm*i*e)/e}return t/S.ptPerEm*i}var C={toEm:M,toPx:function(t,e){return M(t,e)*(4/3)*S.ptPerEm},METRICS:S,SIGMAS:w,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in A?i=A[t[0]].charCodeAt(0):v.test(t[0])&&(i=77);const a=k[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const _=[{},{},{}];let T;for(const t in w)if(w.hasOwnProperty(t))for(T=0;T<3;T++)_[T][t]=w[t][T];for(T=0;T<3;T++)_[T].emPerEx=w.xHeight[T]/w.quad[T];class L{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=_[e>0?e-1:0]}sup(){return q[P[this.id]]}sub(){return q[R[this.id]]}fracNum(){return q[O[this.id]]}fracDen(){return q[K[this.id]]}cramp(){return q[N[this.id]]}cls(){return I[this.size]}adjustTo(t){let e=B[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const D=0,F=2,E=4,z=6,q=[new L(D,0,1,!1),new L(1,0,1,!0),new L(F,1,1,!1),new L(3,1,1,!0),new L(E,2,.7,!1),new L(5,2,.7,!0),new L(z,3,.5,!1),new L(7,3,.5,!0)];const I=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],B=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],P=[E,5,E,5,z,7,z,7],R=[5,5,5,5,7,7,7,7],O=[F,3,E,5,z,7,z,7],K=[3,3,5,5,7,7,7,7],N=[1,1,3,3,5,5,7,7];var $={DISPLAY:q[D],TEXT:q[F],SCRIPT:q[E],SCRIPTSCRIPT:q[z],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:q[D],textstyle:q[F],scriptstyle:q[E],scriptscriptstyle:q[z]}[t]:t}};class W{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=$.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new W(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(this,t),"string"==typeof t.mathstyle&&(this.mathstyle=$.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=$.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var V={Context:W};function H(t){let e="";if("number"==typeof t)e+=Math.floor(1e5*t)/1e5;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=H(s);else t&&(e+=t.toString());return e}class U{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=0;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color",""));let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return it[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-.\/:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-.\/:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return it[e]}(this.body,e)),t.cssClass&&(this.classes+=" "+t.cssClass),t.fontShape&&(this.classes+=" "+{it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||""),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+{ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||"",this.classes+=" "+{uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||"")}if(at[e]?this.classes+=" "+at[e]:this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=H(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=H(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=H(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=H(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=H(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?X[t+"+"+i]||0:G[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=Y(s)}}const a=this.tag||"span";if(0===a.length)s=i||"";else{if(s="<"+a,this.cssId&&(s+=' id="'+this.cssId+'" '),this.svgOverlay&&(this.style||(this.style={}),this.style.position="relative"),this.attributes)for(const t in this.attributes)this.attributes.hasOwnProperty(t)&&(s+=" "+t+'="'+this.attributes[t]+'"');const e=this.classes.split(" ");this.type&&(/command|placeholder|error/.test(this.type)&&e.push({command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type]),this.caret&&"command"===this.type&&e.push("ML__command-caret"));let o="";if((o=e.length>1?e.filter(function(t,e,s){return t.length>0&&s.indexOf(t)===e}).join(" "):e[0]).length>0&&(s+=' class="'+o+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=H(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&Z[-t]?i=Z[-t]+i:j[t]?i=j[t]+i:(this.style||(this.style={}),this.style["margin-left"]=H(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)this.style.hasOwnProperty(s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+=i,s+=""):s+=i,s=s+""}return""===s&&(s=""),this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;t0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new U(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=-t.depth-o;o+=t.height+t.depth;const s=tt([r,t]);s.setTop(e),l.push(s)}const c=tt(l,"vlist");return c.depth=Math.max(a,Q(c)||0),c.height=Math.max(-o,J(c)||0),c},makeHlist:st,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=st(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:J,depth:Q,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let nt="";const rt={},lt={},ct={},ht="CRYPTIC",pt="COMMON",dt="SUPERCOMMON",mt={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function ut(t,...e){const s="string"==typeof t?mt[t]:t;for(const t of e)rt[t]&&(rt[t].frequency=s),lt[t]&&(lt[t]=Object.assign({},lt[t]),lt[t].frequency=s)}function ft(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=mt[a]),rt[t]={type:s===At?Mt:s,baseFontFamily:e,value:i,category:nt,frequency:a}}function yt(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);ft(t,"","mord",t)}}const gt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function bt(t,e){const s=String.fromCodePoint(e);if("math"===t&>[s])return gt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in rt)if(rt.hasOwnProperty(t)&&rt[t].value===s){i=t;break}}else for(const t in Rt)if(Rt.hasOwnProperty(t)&&Rt[t]===s){i=t;break}return i||s}const xt={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},kt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function vt(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in xt)if(xt.hasOwnProperty(t)&&xt[t]===e){e=t;break}for(let t=0;t=kt[t].start&&et.body).join("")}function qt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=Et(e),o={category:nt,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)ct[e]=o}function It(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:nt,baseFontFamily:s.fontFamily,params:Et(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)lt[e]=a}nt="Environments",qt("math","",{frequency:0},function(){return{mathstyle:"textstyle"}}),qt("displaymath","",{frequency:8},function(){return{mathstyle:"displaystyle"}}),qt("array","{columns:colspec}",{frequency:pt},function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}}),qt("eqnarray","",{},function(){return{}}),qt("equation","",{},function(){return{colFormat:[{align:"c"}]}}),qt("subequations","",{},function(){return{colFormat:[{align:"c"}]}}),qt("multline","",{},function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}}),qt(["align","aligned"],"",{},function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),It("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),ut(3,"\\textcolor"),It("\\overline","{:auto}",null,function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\overline"),It("\\underline","{:auto}",null,function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\underline"),It("\\overset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\overset"),It("\\underset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\underset"),It(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}}),ut(pt,"\\stackrel"),ut(0,"\\stackbin"),It("\\rlap","{:auto}",null,function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}}),ut(270,"\\rlap"),It("\\llap","{:auto}",null,function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}}),ut(18,"\\llap"),It("\\mathrlap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathrlap"),It("\\mathllap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathllap"),It("\\boxed","{content:math}",null,function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}}),ut(1236,"\\boxed"),It("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}}),ut(ht,"\\colorbox"),It("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}}),ut(ht,"\\fcolorbox"),It("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}}),ut(ht,"\\bbox"),It("\\enclose","{notation:string}[style:string]{body:auto}",null,function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=C.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=C.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i}),ut(ht,"\\enclose"),It("\\cancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}}),It("\\bcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}}),It("\\xcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}}),ut(ht,"\\cancel","\\bcancel","\\xcancel"),nt="Styling",It("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:zt(e[0])})),It("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),It(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),It("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),It("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:zt(e[0])})),It("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),It("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),It("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),It("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:zt(e[0])})),It("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),It("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmss",fontSeries:"m",fontShape:"n"})),It("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),It("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"bb"})),It(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({fontFamily:"frak"})),It("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cal",fontSeries:"m",fontShape:"n"})),It("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"scr",fontSeries:"m",fontShape:"n"})),ut(dt,"\\mathbb"),ut(1081,"\\Bbb"),ut(0,"\\mathcal"),ut(pt,"\\mathfrak"),ut(271,"\\frak"),ut(pt,"\\mathscr"),ut("UNCOMMON","\\mathsf"),ut(pt,"\\mathtt"),ut(pt,"\\boldsymbol"),It("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),It("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),It("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),It("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:zt(e[0])})),It("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:zt(e[0]),body:e[1],type:"group"})),It("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),It("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),ut(pt,"\\textrm"),ut(pt,"\\textit"),ut(pt,"\\textsf"),ut(pt,"\\texttt"),ut(433,"\\textnormal"),ut(pt,"\\textbf"),ut(421,"\\textup"),ut(819,"\\emph"),ut(49,"\\em"),nt="Operators",It("\\sqrt","[index:auto]{radicand:auto}",null,function(t,e){return{type:"surd",body:e[1],index:e[0]}}),ut(dt,"\\sqrt"),nt="Fractions",It(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s}),It(["\\over","\\atop","\\choose"],"",{infix:!0},function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}}),ut(21,"\\over"),ut(12,"\\atop"),ut(1968,"\\choose"),It(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}}),ut(15,"\\overwithdelims"),ut(pt,"\\atopwithdelims"),nt="Fractions",It("\\pdiff","{numerator}{denominator}",null,function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}}),nt="Quantifiers",ft("\\forall","",Mt,"∀",dt),ft("\\exists","",Mt,"∃",dt),ft("\\nexists",St,Mt,"∄",dt),ft("\\mid","",_t,"∣",pt),ft("\\top","",Mt,"⊤","RARE"),ft("\\bot","",Mt,"⊥","RARE"),nt="Variable Sized Symbols",It(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}}),It(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}}),ut(dt,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),ut(pt,"\\bigoplus","\\smallint","\\iint","\\oint"),ut("RARE","\\bigwedge","\\bigvee"),ut(756,"\\coprod"),ut(723,"\\bigsqcup"),ut(1241,"\\bigotimes"),ut(150,"\\bigodot"),ut(174,"\\biguplus"),ut(878,"\\iiint"),ut(97,"\\intop"),nt="Various",ft("\\sharp","",Mt,"♯",pt),ft("\\flat","",Mt,"♭",590),ft("\\natural","",Mt,"♮",278),ft("\\#","",Mt,"#","RARE"),ft("\\&","",Mt,"&","RARE"),ft("\\clubsuit","",Mt,"♣",172),ft("\\heartsuit","",Mt,"♡","ARCANE"),ft("\\spadesuit","",Mt,"♠","ARCANE"),ft("\\diamondsuit","",Mt,"♢",ht),ft("\\differencedelta","",_t,"∆",pt),nt="Letters and Letter Like Forms",It("\\unicode","{charcode:number}",null,function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}}),ft("\\backslash","",Mt,"\\"),ft("?","",Mt,"?"),ft("!","",Mt,"!"),ft("\\nabla","",Mt,"∇",dt),ft("\\partial","",Mt,"∂",dt),ft("\\ell","",Mt,"ℓ",pt),ft("\\imaginaryI","",Mt,"i"),ft("\\imaginaryJ","",Mt,"j"),It(["\\Re","\\Im"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}}),ft("\\hbar","",Mt,"ℏ",pt),ft("\\hslash",St,Mt,"ℏ",pt),ft("\\differentialD","cmr",Mt,"d"),ft("\\rd","cmr",Mt,"d"),ft("\\capitalDifferentialD","cmr",Mt,"D"),ft("\\rD","cmr",Mt,"D"),ft("\\exponentialE","cmr",Mt,"e"),ft("\\Finv",St,Mt,"Ⅎ",3),ft("\\Game",St,Mt,"⅁",1),ft("\\wp","",Mt,"℘",1306),ft("\\eth",St,Mt,"ð",77),ft("\\mho",St,Mt,"℧",138),ft("\\Bbbk",St,Mt,"k"),ft("\\doubleStruckCapitalN","bb",Mt,"N"),ft("\\N","bb",Mt,"N"),ft("\\doubleStruckCapitalR","bb",Mt,"R"),ft("\\R","bb",Mt,"R"),ft("\\doubleStruckCapitalQ","bb",Mt,"Q"),ft("\\Q","bb",Mt,"Q"),ft("\\doubleStruckCapitalC","bb",Mt,"C"),ft("\\C","bb",Mt,"C"),ft("\\doubleStruckCapitalZ","bb",Mt,"Z"),ft("\\Z","bb",Mt,"Z"),ft("\\doubleStruckCapitalP","bb",Mt,"P"),ft("\\P","bb",Mt,"P"),ft("\\scriptCapitalE","scr",Mt,"E"),ft("\\scriptCapitalH","scr",Mt,"H"),ft("\\scriptCapitalL","scr",Mt,"L"),ft("\\gothicCapitalC","frak",Mt,"C"),ft("\\gothicCapitalH","frak",Mt,"H"),ft("\\gothicCapitalI","frak",Mt,"I"),ft("\\gothicCapitalR","frak",Mt,"R"),ft("\\pounds","",Mt,"£",509),ft("\\yen",St,Mt,"¥",57),ft("\\euro","",Mt,"€",4),nt="Crosses",ft("\\textdagger","",Ct,"†"),ft("\\dagger","",Ct,"†",pt),ft("\\dag","",Ct,"†",pt),ft("\\ddag","",Ct,"‡",500),ft("\\textdaggerdbl","",Ct,"‡"),ft("\\ddagger","",Ct,"‡",353),ft("\\maltese",St,Mt,"✠",24),nt="Arrows",ft("\\longrightarrow","",_t,"⟶",dt),ft("\\rightarrow","",_t,"→",dt),ft("\\Longrightarrow","",_t,"⟹",dt),ft("\\Rightarrow","",_t,"⇒",dt),ft("\\longmapsto","",_t,"⟼",pt),ft("\\mapsto","",_t,"↦",pt),ft("\\Longleftrightarrow","",_t,"⟺",pt),ft("\\rightleftarrows",St,_t,"⇄",pt),ft("\\leftarrow","",_t,"←",pt),ft("\\curvearrowleft",St,_t,"↶",pt),ft("\\uparrow","",_t,"↑",pt),ft("\\downarrow","",_t,"↓",pt),ft("\\hookrightarrow","",_t,"↪",pt),ft("\\rightharpoonup","",_t,"⇀",pt),ft("\\rightleftharpoons","",_t,"⇌",pt),ft("\\Leftarrow","",_t,"⇐",1695),ft("\\longleftrightarrow","",_t,"⟷",1599),ft("\\longleftarrow","",_t,"⟵",878),ft("\\Longleftarrow","",_t,"⟸",296),ft("\\searrow","",_t,"↘",1609),ft("\\nearrow","",_t,"↗",1301),ft("\\swarrow","",_t,"↙",167),ft("\\nwarrow","",_t,"↖",108),ft("\\Uparrow","",_t,"⇑",257),ft("\\Downarrow","",_t,"⇓",556),ft("\\updownarrow","",_t,"↕",192),ft("\\Updownarrow","",_t,"⇕",161),ft("\\hookleftarrow","",_t,"↩",115),ft("\\leftharpoonup","",_t,"↼",93),ft("\\leftharpoondown","",_t,"↽",42),ft("\\rightharpoondown","",_t,"⇁",80),ft("\\leftrightarrows",St,_t,"⇆",765),ft("\\dashrightarrow",St,_t,"⇢",311),ft("\\dashleftarrow",St,_t,"⇠",5),ft("\\leftleftarrows",St,_t,"⇇",8),ft("\\Lleftarrow",St,_t,"⇚",7),ft("\\twoheadleftarrow",St,_t,"↞",32),ft("\\leftarrowtail",St,_t,"↢",25),ft("\\looparrowleft",St,_t,"↫",6),ft("\\leftrightharpoons",St,_t,"⇋",205),ft("\\circlearrowleft",St,_t,"↺",105),ft("\\Lsh",St,_t,"↰",11),ft("\\upuparrows",St,_t,"⇈",15),ft("\\downharpoonleft",St,_t,"⇃",21),ft("\\multimap",St,_t,"⊸",108),ft("\\leftrightsquigarrow",St,_t,"↭",31),ft("\\twoheadrightarrow",St,_t,"↠",835),ft("\\rightarrowtail",St,_t,"↣",195),ft("\\looparrowright",St,_t,"↬",37),ft("\\curvearrowright",St,_t,"↷",209),ft("\\circlearrowright",St,_t,"↻",63),ft("\\Rsh",St,_t,"↱",18),ft("\\downdownarrows",St,_t,"⇊",6),ft("\\upharpoonright",St,_t,"↾",579),ft("\\downharpoonright",St,_t,"⇂",39),ft("\\rightsquigarrow",St,_t,"⇝",674),ft("\\leadsto",St,_t,"⇝",709),ft("\\Rrightarrow",St,_t,"⇛",62),ft("\\restriction",St,_t,"↾",29),ft("\\upharpoonleft",St,_t,"↿",ht),ft("\\rightrightarrows",St,_t,"⇉",ht),nt="Negated Arrows",ft("\\nrightarrow",St,_t,"↛",324),ft("\\nRightarrow",St,_t,"⇏",107),ft("\\nleftrightarrow",St,_t,"↮",36),ft("\\nLeftrightarrow",St,_t,"⇎",20),ft("\\nleftarrow",St,_t,"↚",7),ft("\\nLeftarrow",St,_t,"⇍",5),nt="Negated Relations",ft("\\nless",St,_t,"≮",146),ft("\\nleqslant",St,_t,"",58),ft("\\lneq",St,_t,"⪇",54),ft("\\lneqq",St,_t,"≨",36),ft("\\nleqq",St,_t,"",18),ft("\\unlhd",St,Ct,"⊴",253),ft("\\unrhd",St,Ct,"⊵",66),ft("\\lvertneqq",St,_t,"",6),ft("\\lnsim",St,_t,"⋦",4),ft("\\lnapprox",St,_t,"⪉",ht),ft("\\nprec",St,_t,"⊀",71),ft("\\npreceq",St,_t,"⋠",57),ft("\\precnsim",St,_t,"⋨",4),ft("\\precnapprox",St,_t,"⪹",2),ft("\\nsim",St,_t,"≁",40),ft("\\nshortmid",St,_t,"",1),ft("\\nmid",St,_t,"∤",417),ft("\\nvdash",St,_t,"⊬",266),ft("\\nvDash",St,_t,"⊭",405),ft("\\ngtr",St,_t,"≯",90),ft("\\ngeqslant",St,_t,"",23),ft("\\ngeqq",St,_t,"",12),ft("\\gneq",St,_t,"⪈",29),ft("\\gneqq",St,_t,"≩",35),ft("\\gvertneqq",St,_t,"",6),ft("\\gnsim",St,_t,"⋧",3),ft("\\gnapprox",St,_t,"⪊",ht),ft("\\nsucc",St,_t,"⊁",44),ft("\\nsucceq",St,_t,"⋡",ht),ft("\\succnsim",St,_t,"⋩",4),ft("\\succnapprox",St,_t,"⪺",ht),ft("\\ncong",St,_t,"≆",128),ft("\\nshortparallel",St,_t,"",6),ft("\\nparallel",St,_t,"∦",54),ft("\\nVDash",St,_t,"⊯",5),ft("\\nsupseteqq",St,_t,"",1),ft("\\supsetneq",St,_t,"⊋",286),ft("\\varsupsetneq",St,_t,"",2),ft("\\supsetneqq",St,_t,"⫌",49),ft("\\varsupsetneqq",St,_t,"",3),ft("\\nVdash",St,_t,"⊮",179),ft("\\precneqq",St,_t,"⪵",11),ft("\\succneqq",St,_t,"⪶",3),ft("\\nsubseteqq",St,_t,"",16),nt="Various",ft("\\checkmark",St,Mt,"✓",1025),ft("\\diagup",St,Mt,"╱",440),ft("\\diagdown",St,Mt,"╲",175),ft("\\measuredangle",St,Mt,"∡",271),ft("\\sphericalangle",St,Mt,"∢",156),ft("\\backprime",St,Mt,"‵",104),ft("\\backdoubleprime",St,Mt,"‶",ht),nt="Shapes",ft("\\ast","",Ct,"∗",dt),ft("\\star","",Ct,"⋆",pt),ft("\\diamond","",Ct,"⋄",1356),ft("\\Diamond",St,Mt,"◊",695),ft("\\lozenge",St,Mt,"◊",422),ft("\\blacklozenge",St,Mt,"⧫",344),ft("\\bigstar",St,Mt,"★",168),nt="Hebrew",ft("\\aleph","",Mt,"ℵ",1381),ft("\\beth",St,Mt,"ℶ",54),ft("\\daleth",St,Mt,"ℸ",43),ft("\\gimel",St,Mt,"ℷ",36),nt="Fences",ft("\\lbrace","",Tt,"{",dt),ft("\\rbrace","",Lt,"}",dt),ft("\\langle","",Tt,"⟨",pt),ft("\\rangle","",Lt,"⟩",pt),ft("\\lfloor","",Tt,"⌊",pt),ft("\\rfloor","",Lt,"⌋",pt),ft("\\lceil","",Tt,"⌈",pt),ft("\\rceil","",Lt,"⌉",pt),ft("\\vert","",Mt,"∣",dt),ft("\\mvert","",_t,"∣"),ft("\\lvert","",Tt,"∣",496),ft("\\rvert","",Lt,"∣",496),ft("\\|","",Mt,"∥"),ft("\\Vert","",Mt,"∥",dt),ft("\\mVert","",Mt,"∥"),ft("\\lVert","",Tt,"∥",287),ft("\\rVert","",Lt,"∥",ht),ft("\\lbrack","",Tt,"[",574),ft("\\rbrack","",Lt,"]",213),ft("\\{","",Tt,"{"),ft("\\}","",Lt,"}"),ft("(","",Tt,"("),ft(")","",Lt,")"),ft("[","",Tt,"["),ft("]","",Lt,"]"),ft("\\ulcorner",St,Tt,"┌",296),ft("\\urcorner",St,Lt,"┐",310),ft("\\llcorner",St,Tt,"└",137),ft("\\lrcorner",St,Lt,"┘",199),ft("\\lgroup","",Tt,"⟮",24),ft("\\rgroup","",Lt,"⟯",24),ft("\\lmoustache","",Tt,"⎰",ht),ft("\\rmoustache","",Lt,"⎱",ht),It(["\\middle"],"{:delim}",null,function(t,e){return{type:"delim",delim:e[0]}}),nt="Sizing";const Bt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function Pt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}It(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,function(t,e){return{type:"sizeddelim",size:Bt[t].size,cls:Bt[t].mclass,delim:e[0]}}),nt="Relations",ft("=","",_t,"=",dt),ft("\\ne","",_t,"≠",dt),ft("\\neq","",_t,"≠",pt),ft("<","",_t,"<",dt),ft("\\lt","",_t,"<",pt),ft(">","",_t,">",dt),ft("\\gt","",_t,">",pt),ft("\\le","",_t,"≤",pt),ft("\\ge","",_t,"≥",pt),ft("\\leqslant",St,_t,"⩽",dt),ft("\\geqslant",St,_t,"⩾",dt),ft("\\leq","",_t,"≤",pt),ft("\\geq","",_t,"≥",pt),ft("\\ll","",_t,"≪"),ft("\\gg","",_t,"≫",pt),ft("\\coloneq","",_t,"≔",5),ft("\\measeq","",_t,"≝"),ft("\\eqdef","",_t,"≞"),ft("\\questeq","",_t,"≟"),ft(":","",_t,":"),ft("\\cong","",_t,"≅",pt),ft("\\equiv","",_t,"≡",pt),ft("\\prec","",_t,"≺",pt),ft("\\preceq","",_t,"⪯",pt),ft("\\succ","",_t,"≻",pt),ft("\\succeq","",_t,"⪰",1916),ft("\\perp","",_t,"⊥",pt),ft("\\parallel","",_t,"∥",pt),ft("\\propto","",_t,"∝",pt),ft("\\Colon","",_t,"∷"),ft("\\smile","",_t,"⌣",pt),ft("\\frown","",_t,"⌢",pt),ft("\\sim","",_t,"∼",pt),ft("\\gtrsim",St,_t,"≳",pt),ft("\\approx","",_t,"≈",dt),ft("\\approxeq",St,_t,"≊",147),ft("\\thickapprox",St,_t,"≈",377),ft("\\lessapprox",St,_t,"⪅",146),ft("\\gtrapprox",St,_t,"⪆",95),ft("\\precapprox",St,_t,"⪷",50),ft("\\succapprox",St,_t,"⪸",ht),ft("\\thicksim",St,_t,"∼",779),ft("\\succsim",St,_t,"≿",251),ft("\\precsim",St,_t,"≾",104),ft("\\backsim",St,_t,"∽",251),ft("\\eqsim",St,_t,"≂",62),ft("\\backsimeq",St,_t,"⋍",91),ft("\\simeq","",_t,"≃",ht),ft("\\lesssim",St,_t,"≲",ht),ft("\\nleq",St,_t,"≰",369),ft("\\ngeq",St,_t,"≱",164),ft("\\smallsmile",St,_t,"⌣",31),ft("\\smallfrown",St,_t,"⌢",71),ft("\\bowtie","",_t,"⋈",558),ft("\\asymp","",_t,"≍",755),ft("\\sqsubseteq","",_t,"⊑",1255),ft("\\sqsupseteq","",_t,"⊒",183),ft("\\leqq",St,_t,"≦",1356),ft("\\eqslantless",St,_t,"⪕",15),ft("\\lll",St,_t,"⋘",157),ft("\\lessgtr",St,_t,"≶",281),ft("\\lesseqgtr",St,_t,"⋚",134),ft("\\lesseqqgtr",St,_t,"⪋",ht),ft("\\risingdotseq",St,_t,"≓",8),ft("\\fallingdotseq",St,_t,"≒",99),ft("\\subseteqq",St,_t,"⫅",82),ft("\\Subset",St,_t,"⋐"),ft("\\sqsubset",St,_t,"⊏",309),ft("\\preccurlyeq",St,_t,"≼",549),ft("\\curlyeqprec",St,_t,"⋞",14),ft("\\vDash",St,_t,"⊨",646),ft("\\Vvdash",St,_t,"⊪",20),ft("\\bumpeq",St,_t,"≏",13),ft("\\Bumpeq",St,_t,"≎",12),ft("\\geqq",St,_t,"≧",972),ft("\\eqslantgtr",St,_t,"⪖",13),ft("\\ggg",St,_t,"⋙",127),ft("\\gtrless",St,_t,"≷",417),ft("\\gtreqless",St,_t,"⋛",190),ft("\\gtreqqless",St,_t,"⪌",91),ft("\\supseteqq",St,_t,"⫆",6),ft("\\Supset",St,_t,"⋑",34),ft("\\sqsupset",St,_t,"⊐",71),ft("\\succcurlyeq",St,_t,"≽",442),ft("\\curlyeqsucc",St,_t,"⋟",10),ft("\\Vdash",St,_t,"⊩",276),ft("\\shortmid",St,_t,"∣",67),ft("\\shortparallel",St,_t,"∥",17),ft("\\between",St,_t,"≬",110),ft("\\pitchfork",St,_t,"⋔",66),ft("\\varpropto",St,_t,"∝",203),ft("\\backepsilon",St,_t,"∍",176),ft("\\llless",St,_t,"⋘",ht),ft("\\gggtr",St,_t,"⋙",ht),ft("\\lhd",St,Ct,"⊲",447),ft("\\rhd",St,Ct,"⊳",338),ft("\\Join","",_t,"⋈",35),ft("\\doteq","",_t,"≐",1450),ft("\\doteqdot",St,_t,"≑",60),ft("\\Doteq",St,_t,"≑",ht),ft("\\eqcirc",St,_t,"≖",6),ft("\\circeq",St,_t,"≗",31),ft("\\lessdot",St,Ct,"⋖",88),ft("\\gtrdot",St,Ct,"⋗",45),ft("\\~","",_t,"~"),nt="Logic",ft("\\leftrightarrow","",_t,"↔",dt),ft("\\Leftrightarrow","",_t,"⇔",dt),ft("\\to","",_t,"→",dt),ft("\\models","",_t,"⊨",pt),ft("\\vdash","",_t,"⊢",pt),ft("\\therefore",St,_t,"∴",1129),ft("\\because",St,_t,"∵",388),ft("\\implies","",_t,"⟹",1858),ft("\\gets","",_t,"←",150),ft("\\dashv","",_t,"⊣",299),ft("\\impliedby","",_t,"⟸",ht),ft("\\biconditional","",_t,"⟷",ht),ft("\\roundimplies","",_t,"⥰",ht),nt="Operators",ft("+","",Ct,"+",dt),ft("-","",Ct,"−",dt),ft("−","",Ct,"−",dt),ft("\\pm","",Ct,"±",pt),ft("\\mp","",Ct,"∓",pt),ft("*","",Ct,"∗",pt),ft("\\times","",Ct,"×",pt),ft("\\div","",Ct,"÷",pt),ft("\\surd","",Mt,"√",pt),ft("\\divides","",Ct,"∣",ht),ft("\\ltimes",St,Ct,"⋉",576),ft("\\rtimes",St,Ct,"⋊",946),ft("\\leftthreetimes",St,Ct,"⋋",34),ft("\\rightthreetimes",St,Ct,"⋌",14),ft("\\intercal",St,Ct,"⊺",478),ft("\\dotplus",St,Ct,"∔",81),ft("\\centerdot",St,Ct,"⋅",271),ft("\\doublebarwedge",St,Ct,"⩞",5),ft("\\divideontimes",St,Ct,"⋇",51),ft("\\cdot","",Ct,"⋅",ht),nt="Others",ft("\\infty","",Mt,"∞",dt),ft("\\prime","",At,"′",dt),ft("\\doubleprime","",Mt,"″"),ft("\\angle","",Mt,"∠",pt),ft("`","",Mt,"‘"),ft("\\$","",Mt,"$"),ft("\\%","",Mt,"%"),ft("\\_","",Mt,"_"),nt="Greek",ft("\\alpha","",At,"α",pt),ft("\\beta","",At,"β",pt),ft("\\gamma","",At,"γ",pt),ft("\\delta","",At,"δ",pt),ft("\\epsilon","",At,"ϵ",pt),ft("\\varepsilon","",At,"ε"),ft("\\zeta","",At,"ζ",pt),ft("\\eta","",At,"η",pt),ft("\\theta","",At,"θ",pt),ft("\\vartheta","",At,"ϑ",pt),ft("\\iota","",At,"ι",pt),ft("\\kappa","",At,"κ",pt),ft("\\varkappa",St,At,"ϰ",pt),ft("\\lambda","",At,"λ",pt),ft("\\mu","",At,"μ",pt),ft("\\nu","",At,"ν",pt),ft("\\xi","",At,"ξ",pt),ft("\\omicron","",At,"o"),ft("\\pi","",At,"π",pt),ft("\\varpi","",At,"ϖ",pt),ft("\\rho","",At,"ρ",pt),ft("\\varrho","",At,"ϱ",pt),ft("\\sigma","",At,"σ",pt),ft("\\varsigma","",At,"ς",pt),ft("\\tau","",At,"τ",pt),ft("\\phi","",At,"ϕ",pt),ft("\\varphi","",At,"φ",pt),ft("\\upsilon","",At,"υ",pt),ft("\\chi","",At,"χ",pt),ft("\\psi","",At,"ψ",pt),ft("\\omega","",At,"ω",pt),ft("\\Gamma","",At,"Γ",pt),ft("\\Delta","",At,"Δ",pt),ft("\\Theta","",At,"Θ",pt),ft("\\Lambda","",At,"Λ",pt),ft("\\Xi","",At,"Ξ",pt),ft("\\Pi","",At,"Π",pt),ft("\\Sigma","",At,"Σ",pt),ft("\\Upsilon","",At,"Υ",pt),ft("\\Phi","",At,"Φ",pt),ft("\\Psi","",At,"Ψ",pt),ft("\\Omega","",At,"Ω",pt),ft("\\digamma",St,At,"ϝ",248),nt="Others",ft("\\emptyset","",Mt,"∅",dt),ft("\\varnothing",St,Mt,"∅",dt),nt="Set Operators",ft("\\cap","",Ct,"∩",dt),ft("\\cup","",Ct,"∪",dt),ft("\\setminus","",Ct,"∖",pt),ft("\\smallsetminus",St,Ct,"∖",254),ft("\\complement",St,Mt,"∁",200),nt="Set Relations",ft("\\in","",_t,"∈",dt),ft("\\notin","",_t,"∉",dt),ft("\\not","",_t,"̸",pt),ft("\\ni","",_t,"∋",pt),ft("\\owns","",_t,"∋",18),ft("\\subset","",_t,"⊂",dt),ft("\\supset","",_t,"⊃",dt),ft("\\subseteq","",_t,"⊆",dt),ft("\\supseteq","",_t,"⊇",dt),ft("\\subsetneq",St,_t,"⊊",1945),ft("\\varsubsetneq",St,_t,"",198),ft("\\subsetneqq",St,_t,"⫋",314),ft("\\varsubsetneqq",St,_t,"",55),ft("\\nsubset",St,_t,"⊄",ht),ft("\\nsupset",St,_t,"⊅",ht),ft("\\nsubseteq",St,_t,"⊈",950),ft("\\nsupseteq",St,_t,"⊉",49),nt="Spacing",ft("\\ ","",Dt," "),ft("~","",Dt," "),ft("\\space","",Dt," "),ft("\\!","",Dt,null),ft("\\,","",Dt,null),ft("\\:","",Dt,null),ft("\\;","",Dt,null),ft("\\enskip","",Dt,null),ft("\\enspace","",Dt,null,672),ft("\\quad","",Dt,null,pt),ft("\\qquad","",Dt,null,pt),It(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},function(t,e){return{type:"spacing",width:e[0]||0}}),It(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:Pt(e[0])||e[0],captureSelection:!0,baseFontFamily:"cmr"};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s}),It(["\\operatorname","\\operatorname*"],"{operator:string}",null,function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s}),nt="Punctuation",ft("\\colon","","mpunct",":",pt),ft("\\cdotp","","mpunct","⋅",pt),ft("\\ldots","","minner","…",pt),ft("\\cdots","","minner","⋯",pt),ft("\\ddots","","minner","⋱",pt),ft("\\mathellipsis","","minner","…",91),ft("\\vdots","",Mt,"⋮",pt),ft("\\ldotp","","mpunct",".",18),ft(",","","mpunct",","),ft(";","","mpunct",";"),nt="Logical Operators",ft("\\wedge","",Ct,"∧",dt),ft("\\vee","",Ct,"∨",dt),ft("\\lnot","",Mt,"¬",pt),ft("\\neg","",Mt,"¬",dt),ft("\\land","",Ct,"∧",659),ft("\\lor","",Ct,"∨",364),ft("\\barwedge",St,Ct,"⊼",21),ft("\\veebar",St,Ct,"⊻",43),ft("\\nor",St,Ct,"⊻",7),ft("\\curlywedge",St,Ct,"⋏",58),ft("\\curlyvee",St,Ct,"⋎",57),nt="Boxes",ft("\\square",St,Mt,"□",pt),ft("\\Box",St,Mt,"□",pt),ft("\\blacksquare",St,Mt,"■",1679),ft("\\boxminus",St,Ct,"⊟",79),ft("\\boxplus",St,Ct,"⊞",276),ft("\\boxtimes",St,Ct,"⊠",457),ft("\\boxdot",St,Ct,"⊡",120),nt="Circles",ft("\\circ","",Ct,"∘",dt),ft("\\bigcirc","",Ct,"◯",903),ft("\\bullet","",Ct,"∙",pt),ft("\\circleddash",St,Ct,"⊝",pt),ft("\\circledast",St,Ct,"⊛",339),ft("\\oplus","",Ct,"⊕",pt),ft("\\ominus","",Ct,"⊖",1568),ft("\\otimes","",Ct,"⊗",pt),ft("\\odot","",Ct,"⊙",pt),ft("\\circledcirc",St,Ct,"⊚",93),ft("\\oslash","",Ct,"⊘",497),ft("\\circledS",St,Mt,"Ⓢ",31),ft("\\circledR",St,Mt,"®",1329),nt="Triangles",ft("\\triangle","",Mt,"△",pt),ft("\\triangleq",St,_t,"≜",pt),ft("\\bigtriangleup","",Ct,"△",1773),ft("\\vartriangle",St,_t,"△",762),ft("\\triangledown",St,Mt,"▽",520),ft("\\bigtriangledown","",Ct,"▽",661),ft("\\triangleleft","",Ct,"◃",534),ft("\\vartriangleleft",St,_t,"⊲",281),ft("\\trianglelefteq",St,_t,"⊴",176),ft("\\ntriangleleft",St,_t,"⋪",13),ft("\\ntrianglelefteq",St,_t,"⋬",22),ft("\\triangleright","",Ct,"▹",516),ft("\\vartriangleright",St,_t,"⊳",209),ft("\\trianglerighteq",St,_t,"⊵",45),ft("\\ntriangleright",St,_t,"⋫",15),ft("\\ntrianglerighteq",St,_t,"⋭",6),ft("\\blacktriangle",St,Mt,"▲",360),ft("\\blacktriangledown",St,Mt,"▼",159),ft("\\blacktriangleleft",St,_t,"◀",101),ft("\\blacktriangleright",St,_t,"▶",271),nt="Others",ft("\\/","",At,"/"),ft("|","","textord","∣"),nt="Big Operators",ft("\\sqcup","",Ct,"⊔",1717),ft("\\sqcap","",Ct,"⊓",735),ft("\\uplus","",Ct,"⊎",597),ft("\\wr","",Ct,"≀",286),ft("\\Cap",St,Ct,"⋒",2),ft("\\Cup",St,Ct,"⋓",2),ft("\\doublecap",St,Ct,"⋒",1),ft("\\doublecup",St,Ct,"⋓",1),ft("\\amalg","",Ct,"⨿",ht),ft("\\And","",Ct,"&"),nt="Accents",It(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}}),ut(pt,"\\bar","\\ddot","\\acute","\\tilde","\\check"),ut(1548,"\\breve"),ut(735,"\\grave"),ut(dt,"\\vec"),nt="Letters and Letter Like Forms",ft("\\imath","",Mt,"ı"),ft("\\jmath","",Mt,"ȷ"),nt="Others",ft("\\degree","",Mt,"°",46),nt="Others",ft("'","",Mt,"′"),ft('"',"",Mt,"”"),nt="Others",It("\\^","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\`","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}}),It("\\'","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\~","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}}),It("\\c","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}});const Rt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},Ot="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),Kt="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var Nt={matchCodepoint:bt,commandAllowed:function(t,e){return!(!lt[e]||"text"===t&&!lt[e].allowedInText)||!!{text:Rt,math:rt}[t][e]},unicodeToMathVariant:vt,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=kt[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=rt[t]:Rt[t]&&(i={value:Rt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?rt[e]&&rt[e].value?rt[e].value:e:Rt[e]?Rt[e]:e},getEnvironmentInfo:function(t){let e=ct[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in lt)lt.hasOwnProperty(s)&&s.startsWith(t)&&!lt[s].infix&&e.push({match:s,frequency:lt[s].frequency});for(const s in rt)rt.hasOwnProperty(s)&&s.startsWith(t)&&e.push({match:s,frequency:rt[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:mt,TEXT_SYMBOLS:Rt,MATH_SYMBOLS:rt,ENVIRONMENTS:ct,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:lt,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?\/.,~<>`|'$%#&^_" ]/,LETTER:Ot,LETTER_AND_DIGITS:Kt};const $t=ot.makeSymbol,Wt=ot.makeStyleWrap,Vt=ot.makeSpan,Ht=ot.makeVlist;function Ut(t,e,s,i,a,o){const n=$t("Size"+s+"-Regular",Nt.getValue("math",e)),r=Wt(t,Vt(n,"delimsizing size"+s),a.mathstyle,$.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Gt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Vt($t(e,Nt.getValue("math",t)),"delimsizinginner"+s)}function jt(t,e,s,i,a,o){let n,r,l,c;n=l=c=Nt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const p=C.getCharacterMetrics(Nt.getValue("math",n),h),d=p.height+p.depth,m=C.getCharacterMetrics(Nt.getValue("math",l),h),u=m.height+m.depth,f=C.getCharacterMetrics(Nt.getValue("math",c),h),y=f.height+f.depth;let g=0,b=1;if(null!==r){const t=C.getCharacterMetrics(Nt.getValue("math",r),h);g=t.height+t.depth,b=2}const x=d+y+g,k=Math.ceil((s-x)/(b*u)),v=x+k*b*u;let w=a.mathstyle.metrics.axisHeight;i&&(w*=a.mathstyle.sizeMultiplier);const S=v/2-w,A=[];if(A.push(Gt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Jt=[0,1.2,1.8,2.4,3];const Qt=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],te=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"stack"}],ee=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function se(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return ie(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Yt.includes(e)?Qt:Zt.includes(e)?ee:te;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(Nt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=$t("AMS-Regular",Nt.getValue("math",e)),r=Wt(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ut(t,e,r.size,i,a,o):jt(t,e,s,i,a,o)}function ie(t,e,s){return ot.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo($.TEXT)+" nulldelimiter "+(s||""))}var ae={makeSizedDelim:function(t,e,s,i,a){return"."===e?ie(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Zt.includes(e)||Yt.includes(e)?Ut(t,e,s,!1,i,a):Xt.includes(e)?jt(t,e,Jt[s],!1,i,a):null)},makeCustomSizedDelim:se,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return ie(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/C.METRICS.ptPerEm;let l=i+n,c=s-n,h=901*(c=Math.max(l,c))/500;return l=2*c-r,se(t,e,h=Math.max(h,l),!0,a,o)}};const oe=ot.makeSpan,ne=ot.makeOrd,re=ot.makeInner,le=ot.makeHlist,ce=ot.makeVlist,he=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,pe=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/;class de{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",pe.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":he.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&(this.type="",delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=ne(ye(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(o<(m+=r)&&(o=m),m=0),d.height=a,d.depth=o,l+=a,d.pos=l,l+=o+m,h.push(d)}const d=l/2+a.metrics.axisHeight,m=[];for(let e=0;e0&&m.push(ce(t,s,"individualShift"))}const u=[];let f=!1,y=!1,g=0,b=!this.lFence;for(const s of e){if(s.align&&g>=m.length)break;if(s.align&&g0?3*c:7*S.defaultRuleThickness,d=e.metrics.denom1):(c>0?(h=e.metrics.num2,p=c):(h=e.metrics.num3,p=3*S.defaultRuleThickness),d=e.metrics.denom2);const m=o?o.depth:0,u=l?l.height:0;let f;if(0===c){const t=h-m-(u-d);tot.height(s)+ot.depth(s)+o&&(o=(o+l-ot.height(s)-ot.depth(s))/2),r.setTop(r.height-ot.height(s)-(o+i));const c=oe("",t.mathstyle.adjustTo($.TEXT)+" sqrt-line");let h;if(c.applyStyle(this.getStyle()),c.height=i,h=0===ot.height(s)&&0===ot.depth(s)?oe():ce(t,[s,o,c,i]),!this.index)return this.bind(t,ne([r,h],"sqrt"));const p=t.clone({mathstyle:$.SCRIPTSCRIPT}),d=oe(ye(p,this.index),e.adjustTo($.SCRIPTSCRIPT)),m=Math.max(r.height,h.height),u=Math.max(r.depth,h.depth),f=ce(t,[d],"shift",-(.6*(m-u)));return this.bind(t,ne([oe(f,"root"),r,h],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=ye(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,ne(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=ot.skew(s));const a=Math.min(ot.height(s),e.metrics.xHeight),o=ot.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=oe(oe(o),"accent-body"+n);return(r=ce(t,[s,-a,r])).children[1].setLeft(2*i),ne(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=ye(t.cramp(),this.body),i=S.defaultRuleThickness/e.sizeMultiplier,a=oe("",t.mathstyle.adjustTo($.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=ce(t,[s,3*i,a,i]);else{const e=oe(s);o=ce(t,[i,a,3*i,e],"top",ot.height(e))}return ne(o,this.position)}decomposeOverunder(t){const e=ye(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?oe(ye(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?oe(ye(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return fe(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=oe(ye(t,this.body),"inner");return ne([e,oe("","fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=ne("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===$.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";(s=ot.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op"))).type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=ot.makeOp(ye(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===$.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}applySizing(t){const e={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[this.size]*t.mathstyle.sizeMultiplier;t.size=this.size,t.sizeMultiplier=e}decomposeBox(t){const e=ne(ye(t,this.body));e.setStyle("position","relative");const s=ne(e),i=this.padding?this.padding:S.fboxsep;return s.setStyle("padding",i,"em"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",S.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),s.height=e.height,s.depth=e.depth,s.setStyle("position","relative"),s.setStyle("height",s.height+s.depth,"em"),this.bind(t,s)}decomposeEnclose(t){const e=ne(ye(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(ot.height(e)+ot.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=oe("​","mspace "+t)}else"sizing"===this.type?this.applySizing(t):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?((s=this.makeSpan(t,this.body)).classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&this.caret&&((s=this.makeSpan(t,"​")).caret=this.caret);if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=ye(t.sup(),this.superscript);a=oe(e,i.adjustTo(i.sup()))}if(this.subscript){const e=ye(t.sub(),this.subscript);o=oe(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=ot.height(e)-i.metrics.supDrop,l=ot.depth(e)+i.metrics.subDrop),n=i===$.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=$.TEXT.sizeMultiplier*i.sizeMultiplier,h=.5/S.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=S.defaultRuleThickness;if(r-ot.depth(a)-(ot.height(o)-l)<4*s){l=4*s-(r-a.depth)+ot.height(o);const t=.8*i.metrics.xHeight-(r-ot.depth(a));t>0&&(r+=t,l-=t)}p=ce(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-ot.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,ot.height(o)-.8*i.metrics.xHeight),(p=ce(t,[o],"shift",l)).children[0].setRight(h),this.isCharacterBox()&&p.children[0].setLeft(-ot.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),(p=ce(t,[a],"shift",-r)).children[0].setRight(h));const d=oe(p,"msubsup");return this.caret&&(d.caret=this.caret),ot.makeSpanOfType(s,[e,d])}attachLimits(t,e,s,i){const a=this.superscript?oe(ye(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?oe(ye(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return fe(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"boolean"!=typeof t.generateID&&(t.generateID.overrideID?e=t.generateID.overrideID:(e=t.generateID.seed.toString(36),t.generateID.seed+=1));return e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=ot.makeSpanOfType(s,e);return i.applyStyle(this.getStyle()),t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function me(t){const e=oe("​","arraycolsep");return e.setWidth(t,"em"),e}function ue(t,e,s,i){const a=[];for(const o of e){const e=oe(ye(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return ce(t,a,"individualShift")}function fe(t,e,s,i,a,o,n){if(!a&&!o)return e;e=oe(e);let r=0,l=0;a&&(r=Math.max(S.bigOpSpacing1,S.bigOpSpacing3-a.depth)),o&&(l=Math.max(S.bigOpSpacing2,S.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=S.bigOpSpacing5+ot.height(o)+ot.depth(o)+l+ot.depth(e)+s;(c=ce(t,[S.bigOpSpacing5,o,l,e,r,a,S.bigOpSpacing5],"bottom",n)).children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=ot.height(e)-s;(c=ce(t,[S.bigOpSpacing5,o,l,e],"top",a)).children[0].setLeft(-i)}else if(!o&&a){const o=ot.depth(e)+s;(c=ce(t,[e,r,a,S.bigOpSpacing5],"bottom",o)).children[1].setLeft(i)}return ot.makeSpanOfType(n,c,"op-limits")}function ye(t,e){t instanceof V.Context||(t=new V.Context(t));const s=!t.generateID||!t.generateID.groupNumbers;let i=[];if(Array.isArray(e)){if(0===e.length)return i;if(1===e.length)(i=e[0].decompose(t))&&s&&e[0].isSelected&&i.forEach(t=>t.selected(!0));else{let a="none",o=e[1].type,n=[],r=null,l=null;for(let c=0;ct.selected(!0)):(n.length>0&&(i=[...i,...n],n=[]),i=i.concat(a))}a=e[c].getFinalBaseElement().type,o=e[c+1]?e[c+1].getInitialBaseElement().type:"none"}n.length>0&&(i=[...i,...n],n=[])}}else e&&(i=e.decompose(t))&&s&&e.isSelected&&i.forEach(t=>t.selected(!0));if(!i||0===i.length)return null;const a={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of i)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=a[t.size]/a[t.parentSize];for(const t of i)t.height*=e,t.depth*=e}return i}var ge={MathAtom:de,decompose:ye,makeRoot:function(t,e){const s=new de(t=t||"math","root");return s.body=e||[],0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new de("","first")),s},GREEK_REGEX:he};const be={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},xe={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ke={stringToColor:function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},colorToString:function(t){let e=t.toUpperCase();for(const t in xe)if(xe[t]===e){e=t;break}for(const t in be)if(be[t]===e){e=t;break}return e},AREA_COLORS:["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],LINE_COLORS:["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"]};const ve=ge.MathAtom;class we{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ke.stringToColor(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?C.toEm(t,"pt"):this.parseKeyword("mm")?C.toEm(t,"mm"):this.parseKeyword("cm")?C.toEm(t,"cm"):this.parseKeyword("ex")?C.toEm(t,"ex"):this.parseKeyword("px")?C.toEm(t,"px"):this.parseKeyword("em")?C.toEm(t,"em"):this.parseKeyword("bp")?C.toEm(t,"bp"):this.parseKeyword("dd")?C.toEm(t,"dd"):this.parseKeyword("pc")?C.toEm(t,"pc"):this.parseKeyword("in")?C.toEm(t,"in"):this.parseKeyword("mu")?C.toEm(t,"mu"):C.toEm(t,"pt")}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new ve("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new ve("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=Nt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(!(c=this.end())&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const p=new ve(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return p.array=n,p.rowGaps=r,p.env={...e},p.env.name=t,p}scanImplicitGroup(t){const e=this.style;t||(t=(t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value)));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(Se)){const t=new ve(this.parseMode,"sizing");t.size={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[this.get().value],this.mathList.push(t)}else if(this.hasImplicitCommand(Ae)){this.parseMode="math";const t=new ve("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=Nt.getInfo("\\"+s.value,"math",this.macros);o=e?[new ve(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new ve(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new ve(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new ve(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=Nt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright")){const t=new ve(this.parseMode,"leftright");return t.rightDelim=this.scanDelim()||".",t}const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim()||".",i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new ve(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasToken("^")||this.hasToken("_")||this.hasLiteral("'");){let e;if(this.hasToken("^")?e="superscript":this.hasToken("_")&&(e="subscript"),this.parseToken("^")||this.parseToken("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new ve(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ke.stringToColor(e);if(t)(i=i||{}).backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)(i=i||{}).padding=C.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&((i=i||{}).border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new ve("text",""," ",this.style));else if("placeholder"===t.type)e=new ve(this.parseMode,"placeholder",t.value);else if("command"===t.type){if("placeholder"===t.value)e=new ve(this.parseMode,"placeholder",this.scanArg("string"));else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),(e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t))).latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&((e=new ve(this.parseMode,"spacing",null,this.style)).width=s),e.latex="\\"+t.value}else if(!(e=this.scanMacro(t.value))){const s=Nt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e?i.push(e):t.placeholder?i.push([new ve(this.parseMode,"placeholder",t.placeholder)]):i.push(this.placeholder()),"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new ve(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||((e=new ve(this.parseMode,"error","\\"+t.value)).latex="\\"+t.value)}}else if("literal"===t.type){const s=Nt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=Nt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new ve(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new ve(this.parseMode,"group",Me(x.tokenize(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var Le={pathFromString:Te,pathToString:_e,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)a=(a=(i+=1)>=t.length||i>=e.length)||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return Te(_e(t)).path}};const De={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left[ #0 \\right]"],"math:Alt-Shift-BracketLeft":["insert","\\left{ #0 \\right}"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":"speakParent","!mac:Ctrl-Alt-Up":"speakParent","mac:Ctrl-Meta-Down":"speakGroup","!mac:Ctrl-Alt-Down":"speakGroup","mac:Ctrl-Meta-Left":"speakLeftSibling","!mac:Ctrl-Alt-Left":"speakLeftSibling","mac:Ctrl-Meta-Right":"speakRightSibling","!mac:Ctrl-Alt-Right":"speakRightSibling","mac:Ctrl-Meta-Shift-Down":"speakAllWithSynchronizedHighlighting","!mac:Ctrl-Alt-Shift-Down":"speakAllWithSynchronizedHighlighting"},Fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},Ee={"''":"^{\\doubleprime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi","π":"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:"\\imaginaryI",jj:"\\imaginaryJ",ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial","∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt","∆":"\\differentialD","∂":"\\differentialD",sin:"\\sin",cos:"\\cos",tan:"\\tan",tanh:"\\tanh",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:"\\eta",gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:"\\mu",nu:"\\nu","µ":"\\mu",phi:"\\phi",Phi:"\\Phi",varphi:"\\varphi",psi:"\\psi",Psi:"\\Psi",rho:"\\rho",sigma:"\\sigma",Sigma:"\\Sigma",tau:"\\tau",vartheta:"\\vartheta",upsilon:"\\upsilon",xi:"\\xi",Xi:"\\Xi",zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\mod",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"digit",value:"\\operatorname{mm}"},cm:{after:"digit",value:"\\operatorname{cm}"},km:{after:"digit",value:"\\operatorname{km}"},kg:{after:"digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}"};function ze(t,e){if("string"==typeof e)return e;if(!t)return e?e.value:void 0;let s=!1,i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,p=!1,d=!1,m=!1,u=!1;const f=t[t.length-1];return s=!f||"first"===f.type,f&&(i=!(u="text"===f.mode)&&"mord"===f.type&&Nt.LETTER.test(f.body),a=!u&&"mord"===f.type&&/[0-9]+$/.test(f.body),o=!u&&f.isFunction,n="genfrac"===f.type,r="surd"===f.type,l="mbin"===f.type,c="mrel"===f.type,h="mpunct"===f.type||"minner"===f.type,p=f.array,d="mopen"===f.type,m="mclose"===f.type||"leftright"===f.type),"object"==typeof e&&(e=/nothing/.test(e.after)&&s||/letter/.test(e.after)&&i||/digit/.test(e.after)&&a||/function/.test(e.after)&&o||/frac/.test(e.after)&&n||/surd/.test(e.after)&&r||/binop/.test(e.after)&&l||/relop/.test(e.after)&&c||/punct/.test(e.after)&&h||/array/.test(e.after)&&p||/openfence/.test(e.after)&&d||/closefence/.test(e.after)&&m||/text/.test(e.after)&&u||(/space/.test(e.after),0)?e.value:null),e}function qe(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function Ie(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function Be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===qe("mac")||o===qe("win")||o===qe("ios")||o===qe("android")||o===qe("chromeos")||o===qe("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===qe("mac")||"ios"===qe("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var Pe={KEYBOARD_SHORTCUTS:De,INLINE_SHORTCUTS:Ee,stringify:Be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(Ee).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s){let i="";s&&s.overrideDefaultInlineShortcuts||(i=ze(t,Ee[e]));const a=s&&s.inlineShortcuts?s.inlineShortcuts:null;let o;return a&&(o=ze(t,a[e])),o||i},selectorForKeystroke:function(t,e){for(const s of[qe("mac")+":"+t+":"+e,qe("win")+":"+t+":"+e,qe("ios")+":"+t+":"+e,qe("android")+":"+t+":"+e,qe("chromeos")+":"+t+":"+e,qe("other")+":"+t+":"+e,qe("mac")+":"+e,qe("win")+":"+e,qe("ios")+":"+e,qe("android")+":"+e,qe("chromeos")+":"+e,t+":"+e,e])if(De[s])return De[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=Fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=Ie(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const t in De)if(De.hasOwnProperty(t)&&s.test(Ie(De[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}return Be(e)}};function Re(t,e){this.root=ge.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Oe(t){const e=Object.assign(new Re(t.config,t.target),t);return e.path=Le.clone(t.path),e}function Ke(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function $e(t,e){let s;return"object"!=typeof e&&(e=Ne(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Qe()),s}function We(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i}function Ve(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new ge.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function He(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!$e(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Ue(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Ge(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Ge(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some(function(s){return s===e||Ge(t[s],e)}))return!0;if(t.array)for(let s=We(t.array);s>=0;s--)if(Ge($e(t.array,s),e))return!0}return!1}function je(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ze(t,e){return t?t.length<=1?t:(e&&"ASCIIMath"===e.format||(t=t.replace(/\\\\([^\s\n])/g,"\\$1")),e&&"ASCIIMath"===e.format||!/\\/.test(t)?Xe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e):t):""}function Xe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ye(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/))&&(t="\\sqrt{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/))&&(t="\\sqrt[3]{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^abs(.*)/))&&(t="\\left|"+(s=Ye(s[1],{...e,noWrap:!0})).match+"\\right|",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^["”“](.*?)["”“](.*)/))&&(t="\\text{"+s[1]+"}",t+=Xe(s[2],e),i=!0),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ye(t.substring(1),e),t=t[0],t+=s.match,t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i)if((s=Ye(t,{...e,noWrap:!0})).match&&"/"===s.rest[0]){const a=Ye(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+Xe(a.rest,e)),i=!0}else s.match&&/^(\(|\{|\[)$/.test(t[0])?(t="\\left"+t[0]+s.match+"\\right"+{"(":")","{":"}","[":"]"}[t[0]]+Xe(s.rest,e),i=!0):s.match&&(t=s.match,t+=Xe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/))&&(t=" "+Xe(s[2],e),i=!0),t}function Ye(t,e){let s="",i=t=t.trim();const a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(s=e.noWrap&&"("===a&&")"===o?Xe(t.substring(1,r-1),e):"\\mleft"+a+Xe(t.substring(1,r-1),e)+"\\mright"+o,i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=Pe.forString(null,t,e);if(s)return{match:s=(s=s.replace("_{#?}","")).replace("^{#?}",""),rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/))return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/))return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/))&&(i=t.substring(a[1].length),s=a[1])}return{match:s,rest:i}}function Je(t,e){let s=Pe.forString(null,t,e);return s?(s=(s=s.replace("_{#?}","")).replace("^{#?}",""),s+=" "):s=t,s}function Qe(){return new ge.MathAtom("","first")}Re.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},Re.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new Re;i.path=Le.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},Re.prototype.forEach=function(t){this.root.forEach(t)},Re.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},Re.prototype.setRange=function(t,e,s){s=s||{};const i=Le.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(Le.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(Le.clone(t),i)}let a=Le.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=Le.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(n-=1),this.setPath(a,n)},Re.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},Re.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},Re.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},Re.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},Re.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},Re.prototype.insertFirstAtom=function(){this.siblings()},Re.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=$e(this.parent().array,this.relation()):"string"==typeof(t=this.parent()[this.relation()]||[])&&(t=[]),0!==t.length&&"first"===t[0].type||t.unshift(Qe()),t},Re.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},Re.prototype.isCollapsed=function(){return 0===this.extent},Re.prototype.setExtent=function(t){this.extent=t},Re.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},Re.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},Re.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&Nt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&Nt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(e>=(s-=1))return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Ue(t[e]);)e-=1;for(;Ue(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},Re.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},Re.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},Re.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},Re.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},Re.prototype.extractArgBeforeInsertionPoint=function(){const t=[],e=this.siblings();if(e.length<=1)return[];let s=this.startOffset();if("text"===e[s].mode)for(;s>=1&&"text"===e[s].mode;)t.unshift(e[s]),s--;else for(;s>=1&&("mord"===e[s].type||"surd"===e[s].type||"leftright"===e[s].type);)t.unshift(e[s]),s--;return t},Re.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},Re.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=We(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if($e(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=We(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},Re.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,-1))?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},Re.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,1))?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},Re.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Oe(this),a=e+(s=this.extent+t);if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},Re.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Oe(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if((n=this.wordBoundaryOffset(n,t))<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},Re.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},Re.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Oe(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===i.length){if(e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return!1}return this.setPath(i[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),!0},Re.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},Re.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries}),s+=1,i=this.ancestor(s);return e},Re.prototype.simplifyParen=function(t){t&&this.config.removeExtraneousParentheses&&t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=je(t.numer),t.denom=je(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=je(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=je(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=je(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=je(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=je(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=je(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=We(t.array);e>=0;e--)this.simplifyParen($e(t.array,e))})},Re.prototype.insert=function(t,e){e=e||{};const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const n=[this.getSelectedAtoms()];void 0!==e.placeholder&&(n["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const r=this.siblings(),l=this.startOffset();if(l+10&&r[l]&&"placeholder"===r[l].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ze(t,{...this.config,format:"ASCIIMath"}),o=Ce.parseTokens(x.tokenize(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)Nt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new ge.MathAtom("command","command",e))}else""===t?o=[new ge.MathAtom("command","command","\\")]:(t=Ze(t,this.config),n[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),n[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-n[0].length),Array.isArray(n[0])&&0===n[0].length&&(n[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=Ce.parseTokens(x.tokenize(t),"text",n,e.macros,!1));if(function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},Re.prototype._insertSmartFence=function(t,e){if(!this.config.smartFence)return!1;const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=Nt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;return s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i,this.insert(s,{mode:"math",format:"latex",style:e}),a&&this.move(-1),!0}let a;for(const e in Nt.RIGHT_DELIM)Nt.RIGHT_DELIM.hasOwnProperty(e)&&t===Nt.RIGHT_DELIM[e]&&(a=e);if(a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},Re.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},Re.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new ge.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},Re.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},Re.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},Re.prototype.delete_=function(t){this.contentWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else{if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(1)}}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.contentDidChange()},Re.prototype.moveToNextPlaceholder_=function(){this.leap(1)},Re.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},Re.prototype.moveToNextChar_=function(){this.move(1)},Re.prototype.moveToPreviousChar_=function(){this.move(-1)},Re.prototype.moveUp_=function(){this.up()},Re.prototype.moveDown_=function(){this.down()},Re.prototype.moveToNextWord_=function(){this.skip(1)},Re.prototype.moveToPreviousWord_=function(){this.skip(-1)},Re.prototype.moveToGroupStart_=function(){this.setSelection(0)},Re.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},Re.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},Re.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},Re.prototype.deleteNextChar_=function(){this.delete_(1)},Re.prototype.deletePreviousChar_=function(){this.delete_(-1)},Re.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},Re.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},Re.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},Re.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},Re.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},Re.prototype.transpose_=function(){},Re.prototype.extendToNextChar_=function(){this.extend(1)},Re.prototype.extendToPreviousChar_=function(){this.extend(-1)},Re.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendUp_=function(){this.up({extend:!0})},Re.prototype.extendDown_=function(){this.down({extend:!0})},Re.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},Re.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},Re.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},Re.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},Re.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Qe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Qe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Qe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},Re.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Qe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Qe()]):("nolimits"===this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Qe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},Re.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];return t?(this.parent()[t]||(this.parent()[t]=[Qe()]),this.setSelection(1,"end",t),!0):(this.moveToSuperscript_(),!1)},Re.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},Re.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Oe(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},Re.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Ne(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ke(e.array,i);this.selectionWillChange(),this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom(),this.selectionDidChange()}}},Re.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=Nt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},Re.prototype.addRowAfter_=function(){this.convertParentToArray(),this._addCell("after row")},Re.prototype.addRowBefore_=function(){this.convertParentToArray(),this._addCell("before row")},Re.prototype.addColumnAfter_=function(){this.convertParentToArray(),this._addCell("after column")},Re.prototype.addColumnBefore_=function(){this.convertParentToArray(),this._addCell("before column")},Re.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="md"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="up"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var ts={EditableMathlist:Re,parseMathString:Ze};const es={Escape:"Esc"," ":"Spacebar",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},ss={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function is(t){let e;"Unidentified"===t.key&&t.target&&(e=ss[t.target.value]||t.target.value),e||(e=es[t.key]||t.code)||(e=ss[t.key.toLowerCase()]||t.key);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),t.altKey&&s.push("Alt"),t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function as(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),t()})}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",function(s){return"function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode?n=!1:(n=!0,o=!1,t.blur(),t.focus()),!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(is(s),s))},!0),c.addEventListener("keypress",function(t){o||(i&&a&&e.keystroke(is(i),i),a=t,r(l))},!0),c.addEventListener("keyup",function(){o||!i||a||l()},!0),c.addEventListener("paste",function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)},!0),c.addEventListener("copy",function(t){e.copy&&e.copy(t)},!0),c.addEventListener("cut",function(t){e.cut&&e.cut(t)},!0),c.addEventListener("blur",function(){i=null,a=null},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{n?(t.blur(),t.focus(),n=!1,o=!1,r(l)):o||r(l)})}var os={delegateKeyboardEvents:as,select:as.select,keyboardEventToString:is,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};var ns={UndoManager:class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}])}}};const rs={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},ls={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function cs(t){let e=ls[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function hs(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&(t.popover.style.left=s.x-t.popover.offsetWidth/2+"px",t.popover.style.top=s.y+5+"px"),t.popover.classList.add("is-visible")}function ps(t){t.popover.classList.remove("is-visible")}var ds={getNote:cs,SAMPLES:rs,NOTES:ls,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void ps(t);const i=e,a=function(t,e){const s=Ce.parseTokens(x.tokenize(t),"math",null,e.config.macros),i=ge.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=ot.makeSpan(i,"ML__base"),o=ot.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const n=ot.makeSpan("","ML__strut--bottom");return n.setStyle("height",a.height+a.depth,"em"),n.setStyle("vertical-align",-a.depth,"em"),ot.makeSpan([o,n,a],"ML__mathlive").toMarkup()}(rs[i]||e,t),o=cs(i),n=Pe.forCommand(i);let r=s?'
    ':"";r+='',r+='
    '+a+"
    ",o&&(r+='
    '+o+"
    "),n&&(r+='
    '+n+"
    "),r+="
    ",hs(t,r+=s?'
    ':"");let l=t.popover.getElementsByClassName("ML__popover_content");l&&l.length>0&&t._attachButtonHandlers(l[0],["complete",{acceptSuggestion:!0}]),(l=t.popover.getElementsByClassName("ML__popover__prev-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"previousSuggestion"),(l=t.popover.getElementsByClassName("ML__popover__next-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"nextSuggestion")},showPopover:hs,hidePopover:ps,updatePopoverPosition:function t(e,s){if(e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&(e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",e.popover.style.top=t.y+5+"px")}else ps(e)}};function ms(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0],c=function(t,e,s){let i=0;for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,i[0][l]);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=ms(this,this.array[i][e],t);i1&&(s+=" "),s+=ms(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):(s+="."===this.leftDelim?"":this.leftDelim||"",this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=ms(this,this.body,t),s+=this.rightDelim&&"?"!==this.rightDelim&&"."!==this.rightDelim?this.rightDelim:"",this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${ms(this,this.shift,t)}em]`),s+=`{${ms(this,this.width,t)}em}{${ms(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${ms(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${ms(this,this.overscript||this.underscript,t)}}{${ms(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+ms(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+ms(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+this.body+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,this.padding||this.border||this.backgroundcolor){let e=ms(this,this.padding,t);this.border&&(e&&(e+=","),e+="border:"+ms(this,this.border,t)),this.backgroundcolor&&(e&&(e+=","),e+=ms(this,this.backgroundcolor,t)),s+=`[${e}]`}s+=`{${ms(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${ms(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ms(this,this.framecolor,t)}}`),this.backgroundcolor&&(s+=`{${ms(this,this.backgroundcolor,t)}}`),s+=`{${ms(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)this.notation.hasOwnProperty(e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+this.backgroundcolor+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+this.strokeColor+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${ms(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"sizing":s={size1:"\\tiny ",size2:"\\scriptsize ",size3:"\\footnotesize ",size4:"\\small ",size5:"\\normalsize ",size6:"\\large ",size7:"\\Large ",size8:"\\LARGE ",size9:"\\huge ",size10:"\\Huge "}[this.size]||"";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=ms(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=ms(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},us.merge=function(t,e){if(t&&e){const s=us._locale;us.locale=t,us.strings[t]={...us.strings[t],...e},us.locale=s}else if(t&&!e){e=t;for(const t of e)e.hasOwnProperty(t)&&us.merge(t,e[t])}},Object.defineProperty(us,"locale",{set(t){us._locale=t},get:()=>us._locale}),us.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Rückgängig machen"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le Presse-papiers","tooltip.redo":"Refaire","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const fs={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ys={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},gs={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let bs={};const xs={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ks(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=Ce.parseTokens(x.tokenize(t),"math",e,s.config.macros),a=ge.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=ot.makeSpan(a,"ML__base"),n=ot.makeSpan("","ML__strut");n.setStyle("height",o.height,"em");const r=ot.makeSpan("","ML__strut--bottom");return r.setStyle("height",o.height+o.depth,"em"),r.setStyle("vertical-align",-o.depth,"em"),ot.makeSpan([n,r,o],"ML__mathlive").toMarkup()}function vs(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},fs,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",""}function ws(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ys[n]&&(a.setAttribute("data-shifted",ys[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ys[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=bs[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function Ss(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e,n=(o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ")).match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}else;n=(o=o.replace(new RegExp(n[1]+n[2]+n[3]),a)).match(/()/)}return o}var As={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';gs["foreground-color"]=[];for(const t of ke.LINE_COLORS)gs["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});gs["background-color"]=[];for(const t of ke.AREA_COLORS)gs["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});bs={},bs=Object.assign({},gs);for(const t in bs)bs.hasOwnProperty(t)&&(bs[t]=bs[t].slice());const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),bs[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},xs,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},fs,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=vs(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=Ss(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,ws(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e/g,">")}function Ls(t,e){return t&&e.generateID?' extid="'+t+'"':""}function Ds(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,Fs(t)&&(n=t.index,t.index+=1),Es(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=Ps(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,Fs(t)){const e=Ps(t.atoms[n].superscript,0,0,s).mathML,i=Ps(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ps(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function Fs(t){return t.index"+t,a+=Ps(o.subscript,0,0,s).mathML,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ps(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function qs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].latex,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&Fs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ps(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function Is(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Rs(t.atoms[l],s),a+=Ps(t.atoms,l+1,c,s).mathML,a+=Rs(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,zs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Bs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=Rs(t.atoms[t.index],s);a+=e,t.index+=1,zs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,/^(.*)<\/mo>$/.test(e)?o="mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ps(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Rs(t,e){let s="";const i=function(t){if(!t)return"";if("string"==typeof t)return Ts(t);if(!Array.isArray(t)&&"string"==typeof t.body)return Ts(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return Ts(e)}(t.body);return i&&(s=""+i+""),s}ge.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",p={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";p&&(p=' mathvariant="'+p+'"');const d=this.latex?this.latex.trim():null;let m;switch(this.type){case"group":case"root":c=Ps(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(_s[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ps(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(_s[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ps(this.numer,0,0,t).mathML||" ",c+=Ps(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ps(this.numer,0,0,t).mathML+"",c+=""+Ps(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ps(this.body,0,0,t).mathML,c+=Ps(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ps(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ps(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(_s[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ps(this.body,0,0,t).mathML,c+=""+(_s[d]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ps(l,0,0,t).mathML,c+=Ps(n,0,0,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):r?(c+=""+Ps(l,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):n&&(c+=""+Ps(l,t).mathML,c+=Ps(n,0,0,t).mathML,c+="");break;case"mord":c=e[d]||d||("string"==typeof this.body?this.body:""),(m=d?d.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null)?c="&#x"+m[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.latex),c=""+Ts(c)+"";break;case"mbin":case"mrel":case"textord":case"minner":c=d&&e[d]?""+e[d]+"":d&&_s[d]?""+_s[d]+"":Rs(this,t);break;case"mpunct":c='"+(_s[d]||d)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===d?this.body:d||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ps(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ps(this.body,0,0,t).mathML+"";break;case"sizing":break;case"space":c+=" "}return c},ge.toMathML=function(t,e){return Ps(t,0,0,e).mathML};const Os={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ks={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ns={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},$s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ws(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Vs(t){return t&&$s[t]||-1}function Hs(t){return/=|=>/.test(t)?"right":"left"}function Us(t){if("f"===t||"g"===t)return!0;const e=Ns[t];return!!e&&!!/%[^01_^]?/.test(e)}function Gs(t){t=(t||"").trim();let e=Os[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=Nt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function js(t){if(!t)return null;const e=Gs(ti(t)),s=[Vs(e),Hs(e)];return s[0]<=0?null:s}function Zs(t){return null!==js(t)}const Xs={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ys={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Js={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Qs={",":"list",";":"list2"};function ti(t){if(Array.isArray(t)){let e="";for(const s of t)e+=ti(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=ti(s);return e}return""}function ei(t){return parseFloat(t.num)}function si(t){return"object"==typeof t&&void 0!==t.num}function ii(t){let e=0;return si(t)&&(e="object"==typeof t.num?void 0!==t.num.re?xi(t.num.re):0:parseFloat(t.num)),e}function ai(t){let e=0;return si(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?xi(t.num.im):0),e}function oi(t){return t&&void 0!==t.sup}function ni(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||ti(a)===s),i}function ri(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function li(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function ci(t){if(si(t)){const e=ii(t),s=ai(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return ri("negate",t)}function hi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function pi(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||((s=t.atoms[t.index+1])&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=bi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(ti(s.superscript))?(t.index+=1,(s=t.atoms[t.index+1])&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=bi(s.superscript,e)):t.ast.sup=bi(s.superscript,e))):t.index+=1,t}function di(t,e){const s=t.ast;if(ui(t,"!!"))return t.index+=1,t.ast=ri("factorial2",s),t=di(t=pi(t,e),e);if(ui(t,"++"))return t.index+=1,t.ast=ri("increment",s),t=di(t=pi(t,e),e);if(ui(t,"--"))return t.index+=1,t.ast=ri("decrement",s),t=di(t=pi(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ys[i.latex.trim()]&&(t.ast=ri(Ys[i.latex.trim()],s),t=di(t=pi(t,e),e)),t}function mi(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"mclose"===o.type&&ti(o)===s&&(hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i));else if("textord"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"textord"===o.type&&ti(o)===s&&(t.index+=1,t=di(t=pi(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if((o=t.atoms[t.index+1])&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=yi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=di(t=pi(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=di(t=pi(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=bi(o.body,i),hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=Nt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=Nt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=mi(t,e,s))return i&&(t.index+=1),t.ast={fn:Xs[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ui(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===ti(t.atoms[t.index])+ti(t.atoms[t.index+1])}function fi(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ni(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,ni(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ni(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function yi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];const a=Gs(ti(i));if(fi(e))e.ast=ri(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=ci(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=ri("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.index1?ri("list0",s):s[0]||void 0}({atoms:gi(t)},e)}function xi(t){return parseFloat(parseFloat(t).toPrecision(15))}ge.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},n="",r={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],l="";"b"===this.fontSeries&&(l+="bold"),"it"===this.fontShape&&(l+="italic");const c=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/))?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=Ce.parseTokens(x.tokenize(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=Ce.parseTokens(x.tokenize(i),"math",null,t.macros),o=ri("divide",bi(s,t),bi(i,t))):o.fn="divide":o.group=bi(this.body,t);break;case"genfrac":o=ri("divide",bi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?li(1):bi(this.denom,t));break;case"surd":o=this.index?ri("pow",bi(this.body,t),ri("divide",1,bi(this.index,t))):ri("sqrt",bi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":(e=c?c.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0)?n=String.fromCodePoint(parseInt(e[1],16)):(n=Gs(ti(this))).length>0&&"\\"===n.charAt(0)&&"string"==typeof this.body&&(n=this.body),(a=Nt.mathVariantToUnicode(n,r,l).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))!==n?(o={sym:a},r="normal"):o={sym:n};break;case"minner":case"mop":break;case"box":o=bi(this.body,t);break;case"enclose":break;case"array":"cardinality"===this.env.name?o=ri("card",bi(this.array,t)):/matrix|pmatrix|bmatrix/.test(this.env.name)&&(o=ri("array",bi(this.array,t)));break;case"spacing":case"space":case"sizing":case"mathstyle":break;default:o=void 0}return o&&r&&"normal"!==r&&(o.variant=r),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},ge.toAST=function(t,e){return bi(t,e)};const ki={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket '};function vi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function wi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}ge.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1;for(let o=0;o'+o+'. End fraction.';break;case"surd":if(n=ge.toSpeakableFragment(t.body,e),t.index){let s=ge.toSpeakableFragment(t.index,e);const a=(s=s.trim()).replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else vi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=ki[t.leftDelim]||t.leftDelim,i+=ge.toSpeakableFragment(t.body,e),i+=ki[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=ge.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=ki[a]||(o?ki[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=ds.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=ge.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(s=s.trim())+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(s=s.trim())+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=ge.toSpeakableFragment(t.superscript,e);a=a.trim();let o=ge.toSpeakableFragment(t.subscript,e);i+=' the integral from '+s(o=o.trim())+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){const e=ki[t.body]||ki[t.latex.trim()];i+=e||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=ge.toSpeakableFragment(t.body,e),vi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=ge.toSpeakableFragment(t.superscript,e);const a=(s=s.trim()).replace(/<[^>]*>/g,"");if(vi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);s=s.trim(),vi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},ge.toSpeakableText=function(t,e){if(e||(e={textToSpeechMarkup:"",textToSpeechRules:"mathlive"}),e.speechMode="math",window.sre&&"sre"===e.textToSpeechRules){e.generateID=!0;const s=ge.toMathML(t,e);return s?(e.textToSpeechMarkup&&(e.textToSpeechRulesOptions=e.textToSpeechRulesOptions||{},e.textToSpeechRulesOptions.markup=e.textToSpeechMarkup,"ssml"===e.textToSpeechRulesOptions.markup&&(e.textToSpeechRulesOptions.markup="ssml_step"),e.textToSpeechRulesOptions.rate=e.speechEngineRate),e.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(e.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(s)):""}let s=ge.toSpeakableFragment(t,e);if("ssml"===e.textToSpeechMarkup){let t="";e.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===e.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};function Si(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function Ai(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function Mi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):((s=document.createElement("div")).setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function Ci(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function _i(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=Mi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=Mi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,Si(window,"focus",this),Si(window,"blur",this),Si(this.element,"focus",this),Si(this.element,"blur",this),Si(this.textarea,"cut",this),Si(this.textarea,"copy",this),Si(this.textarea,"paste",this),os.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this)}),Si(this.element,"touchstart:active mousedown",this),Si(window,"resize",this);const o={...e};o.onSelectionDidChange=_i.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=_i.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.smartFence=this.config.smartFence,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new ts.EditableMathlist(o,this),this.undoManager=new ns.UndoManager(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}let Ti,Li;_i.prototype.handleEvent=function(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}},_i.prototype.revertToOriginalContent=_i.prototype.$revertToOriginalContent=function(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,Ai(this.textarea,"cut",this),Ai(this.textarea,"copy",this),Ai(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,Ci(this.popover),Ci(this.keystrokeCaption),Ci(this.virtualKeyboard),Ci(document.getElementById("mathlive-alternate-keys-panel")),Ai(this.element,"touchstart:active mousedown",this),Ai(this.element,"focus",this),Ai(this.element,"blur",this),Ai(window,"resize",this),Ai(window,"focus",this),Ai(window,"blur",this)},_i.prototype._resetKeystrokeBuffer=function(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)},_i.prototype._getCaretPosition=function(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach(function(e){s=s||t(e)}),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right+window.scrollX,y:e.bottom+window.scrollY}}return null},_i.prototype._pathFromPoint=function(t,e,s){let i;(s=s||{}).bias=s.bias||0;const a=function t(e,s,i){let a={element:null},o=!0;if(e.getAttribute("data-atom-id")){a.element=e;const t=e.getBoundingClientRect(),n=Math.max(t.left-s,s-t.right),r=Math.max(t.top-i,i-t.bottom);a.distance=n*n+r*r,o=s>=t.left&&s<=t.right}else a.distance=Number.POSITIVE_INFINITY;return o&&e.children&&Array.from(e.children).forEach(function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)}),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter(function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o});if(e&&e.length>0)if(i=Le.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tvoid 0)),t._resetKeystrokeBuffer()):"delete"===e?a=Fi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Fi(t,"",t.mathlist.sibling(0)):"line"===e?(a=Fi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+ge.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Fi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}_i.prototype._onPointerDown=function(t){let e;const s=this;let i=!1,a=!1,o=!1;function n(t){Ai(s.field,"touchmove",r),Ai(s.field,"touchend touchleave",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,t.preventDefault(),t.stopPropagation()}function r(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;if(Date.now()=p.left&&l<=p.right&&c>=p.top&&c<=p.bottom){if(this.hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,t.buttons&&1!==t.buttons)return;(e=this._pathFromPoint(l,c,{bias:0}))&&(t.shiftKey?(this.mathlist.setRange(this.mathlist.path,e),(e=Le.clone(this.mathlist.path))[e.length-1].offset-=1):this.mathlist.setPath(e,0),o=!0,3===t.detail||Di>2?(Ai(this.field,"touchmove",r),Ai(this.field,"touchend",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,3!==t.detail&&3!==Di||this.mathlist.selectAll_()):i||(i=!0,Si(window,"blur",n),t.touches?(Si(t.target,"touchmove",r),Si(t.target,"touchend",n)):(Si(window,"mousemove",r),Si(window,"mouseup",n)),2!==t.detail&&2!==Di||(a=!0,this.mathlist.selectGroup_())))}else Ti=null;o&&this._render(),t.preventDefault()},_i.prototype._onSelectionDidChange=function(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}this.style={},ds.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)},_i.prototype._onContentDidChange=function(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)},_i.prototype._nextAtomSpeechText=function(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Fi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Fi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o},_i.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)},_i.prototype._onFocus=function(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),ds.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._render())},_i.prototype._onBlur=function(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),ds.updatePopoverPosition(this),this._render(),this.config.onBlur&&this.config.onBlur(this))},_i.prototype._onResize=function(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),ds.updatePopoverPosition(this)},_i.prototype.toggleKeystrokeCaption_=function(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")},_i.prototype._showKeystroke=function(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(Pe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout(function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")},3e3)}},_i.prototype.perform=_i.prototype.$perform=function(t){if(!t)return!1;let e,s=!1,i=[],a=!1;return Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]?(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),a=!0,s=!0):"function"==typeof this[e]&&(a=this[e](...i),s=!0),this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||this._resetKeystrokeBuffer(),a&&this._render(),s},_i.prototype.performWithFeedback_=function(t){return this.focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)):("deletePreviousChar"===t||"deleteNextChar"===t||"deletePreviousWord"===t||"deleteNextWord"===t||"deleteToGroupStart"===t||"deleteToGroupEnd"===t||"deleteToMathFieldStart"===t||"deleteToMathFieldEnd"===t)&&this.deleteKeypressSound?(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)),this.perform(t)},_i.prototype.convertLastAtomsToText_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"math"!==a.mode||!/mord|textord|mpunct/.test(a.type)||a.superscript||a.subscript||e&&!e(a))||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()},_i.prototype.convertLastAtomsToMath_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a))||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()},_i.prototype.removeIsolatedSpace_=function(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}},_i.prototype.getTextBeforeAnchor_=function(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);(s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))))||(t=i.body+t),e-=1}return t},_i.prototype.smartMode_=function(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(this.mathlist.isCollapsed()){const e=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[\/^_\\]/.test(s))return!0;const i={")":"(","}":"{","]":"["}[s];if(i&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===i)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(e))return!1;if(/(^|[^a-zA-Z])[a-zA-Z][ ]$/.test(e))return this.convertLastAtomsToMath_(1),!1;if(/\.\S$/.test(e)){const t=this.mathlist.sibling(0);return t.body="⋅",t.fontFamily="cmr",t.latex="\\cdot",t.mode="math",t.type="mord",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/\.[0-9]$/.test(e))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/[(][a-z][,;]$/.test(e))return this.convertLastAtomsToMath_(2),this.removeIsolatedSpace_(),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(e)&&!/dxd$/.test(e))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(e))return this.convertLastAtomsToText_(1),!0;if(/\?|\./.test(s))return!0}}return!1},_i.prototype._onKeystroke=function(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=os.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=Pe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const n=this.mathlist.parent();if("moveAfterParent"===a&&n&&"leftright"===n.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.mathlist._insertSmartFence(".")&&(a="",this._render()),"math"===this.mode&&"Spacebar"===t){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(os.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist._insertSmartFence(s,a)||this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a}),this.removeIsolatedSpace_(),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._render(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1},_i.prototype._onTypedText=function(t,e){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=os.charToEvent(e);if(!this.$keystroke(os.keyboardEventToString(s),s))return}let s="",i=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},a=y.splitGraphemes(t);for(const t of a)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),a=Nt.suggest(e+t);i=a.length>1,0===a.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),ds.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),a[0].match!==e+t&&this.mathlist.insertSuggestion(a[0].match,-a[0].match.length+e.length+1),s=a[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist._insertSmartFence(t,e)||this.mathlist.insert(t,{mode:"math",style:e})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._render(),ds.showPopoverWithLatex(this,s,i)},_i.prototype._hash=function(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;s{t.caret="",t.isSelected=!1});const e=this.hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const s=ge.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=ot.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=ot.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=ot.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=ot.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+ge.toMathML(this.mathlist.root,this.config)+"";const r=this.field.querySelectorAll(".ML__selected");if(r&&r.length>0){const t={top:1/0,bottom:-1/0,left:1/0,right:-1/0};r.forEach(e=>{if(e.classList.contains("ML__selected")){const s=e.getBoundingClientRect();s.leftt.right&&(t.right=s.right),s.bottom>t.bottom&&(t.bottom=s.bottom),s.top0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&Ms[a]?Ms[a]:a&&Cs[a]?Cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=Cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?e.body:e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":case"sizing":break;case"space":i=" "}if(e.subscript){i+="_";const a=t(e.subscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}if(e.superscript){i+="^";const a=t(e.superscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}return i}(t,this.config));return s},_i.prototype.text=_i.prototype.$text=function(t){return this.formatMathlist(this.mathlist.root,t)},_i.prototype.selectedText=_i.prototype.$selectedText=function(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=ge.makeRoot(e[0].mode,e);return this.formatMathlist(s,t)},_i.prototype.selectionIsCollapsed=_i.prototype.$selectionIsCollapsed=function(){return this.mathlist.isCollapsed()},_i.prototype.selectionDepth=_i.prototype.$selectionDepth=function(){return this.mathlist.path.length},_i.prototype._superscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype._subscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype.selectionAtStart=_i.prototype.$selectionAtStart=function(){return 0===this.mathlist.startOffset()},_i.prototype.selectionAtEnd=_i.prototype.$selectionAtEnd=function(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.groupIsSelected=function(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.latex=_i.prototype.$latex=function(t,e){if(t){return t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._render()),t}return this.mathlist.root.toLatex()},_i.prototype.el=_i.prototype.$el=function(){return this.element},_i.prototype.undo_=_i.prototype.undo=function(){return this.complete_(),this.undoManager.undo(this.config),!0},_i.prototype.redo_=_i.prototype.redo=function(){return this.complete_(),this.undoManager.redo(this.config),!0},_i.prototype.scrollIntoView_=_i.prototype.scrollIntoView=function(){return!1},_i.prototype.scrollToStart_=_i.prototype.scrollToStart=function(){return!0},_i.prototype.scrollToEnd_=_i.prototype.scrollToEnd=function(){return!0},_i.prototype.enterCommandMode_=function(){this.switchMode_("command")},_i.prototype.copyToClipboard_=function(){return this.focus(),this.mathlist.isCollapsed()&&this.select(),document.execCommand("copy"),!1},_i.prototype.cutToClipboard_=function(){return this.focus(),document.execCommand("cut"),!0},_i.prototype.pasteFromClipboard_=function(){return this.focus(),document.execCommand("paste"),!0},_i.prototype.insert_=_i.prototype.insert=_i.prototype.$insert=function(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.style.fontFamily||(this.style.fontFamily="math"),this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),!0}return!1},_i.prototype.switchMode_=function(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=!0,e&&this.insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),ds.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._render()},_i.prototype.complete_=function(t){if(t=t||{},ds.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(Nt.commandAllowed(t,e)){const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1},_i.prototype._updateSuggestion=function(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);if(0===e.length)ds.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),ds.showPopoverWithLatex(this,e[s].match,e.length>1)}this._render()},_i.prototype.nextSuggestion_=function(){return this.suggestionIndex+=1,this._updateSuggestion(),!1},_i.prototype.previousSuggestion_=function(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1},_i.prototype._attachButtonHandlers=function(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),Si(t,"mousedown touchstart:passive",function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout(function(){t.classList.contains("pressed")&&s.perform(JSON.parse(l))},300))}}),Si(t,"mouseleave touchcancel",function(){t.classList.remove("pressed")}),Si(t,"touchmove:passive",function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,As.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1},_i.prototype.hideAlternateKeys_=function(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",Ci(t)),!1},_i.prototype.performAlternateKeys_=function(t){return this.hideAlternateKeys_(),this.perform(t)},_i.prototype.switchKeyboardLayer_=function(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){const i=[];for(let t=1;t<=s;t++)i.push(e[t]);t=ge.toSpeakableText(i,this.config)}return this._speak(t),!1},_i.prototype.speakGroup_=function(){return this._speak(ge.toSpeakableText(this.mathlist.siblings(),this.config)),!1},_i.prototype.speakAll_=function(){return this._speak(ge.toSpeakableText(this.mathlist.root,this.config)),!1},_i.prototype.speakAllWithSynchronizedHighlighting_=function(){window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0});const t=this.config;t.textToSpeechMarkup=window.sre&&"sre"===t.textToSpeechRules?"ssml_step":"ssml";const e=ge.toSpeakableText(this.mathlist.root,t);return this._speakWithSynchronizedHighlighting(e),!1};var zi={MathField:_i};function qi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(-1===(r=n.indexOf(e,c))){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(-1===(r=qi(s,n,c+e.length))){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Ri(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))(s=document.createDocumentFragment()).appendChild(Pi(t,void 0,e,!0));else{const i=Bi(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;tvoid 0)}})}else;else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Hi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}})}})}function Ui(t){let e=t;if("string"==typeof t&&!(e=document.getElementById(t)))throw Error(`The element with ID "${t}" could not be found.`);return e}function Gi(t,e){Ki&&((e=e||{}).renderToMarkup=e.renderToMarkup||Ni,e.renderToMathML=e.renderToMathML||$i,e.renderToSpeakableText=e.renderToSpeakableText||Wi,e.macros=e.macros||Nt.MACROS,Ki.renderMathInElement(Ui(t),e))}function ji(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}export default{latexToMarkup:Ni,latexToMathML:$i,latexToSpeakableText:Wi,latexToAST:function(t,e){if(!ge.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,Nt.MACROS);const s=Ce.parseTokens(x.tokenize(t),"math",null,e.macros);return ge.toAST(s,e)},makeMathField:function(t,e){if(!zi)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Vi,e.handleReadAloud=e.handleReadAloud||Hi,new zi.MathField(Ui(t),e)},renderMathInDocument:function(t){Gi(document.body,t)},renderMathInElement:Gi,revertToOriginalContent:function(t,e){(t=(t=Ui(t)).children[1])instanceof zi.MathField?t.revertToOriginalContent():(ji(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Ui(t)).children[1])instanceof zi.MathField?t.originalContent:(ji(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Hi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e)=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function u(u,y){if((y=y||0)<0)return 0;if(y>=u.length-1)return u.length;let g=f(m(u,y));for(let k=y+1;k=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new g("literal","#")}}else"^"===this.peek()?t=new g(this.get()):"_"===this.peek()?t=new g(this.get()):"~"===this.peek()?(this.get(),t=new g("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new g("$$")):t=new g("$")):t=new g("literal",this.get());return t}}var x={tokenize:function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const o=new b(i);for(;!o.end();){const t=o.makeToken();t&&e.push(t)}return e}},k={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const v=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,w={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},S={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},A={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function M(t,e,s){if("string"==typeof t){const s=t.match(/([0-9.]*)\s*([a-z]*)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}let i=1;if("pt"===e?i=1:"mm"===e?i=7227/2540:"cm"===e?i=7227/254:"ex"===e?i=35271/8192:"px"===e?i=.75:"em"===e?i=S.ptPerEm:"bp"===e?i=1.00375:"dd"===e?i=1238/1157:"pc"===e?i=12:"in"===e?i=72.27:"mu"===e&&(i=10/18),s){const e=Math.pow(10,s);return Math.round(t/S.ptPerEm*i*e)/e}return t/S.ptPerEm*i}var C={toEm:M,toPx:function(t,e){return M(t,e)*(4/3)*S.ptPerEm},METRICS:S,SIGMAS:w,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in A?i=A[t[0]].charCodeAt(0):v.test(t[0])&&(i=77);const a=k[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const _=[{},{},{}];let T;for(const t in w)if(w.hasOwnProperty(t))for(T=0;T<3;T++)_[T][t]=w[t][T];for(T=0;T<3;T++)_[T].emPerEx=w.xHeight[T]/w.quad[T];class L{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=_[e>0?e-1:0]}sup(){return z[P[this.id]]}sub(){return z[R[this.id]]}fracNum(){return z[O[this.id]]}fracDen(){return z[K[this.id]]}cramp(){return z[N[this.id]]}cls(){return I[this.size]}adjustTo(t){let e=B[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const D=0,F=2,E=4,q=6,z=[new L(D,0,1,!1),new L(1,0,1,!0),new L(F,1,1,!1),new L(3,1,1,!0),new L(E,2,.7,!1),new L(5,2,.7,!0),new L(q,3,.5,!1),new L(7,3,.5,!0)];const I=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],B=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],P=[E,5,E,5,q,7,q,7],R=[5,5,5,5,7,7,7,7],O=[F,3,E,5,q,7,q,7],K=[3,3,5,5,7,7,7,7],N=[1,1,3,3,5,5,7,7];var $={DISPLAY:z[D],TEXT:z[F],SCRIPT:z[E],SCRIPTSCRIPT:z[q],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:z[D],textstyle:z[F],scriptstyle:z[E],scriptscriptstyle:z[q]}[t]:t}};class W{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=$.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new W(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(this,t),"string"==typeof t.mathstyle&&(this.mathstyle=$.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=$.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var V={Context:W};function H(t){let e="";if("number"==typeof t)e+=Math.floor(1e5*t)/1e5;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=H(s);else t&&(e+=t.toString());return e}class U{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=0;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color",""));let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return it[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-.\/:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-.\/:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return it[e]}(this.body,e)),t.cssClass&&(this.classes+=" "+t.cssClass),t.fontShape&&(this.classes+=" "+{it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||""),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+{ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||"",this.classes+=" "+{uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||"")}if(at[e]?this.classes+=" "+at[e]:this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=H(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=H(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=H(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=H(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=H(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?X[t+"+"+i]||0:G[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=Y(s)}}const a=this.tag||"span";if(0===a.length)s=i||"";else{if(s="<"+a,this.cssId&&(s+=' id="'+this.cssId+'" '),this.svgOverlay&&(this.style||(this.style={}),this.style.position="relative"),this.attributes)for(const t in this.attributes)this.attributes.hasOwnProperty(t)&&(s+=" "+t+'="'+this.attributes[t]+'"');const e=this.classes.split(" ");this.type&&(/command|placeholder|error/.test(this.type)&&e.push({command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type]),this.caret&&"command"===this.type&&e.push("ML__command-caret"));let o="";if((o=e.length>1?e.filter(function(t,e,s){return t.length>0&&s.indexOf(t)===e}).join(" "):e[0]).length>0&&(s+=' class="'+o+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=H(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&Z[-t]?i=Z[-t]+i:j[t]?i=j[t]+i:(this.style||(this.style={}),this.style["margin-left"]=H(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)this.style.hasOwnProperty(s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+=i,s+=""):s+=i,s=s+""}return""===s&&(s=""),this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;t0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new U(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=-t.depth-o;o+=t.height+t.depth;const s=tt([r,t]);s.setTop(e),l.push(s)}const c=tt(l,"vlist");return c.depth=Math.max(a,Q(c)||0),c.height=Math.max(-o,J(c)||0),c},makeHlist:st,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=st(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:J,depth:Q,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let nt="";const rt={},lt={},ct={},ht="CRYPTIC",pt="COMMON",dt="SUPERCOMMON",mt={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function ut(t,...e){const s="string"==typeof t?mt[t]:t;for(const t of e)rt[t]&&(rt[t].frequency=s),lt[t]&&(lt[t]=Object.assign({},lt[t]),lt[t].frequency=s)}function ft(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=mt[a]),rt[t]={type:s===At?Mt:s,baseFontFamily:e,value:i,category:nt,frequency:a}}function yt(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);ft(t,"","mord",t)}}const gt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function bt(t,e){const s=String.fromCodePoint(e);if("math"===t&>[s])return gt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in rt)if(rt.hasOwnProperty(t)&&rt[t].value===s){i=t;break}}else for(const t in Rt)if(Rt.hasOwnProperty(t)&&Rt[t]===s){i=t;break}return i||s}const xt={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},kt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function vt(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in xt)if(xt.hasOwnProperty(t)&&xt[t]===e){e=t;break}for(let t=0;t=kt[t].start&&et.body).join("")}function zt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=Et(e),o={category:nt,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)ct[e]=o}function It(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:nt,baseFontFamily:s.fontFamily,params:Et(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)lt[e]=a}nt="Environments",zt("math","",{frequency:0},function(){return{mathstyle:"textstyle"}}),zt("displaymath","",{frequency:8},function(){return{mathstyle:"displaystyle"}}),zt("array","{columns:colspec}",{frequency:pt},function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}}),zt("eqnarray","",{},function(){return{}}),zt("equation","",{},function(){return{colFormat:[{align:"c"}]}}),zt("subequations","",{},function(){return{colFormat:[{align:"c"}]}}),zt("multline","",{},function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}}),zt(["align","aligned"],"",{},function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),It("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),ut(3,"\\textcolor"),It("\\overline","{:auto}",null,function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\overline"),It("\\underline","{:auto}",null,function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}}),ut(pt,"\\underline"),It("\\overset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\overset"),It("\\underset","{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}}),ut(pt,"\\underset"),It(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}}),ut(pt,"\\stackrel"),ut(0,"\\stackbin"),It("\\rlap","{:auto}",null,function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}}),ut(270,"\\rlap"),It("\\llap","{:auto}",null,function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}}),ut(18,"\\llap"),It("\\mathrlap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathrlap"),It("\\mathllap","{:auto}",null,function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}}),ut(ht,"\\mathllap"),It("\\boxed","{content:math}",null,function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}}),ut(1236,"\\boxed"),It("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}}),ut(ht,"\\colorbox"),It("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}}),ut(ht,"\\fcolorbox"),It("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}}),ut(ht,"\\bbox"),It("\\enclose","{notation:string}[style:string]{body:auto}",null,function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=C.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=C.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i}),ut(ht,"\\enclose"),It("\\cancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}}),It("\\bcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}}),It("\\xcancel","{body:auto}",null,function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}}),ut(ht,"\\cancel","\\bcancel","\\xcancel"),nt="Styling",It("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:qt(e[0])})),It("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),It(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),It("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),It("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),It("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),It("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:qt(e[0])})),It("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),It("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),It("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),It("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),It("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),It("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),It("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:qt(e[0])})),It("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),It("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),It("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmss",fontSeries:"m",fontShape:"n"})),It("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),It("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),It("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),It(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"bb"})),It(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({fontFamily:"frak"})),It("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cal",fontSeries:"m",fontShape:"n"})),It("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"scr",fontSeries:"m",fontShape:"n"})),ut(dt,"\\mathbb"),ut(1081,"\\Bbb"),ut(0,"\\mathcal"),ut(pt,"\\mathfrak"),ut(271,"\\frak"),ut(pt,"\\mathscr"),ut("UNCOMMON","\\mathsf"),ut(pt,"\\mathtt"),ut(pt,"\\boldsymbol"),It("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),It("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),It("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),It("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:qt(e[0])})),It("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:qt(e[0]),body:e[1],type:"group"})),It("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),It("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),ut(pt,"\\textrm"),ut(pt,"\\textit"),ut(pt,"\\textsf"),ut(pt,"\\texttt"),ut(433,"\\textnormal"),ut(pt,"\\textbf"),ut(421,"\\textup"),ut(819,"\\emph"),ut(49,"\\em"),nt="Operators",It("\\sqrt","[index:auto]{radicand:auto}",null,function(t,e){return{type:"surd",body:e[1],index:e[0]}}),ut(dt,"\\sqrt"),nt="Fractions",It(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s}),It(["\\over","\\atop","\\choose"],"",{infix:!0},function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}}),ut(21,"\\over"),ut(12,"\\atop"),ut(1968,"\\choose"),It(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}}),ut(15,"\\overwithdelims"),ut(pt,"\\atopwithdelims"),nt="Fractions",It("\\pdiff","{numerator}{denominator}",null,function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}}),nt="Quantifiers",ft("\\forall","",Mt,"∀",dt),ft("\\exists","",Mt,"∃",dt),ft("\\nexists",St,Mt,"∄",dt),ft("\\mid","",_t,"∣",pt),ft("\\top","",Mt,"⊤","RARE"),ft("\\bot","",Mt,"⊥","RARE"),nt="Variable Sized Symbols",It(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}}),It(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}}),ut(dt,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),ut(pt,"\\bigoplus","\\smallint","\\iint","\\oint"),ut("RARE","\\bigwedge","\\bigvee"),ut(756,"\\coprod"),ut(723,"\\bigsqcup"),ut(1241,"\\bigotimes"),ut(150,"\\bigodot"),ut(174,"\\biguplus"),ut(878,"\\iiint"),ut(97,"\\intop"),nt="Various",ft("\\sharp","",Mt,"♯",pt),ft("\\flat","",Mt,"♭",590),ft("\\natural","",Mt,"♮",278),ft("\\#","",Mt,"#","RARE"),ft("\\&","",Mt,"&","RARE"),ft("\\clubsuit","",Mt,"♣",172),ft("\\heartsuit","",Mt,"♡","ARCANE"),ft("\\spadesuit","",Mt,"♠","ARCANE"),ft("\\diamondsuit","",Mt,"♢",ht),ft("\\differencedelta","",_t,"∆",pt),nt="Letters and Letter Like Forms",It("\\unicode","{charcode:number}",null,function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}}),ft("\\backslash","",Mt,"\\"),ft("?","",Mt,"?"),ft("!","",Mt,"!"),ft("\\nabla","",Mt,"∇",dt),ft("\\partial","",Mt,"∂",dt),ft("\\ell","",Mt,"ℓ",pt),ft("\\imaginaryI","",Mt,"i"),ft("\\imaginaryJ","",Mt,"j"),It(["\\Re","\\Im"],"",null,function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}}),ft("\\hbar","",Mt,"ℏ",pt),ft("\\hslash",St,Mt,"ℏ",pt),ft("\\differentialD","cmr",Mt,"d"),ft("\\rd","cmr",Mt,"d"),ft("\\capitalDifferentialD","cmr",Mt,"D"),ft("\\rD","cmr",Mt,"D"),ft("\\exponentialE","cmr",Mt,"e"),ft("\\Finv",St,Mt,"Ⅎ",3),ft("\\Game",St,Mt,"⅁",1),ft("\\wp","",Mt,"℘",1306),ft("\\eth",St,Mt,"ð",77),ft("\\mho",St,Mt,"℧",138),ft("\\Bbbk",St,Mt,"k"),ft("\\doubleStruckCapitalN","bb",Mt,"N"),ft("\\N","bb",Mt,"N"),ft("\\doubleStruckCapitalR","bb",Mt,"R"),ft("\\R","bb",Mt,"R"),ft("\\doubleStruckCapitalQ","bb",Mt,"Q"),ft("\\Q","bb",Mt,"Q"),ft("\\doubleStruckCapitalC","bb",Mt,"C"),ft("\\C","bb",Mt,"C"),ft("\\doubleStruckCapitalZ","bb",Mt,"Z"),ft("\\Z","bb",Mt,"Z"),ft("\\doubleStruckCapitalP","bb",Mt,"P"),ft("\\P","bb",Mt,"P"),ft("\\scriptCapitalE","scr",Mt,"E"),ft("\\scriptCapitalH","scr",Mt,"H"),ft("\\scriptCapitalL","scr",Mt,"L"),ft("\\gothicCapitalC","frak",Mt,"C"),ft("\\gothicCapitalH","frak",Mt,"H"),ft("\\gothicCapitalI","frak",Mt,"I"),ft("\\gothicCapitalR","frak",Mt,"R"),ft("\\pounds","",Mt,"£",509),ft("\\yen",St,Mt,"¥",57),ft("\\euro","",Mt,"€",4),nt="Crosses",ft("\\textdagger","",Ct,"†"),ft("\\dagger","",Ct,"†",pt),ft("\\dag","",Ct,"†",pt),ft("\\ddag","",Ct,"‡",500),ft("\\textdaggerdbl","",Ct,"‡"),ft("\\ddagger","",Ct,"‡",353),ft("\\maltese",St,Mt,"✠",24),nt="Arrows",ft("\\longrightarrow","",_t,"⟶",dt),ft("\\rightarrow","",_t,"→",dt),ft("\\Longrightarrow","",_t,"⟹",dt),ft("\\Rightarrow","",_t,"⇒",dt),ft("\\longmapsto","",_t,"⟼",pt),ft("\\mapsto","",_t,"↦",pt),ft("\\Longleftrightarrow","",_t,"⟺",pt),ft("\\rightleftarrows",St,_t,"⇄",pt),ft("\\leftarrow","",_t,"←",pt),ft("\\curvearrowleft",St,_t,"↶",pt),ft("\\uparrow","",_t,"↑",pt),ft("\\downarrow","",_t,"↓",pt),ft("\\hookrightarrow","",_t,"↪",pt),ft("\\rightharpoonup","",_t,"⇀",pt),ft("\\rightleftharpoons","",_t,"⇌",pt),ft("\\Leftarrow","",_t,"⇐",1695),ft("\\longleftrightarrow","",_t,"⟷",1599),ft("\\longleftarrow","",_t,"⟵",878),ft("\\Longleftarrow","",_t,"⟸",296),ft("\\searrow","",_t,"↘",1609),ft("\\nearrow","",_t,"↗",1301),ft("\\swarrow","",_t,"↙",167),ft("\\nwarrow","",_t,"↖",108),ft("\\Uparrow","",_t,"⇑",257),ft("\\Downarrow","",_t,"⇓",556),ft("\\updownarrow","",_t,"↕",192),ft("\\Updownarrow","",_t,"⇕",161),ft("\\hookleftarrow","",_t,"↩",115),ft("\\leftharpoonup","",_t,"↼",93),ft("\\leftharpoondown","",_t,"↽",42),ft("\\rightharpoondown","",_t,"⇁",80),ft("\\leftrightarrows",St,_t,"⇆",765),ft("\\dashrightarrow",St,_t,"⇢",311),ft("\\dashleftarrow",St,_t,"⇠",5),ft("\\leftleftarrows",St,_t,"⇇",8),ft("\\Lleftarrow",St,_t,"⇚",7),ft("\\twoheadleftarrow",St,_t,"↞",32),ft("\\leftarrowtail",St,_t,"↢",25),ft("\\looparrowleft",St,_t,"↫",6),ft("\\leftrightharpoons",St,_t,"⇋",205),ft("\\circlearrowleft",St,_t,"↺",105),ft("\\Lsh",St,_t,"↰",11),ft("\\upuparrows",St,_t,"⇈",15),ft("\\downharpoonleft",St,_t,"⇃",21),ft("\\multimap",St,_t,"⊸",108),ft("\\leftrightsquigarrow",St,_t,"↭",31),ft("\\twoheadrightarrow",St,_t,"↠",835),ft("\\rightarrowtail",St,_t,"↣",195),ft("\\looparrowright",St,_t,"↬",37),ft("\\curvearrowright",St,_t,"↷",209),ft("\\circlearrowright",St,_t,"↻",63),ft("\\Rsh",St,_t,"↱",18),ft("\\downdownarrows",St,_t,"⇊",6),ft("\\upharpoonright",St,_t,"↾",579),ft("\\downharpoonright",St,_t,"⇂",39),ft("\\rightsquigarrow",St,_t,"⇝",674),ft("\\leadsto",St,_t,"⇝",709),ft("\\Rrightarrow",St,_t,"⇛",62),ft("\\restriction",St,_t,"↾",29),ft("\\upharpoonleft",St,_t,"↿",ht),ft("\\rightrightarrows",St,_t,"⇉",ht),nt="Negated Arrows",ft("\\nrightarrow",St,_t,"↛",324),ft("\\nRightarrow",St,_t,"⇏",107),ft("\\nleftrightarrow",St,_t,"↮",36),ft("\\nLeftrightarrow",St,_t,"⇎",20),ft("\\nleftarrow",St,_t,"↚",7),ft("\\nLeftarrow",St,_t,"⇍",5),nt="Negated Relations",ft("\\nless",St,_t,"≮",146),ft("\\nleqslant",St,_t,"",58),ft("\\lneq",St,_t,"⪇",54),ft("\\lneqq",St,_t,"≨",36),ft("\\nleqq",St,_t,"",18),ft("\\unlhd",St,Ct,"⊴",253),ft("\\unrhd",St,Ct,"⊵",66),ft("\\lvertneqq",St,_t,"",6),ft("\\lnsim",St,_t,"⋦",4),ft("\\lnapprox",St,_t,"⪉",ht),ft("\\nprec",St,_t,"⊀",71),ft("\\npreceq",St,_t,"⋠",57),ft("\\precnsim",St,_t,"⋨",4),ft("\\precnapprox",St,_t,"⪹",2),ft("\\nsim",St,_t,"≁",40),ft("\\nshortmid",St,_t,"",1),ft("\\nmid",St,_t,"∤",417),ft("\\nvdash",St,_t,"⊬",266),ft("\\nvDash",St,_t,"⊭",405),ft("\\ngtr",St,_t,"≯",90),ft("\\ngeqslant",St,_t,"",23),ft("\\ngeqq",St,_t,"",12),ft("\\gneq",St,_t,"⪈",29),ft("\\gneqq",St,_t,"≩",35),ft("\\gvertneqq",St,_t,"",6),ft("\\gnsim",St,_t,"⋧",3),ft("\\gnapprox",St,_t,"⪊",ht),ft("\\nsucc",St,_t,"⊁",44),ft("\\nsucceq",St,_t,"⋡",ht),ft("\\succnsim",St,_t,"⋩",4),ft("\\succnapprox",St,_t,"⪺",ht),ft("\\ncong",St,_t,"≆",128),ft("\\nshortparallel",St,_t,"",6),ft("\\nparallel",St,_t,"∦",54),ft("\\nVDash",St,_t,"⊯",5),ft("\\nsupseteqq",St,_t,"",1),ft("\\supsetneq",St,_t,"⊋",286),ft("\\varsupsetneq",St,_t,"",2),ft("\\supsetneqq",St,_t,"⫌",49),ft("\\varsupsetneqq",St,_t,"",3),ft("\\nVdash",St,_t,"⊮",179),ft("\\precneqq",St,_t,"⪵",11),ft("\\succneqq",St,_t,"⪶",3),ft("\\nsubseteqq",St,_t,"",16),nt="Various",ft("\\checkmark",St,Mt,"✓",1025),ft("\\diagup",St,Mt,"╱",440),ft("\\diagdown",St,Mt,"╲",175),ft("\\measuredangle",St,Mt,"∡",271),ft("\\sphericalangle",St,Mt,"∢",156),ft("\\backprime",St,Mt,"‵",104),ft("\\backdoubleprime",St,Mt,"‶",ht),nt="Shapes",ft("\\ast","",Ct,"∗",dt),ft("\\star","",Ct,"⋆",pt),ft("\\diamond","",Ct,"⋄",1356),ft("\\Diamond",St,Mt,"◊",695),ft("\\lozenge",St,Mt,"◊",422),ft("\\blacklozenge",St,Mt,"⧫",344),ft("\\bigstar",St,Mt,"★",168),nt="Hebrew",ft("\\aleph","",Mt,"ℵ",1381),ft("\\beth",St,Mt,"ℶ",54),ft("\\daleth",St,Mt,"ℸ",43),ft("\\gimel",St,Mt,"ℷ",36),nt="Fences",ft("\\lbrace","",Tt,"{",dt),ft("\\rbrace","",Lt,"}",dt),ft("\\langle","",Tt,"⟨",pt),ft("\\rangle","",Lt,"⟩",pt),ft("\\lfloor","",Tt,"⌊",pt),ft("\\rfloor","",Lt,"⌋",pt),ft("\\lceil","",Tt,"⌈",pt),ft("\\rceil","",Lt,"⌉",pt),ft("\\vert","",Mt,"∣",dt),ft("\\mvert","",_t,"∣"),ft("\\lvert","",Tt,"∣",496),ft("\\rvert","",Lt,"∣",496),ft("\\|","",Mt,"∥"),ft("\\Vert","",Mt,"∥",dt),ft("\\mVert","",Mt,"∥"),ft("\\lVert","",Tt,"∥",287),ft("\\rVert","",Lt,"∥",ht),ft("\\lbrack","",Tt,"[",574),ft("\\rbrack","",Lt,"]",213),ft("\\{","",Tt,"{"),ft("\\}","",Lt,"}"),ft("(","",Tt,"("),ft(")","",Lt,")"),ft("[","",Tt,"["),ft("]","",Lt,"]"),ft("\\ulcorner",St,Tt,"┌",296),ft("\\urcorner",St,Lt,"┐",310),ft("\\llcorner",St,Tt,"└",137),ft("\\lrcorner",St,Lt,"┘",199),ft("\\lgroup","",Tt,"⟮",24),ft("\\rgroup","",Lt,"⟯",24),ft("\\lmoustache","",Tt,"⎰",ht),ft("\\rmoustache","",Lt,"⎱",ht),It(["\\middle"],"{:delim}",null,function(t,e){return{type:"delim",delim:e[0]}}),nt="Sizing";const Bt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function Pt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}It(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,function(t,e){return{type:"sizeddelim",size:Bt[t].size,cls:Bt[t].mclass,delim:e[0]}}),nt="Relations",ft("=","",_t,"=",dt),ft("\\ne","",_t,"≠",dt),ft("\\neq","",_t,"≠",pt),ft("<","",_t,"<",dt),ft("\\lt","",_t,"<",pt),ft(">","",_t,">",dt),ft("\\gt","",_t,">",pt),ft("\\le","",_t,"≤",pt),ft("\\ge","",_t,"≥",pt),ft("\\leqslant",St,_t,"⩽",dt),ft("\\geqslant",St,_t,"⩾",dt),ft("\\leq","",_t,"≤",pt),ft("\\geq","",_t,"≥",pt),ft("\\ll","",_t,"≪"),ft("\\gg","",_t,"≫",pt),ft("\\coloneq","",_t,"≔",5),ft("\\measeq","",_t,"≝"),ft("\\eqdef","",_t,"≞"),ft("\\questeq","",_t,"≟"),ft(":","",_t,":"),ft("\\cong","",_t,"≅",pt),ft("\\equiv","",_t,"≡",pt),ft("\\prec","",_t,"≺",pt),ft("\\preceq","",_t,"⪯",pt),ft("\\succ","",_t,"≻",pt),ft("\\succeq","",_t,"⪰",1916),ft("\\perp","",_t,"⊥",pt),ft("\\parallel","",_t,"∥",pt),ft("\\propto","",_t,"∝",pt),ft("\\Colon","",_t,"∷"),ft("\\smile","",_t,"⌣",pt),ft("\\frown","",_t,"⌢",pt),ft("\\sim","",_t,"∼",pt),ft("\\gtrsim",St,_t,"≳",pt),ft("\\approx","",_t,"≈",dt),ft("\\approxeq",St,_t,"≊",147),ft("\\thickapprox",St,_t,"≈",377),ft("\\lessapprox",St,_t,"⪅",146),ft("\\gtrapprox",St,_t,"⪆",95),ft("\\precapprox",St,_t,"⪷",50),ft("\\succapprox",St,_t,"⪸",ht),ft("\\thicksim",St,_t,"∼",779),ft("\\succsim",St,_t,"≿",251),ft("\\precsim",St,_t,"≾",104),ft("\\backsim",St,_t,"∽",251),ft("\\eqsim",St,_t,"≂",62),ft("\\backsimeq",St,_t,"⋍",91),ft("\\simeq","",_t,"≃",ht),ft("\\lesssim",St,_t,"≲",ht),ft("\\nleq",St,_t,"≰",369),ft("\\ngeq",St,_t,"≱",164),ft("\\smallsmile",St,_t,"⌣",31),ft("\\smallfrown",St,_t,"⌢",71),ft("\\bowtie","",_t,"⋈",558),ft("\\asymp","",_t,"≍",755),ft("\\sqsubseteq","",_t,"⊑",1255),ft("\\sqsupseteq","",_t,"⊒",183),ft("\\leqq",St,_t,"≦",1356),ft("\\eqslantless",St,_t,"⪕",15),ft("\\lll",St,_t,"⋘",157),ft("\\lessgtr",St,_t,"≶",281),ft("\\lesseqgtr",St,_t,"⋚",134),ft("\\lesseqqgtr",St,_t,"⪋",ht),ft("\\risingdotseq",St,_t,"≓",8),ft("\\fallingdotseq",St,_t,"≒",99),ft("\\subseteqq",St,_t,"⫅",82),ft("\\Subset",St,_t,"⋐"),ft("\\sqsubset",St,_t,"⊏",309),ft("\\preccurlyeq",St,_t,"≼",549),ft("\\curlyeqprec",St,_t,"⋞",14),ft("\\vDash",St,_t,"⊨",646),ft("\\Vvdash",St,_t,"⊪",20),ft("\\bumpeq",St,_t,"≏",13),ft("\\Bumpeq",St,_t,"≎",12),ft("\\geqq",St,_t,"≧",972),ft("\\eqslantgtr",St,_t,"⪖",13),ft("\\ggg",St,_t,"⋙",127),ft("\\gtrless",St,_t,"≷",417),ft("\\gtreqless",St,_t,"⋛",190),ft("\\gtreqqless",St,_t,"⪌",91),ft("\\supseteqq",St,_t,"⫆",6),ft("\\Supset",St,_t,"⋑",34),ft("\\sqsupset",St,_t,"⊐",71),ft("\\succcurlyeq",St,_t,"≽",442),ft("\\curlyeqsucc",St,_t,"⋟",10),ft("\\Vdash",St,_t,"⊩",276),ft("\\shortmid",St,_t,"∣",67),ft("\\shortparallel",St,_t,"∥",17),ft("\\between",St,_t,"≬",110),ft("\\pitchfork",St,_t,"⋔",66),ft("\\varpropto",St,_t,"∝",203),ft("\\backepsilon",St,_t,"∍",176),ft("\\llless",St,_t,"⋘",ht),ft("\\gggtr",St,_t,"⋙",ht),ft("\\lhd",St,Ct,"⊲",447),ft("\\rhd",St,Ct,"⊳",338),ft("\\Join","",_t,"⋈",35),ft("\\doteq","",_t,"≐",1450),ft("\\doteqdot",St,_t,"≑",60),ft("\\Doteq",St,_t,"≑",ht),ft("\\eqcirc",St,_t,"≖",6),ft("\\circeq",St,_t,"≗",31),ft("\\lessdot",St,Ct,"⋖",88),ft("\\gtrdot",St,Ct,"⋗",45),ft("\\~","",_t,"~"),nt="Logic",ft("\\leftrightarrow","",_t,"↔",dt),ft("\\Leftrightarrow","",_t,"⇔",dt),ft("\\to","",_t,"→",dt),ft("\\models","",_t,"⊨",pt),ft("\\vdash","",_t,"⊢",pt),ft("\\therefore",St,_t,"∴",1129),ft("\\because",St,_t,"∵",388),ft("\\implies","",_t,"⟹",1858),ft("\\gets","",_t,"←",150),ft("\\dashv","",_t,"⊣",299),ft("\\impliedby","",_t,"⟸",ht),ft("\\biconditional","",_t,"⟷",ht),ft("\\roundimplies","",_t,"⥰",ht),nt="Operators",ft("+","",Ct,"+",dt),ft("-","",Ct,"−",dt),ft("−","",Ct,"−",dt),ft("\\pm","",Ct,"±",pt),ft("\\mp","",Ct,"∓",pt),ft("*","",Ct,"∗",pt),ft("\\times","",Ct,"×",pt),ft("\\div","",Ct,"÷",pt),ft("\\surd","",Mt,"√",pt),ft("\\divides","",Ct,"∣",ht),ft("\\ltimes",St,Ct,"⋉",576),ft("\\rtimes",St,Ct,"⋊",946),ft("\\leftthreetimes",St,Ct,"⋋",34),ft("\\rightthreetimes",St,Ct,"⋌",14),ft("\\intercal",St,Ct,"⊺",478),ft("\\dotplus",St,Ct,"∔",81),ft("\\centerdot",St,Ct,"⋅",271),ft("\\doublebarwedge",St,Ct,"⩞",5),ft("\\divideontimes",St,Ct,"⋇",51),ft("\\cdot","",Ct,"⋅",ht),nt="Others",ft("\\infty","",Mt,"∞",dt),ft("\\prime","",At,"′",dt),ft("\\doubleprime","",Mt,"″"),ft("\\angle","",Mt,"∠",pt),ft("`","",Mt,"‘"),ft("\\$","",Mt,"$"),ft("\\%","",Mt,"%"),ft("\\_","",Mt,"_"),nt="Greek",ft("\\alpha","",At,"α",pt),ft("\\beta","",At,"β",pt),ft("\\gamma","",At,"γ",pt),ft("\\delta","",At,"δ",pt),ft("\\epsilon","",At,"ϵ",pt),ft("\\varepsilon","",At,"ε"),ft("\\zeta","",At,"ζ",pt),ft("\\eta","",At,"η",pt),ft("\\theta","",At,"θ",pt),ft("\\vartheta","",At,"ϑ",pt),ft("\\iota","",At,"ι",pt),ft("\\kappa","",At,"κ",pt),ft("\\varkappa",St,At,"ϰ",pt),ft("\\lambda","",At,"λ",pt),ft("\\mu","",At,"μ",pt),ft("\\nu","",At,"ν",pt),ft("\\xi","",At,"ξ",pt),ft("\\omicron","",At,"o"),ft("\\pi","",At,"π",pt),ft("\\varpi","",At,"ϖ",pt),ft("\\rho","",At,"ρ",pt),ft("\\varrho","",At,"ϱ",pt),ft("\\sigma","",At,"σ",pt),ft("\\varsigma","",At,"ς",pt),ft("\\tau","",At,"τ",pt),ft("\\phi","",At,"ϕ",pt),ft("\\varphi","",At,"φ",pt),ft("\\upsilon","",At,"υ",pt),ft("\\chi","",At,"χ",pt),ft("\\psi","",At,"ψ",pt),ft("\\omega","",At,"ω",pt),ft("\\Gamma","",At,"Γ",pt),ft("\\Delta","",At,"Δ",pt),ft("\\Theta","",At,"Θ",pt),ft("\\Lambda","",At,"Λ",pt),ft("\\Xi","",At,"Ξ",pt),ft("\\Pi","",At,"Π",pt),ft("\\Sigma","",At,"Σ",pt),ft("\\Upsilon","",At,"Υ",pt),ft("\\Phi","",At,"Φ",pt),ft("\\Psi","",At,"Ψ",pt),ft("\\Omega","",At,"Ω",pt),ft("\\digamma",St,At,"ϝ",248),nt="Others",ft("\\emptyset","",Mt,"∅",dt),ft("\\varnothing",St,Mt,"∅",dt),nt="Set Operators",ft("\\cap","",Ct,"∩",dt),ft("\\cup","",Ct,"∪",dt),ft("\\setminus","",Ct,"∖",pt),ft("\\smallsetminus",St,Ct,"∖",254),ft("\\complement",St,Mt,"∁",200),nt="Set Relations",ft("\\in","",_t,"∈",dt),ft("\\notin","",_t,"∉",dt),ft("\\not","",_t,"̸",pt),ft("\\ni","",_t,"∋",pt),ft("\\owns","",_t,"∋",18),ft("\\subset","",_t,"⊂",dt),ft("\\supset","",_t,"⊃",dt),ft("\\subseteq","",_t,"⊆",dt),ft("\\supseteq","",_t,"⊇",dt),ft("\\subsetneq",St,_t,"⊊",1945),ft("\\varsubsetneq",St,_t,"",198),ft("\\subsetneqq",St,_t,"⫋",314),ft("\\varsubsetneqq",St,_t,"",55),ft("\\nsubset",St,_t,"⊄",ht),ft("\\nsupset",St,_t,"⊅",ht),ft("\\nsubseteq",St,_t,"⊈",950),ft("\\nsupseteq",St,_t,"⊉",49),nt="Spacing",ft("\\ ","",Dt," "),ft("~","",Dt," "),ft("\\space","",Dt," "),ft("\\!","",Dt,null),ft("\\,","",Dt,null),ft("\\:","",Dt,null),ft("\\;","",Dt,null),ft("\\enskip","",Dt,null),ft("\\enspace","",Dt,null,672),ft("\\quad","",Dt,null,pt),ft("\\qquad","",Dt,null,pt),It(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},function(t,e){return{type:"spacing",width:e[0]||0}}),It(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:Pt(e[0])||e[0],captureSelection:!0,baseFontFamily:"cmr"};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s}),It(["\\operatorname","\\operatorname*"],"{operator:string}",null,function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s}),nt="Punctuation",ft("\\colon","","mpunct",":",pt),ft("\\cdotp","","mpunct","⋅",pt),ft("\\ldots","","minner","…",pt),ft("\\cdots","","minner","⋯",pt),ft("\\ddots","","minner","⋱",pt),ft("\\mathellipsis","","minner","…",91),ft("\\vdots","",Mt,"⋮",pt),ft("\\ldotp","","mpunct",".",18),ft(",","","mpunct",","),ft(";","","mpunct",";"),nt="Logical Operators",ft("\\wedge","",Ct,"∧",dt),ft("\\vee","",Ct,"∨",dt),ft("\\lnot","",Mt,"¬",pt),ft("\\neg","",Mt,"¬",dt),ft("\\land","",Ct,"∧",659),ft("\\lor","",Ct,"∨",364),ft("\\barwedge",St,Ct,"⊼",21),ft("\\veebar",St,Ct,"⊻",43),ft("\\nor",St,Ct,"⊻",7),ft("\\curlywedge",St,Ct,"⋏",58),ft("\\curlyvee",St,Ct,"⋎",57),nt="Boxes",ft("\\square",St,Mt,"□",pt),ft("\\Box",St,Mt,"□",pt),ft("\\blacksquare",St,Mt,"■",1679),ft("\\boxminus",St,Ct,"⊟",79),ft("\\boxplus",St,Ct,"⊞",276),ft("\\boxtimes",St,Ct,"⊠",457),ft("\\boxdot",St,Ct,"⊡",120),nt="Circles",ft("\\circ","",Ct,"∘",dt),ft("\\bigcirc","",Ct,"◯",903),ft("\\bullet","",Ct,"∙",pt),ft("\\circleddash",St,Ct,"⊝",pt),ft("\\circledast",St,Ct,"⊛",339),ft("\\oplus","",Ct,"⊕",pt),ft("\\ominus","",Ct,"⊖",1568),ft("\\otimes","",Ct,"⊗",pt),ft("\\odot","",Ct,"⊙",pt),ft("\\circledcirc",St,Ct,"⊚",93),ft("\\oslash","",Ct,"⊘",497),ft("\\circledS",St,Mt,"Ⓢ",31),ft("\\circledR",St,Mt,"®",1329),nt="Triangles",ft("\\triangle","",Mt,"△",pt),ft("\\triangleq",St,_t,"≜",pt),ft("\\bigtriangleup","",Ct,"△",1773),ft("\\vartriangle",St,_t,"△",762),ft("\\triangledown",St,Mt,"▽",520),ft("\\bigtriangledown","",Ct,"▽",661),ft("\\triangleleft","",Ct,"◃",534),ft("\\vartriangleleft",St,_t,"⊲",281),ft("\\trianglelefteq",St,_t,"⊴",176),ft("\\ntriangleleft",St,_t,"⋪",13),ft("\\ntrianglelefteq",St,_t,"⋬",22),ft("\\triangleright","",Ct,"▹",516),ft("\\vartriangleright",St,_t,"⊳",209),ft("\\trianglerighteq",St,_t,"⊵",45),ft("\\ntriangleright",St,_t,"⋫",15),ft("\\ntrianglerighteq",St,_t,"⋭",6),ft("\\blacktriangle",St,Mt,"▲",360),ft("\\blacktriangledown",St,Mt,"▼",159),ft("\\blacktriangleleft",St,_t,"◀",101),ft("\\blacktriangleright",St,_t,"▶",271),nt="Others",ft("\\/","",At,"/"),ft("|","","textord","∣"),nt="Big Operators",ft("\\sqcup","",Ct,"⊔",1717),ft("\\sqcap","",Ct,"⊓",735),ft("\\uplus","",Ct,"⊎",597),ft("\\wr","",Ct,"≀",286),ft("\\Cap",St,Ct,"⋒",2),ft("\\Cup",St,Ct,"⋓",2),ft("\\doublecap",St,Ct,"⋒",1),ft("\\doublecup",St,Ct,"⋓",1),ft("\\amalg","",Ct,"⨿",ht),ft("\\And","",Ct,"&"),nt="Accents",It(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}}),ut(pt,"\\bar","\\ddot","\\acute","\\tilde","\\check"),ut(1548,"\\breve"),ut(735,"\\grave"),ut(dt,"\\vec"),nt="Letters and Letter Like Forms",ft("\\imath","",Mt,"ı"),ft("\\jmath","",Mt,"ȷ"),nt="Others",ft("\\degree","",Mt,"°",46),nt="Others",ft("'","",Mt,"′"),ft('"',"",Mt,"”"),nt="Others",It("\\^","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\`","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}}),It("\\'","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}}),It("\\~","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}}),It("\\c","{:string}",{allowedInText:!0},function(t,e){return{type:"MATHORD",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}});const Rt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},Ot="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),Kt="undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var Nt={matchCodepoint:bt,commandAllowed:function(t,e){return!(!lt[e]||"text"===t&&!lt[e].allowedInText)||!!{text:Rt,math:rt}[t][e]},unicodeToMathVariant:vt,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=kt[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=rt[t]:Rt[t]&&(i={value:Rt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?rt[e]&&rt[e].value?rt[e].value:e:Rt[e]?Rt[e]:e},getEnvironmentInfo:function(t){let e=ct[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in lt)lt.hasOwnProperty(s)&&s.startsWith(t)&&!lt[s].infix&&e.push({match:s,frequency:lt[s].frequency});for(const s in rt)rt.hasOwnProperty(s)&&s.startsWith(t)&&e.push({match:s,frequency:rt[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:mt,TEXT_SYMBOLS:Rt,MATH_SYMBOLS:rt,ENVIRONMENTS:ct,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:lt,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?\/.,~<>`|'$%#&^_" ]/,LETTER:Ot,LETTER_AND_DIGITS:Kt};const $t=ot.makeSymbol,Wt=ot.makeStyleWrap,Vt=ot.makeSpan,Ht=ot.makeVlist;function Ut(t,e,s,i,a,o){const n=$t("Size"+s+"-Regular",Nt.getValue("math",e)),r=Wt(t,Vt(n,"delimsizing size"+s),a.mathstyle,$.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Gt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Vt($t(e,Nt.getValue("math",t)),"delimsizinginner"+s)}function jt(t,e,s,i,a,o){let n,r,l,c;n=l=c=Nt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const p=C.getCharacterMetrics(Nt.getValue("math",n),h),d=p.height+p.depth,m=C.getCharacterMetrics(Nt.getValue("math",l),h),u=m.height+m.depth,f=C.getCharacterMetrics(Nt.getValue("math",c),h),y=f.height+f.depth;let g=0,b=1;if(null!==r){const t=C.getCharacterMetrics(Nt.getValue("math",r),h);g=t.height+t.depth,b=2}const x=d+y+g,k=Math.ceil((s-x)/(b*u)),v=x+k*b*u;let w=a.mathstyle.metrics.axisHeight;i&&(w*=a.mathstyle.sizeMultiplier);const S=v/2-w,A=[];if(A.push(Gt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Jt=[0,1.2,1.8,2.4,3];const Qt=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],te=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"stack"}],ee=[{type:"small",mathstyle:$.SCRIPTSCRIPT},{type:"small",mathstyle:$.SCRIPT},{type:"small",mathstyle:$.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function se(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return ie(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Yt.includes(e)?Qt:Zt.includes(e)?ee:te;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(Nt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=$t("AMS-Regular",Nt.getValue("math",e)),r=Wt(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ut(t,e,r.size,i,a,o):jt(t,e,s,i,a,o)}function ie(t,e,s){return ot.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo($.TEXT)+" nulldelimiter "+(s||""))}var ae={makeSizedDelim:function(t,e,s,i,a){return"."===e?ie(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Zt.includes(e)||Yt.includes(e)?Ut(t,e,s,!1,i,a):Xt.includes(e)?jt(t,e,Jt[s],!1,i,a):null)},makeCustomSizedDelim:se,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return ie(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/C.METRICS.ptPerEm;let l=i+n,c=s-n,h=901*(c=Math.max(l,c))/500;return l=2*c-r,se(t,e,h=Math.max(h,l),!0,a,o)}};const oe=ot.makeSpan,ne=ot.makeOrd,re=ot.makeInner,le=ot.makeHlist,ce=ot.makeVlist,he=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,pe=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/;class de{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",pe.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":he.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&(this.type="",delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=ne(ye(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(o<(m+=r)&&(o=m),m=0),d.height=a,d.depth=o,l+=a,d.pos=l,l+=o+m,h.push(d)}const d=l/2+a.metrics.axisHeight,m=[];for(let e=0;e0&&m.push(ce(t,s,"individualShift"))}const u=[];let f=!1,y=!1,g=0,b=!this.lFence;for(const s of e){if(s.align&&g>=m.length)break;if(s.align&&g0?3*c:7*S.defaultRuleThickness,d=e.metrics.denom1):(c>0?(h=e.metrics.num2,p=c):(h=e.metrics.num3,p=3*S.defaultRuleThickness),d=e.metrics.denom2);const m=o?o.depth:0,u=l?l.height:0;let f;if(0===c){const t=h-m-(u-d);tot.height(s)+ot.depth(s)+o&&(o=(o+l-ot.height(s)-ot.depth(s))/2),r.setTop(r.height-ot.height(s)-(o+i));const c=oe("",t.mathstyle.adjustTo($.TEXT)+" sqrt-line");let h;if(c.applyStyle(this.getStyle()),c.height=i,h=0===ot.height(s)&&0===ot.depth(s)?oe():ce(t,[s,o,c,i]),!this.index)return this.bind(t,ne([r,h],"sqrt"));const p=t.clone({mathstyle:$.SCRIPTSCRIPT}),d=oe(ye(p,this.index),e.adjustTo($.SCRIPTSCRIPT)),m=Math.max(r.height,h.height),u=Math.max(r.depth,h.depth),f=ce(t,[d],"shift",-(.6*(m-u)));return this.bind(t,ne([oe(f,"root"),r,h],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=ye(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,ne(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=ot.skew(s));const a=Math.min(ot.height(s),e.metrics.xHeight),o=ot.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=oe(oe(o),"accent-body"+n);return(r=ce(t,[s,-a,r])).children[1].setLeft(2*i),ne(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=ye(t.cramp(),this.body),i=S.defaultRuleThickness/e.sizeMultiplier,a=oe("",t.mathstyle.adjustTo($.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=ce(t,[s,3*i,a,i]);else{const e=oe(s);o=ce(t,[i,a,3*i,e],"top",ot.height(e))}return ne(o,this.position)}decomposeOverunder(t){const e=ye(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?oe(ye(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?oe(ye(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return fe(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=oe(ye(t,this.body),"inner");return ne([e,oe("","fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=ne("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===$.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";(s=ot.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op"))).type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=ot.makeOp(ye(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===$.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}applySizing(t){const e={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[this.size]*t.mathstyle.sizeMultiplier;t.size=this.size,t.sizeMultiplier=e}decomposeBox(t){const e=ne(ye(t,this.body));e.setStyle("position","relative");const s=ne(e),i=this.padding?this.padding:S.fboxsep;return s.setStyle("padding",i,"em"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",S.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),s.height=e.height,s.depth=e.depth,s.setStyle("position","relative"),s.setStyle("height",s.height+s.depth,"em"),this.bind(t,s)}decomposeEnclose(t){const e=ne(ye(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(ot.height(e)+ot.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=oe("​","mspace "+t)}else"sizing"===this.type?this.applySizing(t):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?((s=this.makeSpan(t,this.body)).classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&this.caret&&((s=this.makeSpan(t,"​")).caret=this.caret);if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=ye(t.sup(),this.superscript);a=oe(e,i.adjustTo(i.sup()))}if(this.subscript){const e=ye(t.sub(),this.subscript);o=oe(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=ot.height(e)-i.metrics.supDrop,l=ot.depth(e)+i.metrics.subDrop),n=i===$.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=$.TEXT.sizeMultiplier*i.sizeMultiplier,h=.5/S.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=S.defaultRuleThickness;if(r-ot.depth(a)-(ot.height(o)-l)<4*s){l=4*s-(r-a.depth)+ot.height(o);const t=.8*i.metrics.xHeight-(r-ot.depth(a));t>0&&(r+=t,l-=t)}p=ce(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-ot.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,ot.height(o)-.8*i.metrics.xHeight),(p=ce(t,[o],"shift",l)).children[0].setRight(h),this.isCharacterBox()&&p.children[0].setLeft(-ot.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),(p=ce(t,[a],"shift",-r)).children[0].setRight(h));const d=oe(p,"msubsup");return this.caret&&(d.caret=this.caret),ot.makeSpanOfType(s,[e,d])}attachLimits(t,e,s,i){const a=this.superscript?oe(ye(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?oe(ye(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return fe(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"boolean"!=typeof t.generateID&&(t.generateID.overrideID?e=t.generateID.overrideID:(e=t.generateID.seed.toString(36),t.generateID.seed+=1));return e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=ot.makeSpanOfType(s,e);return i.applyStyle(this.getStyle()),t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function me(t){const e=oe("​","arraycolsep");return e.setWidth(t,"em"),e}function ue(t,e,s,i){const a=[];for(const o of e){const e=oe(ye(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return ce(t,a,"individualShift")}function fe(t,e,s,i,a,o,n){if(!a&&!o)return e;e=oe(e);let r=0,l=0;a&&(r=Math.max(S.bigOpSpacing1,S.bigOpSpacing3-a.depth)),o&&(l=Math.max(S.bigOpSpacing2,S.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=S.bigOpSpacing5+ot.height(o)+ot.depth(o)+l+ot.depth(e)+s;(c=ce(t,[S.bigOpSpacing5,o,l,e,r,a,S.bigOpSpacing5],"bottom",n)).children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=ot.height(e)-s;(c=ce(t,[S.bigOpSpacing5,o,l,e],"top",a)).children[0].setLeft(-i)}else if(!o&&a){const o=ot.depth(e)+s;(c=ce(t,[e,r,a,S.bigOpSpacing5],"bottom",o)).children[1].setLeft(i)}return ot.makeSpanOfType(n,c,"op-limits")}function ye(t,e){t instanceof V.Context||(t=new V.Context(t));const s=!t.generateID||!t.generateID.groupNumbers;let i=[];if(Array.isArray(e)){if(0===e.length)return i;if(1===e.length)(i=e[0].decompose(t))&&s&&e[0].isSelected&&i.forEach(t=>t.selected(!0));else{let a="none",o=e[1].type,n=[],r=null,l=null;for(let c=0;ct.selected(!0)):(n.length>0&&(i=[...i,...n],n=[]),i=i.concat(a))}a=e[c].getFinalBaseElement().type,o=e[c+1]?e[c+1].getInitialBaseElement().type:"none"}n.length>0&&(i=[...i,...n],n=[])}}else e&&(i=e.decompose(t))&&s&&e.isSelected&&i.forEach(t=>t.selected(!0));if(!i||0===i.length)return null;const a={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of i)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=a[t.size]/a[t.parentSize];for(const t of i)t.height*=e,t.depth*=e}return i}var ge={MathAtom:de,decompose:ye,makeRoot:function(t,e){const s=new de(t=t||"math","root");return s.body=e||[],0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new de("","first")),s},GREEK_REGEX:he};const be={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},xe={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ke={stringToColor:function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},colorToString:function(t){let e=t.toUpperCase();for(const t in xe)if(xe[t]===e){e=t;break}for(const t in be)if(be[t]===e){e=t;break}return e},AREA_COLORS:["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],LINE_COLORS:["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"]};const ve=ge.MathAtom;class we{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ke.stringToColor(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?C.toEm(t,"pt"):this.parseKeyword("mm")?C.toEm(t,"mm"):this.parseKeyword("cm")?C.toEm(t,"cm"):this.parseKeyword("ex")?C.toEm(t,"ex"):this.parseKeyword("px")?C.toEm(t,"px"):this.parseKeyword("em")?C.toEm(t,"em"):this.parseKeyword("bp")?C.toEm(t,"bp"):this.parseKeyword("dd")?C.toEm(t,"dd"):this.parseKeyword("pc")?C.toEm(t,"pc"):this.parseKeyword("in")?C.toEm(t,"in"):this.parseKeyword("mu")?C.toEm(t,"mu"):C.toEm(t,"pt")}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new ve("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new ve("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=Nt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(!(c=this.end())&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const p=new ve(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return p.array=n,p.rowGaps=r,p.env={...e},p.env.name=t,p}scanImplicitGroup(t){const e=this.style;t||(t=(t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value)));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(Se)){const t=new ve(this.parseMode,"sizing");t.size={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[this.get().value],this.mathList.push(t)}else if(this.hasImplicitCommand(Ae)){this.parseMode="math";const t=new ve("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=Nt.getInfo("\\"+s.value,"math",this.macros);o=e?[new ve(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new ve(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new ve(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new ve(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=Nt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright")){const t=new ve(this.parseMode,"leftright");return t.rightDelim=this.scanDelim()||".",t}const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim()||".",i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new ve(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasToken("^")||this.hasToken("_")||this.hasLiteral("'");){let e;if(this.hasToken("^")?e="superscript":this.hasToken("_")&&(e="subscript"),this.parseToken("^")||this.parseToken("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new ve(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ke.stringToColor(e);if(t)(i=i||{}).backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)(i=i||{}).padding=C.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&((i=i||{}).border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new ve("text",""," ",this.style));else if("placeholder"===t.type)e=new ve(this.parseMode,"placeholder",t.value);else if("command"===t.type){if("placeholder"===t.value)e=new ve(this.parseMode,"placeholder",this.scanArg("string"));else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),(e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t))).latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&((e=new ve(this.parseMode,"spacing",null,this.style)).width=s),e.latex="\\"+t.value}else if(!(e=this.scanMacro(t.value))){const s=Nt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e?i.push(e):t.placeholder?i.push([new ve(this.parseMode,"placeholder",t.placeholder)]):i.push(this.placeholder()),"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new ve(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||((e=new ve(this.parseMode,"error","\\"+t.value)).latex="\\"+t.value)}}else if("literal"===t.type){const s=Nt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new ve(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new ve(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=Nt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new ve(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new ve(this.parseMode,"group",Me(x.tokenize(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var Le={pathFromString:Te,pathToString:_e,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)a=(a=(i+=1)>=t.length||i>=e.length)||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return Te(_e(t)).path}};const De={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left[ #0 \\right]"],"math:Alt-Shift-BracketLeft":["insert","\\left{ #0 \\right}"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":"speakParent","!mac:Ctrl-Alt-Up":"speakParent","mac:Ctrl-Meta-Down":"speakGroup","!mac:Ctrl-Alt-Down":"speakGroup","mac:Ctrl-Meta-Left":"speakLeftSibling","!mac:Ctrl-Alt-Left":"speakLeftSibling","mac:Ctrl-Meta-Right":"speakRightSibling","!mac:Ctrl-Alt-Right":"speakRightSibling","mac:Ctrl-Meta-Shift-Down":"speakAllWithSynchronizedHighlighting","!mac:Ctrl-Alt-Shift-Down":"speakAllWithSynchronizedHighlighting"},Fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},Ee={"''":"^{\\doubleprime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi","π":"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:"\\imaginaryI",jj:"\\imaginaryJ",ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial","∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt","∆":"\\differentialD","∂":"\\differentialD",sin:"\\sin",cos:"\\cos",tan:"\\tan",tanh:"\\tanh",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:"\\eta",gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:"\\mu",nu:"\\nu","µ":"\\mu",phi:"\\phi",Phi:"\\Phi",varphi:"\\varphi",psi:"\\psi",Psi:"\\Psi",rho:"\\rho",sigma:"\\sigma",Sigma:"\\Sigma",tau:"\\tau",vartheta:"\\vartheta",upsilon:"\\upsilon",xi:"\\xi",Xi:"\\Xi",zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\mod",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"digit",value:"\\operatorname{mm}"},cm:{after:"digit",value:"\\operatorname{cm}"},km:{after:"digit",value:"\\operatorname{km}"},kg:{after:"digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}"};function qe(t,e){if("string"==typeof e)return e;if(!t)return e?e.value:void 0;let s=!1,i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,p=!1,d=!1,m=!1,u=!1,f=!1;const y=t[t.length-1];return s=!y||"first"===y.type,y&&(i=!(u="text"===y.mode)&&"mord"===y.type&&Nt.LETTER.test(y.body),a=!u&&"mord"===y.type&&/[0-9]+$/.test(y.body),o=!u&&y.isFunction,n="genfrac"===y.type,r="surd"===y.type,l="mbin"===y.type,c="mrel"===y.type,h="mpunct"===y.type||"minner"===y.type,p=y.array,d="mopen"===y.type,m="mclose"===y.type||"leftright"===y.type,f="space"===y.type),"object"==typeof e&&(e=/nothing/.test(e.after)&&s||/letter/.test(e.after)&&i||/digit/.test(e.after)&&a||/function/.test(e.after)&&o||/frac/.test(e.after)&&n||/surd/.test(e.after)&&r||/binop/.test(e.after)&&l||/relop/.test(e.after)&&c||/punct/.test(e.after)&&h||/array/.test(e.after)&&p||/openfence/.test(e.after)&&d||/closefence/.test(e.after)&&m||/text/.test(e.after)&&u||/space/.test(e.after)&&f?e.value:null),e}function ze(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function Ie(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function Be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ze("mac")||o===ze("win")||o===ze("ios")||o===ze("android")||o===ze("chromeos")||o===ze("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===ze("mac")||"ios"===ze("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var Pe={KEYBOARD_SHORTCUTS:De,INLINE_SHORTCUTS:Ee,stringify:Be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(Ee).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s){let i="";s&&s.overrideDefaultInlineShortcuts||(i=qe(t,Ee[e]));const a=s&&s.inlineShortcuts?s.inlineShortcuts:null;let o;return a&&(o=qe(t,a[e])),o||i},selectorForKeystroke:function(t,e){for(const s of[ze("mac")+":"+t+":"+e,ze("win")+":"+t+":"+e,ze("ios")+":"+t+":"+e,ze("android")+":"+t+":"+e,ze("chromeos")+":"+t+":"+e,ze("other")+":"+t+":"+e,ze("mac")+":"+e,ze("win")+":"+e,ze("ios")+":"+e,ze("android")+":"+e,ze("chromeos")+":"+e,t+":"+e,e])if(De[s])return De[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=Fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=Ie(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const t in De)if(De.hasOwnProperty(t)&&s.test(Ie(De[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}return Be(e)}};function Re(t,e){this.root=ge.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Oe(t){const e=Object.assign(new Re(t.config,t.target),t);return e.path=Le.clone(t.path),e}function Ke(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function $e(t,e){let s;return"object"!=typeof e&&(e=Ne(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Qe()),s}function We(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i}function Ve(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new ge.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function He(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!$e(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Ue(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Ge(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Ge(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some(function(s){return s===e||Ge(t[s],e)}))return!0;if(t.array)for(let s=We(t.array);s>=0;s--)if(Ge($e(t.array,s),e))return!0}return!1}function je(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ze(t,e){return t?t.length<=1?t:(e&&"ASCIIMath"===e.format||(t=t.replace(/\\\\([^\s\n])/g,"\\$1")),e&&"ASCIIMath"===e.format||!/\\/.test(t)?Xe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e):t):""}function Xe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ye(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/))&&(t="\\sqrt{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/))&&(t="\\sqrt[3]{"+(s=Ye(s[2],{...e,noWrap:!0})).match+"}",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^abs(.*)/))&&(t="\\left|"+(s=Ye(s[1],{...e,noWrap:!0})).match+"\\right|",t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^["”“](.*?)["”“](.*)/))&&(t="\\text{"+s[1]+"}",t+=Xe(s[2],e),i=!0),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ye(t.substring(1),e),t=t[0],t+=s.match,t+=Xe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/))&&(t=Je(s[1],e),t+=Xe(s[2],e),i=!0),!i)if((s=Ye(t,{...e,noWrap:!0})).match&&"/"===s.rest[0]){const a=Ye(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+Xe(a.rest,e)),i=!0}else s.match&&/^(\(|\{|\[)$/.test(t[0])?(t="\\left"+t[0]+s.match+"\\right"+{"(":")","{":"}","[":"]"}[t[0]]+Xe(s.rest,e),i=!0):s.match&&(t=s.match,t+=Xe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/))&&(t=" "+Xe(s[2],e),i=!0),t}function Ye(t,e){let s="",i=t=t.trim();const a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(s=e.noWrap&&"("===a&&")"===o?Xe(t.substring(1,r-1),e):"\\mleft"+a+Xe(t.substring(1,r-1),e)+"\\mright"+o,i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=Pe.forString(null,t,e);if(s)return{match:s=(s=s.replace("_{#?}","")).replace("^{#?}",""),rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/))return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/))return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/))&&(i=t.substring(a[1].length),s=a[1])}return{match:s,rest:i}}function Je(t,e){let s=Pe.forString(null,t,e);return s?(s=(s=s.replace("_{#?}","")).replace("^{#?}",""),s+=" "):s=t,s}function Qe(){return new ge.MathAtom("","first")}Re.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},Re.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new Re;i.path=Le.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},Re.prototype.forEach=function(t){this.root.forEach(t)},Re.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},Re.prototype.setRange=function(t,e,s){s=s||{};const i=Le.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(Le.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(Le.clone(t),i)}let a=Le.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=Le.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(n-=1),this.setPath(a,n)},Re.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},Re.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},Re.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},Re.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},Re.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},Re.prototype.insertFirstAtom=function(){this.siblings()},Re.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=$e(this.parent().array,this.relation()):"string"==typeof(t=this.parent()[this.relation()]||[])&&(t=[]),0!==t.length&&"first"===t[0].type||t.unshift(Qe()),t},Re.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},Re.prototype.isCollapsed=function(){return 0===this.extent},Re.prototype.setExtent=function(t){this.extent=t},Re.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},Re.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},Re.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&Nt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&Nt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(e>=(s-=1))return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Ue(t[e]);)e-=1;for(;Ue(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},Re.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},Re.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},Re.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},Re.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},Re.prototype.extractArgBeforeInsertionPoint=function(){const t=[],e=this.siblings();if(e.length<=1)return[];let s=this.startOffset();if("text"===e[s].mode)for(;s>=1&&"text"===e[s].mode;)t.unshift(e[s]),s--;else for(;s>=1&&("mord"===e[s].type||"surd"===e[s].type||"leftright"===e[s].type);)t.unshift(e[s]),s--;return t},Re.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},Re.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=We(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if($e(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=We(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},Re.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,-1))&&$e(e)?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},Re.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Ne(this.parent().array,s);(e=He(this.parent().array,e,1))&&$e(e)?(this.path[this.path.length-1].relation="cell"+Ke(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},Re.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Oe(this),a=e+(s=this.extent+t);if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},Re.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Oe(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if((n=this.wordBoundaryOffset(n,t))<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},Re.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},Re.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Oe(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===i.length){if(e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return!1}return this.setPath(i[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),!0},Re.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},Re.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries}),s+=1,i=this.ancestor(s);return e},Re.prototype.simplifyParen=function(t){t&&this.config.removeExtraneousParentheses&&t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=je(t.numer),t.denom=je(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=je(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=je(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=je(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=je(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=je(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=je(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=We(t.array);e>=0;e--)this.simplifyParen($e(t.array,e))})},Re.prototype.insert=function(t,e){e=e||{};const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const n=[this.getSelectedAtoms()];void 0!==e.placeholder&&(n["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const r=this.siblings(),l=this.startOffset();if(l+10&&r[l]&&"placeholder"===r[l].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ze(t,{...this.config,format:"ASCIIMath"}),o=Ce.parseTokens(x.tokenize(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)Nt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new ge.MathAtom("command","command",e))}else""===t?o=[new ge.MathAtom("command","command","\\")]:(t=Ze(t,this.config),n[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),n[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-n[0].length),Array.isArray(n[0])&&0===n[0].length&&(n[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=Ce.parseTokens(x.tokenize(t),a,n,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=Ce.parseTokens(x.tokenize(t),"text",n,e.macros,!1));if(function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},Re.prototype._insertSmartFence=function(t,e){if(!this.config.smartFence)return!1;const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=Nt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;return s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i,this.insert(s,{mode:"math",format:"latex",style:e}),a&&this.move(-1),!0}let a;for(const e in Nt.RIGHT_DELIM)Nt.RIGHT_DELIM.hasOwnProperty(e)&&t===Nt.RIGHT_DELIM[e]&&(a=e);if(a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},Re.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},Re.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new ge.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},Re.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},Re.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},Re.prototype.delete_=function(t){this.contentWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else{if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(1)}}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.contentDidChange()},Re.prototype.moveToNextPlaceholder_=function(){this.leap(1)},Re.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},Re.prototype.moveToNextChar_=function(){this.move(1)},Re.prototype.moveToPreviousChar_=function(){this.move(-1)},Re.prototype.moveUp_=function(){this.up()},Re.prototype.moveDown_=function(){this.down()},Re.prototype.moveToNextWord_=function(){this.skip(1)},Re.prototype.moveToPreviousWord_=function(){this.skip(-1)},Re.prototype.moveToGroupStart_=function(){this.setSelection(0)},Re.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},Re.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},Re.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},Re.prototype.deleteNextChar_=function(){this.delete_(1)},Re.prototype.deletePreviousChar_=function(){this.delete_(-1)},Re.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},Re.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},Re.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},Re.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},Re.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},Re.prototype.transpose_=function(){},Re.prototype.extendToNextChar_=function(){this.extend(1)},Re.prototype.extendToPreviousChar_=function(){this.extend(-1)},Re.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendUp_=function(){this.up({extend:!0})},Re.prototype.extendDown_=function(){this.down({extend:!0})},Re.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},Re.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},Re.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},Re.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},Re.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},Re.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},Re.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Qe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Qe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Qe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},Re.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Qe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Qe()]):("nolimits"===this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new ge.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Qe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},Re.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];return t?(this.parent()[t]||(this.parent()[t]=[Qe()]),this.setSelection(1,"end",t),!0):(this.moveToSuperscript_(),!1)},Re.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},Re.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Oe(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},Re.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Ne(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ke(e.array,i);this.selectionWillChange(),this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom(),this.selectionDidChange()}}},Re.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=Nt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},Re.prototype.addRowAfter_=function(){this.convertParentToArray(),this._addCell("after row")},Re.prototype.addRowBefore_=function(){this.convertParentToArray(),this._addCell("before row")},Re.prototype.addColumnAfter_=function(){this.convertParentToArray(),this._addCell("after column")},Re.prototype.addColumnBefore_=function(){this.convertParentToArray(),this._addCell("before column")},Re.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="md"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="up"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var ts={EditableMathlist:Re,parseMathString:Ze};const es={Escape:"Esc"," ":"Spacebar",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},ss={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function is(t){let e;"Unidentified"===t.key&&t.target&&(e=ss[t.target.value]||t.target.value),e||(e=es[t.key]||t.code)||(e=ss[t.key.toLowerCase()]||t.key);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),t.altKey&&s.push("Alt"),t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function as(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),t()})}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",function(s){return"function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode?n=!1:(n=!0,o=!1,t.blur(),t.focus()),!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(is(s),s))},!0),c.addEventListener("keypress",function(t){o||(i&&a&&e.keystroke(is(i),i),a=t,r(l))},!0),c.addEventListener("keyup",function(){o||!i||a||l()},!0),c.addEventListener("paste",function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)},!0),c.addEventListener("copy",function(t){e.copy&&e.copy(t)},!0),c.addEventListener("cut",function(t){e.cut&&e.cut(t)},!0),c.addEventListener("blur",function(){i=null,a=null},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{n?(t.blur(),t.focus(),n=!1,o=!1,r(l)):o||r(l)})}var os={delegateKeyboardEvents:as,select:as.select,keyboardEventToString:is,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};var ns={UndoManager:class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}])}}};const rs={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},ls={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function cs(t){let e=ls[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function hs(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&(t.popover.style.left=s.x-t.popover.offsetWidth/2+"px",t.popover.style.top=s.y+5+"px"),t.popover.classList.add("is-visible")}function ps(t){t.popover.classList.remove("is-visible")}var ds={getNote:cs,SAMPLES:rs,NOTES:ls,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void ps(t);const i=e,a=function(t,e){const s=Ce.parseTokens(x.tokenize(t),"math",null,e.config.macros),i=ge.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=ot.makeSpan(i,"ML__base"),o=ot.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const n=ot.makeSpan("","ML__strut--bottom");return n.setStyle("height",a.height+a.depth,"em"),n.setStyle("vertical-align",-a.depth,"em"),ot.makeSpan([o,n,a],"ML__mathlive").toMarkup()}(rs[i]||e,t),o=cs(i),n=Pe.forCommand(i);let r=s?'
    ':"";r+='',r+='
    '+a+"
    ",o&&(r+='
    '+o+"
    "),n&&(r+='
    '+n+"
    "),r+="
    ",hs(t,r+=s?'
    ':"");let l=t.popover.getElementsByClassName("ML__popover_content");l&&l.length>0&&t._attachButtonHandlers(l[0],["complete",{acceptSuggestion:!0}]),(l=t.popover.getElementsByClassName("ML__popover__prev-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"previousSuggestion"),(l=t.popover.getElementsByClassName("ML__popover__next-shortcut"))&&l.length>0&&t._attachButtonHandlers(l[0],"nextSuggestion")},showPopover:hs,hidePopover:ps,updatePopoverPosition:function t(e,s){if(e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&(e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",e.popover.style.top=t.y+5+"px")}else ps(e)}};function ms(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0],c=function(t,e,s){let i=0;for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,i[0][l]);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=ms(this,this.array[i][e],t);i1&&(s+=" "),s+=ms(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):(s+="."===this.leftDelim?"":this.leftDelim||"",this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=ms(this,this.body,t),s+=this.rightDelim&&"?"!==this.rightDelim&&"."!==this.rightDelim?this.rightDelim:"",this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${ms(this,this.shift,t)}em]`),s+=`{${ms(this,this.width,t)}em}{${ms(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${ms(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${ms(this,this.overscript||this.underscript,t)}}{${ms(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+ms(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+ms(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+this.body+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,this.padding||this.border||this.backgroundcolor){let e=ms(this,this.padding,t);this.border&&(e&&(e+=","),e+="border:"+ms(this,this.border,t)),this.backgroundcolor&&(e&&(e+=","),e+=ms(this,this.backgroundcolor,t)),s+=`[${e}]`}s+=`{${ms(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${ms(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ms(this,this.framecolor,t)}}`),this.backgroundcolor&&(s+=`{${ms(this,this.backgroundcolor,t)}}`),s+=`{${ms(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)this.notation.hasOwnProperty(e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+this.backgroundcolor+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+this.strokeColor+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${ms(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"sizing":s={size1:"\\tiny ",size2:"\\scriptsize ",size3:"\\footnotesize ",size4:"\\small ",size5:"\\normalsize ",size6:"\\large ",size7:"\\Large ",size8:"\\LARGE ",size9:"\\huge ",size10:"\\Huge "}[this.size]||"";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=ms(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=ms(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},us.merge=function(t,e){if(t&&e){const s=us._locale;us.locale=t,us.strings[t]={...us.strings[t],...e},us.locale=s}else if(t&&!e){e=t;for(const t of e)e.hasOwnProperty(t)&&us.merge(t,e[t])}},Object.defineProperty(us,"locale",{set(t){us._locale=t},get:()=>us._locale}),us.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Rückgängig machen"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le Presse-papiers","tooltip.redo":"Refaire","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const fs={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ys={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},gs={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let bs={};const xs={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ks(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=Ce.parseTokens(x.tokenize(t),"math",e,s.config.macros),a=ge.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=ot.makeSpan(a,"ML__base"),n=ot.makeSpan("","ML__strut");n.setStyle("height",o.height,"em");const r=ot.makeSpan("","ML__strut--bottom");return r.setStyle("height",o.height+o.depth,"em"),r.setStyle("vertical-align",-o.depth,"em"),ot.makeSpan([n,r,o],"ML__mathlive").toMarkup()}function vs(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},fs,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",""}function ws(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ys[n]&&(a.setAttribute("data-shifted",ys[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ys[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=bs[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function Ss(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e,n=(o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ")).match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}else;n=(o=o.replace(new RegExp(n[1]+n[2]+n[3]),a)).match(/()/)}return o}var As={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';gs["foreground-color"]=[];for(const t of ke.LINE_COLORS)gs["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});gs["background-color"]=[];for(const t of ke.AREA_COLORS)gs["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});bs={},bs=Object.assign({},gs);for(const t in bs)bs.hasOwnProperty(t)&&(bs[t]=bs[t].slice());const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),bs[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),bs[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];bs[e]||(bs[e]=[]),bs[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),bs[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),bs[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),bs[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),bs[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},xs,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},fs,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=vs(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=Ss(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,ws(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e/g,">")}function Ls(t,e){return t&&e.generateID?' extid="'+t+'"':""}function Ds(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,Fs(t)&&(n=t.index,t.index+=1),Es(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=Ps(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,Fs(t)){const e=Ps(t.atoms[n].superscript,0,0,s).mathML,i=Ps(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ps(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ps(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function Fs(t){return t.index"+t,a+=Ps(o.subscript,0,0,s).mathML,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ps(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ps(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function zs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].latex,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&Fs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ps(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function Is(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Rs(t.atoms[l],s),a+=Ps(t.atoms,l+1,c,s).mathML,a+=Rs(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,qs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Bs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ps(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=Rs(t.atoms[t.index],s);a+=e,t.index+=1,qs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,/^(.*)<\/mo>$/.test(e)?o="mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ps(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Rs(t,e){let s="";const i=function(t){if(!t)return"";if("string"==typeof t)return Ts(t);if(!Array.isArray(t)&&"string"==typeof t.body)return Ts(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return Ts(e)}(t.body);return i&&(s=""+i+""),s}ge.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",p={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";p&&(p=' mathvariant="'+p+'"');const d=this.latex?this.latex.trim():null;let m;switch(this.type){case"group":case"root":c=Ps(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(_s[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ps(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(_s[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ps(this.numer,0,0,t).mathML||" ",c+=Ps(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ps(this.numer,0,0,t).mathML+"",c+=""+Ps(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ps(this.body,0,0,t).mathML,c+=Ps(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ps(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(_s[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ps(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(_s[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(_s[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ps(this.body,0,0,t).mathML,c+=""+(_s[d]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ps(l,0,0,t).mathML,c+=Ps(n,0,0,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):r?(c+=""+Ps(l,t).mathML,c+=Ps(r,0,0,t).mathML,c+=""):n&&(c+=""+Ps(l,t).mathML,c+=Ps(n,0,0,t).mathML,c+="");break;case"mord":c=e[d]||d||("string"==typeof this.body?this.body:""),(m=d?d.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null)?c="&#x"+m[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.latex),c=""+Ts(c)+"";break;case"mbin":case"mrel":case"textord":case"minner":c=d&&e[d]?""+e[d]+"":d&&_s[d]?""+_s[d]+"":Rs(this,t);break;case"mpunct":c='"+(_s[d]||d)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===d?this.body:d||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ps(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ps(this.body,0,0,t).mathML+"";break;case"sizing":break;case"space":c+=" "}return c},ge.toMathML=function(t,e){return Ps(t,0,0,e).mathML};const Os={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ks={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ns={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},$s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ws(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Vs(t){return t&&$s[t]||-1}function Hs(t){return/=|=>/.test(t)?"right":"left"}function Us(t){if("f"===t||"g"===t)return!0;const e=Ns[t];return!!e&&!!/%[^01_^]?/.test(e)}function Gs(t){t=(t||"").trim();let e=Os[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=Nt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function js(t){if(!t)return null;const e=Gs(ti(t)),s=[Vs(e),Hs(e)];return s[0]<=0?null:s}function Zs(t){return null!==js(t)}const Xs={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ys={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Js={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Qs={",":"list",";":"list2"};function ti(t){if(Array.isArray(t)){let e="";for(const s of t)e+=ti(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=ti(s);return e}return""}function ei(t){return parseFloat(t.num)}function si(t){return"object"==typeof t&&void 0!==t.num}function ii(t){let e=0;return si(t)&&(e="object"==typeof t.num?void 0!==t.num.re?xi(t.num.re):0:parseFloat(t.num)),e}function ai(t){let e=0;return si(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?xi(t.num.im):0),e}function oi(t){return t&&void 0!==t.sup}function ni(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||ti(a)===s),i}function ri(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function li(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function ci(t){if(si(t)){const e=ii(t),s=ai(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return ri("negate",t)}function hi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function pi(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||((s=t.atoms[t.index+1])&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=bi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(ti(s.superscript))?(t.index+=1,(s=t.atoms[t.index+1])&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(ti(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=bi(s.superscript,e)):t.ast.sup=bi(s.superscript,e))):t.index+=1,t}function di(t,e){const s=t.ast;if(ui(t,"!!"))return t.index+=1,t.ast=ri("factorial2",s),t=di(t=pi(t,e),e);if(ui(t,"++"))return t.index+=1,t.ast=ri("increment",s),t=di(t=pi(t,e),e);if(ui(t,"--"))return t.index+=1,t.ast=ri("decrement",s),t=di(t=pi(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ys[i.latex.trim()]&&(t.ast=ri(Ys[i.latex.trim()],s),t=di(t=pi(t,e),e)),t}function mi(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"mclose"===o.type&&ti(o)===s&&(hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i));else if("textord"===o.type&&ti(o)===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"textord"===o.type&&ti(o)===s&&(t.index+=1,t=di(t=pi(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if((o=t.atoms[t.index+1])&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=yi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=di(t=pi(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,(o=(t=yi(t,i)).atoms[t.index])&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=di(t=pi(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=bi(o.body,i),hi(t)&&(t.ast={group:t.ast}),t=di(t=pi(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=Nt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=Nt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=Nt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=mi(t,e,s))return i&&(t.index+=1),t.ast={fn:Xs[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ui(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===ti(t.atoms[t.index])+ti(t.atoms[t.index+1])}function fi(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ni(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,ni(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ni(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function yi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];const a=Gs(ti(i));if(fi(e))e.ast=ri(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=ci(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=ri("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>gi(t)))),e=[t])}return e}function bi(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=yi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?ri("text",...s):s[0]||void 0}({atoms:gi(t)},e)}function xi(t){return parseFloat(parseFloat(t).toPrecision(15))}ge.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},n="",r={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],l="";"b"===this.fontSeries&&(l+="bold"),"it"===this.fontShape&&(l+="italic");const c=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/))?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=Ce.parseTokens(x.tokenize(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=Ce.parseTokens(x.tokenize(i),"math",null,t.macros),o=ri("divide",bi(s,t),bi(i,t))):o.fn="divide":o.group=bi(this.body,t);break;case"genfrac":o=ri("divide",bi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?li(1):bi(this.denom,t));break;case"surd":o=this.index?ri("pow",bi(this.body,t),ri("divide",1,bi(this.index,t))):ri("sqrt",bi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":(e=c?c.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0)?n=String.fromCodePoint(parseInt(e[1],16)):(n=Gs(ti(this))).length>0&&"\\"===n.charAt(0)&&"string"==typeof this.body&&(n=this.body),(a=Nt.mathVariantToUnicode(n,r,l).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))!==n?(o={sym:a},r="normal"):o={sym:n};break;case"minner":case"mop":break;case"box":o=bi(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=ri("card",bi(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>bi(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(bi(e[0],t));let i=bi(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"sizing":case"mathstyle":break;default:o=void 0}return o&&r&&"normal"!==r&&(o.variant=r),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},ge.toAST=function(t,e){return bi(t,e)};const ki={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket '};function vi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function wi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}ge.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1;for(let o=0;o'+o+'. End fraction.';break;case"surd":if(n=ge.toSpeakableFragment(t.body,e),t.index){let s=ge.toSpeakableFragment(t.index,e);const a=(s=s.trim()).replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else vi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=ki[t.leftDelim]||t.leftDelim,i+=ge.toSpeakableFragment(t.body,e),i+=ki[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=ge.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=ki[a]||(o?ki[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=ds.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=ge.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the summation from '+(s=s.trim())+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=ge.toSpeakableFragment(t.superscript,e);s=s.trim();let a=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(a=a.trim())+' to '+s+' of ',r=!0}else if(t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);i+=' the product from '+(s=s.trim())+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=ge.toSpeakableFragment(t.superscript,e);a=a.trim();let o=ge.toSpeakableFragment(t.subscript,e);i+=' the integral from '+s(o=o.trim())+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){const e=ki[t.body]||ki[t.latex.trim()];i+=e||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=ge.toSpeakableFragment(t.body,e),vi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=ge.toSpeakableFragment(t.superscript,e);const a=(s=s.trim()).replace(/<[^>]*>/g,"");if(vi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=ge.toSpeakableFragment(t.subscript,e);s=s.trim(),vi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},ge.toSpeakableText=function(t,e){if(e||(e={textToSpeechMarkup:"",textToSpeechRules:"mathlive"}),e.speechMode="math",window.sre&&"sre"===e.textToSpeechRules){e.generateID=!0;const s=ge.toMathML(t,e);return s?(e.textToSpeechMarkup&&(e.textToSpeechRulesOptions=e.textToSpeechRulesOptions||{},e.textToSpeechRulesOptions.markup=e.textToSpeechMarkup,"ssml"===e.textToSpeechRulesOptions.markup&&(e.textToSpeechRulesOptions.markup="ssml_step"),e.textToSpeechRulesOptions.rate=e.speechEngineRate),e.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(e.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(s)):""}let s=ge.toSpeakableFragment(t,e);if("ssml"===e.textToSpeechMarkup){let t="";e.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===e.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};function Si(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function Ai(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function Mi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):((s=document.createElement("div")).setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function Ci(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function _i(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=Mi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=Mi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,Si(window,"focus",this),Si(window,"blur",this),Si(this.element,"focus",this),Si(this.element,"blur",this),Si(this.textarea,"cut",this),Si(this.textarea,"copy",this),Si(this.textarea,"paste",this),os.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this)}),Si(this.element,"touchstart:active mousedown",this),Si(window,"resize",this);const o={...e};o.onSelectionDidChange=_i.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=_i.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.smartFence=this.config.smartFence,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new ts.EditableMathlist(o,this),this.undoManager=new ns.UndoManager(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}let Ti,Li;_i.prototype.handleEvent=function(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}},_i.prototype.revertToOriginalContent=_i.prototype.$revertToOriginalContent=function(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,Ai(this.textarea,"cut",this),Ai(this.textarea,"copy",this),Ai(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,Ci(this.popover),Ci(this.keystrokeCaption),Ci(this.virtualKeyboard),Ci(document.getElementById("mathlive-alternate-keys-panel")),Ai(this.element,"touchstart:active mousedown",this),Ai(this.element,"focus",this),Ai(this.element,"blur",this),Ai(window,"resize",this),Ai(window,"focus",this),Ai(window,"blur",this)},_i.prototype._resetKeystrokeBuffer=function(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)},_i.prototype._getCaretPosition=function(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach(function(e){s=s||t(e)}),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right+window.scrollX,y:e.bottom+window.scrollY}}return null},_i.prototype._pathFromPoint=function(t,e,s){let i;(s=s||{}).bias=s.bias||0;const a=function t(e,s,i){let a={element:null},o=!0;if(e.getAttribute("data-atom-id")){a.element=e;const t=e.getBoundingClientRect(),n=Math.max(t.left-s,s-t.right),r=Math.max(t.top-i,i-t.bottom);a.distance=n*n+r*r,o=s>=t.left&&s<=t.right}else a.distance=Number.POSITIVE_INFINITY;return o&&e.children&&Array.from(e.children).forEach(function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)}),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter(function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o});if(e&&e.length>0)if(i=Le.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tvoid 0)),t._resetKeystrokeBuffer()):"delete"===e?a=Fi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Fi(t,"",t.mathlist.sibling(0)):"line"===e?(a=Fi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+ge.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Fi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}_i.prototype._onPointerDown=function(t){let e;const s=this;let i=!1,a=!1,o=!1;function n(t){Ai(s.field,"touchmove",r),Ai(s.field,"touchend touchleave",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,t.preventDefault(),t.stopPropagation()}function r(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;if(Date.now()=p.left&&l<=p.right&&c>=p.top&&c<=p.bottom){if(this.hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,t.buttons&&1!==t.buttons)return;(e=this._pathFromPoint(l,c,{bias:0}))&&(t.shiftKey?(this.mathlist.setRange(this.mathlist.path,e),(e=Le.clone(this.mathlist.path))[e.length-1].offset-=1):this.mathlist.setPath(e,0),o=!0,3===t.detail||Di>2?(Ai(this.field,"touchmove",r),Ai(this.field,"touchend",n),Ai(window,"mousemove",r),Ai(window,"mouseup blur",n),i=!1,3!==t.detail&&3!==Di||this.mathlist.selectAll_()):i||(i=!0,Si(window,"blur",n),t.touches?(Si(t.target,"touchmove",r),Si(t.target,"touchend",n)):(Si(window,"mousemove",r),Si(window,"mouseup",n)),2!==t.detail&&2!==Di||(a=!0,this.mathlist.selectGroup_())))}else Ti=null;o&&this._render(),t.preventDefault()},_i.prototype._onSelectionDidChange=function(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}this.style={},ds.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)},_i.prototype._onContentDidChange=function(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)},_i.prototype._nextAtomSpeechText=function(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Fi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Fi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o},_i.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)},_i.prototype._onFocus=function(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),ds.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._render())},_i.prototype._onBlur=function(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),ds.updatePopoverPosition(this),this._render(),this.config.onBlur&&this.config.onBlur(this))},_i.prototype._onResize=function(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),ds.updatePopoverPosition(this)},_i.prototype.toggleKeystrokeCaption_=function(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")},_i.prototype._showKeystroke=function(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(Pe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout(function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")},3e3)}},_i.prototype.perform=_i.prototype.$perform=function(t){if(!t)return!1;let e,s=!1,i=[],a=!1;return Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]?(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),a=!0,s=!0):"function"==typeof this[e]&&(a=this[e](...i),s=!0),this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||this._resetKeystrokeBuffer(),a&&this._render(),s},_i.prototype.performWithFeedback_=function(t){return this.focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)):("deletePreviousChar"===t||"deleteNextChar"===t||"deletePreviousWord"===t||"deleteNextWord"===t||"deleteToGroupStart"===t||"deleteToGroupEnd"===t||"deleteToMathFieldStart"===t||"deleteToMathFieldEnd"===t)&&this.deleteKeypressSound?(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>void 0)):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0)),this.perform(t)},_i.prototype.convertLastAtomsToText_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"math"!==a.mode||!/mord|textord|mpunct/.test(a.type)||a.superscript||a.subscript||e&&!e(a))||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()},_i.prototype.convertLastAtomsToMath_=function(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);(i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a))||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()},_i.prototype.removeIsolatedSpace_=function(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}},_i.prototype.getTextBeforeAnchor_=function(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);(s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))))||(t=i.body+t),e-=1}return t},_i.prototype.smartMode_=function(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(this.mathlist.isCollapsed()){const e=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[\/^_\\]/.test(s))return!0;const i={")":"(","}":"{","]":"["}[s];if(i&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===i)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(e))return!1;if(/(^|[^a-zA-Z])[a-zA-Z][ ]$/.test(e))return this.convertLastAtomsToMath_(1),!1;if(/\.\S$/.test(e)){const t=this.mathlist.sibling(0);return t.body="⋅",t.fontFamily="cmr",t.latex="\\cdot",t.mode="math",t.type="mord",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/\.[0-9]$/.test(e))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(e))return this.convertLastAtomsToMath_(1),this.removeIsolatedSpace_(),!0;if(/[(][a-z][,;]$/.test(e))return this.convertLastAtomsToMath_(2),this.removeIsolatedSpace_(),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(e)&&!/dxd$/.test(e))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(e))return this.convertLastAtomsToText_(1),!0;if(/\?|\./.test(s))return!0}}return!1},_i.prototype._onKeystroke=function(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=os.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=Pe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const n=this.mathlist.parent();if("moveAfterParent"===a&&n&&"leftright"===n.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.mathlist._insertSmartFence(".")&&(a="",this._render()),"math"===this.mode&&"Spacebar"===t){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(os.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist._insertSmartFence(s,a)||this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a}),this.removeIsolatedSpace_(),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._render(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1},_i.prototype._onTypedText=function(t,e){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>void 0))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=os.charToEvent(e);if(!this.$keystroke(os.keyboardEventToString(s),s))return}let s="",i=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},a=y.splitGraphemes(t);for(const t of a)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),a=Nt.suggest(e+t);i=a.length>1,0===a.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),ds.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),a[0].match!==e+t&&this.mathlist.insertSuggestion(a[0].match,-a[0].match.length+e.length+1),s=a[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist._insertSmartFence(t,e)||this.mathlist.insert(t,{mode:"math",style:e})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._render(),ds.showPopoverWithLatex(this,s,i)},_i.prototype._hash=function(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;s{t.caret="",t.isSelected=!1});const e=this.hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const s=ge.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=ot.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=ot.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=ot.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=ot.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+ge.toMathML(this.mathlist.root,this.config)+"";const r=this.field.querySelectorAll(".ML__selected");if(r&&r.length>0){const t={top:1/0,bottom:-1/0,left:1/0,right:-1/0};r.forEach(e=>{if(e.classList.contains("ML__selected")){const s=e.getBoundingClientRect();s.leftt.right&&(t.right=s.right),s.bottom>t.bottom&&(t.bottom=s.bottom),s.top0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&Ms[a]?Ms[a]:a&&Cs[a]?Cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=Cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?e.body:e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":case"sizing":break;case"space":i=" "}if(e.subscript){i+="_";const a=t(e.subscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}if(e.superscript){i+="^";const a=t(e.superscript,s);a.length>1&&!/^(-)?\d+(\.\d*)?$/.test(a)?i+="("+a+")":i+=a}return i}(t,this.config));return s},_i.prototype.text=_i.prototype.$text=function(t){return this.formatMathlist(this.mathlist.root,t)},_i.prototype.selectedText=_i.prototype.$selectedText=function(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=ge.makeRoot(e[0].mode,e);return this.formatMathlist(s,t)},_i.prototype.selectionIsCollapsed=_i.prototype.$selectionIsCollapsed=function(){return this.mathlist.isCollapsed()},_i.prototype.selectionDepth=_i.prototype.$selectionDepth=function(){return this.mathlist.path.length},_i.prototype._superscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype._subscriptDepth=function(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0},_i.prototype.selectionAtStart=_i.prototype.$selectionAtStart=function(){return 0===this.mathlist.startOffset()},_i.prototype.selectionAtEnd=_i.prototype.$selectionAtEnd=function(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.groupIsSelected=function(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1},_i.prototype.latex=_i.prototype.$latex=function(t,e){if(t){return t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._render()),t}return this.mathlist.root.toLatex()},_i.prototype.el=_i.prototype.$el=function(){return this.element},_i.prototype.undo_=_i.prototype.undo=function(){return this.complete_(),this.undoManager.undo(this.config),!0},_i.prototype.redo_=_i.prototype.redo=function(){return this.complete_(),this.undoManager.redo(this.config),!0},_i.prototype.scrollIntoView_=_i.prototype.scrollIntoView=function(){return!1},_i.prototype.scrollToStart_=_i.prototype.scrollToStart=function(){return!0},_i.prototype.scrollToEnd_=_i.prototype.scrollToEnd=function(){return!0},_i.prototype.enterCommandMode_=function(){this.switchMode_("command")},_i.prototype.copyToClipboard_=function(){return this.focus(),this.mathlist.isCollapsed()&&this.select(),document.execCommand("copy"),!1},_i.prototype.cutToClipboard_=function(){return this.focus(),document.execCommand("cut"),!0},_i.prototype.pasteFromClipboard_=function(){return this.focus(),document.execCommand("paste"),!0},_i.prototype.insert_=_i.prototype.insert=_i.prototype.$insert=function(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.style.fontFamily||(this.style.fontFamily="math"),this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),!0}return!1},_i.prototype.switchMode_=function(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=!0,e&&this.insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),ds.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._render()},_i.prototype.complete_=function(t){if(t=t||{},ds.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(Nt.commandAllowed(t,e)){const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=Ce.parseTokens(x.tokenize(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1},_i.prototype._updateSuggestion=function(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);if(0===e.length)ds.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),ds.showPopoverWithLatex(this,e[s].match,e.length>1)}this._render()},_i.prototype.nextSuggestion_=function(){return this.suggestionIndex+=1,this._updateSuggestion(),!1},_i.prototype.previousSuggestion_=function(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=Nt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1},_i.prototype._attachButtonHandlers=function(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),Si(t,"mousedown touchstart:passive",function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout(function(){t.classList.contains("pressed")&&s.perform(JSON.parse(l))},300))}}),Si(t,"mouseleave touchcancel",function(){t.classList.remove("pressed")}),Si(t,"touchmove:passive",function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,As.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1},_i.prototype.hideAlternateKeys_=function(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",Ci(t)),!1},_i.prototype.performAlternateKeys_=function(t){return this.hideAlternateKeys_(),this.perform(t)},_i.prototype.switchKeyboardLayer_=function(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){const i=[];for(let t=1;t<=s;t++)i.push(e[t]);t=ge.toSpeakableText(i,this.config)}return this._speak(t),!1},_i.prototype.speakGroup_=function(){return this._speak(ge.toSpeakableText(this.mathlist.siblings(),this.config)),!1},_i.prototype.speakAll_=function(){return this._speak(ge.toSpeakableText(this.mathlist.root,this.config)),!1},_i.prototype.speakAllWithSynchronizedHighlighting_=function(){window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0});const t=this.config;t.textToSpeechMarkup=window.sre&&"sre"===t.textToSpeechRules?"ssml_step":"ssml";const e=ge.toSpeakableText(this.mathlist.root,t);return this._speakWithSynchronizedHighlighting(e),!1};var qi={MathField:_i};function zi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(-1===(r=n.indexOf(e,c))){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(-1===(r=zi(s,n,c+e.length))){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Ri(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))(s=document.createDocumentFragment()).appendChild(Pi(t,void 0,e,!0));else{const i=Bi(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;tvoid 0)}})}else;else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Hi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}})}})}function Ui(t){let e=t;if("string"==typeof t&&!(e=document.getElementById(t)))throw Error(`The element with ID "${t}" could not be found.`);return e}function Gi(t,e){Ki&&((e=e||{}).renderToMarkup=e.renderToMarkup||Ni,e.renderToMathML=e.renderToMathML||$i,e.renderToSpeakableText=e.renderToSpeakableText||Wi,e.macros=e.macros||Nt.MACROS,Ki.renderMathInElement(Ui(t),e))}function ji(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}export default{latexToMarkup:Ni,latexToMathML:$i,latexToSpeakableText:Wi,latexToAST:function(t,e){if(!ge.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,Nt.MACROS);const s=Ce.parseTokens(x.tokenize(t),"math",null,e.macros);return ge.toAST(s,e)},makeMathField:function(t,e){if(!qi)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Vi,e.handleReadAloud=e.handleReadAloud||Hi,new qi.MathField(Ui(t),e)},renderMathInDocument:function(t){Gi(document.body,t)},renderMathInElement:Gi,revertToOriginalContent:function(t,e){(t=(t=Ui(t)).children[1])instanceof qi.MathField?t.revertToOriginalContent():(ji(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Ui(t)).children[1])instanceof qi.MathField?t.originalContent:(ji(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Hi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e)': 'gt', '<=': 'le', @@ -159,6 +161,7 @@ const FUNCTION_TEMPLATE = { 'approx': '%0 \\approx %1', 'congruent': '%0 \\cong %1', 'similar': '%0 \\sim %1', + 'equiv': '%0 \\equiv %1', 'assign': '%0 := %1', 'lt': '%0 < %1', 'gt': '%0 > %1', @@ -326,6 +329,7 @@ const OP_PRECEDENCE = { // Relational 'congruent': 265, + 'equiv': 260, // MathML: "identical to" '=': 260, '!=': 255, '?=': 255, @@ -1685,9 +1689,34 @@ MathAtom.MathAtom.prototype.toAST = function(options) { case 'array': if (this.env.name === 'cardinality') { result = wrapFn('card', parse(this.array, options)); - } else if (/matrix|pmatrix|bmatrix/.test(this.env.name)) { - - result = wrapFn('array', parse(this.array, options)); + + } else if (/array|matrix|pmatrix|bmatrix/.test(this.env.name)) { + result = { fn: 'array', args: [] }; + for (const row of this.array) { + result.args.push(row.map(cell => parse(cell, options))); + } + + } else if (this.env.name === 'cases') { + result = { fn: 'cases', args: [] }; + for (const row of this.array) { + if (row[0]) { + const statement = []; + statement.push(parse(row[0], options)); + let condition = parse(row[1], options); + if (condition) { + if (condition.fn === 'text' && condition.arg) { + if (/^(if|when|for)$/i.test(condition.arg[0].trim() )) { + condition = condition.arg.filter( + x => typeof x !== 'string') +; + } + } + } + + statement.push(condition || {}); + result.args.push(statement); + } + } } break; @@ -1751,7 +1780,8 @@ function filterPresentationAtoms(atoms) { atoms.numer = filterPresentationAtoms(atoms.numer); } if (atoms.array && Array.isArray(atoms.array)) { - atoms.array = filterPresentationAtoms(atoms.array); + atoms.array = atoms.array.map(row => row.map(cell => + filterPresentationAtoms(cell))); } result = [atoms]; } @@ -1780,7 +1810,7 @@ function parseSentence(expr, options) { text += expr.atoms[expr.index].body; expr.index += 1; } - zones.push(wrapFn('text', text)); + zones.push(text); } else { const z = parseExpression(expr, options).ast; // Something went wrong in parsing the expression... @@ -1790,7 +1820,7 @@ function parseSentence(expr, options) { } if (zones.length > 1) { - return wrapFn('list0', zones); + return wrapFn('text', ...zones); } return zones[0] || undefined; diff --git a/dist/src/editor/editor-editableMathlist.js b/dist/src/editor/editor-editableMathlist.js index 36fa13f35..667850d83 100644 --- a/dist/src/editor/editor-editableMathlist.js +++ b/dist/src/editor/editor-editableMathlist.js @@ -1565,7 +1565,7 @@ EditableMathlist.prototype.up = function(options) { // In an array let colRow = arrayColRow(this.parent().array, relation); colRow = arrayAdjustRow(this.parent().array, colRow, -1); - if (colRow) { + if (colRow && arrayCell(colRow)) { this.path[this.path.length - 1].relation = 'cell' + arrayIndex(this.parent().array, colRow); this.setSelection(this.anchorOffset()); @@ -1602,7 +1602,7 @@ EditableMathlist.prototype.down = function(options) { // In an array let colRow = arrayColRow(this.parent().array, relation); colRow = arrayAdjustRow(this.parent().array, colRow, +1); - if (colRow) { + if (colRow && arrayCell(colRow)) { this.path[this.path.length - 1].relation = 'cell' + arrayIndex(this.parent().array, colRow); this.setSelection(this.anchorOffset()); diff --git a/dist/src/editor/editor-shortcuts.js b/dist/src/editor/editor-shortcuts.js index 707f473f7..8ed8d0ad6 100644 --- a/dist/src/editor/editor-shortcuts.js +++ b/dist/src/editor/editor-shortcuts.js @@ -660,6 +660,7 @@ function validateShortcut(siblings, shortcut) { array = sibling.array; openfence = sibling.type === 'mopen'; closefence = sibling.type === 'mclose' || sibling.type === 'leftright'; + space = sibling.type === 'space'; } if (typeof shortcut === 'object') { diff --git a/src/addons/maston.js b/src/addons/maston.js index 0c6e093b7..13aa69c51 100644 --- a/src/addons/maston.js +++ b/src/addons/maston.js @@ -44,6 +44,7 @@ const CANONICAL_NAMES = { '\\approx': 'approx', '\\cong': 'congruent', '\\sim': 'similar', + '\\equiv': 'equiv', '\\pm': 'plusminus', // PLUS-MINUS SIGN '\\land': 'and', @@ -137,6 +138,7 @@ const OP_NAME = { 'approx': 'approx', 'congruent': 'congruent', 'similar': 'similar', + 'equiv': 'equiv', '<': 'lt', '>': 'gt', '<=': 'le', @@ -159,6 +161,7 @@ const FUNCTION_TEMPLATE = { 'approx': '%0 \\approx %1', 'congruent': '%0 \\cong %1', 'similar': '%0 \\sim %1', + 'equiv': '%0 \\equiv %1', 'assign': '%0 := %1', 'lt': '%0 < %1', 'gt': '%0 > %1', @@ -326,6 +329,7 @@ const OP_PRECEDENCE = { // Relational 'congruent': 265, + 'equiv': 260, // MathML: "identical to" '=': 260, '!=': 255, '?=': 255, @@ -1685,9 +1689,34 @@ MathAtom.MathAtom.prototype.toAST = function(options) { case 'array': if (this.env.name === 'cardinality') { result = wrapFn('card', parse(this.array, options)); - } else if (/matrix|pmatrix|bmatrix/.test(this.env.name)) { - - result = wrapFn('array', parse(this.array, options)); + + } else if (/array|matrix|pmatrix|bmatrix/.test(this.env.name)) { + result = { fn: 'array', args: [] }; + for (const row of this.array) { + result.args.push(row.map(cell => parse(cell, options))); + } + + } else if (this.env.name === 'cases') { + result = { fn: 'cases', args: [] }; + for (const row of this.array) { + if (row[0]) { + const statement = []; + statement.push(parse(row[0], options)); + let condition = parse(row[1], options); + if (condition) { + if (condition.fn === 'text' && condition.arg) { + if (/^(if|when|for)$/i.test(condition.arg[0].trim() )) { + condition = condition.arg.filter( + x => typeof x !== 'string') +; + } + } + } + + statement.push(condition || {}); + result.args.push(statement); + } + } } break; @@ -1751,7 +1780,8 @@ function filterPresentationAtoms(atoms) { atoms.numer = filterPresentationAtoms(atoms.numer); } if (atoms.array && Array.isArray(atoms.array)) { - atoms.array = filterPresentationAtoms(atoms.array); + atoms.array = atoms.array.map(row => row.map(cell => + filterPresentationAtoms(cell))); } result = [atoms]; } @@ -1780,7 +1810,7 @@ function parseSentence(expr, options) { text += expr.atoms[expr.index].body; expr.index += 1; } - zones.push(wrapFn('text', text)); + zones.push(text); } else { const z = parseExpression(expr, options).ast; // Something went wrong in parsing the expression... @@ -1790,7 +1820,7 @@ function parseSentence(expr, options) { } if (zones.length > 1) { - return wrapFn('list0', zones); + return wrapFn('text', ...zones); } return zones[0] || undefined; diff --git a/src/editor/editor-editableMathlist.js b/src/editor/editor-editableMathlist.js index 36fa13f35..667850d83 100644 --- a/src/editor/editor-editableMathlist.js +++ b/src/editor/editor-editableMathlist.js @@ -1565,7 +1565,7 @@ EditableMathlist.prototype.up = function(options) { // In an array let colRow = arrayColRow(this.parent().array, relation); colRow = arrayAdjustRow(this.parent().array, colRow, -1); - if (colRow) { + if (colRow && arrayCell(colRow)) { this.path[this.path.length - 1].relation = 'cell' + arrayIndex(this.parent().array, colRow); this.setSelection(this.anchorOffset()); @@ -1602,7 +1602,7 @@ EditableMathlist.prototype.down = function(options) { // In an array let colRow = arrayColRow(this.parent().array, relation); colRow = arrayAdjustRow(this.parent().array, colRow, +1); - if (colRow) { + if (colRow && arrayCell(colRow)) { this.path[this.path.length - 1].relation = 'cell' + arrayIndex(this.parent().array, colRow); this.setSelection(this.anchorOffset()); diff --git a/src/editor/editor-shortcuts.js b/src/editor/editor-shortcuts.js index 707f473f7..8ed8d0ad6 100644 --- a/src/editor/editor-shortcuts.js +++ b/src/editor/editor-shortcuts.js @@ -660,6 +660,7 @@ function validateShortcut(siblings, shortcut) { array = sibling.array; openfence = sibling.type === 'mopen'; closefence = sibling.type === 'mclose' || sibling.type === 'leftright'; + space = sibling.type === 'space'; } if (typeof shortcut === 'object') {