diff --git a/.yarn/cache/@cortex-js-compute-engine-npm-0.22.0-390edd789b-1ccc95b86b.zip b/.yarn/cache/@cortex-js-compute-engine-npm-0.22.0-390edd789b-1ccc95b86b.zip new file mode 100644 index 0000000000..7866551d45 Binary files /dev/null and b/.yarn/cache/@cortex-js-compute-engine-npm-0.22.0-390edd789b-1ccc95b86b.zip differ diff --git a/.yarn/cache/@types-canvas-confetti-npm-1.6.4-270404d6fb-0452e1f381.zip b/.yarn/cache/@types-canvas-confetti-npm-1.6.4-270404d6fb-0452e1f381.zip new file mode 100644 index 0000000000..d5f55307c6 Binary files /dev/null and b/.yarn/cache/@types-canvas-confetti-npm-1.6.4-270404d6fb-0452e1f381.zip differ diff --git a/.yarn/cache/canvas-confetti-npm-1.9.2-cf1b7e3f3e-e85fc0bbcd.zip b/.yarn/cache/canvas-confetti-npm-1.9.2-cf1b7e3f3e-e85fc0bbcd.zip new file mode 100644 index 0000000000..112bcc5b91 Binary files /dev/null and b/.yarn/cache/canvas-confetti-npm-1.9.2-cf1b7e3f3e-e85fc0bbcd.zip differ diff --git a/.yarn/cache/complex.js-npm-2.1.1-2beaccef20-a0802cc3f0.zip b/.yarn/cache/complex.js-npm-2.1.1-2beaccef20-a0802cc3f0.zip new file mode 100644 index 0000000000..20bd81fe4e Binary files /dev/null and b/.yarn/cache/complex.js-npm-2.1.1-2beaccef20-a0802cc3f0.zip differ diff --git a/.yarn/cache/decimal.js-npm-10.4.3-e7d483387c-796404dcfa.zip b/.yarn/cache/decimal.js-npm-10.4.3-e7d483387c-796404dcfa.zip new file mode 100644 index 0000000000..62560bef0f Binary files /dev/null and b/.yarn/cache/decimal.js-npm-10.4.3-e7d483387c-796404dcfa.zip differ diff --git a/.yarn/cache/mathlive-npm-0.97.4-93c4deaf4a-268a4e4102.zip b/.yarn/cache/mathlive-npm-0.97.4-93c4deaf4a-268a4e4102.zip new file mode 100644 index 0000000000..a9494b41ad Binary files /dev/null and b/.yarn/cache/mathlive-npm-0.97.4-93c4deaf4a-268a4e4102.zip differ diff --git a/package.json b/package.json index 8991bb216b..39778393bd 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "test": "jest" }, "dependencies": { + "@cortex-js/compute-engine": "^0.22.0", "@fortawesome/fontawesome-svg-core": "6.4.2", "@fortawesome/free-brands-svg-icons": "6.4.2", "@fortawesome/free-regular-svg-icons": "6.4.2", @@ -51,6 +52,7 @@ "algebra.js": "^0.2.6", "array-move": "^4.0.0", "autoprefixer": "^10.4.16", + "canvas-confetti": "^1.9.2", "clsx": "^2.0.0", "fast-xml-parser": "^4.3.2", "fp-ts": "^2.16.1", @@ -64,6 +66,7 @@ "js-cookie": "^3.0.5", "json-diff": "^1.0.6", "katex": "^0.16.9", + "mathlive": "^0.97.4", "next": "^13.5.4", "next-query-params": "^4.2.3", "nprogress": "^0.2.0", @@ -111,6 +114,7 @@ "@svgr/webpack": "^8.1.0", "@tailwindcss/typography": "^0.5.10", "@types/algebra.js": "^0.2.2", + "@types/canvas-confetti": "^1.6.4", "@types/escape-html": "^1.0.2", "@types/iframe-resizer": "^3.5.10", "@types/jest": "^29.5.5", diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b8f26ddd40..61abc3d638 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -79,3 +79,15 @@ model QuickbarStats { @@index([timestamp]) } + +model EquationsAppStats { + id Int @id @default(autoincrement()) + + event String @db.VarChar(255) + latex String @db.VarChar(255) + + sessionId String @db.VarChar(64) + timestamp DateTime @default(now()) + + @@index([timestamp]) +} \ No newline at end of file diff --git a/public/_assets/mathlive/fonts/KaTeX_AMS-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 0000000000..0acaaff03d Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Bold.woff2 b/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 0000000000..f390922ece Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 0000000000..75344a1f98 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Fraktur-Bold.woff2 b/public/_assets/mathlive/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 0000000000..395f28beac Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Fraktur-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 0000000000..735f6948d6 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Main-Bold.woff2 b/public/_assets/mathlive/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 0000000000..ab2ad21da6 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Main-BoldItalic.woff2 b/public/_assets/mathlive/fonts/KaTeX_Main-BoldItalic.woff2 new file mode 100644 index 0000000000..5931794de4 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Main-BoldItalic.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Main-Italic.woff2 b/public/_assets/mathlive/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 0000000000..b50920e138 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Main-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 0000000000..eb24a7ba28 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Math-BoldItalic.woff2 b/public/_assets/mathlive/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 0000000000..29657023ad Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Math-Italic.woff2 b/public/_assets/mathlive/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 0000000000..215c143fd7 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_SansSerif-Bold.woff2 b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 0000000000..cfaa3bda59 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_SansSerif-Italic.woff2 b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 0000000000..349c06dc60 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_SansSerif-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 0000000000..a90eea85f6 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Script-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 0000000000..b3048fc115 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Size1-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 0000000000..c5a8462fbf Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Size2-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 0000000000..e1bccfe240 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Size3-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 0000000000..249a286622 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Size4-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 0000000000..680c130850 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/public/_assets/mathlive/fonts/KaTeX_Typewriter-Regular.woff2 b/public/_assets/mathlive/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 0000000000..771f1af705 Binary files /dev/null and b/public/_assets/mathlive/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/public/_assets/mathlive/mathlive.min.js b/public/_assets/mathlive/mathlive.min.js new file mode 100644 index 0000000000..858ad62496 --- /dev/null +++ b/public/_assets/mathlive/mathlive.min.js @@ -0,0 +1,2943 @@ +/** MathLive 0.97.2 */ + (function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathLive = {}));})(this, (function (exports) { 'use strict'; +var MathLive=(()=>{var no=Object.defineProperty,yp=Object.defineProperties,bp=Object.getOwnPropertyDescriptor,xp=Object.getOwnPropertyDescriptors,vp=Object.getOwnPropertyNames,io=Object.getOwnPropertySymbols;var Ya=Object.prototype.hasOwnProperty,rc=Object.prototype.propertyIsEnumerable;var tc=(t,e,r)=>e in t?no(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,p=(t,e)=>{for(var r in e||(e={}))Ya.call(e,r)&&tc(t,r,e[r]);if(io)for(var r of io(e))rc.call(e,r)&&tc(t,r,e[r]);return t},g=(t,e)=>yp(t,xp(e));var Qa=t=>typeof t=="symbol"?t:t+"",si=(t,e)=>{var r={};for(var i in t)Ya.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&io)for(var i of io(t))e.indexOf(i)<0&&rc.call(t,i)&&(r[i]=t[i]);return r};var wp=(t,e)=>{for(var r in e)no(t,r,{get:e[r],enumerable:!0})},kp=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vp(e))!Ya.call(t,n)&&n!==r&&no(t,n,{get:()=>e[n],enumerable:!(i=bp(e,n))||i.enumerable});return t};var Mp=t=>kp(no({},"__esModule",{value:!0}),t);var Ig={};wp(Ig,{MathfieldElement:()=>ai,autoRenderMathInElement:()=>ec,convertAsciiMathToLatex:()=>dg,convertLatexToAsciiMath:()=>ug,convertLatexToMarkup:()=>re,convertLatexToMathMl:()=>Jl,convertLatexToSpeakableText:()=>Gl,convertMathJsonToLatex:()=>Xl,globalMathLive:()=>lt,makeSharedVirtualKeyboard:()=>Bg,renderMathInDocument:()=>Pg,renderMathInElement:()=>fp,validateLatex:()=>cg,version:()=>zg});function ee(t){return Array.isArray(t)}var ic={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.alphabetic":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.cut to clipboard":"Cut to Clipboard","tooltip.paste from clipboard":"Paste from Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.menu":"Menu","tooltip.undo":"Undo","menu.insert matrix":"Insert Matrix","menu.insert vector":"Insert Vector","menu.insert table":"Insert Table","submenu.array.matrix delimiters":"Matrix Delimiters","menu.array.add row above":"Add Row Before","menu.array.add row below":"Add Row After","menu.array.add column after":"Add Column After","menu.array.add column before":"Add Column Before","menu.array.delete row":"Delete Row","menu.array.delete rows":"Delete Selected Rows","menu.array.delete column":"Delete Column","menu.array.delete columns":"Delete Selected Columns","submenu.array.insert separator":"Insert Separator","submenu.table style":"Table Style"},ar:{"keyboard.tooltip.functions":"\u0645\u0647\u0627\u0645","keyboard.tooltip.symbols":"\u062D\u0631\u0641 \u0627\u0648 \u0631\u0645\u0632","keyboard.tooltip.greek":"\u062D\u0631\u0648\u0641 \u064A\u0648\u0646\u0627\u0646\u064A\u0629","keyboard.tooltip.command":"\u062D\u0627\u0644\u0629 \u062A\u0644\u0642\u064A \u0627\u0644\u0623\u0648\u0627\u0645\u0631 \u0627\u0644\u0644\u0627\u062A\u0643","keyboard.tooltip.numeric":"\u0627\u0644\u0631\u0642\u0645\u064A\u0629","keyboard.tooltip.alphabetic":"\u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u062D\u0631\u0641 \u0627\u0644\u0631\u0648\u0645\u0627\u0646\u064A\u0629","tooltip.copy to clipboard":"\u0646\u0633\u062E \u0625\u0644\u0649 \u0627\u0644\u062D\u0627\u0641\u0638\u0629","tooltip.cut to clipboard":"\u0642\u0635 \u0625\u0644\u0649 \u0627\u0644\u062D\u0627\u0641\u0638\u0629","tooltip.paste from clipboard":"\u0644\u0635\u0642 \u0645\u0646 \u0627\u0644\u062D\u0627\u0641\u0638\u0629","tooltip.redo":"\u0627\u0644\u0625\u0639\u0627\u062F\u0629","tooltip.toggle virtual keyboard":"\u062A\u0628\u062F\u064A\u0644 \u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0641\u0627\u062A\u064A\u062D \u0627\u0644\u0625\u0641\u062A\u0631\u0627\u0636\u064A\u0629","tooltip.undo":"\u0625\u0644\u063A\u0627\u0621","menu.insert matrix":"\u0623\u062F\u062E\u0644 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629","menu.insert vector":"\u0623\u062F\u062E\u0644 \u0645\u062A\u062C\u0647","menu.insert table":"\u0625\u062F\u0631\u0627\u062C \u062C\u062F\u0648\u0644","submenu.array.matrix delimiters":"\u0645\u062D\u062F\u062F\u0627\u062A \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629","menu.array.add row above":"\u0623\u0636\u0641 \u0635\u0641\u064B\u0627 \u0628\u0639\u062F \u0630\u0644\u0643","menu.array.add row below":"\u0623\u0636\u0641 \u0627\u0644\u0635\u0641 \u0642\u0628\u0644","menu.array.add column after":"\u0623\u0636\u0641 \u0627\u0644\u0639\u0645\u0648\u062F \u0628\u0639\u062F \u0630\u0644\u0643","menu.array.add column before":"\u0623\u0636\u0641 \u0627\u0644\u0639\u0645\u0648\u062F \u0642\u0628\u0644","menu.array.delete row":"\u0627\u062D\u0630\u0641 \u0635\u0641","menu.array.delete rows":"\u062D\u0630\u0641 \u0627\u0644\u0635\u0641\u0648\u0641 \u0627\u0644\u0645\u062D\u062F\u062F\u0629","menu.array.delete column":"\u062D\u0630\u0641 \u0627\u0644\u0639\u0645\u0648\u062F","menu.array.delete columns":"\u062D\u0630\u0641 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629","submenu.array.insert separator":"\u0623\u062F\u062E\u0644 \u0641\u0627\u0635\u0644","submenu.table style":"\u0646\u0645\u0637 \u0627\u0644\u062C\u062F\u0648\u0644"},bg:{"keyboard.tooltip.functions":"\u0424\u0443\u043D\u043A\u0446\u0438\u0438","keyboard.tooltip.symbols":"\u0421\u0438\u043C\u0432\u043E\u043B\u0438","keyboard.tooltip.greek":"\u0413\u0440\u044A\u0446\u043A\u0438 \u0431\u0443\u043A\u0432\u0438","keyboard.tooltip.command":"\u041A\u043E\u043C\u0430\u043D\u0434\u0435\u043D \u0440\u0435\u0436\u0438\u043C \u043D\u0430 \u043B\u0430\u0442\u0435\u043A\u0441","keyboard.tooltip.numeric":"\u0427\u0438\u0441\u043B\u043E\u0432\u0438","keyboard.tooltip.alphabetic":"\u0420\u0438\u043C\u0441\u043A\u0438 \u0431\u0443\u043A\u0432\u0438","tooltip.copy to clipboard":"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u0435 \u0432 \u043A\u043B\u0438\u043F\u0431\u043E\u0440\u0434\u0430","tooltip.redo":"\u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E","tooltip.toggle virtual keyboard":"\u041F\u0440\u0435\u0432\u043A\u043B\u044E\u0447\u0432\u0430\u043D\u0435 \u043D\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043B\u043D\u0430 \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430","tooltip.undo":"\u041E\u0442\u043C\u044F\u043D\u0430","menu.insert matrix":"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435 \u043D\u0430 \u043C\u0430\u0442\u0440\u0438\u0446\u0430","menu.insert vector":"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435 \u043D\u0430 \u0432\u0435\u043A\u0442\u043E\u0440","menu.insert table":"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435 \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430","submenu.array.matrix delimiters":"\u041C\u0430\u0442\u0440\u0438\u0447\u043D\u0438 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u0438","menu.array.add row above":"\u0414\u043E\u0431\u0430\u0432\u044F\u043D\u0435 \u043D\u0430 \u0440\u0435\u0434 \u0441\u043B\u0435\u0434","menu.array.add row below":"\u0414\u043E\u0431\u0430\u0432\u044F\u043D\u0435 \u043D\u0430 \u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u0438","menu.array.add column after":"\u0414\u043E\u0431\u0430\u0432\u044F\u043D\u0435 \u043D\u0430 \u043A\u043E\u043B\u043E\u043D\u0430 \u0441\u043B\u0435\u0434","menu.array.add column before":"\u0414\u043E\u0431\u0430\u0432\u044F\u043D\u0435 \u043D\u0430 \u043A\u043E\u043B\u043E\u043D\u0430 \u043F\u0440\u0435\u0434\u0438","menu.array.delete row":"\u0418\u0437\u0442\u0440\u0438\u0432\u0430\u043D\u0435 \u043D\u0430 \u0440\u0435\u0434\u0430","menu.array.delete rows":"\u0418\u0437\u0442\u0440\u0438\u0432\u0430\u043D\u0435 \u043D\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438\u0442\u0435 \u0440\u0435\u0434\u043E\u0432\u0435","menu.array.delete column":"\u0418\u0437\u0442\u0440\u0438\u0432\u0430\u043D\u0435 \u043D\u0430 \u043A\u043E\u043B\u043E\u043D\u0430","menu.array.delete columns":"\u0418\u0437\u0442\u0440\u0438\u0432\u0430\u043D\u0435 \u043D\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438\u0442\u0435 \u043A\u043E\u043B\u043E\u043D\u0438","submenu.array.insert separator":"\u041F\u043E\u0441\u0442\u0430\u0432\u0435\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B","submenu.table style":"\u0422\u0430\u0431\u043B\u0438\u0447\u0435\u043D \u0441\u0442\u0438\u043B"},bs:{"keyboard.tooltip.functions":"Funkcije","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Gr\u010Dka slova","keyboard.tooltip.command":"LaTeX naredbeni na\u010Din","keyboard.tooltip.numeric":"Numeri\u010Dki","keyboard.tooltip.alphabetic":"Rimska slova","tooltip.copy to clipboard":"Kopirati u clipboard","tooltip.redo":"Ponovi","tooltip.toggle virtual keyboard":"Uklju\u010Di / isklju\u010Di virtualnu tipkovnicu","tooltip.undo":"Poni\u0161ti","menu.insert matrix":"Umetni matricu","menu.insert vector":"Umetni vektor","menu.insert table":"Ubaci tabelu","submenu.array.matrix delimiters":"Matri\u010Dni razdjelnici","menu.array.add row above":"Dodaj redak nakon","menu.array.add row below":"Dodaj red prije","menu.array.add column after":"Dodaj stupac nakon","menu.array.add column before":"Dodaj stupac prije","menu.array.delete row":"Izbri\u0161i red","menu.array.delete rows":"Izbri\u0161i odabrane redove","menu.array.delete column":"Izbri\u0161i stupac","menu.array.delete columns":"Izbri\u0161i odabrane stupce","submenu.array.insert separator":"Umetni separator","submenu.table style":"Stil tabele"},cs:{"keyboard.tooltip.functions":"Funkce","keyboard.tooltip.symbols":"Symboly","keyboard.tooltip.greek":"\u0158eck\xE9 dopisy","keyboard.tooltip.command":"P\u0159\xEDkazov\xFD re\u017Eim LaTeX","keyboard.tooltip.numeric":"\u010C\xEDseln\xE9","keyboard.tooltip.alphabetic":"\u0158\xEDmsk\xE9 dopisy","tooltip.copy to clipboard":"Zkop\xEDrovat do schr\xE1nky","tooltip.redo":"P\u0159ed\u011Blat","tooltip.toggle virtual keyboard":"P\u0159epnout virtu\xE1ln\xED kl\xE1vesnici","tooltip.undo":"Vr\xE1tit","menu.insert matrix":"Vlo\u017Ete matici","menu.insert vector":"Vlo\u017Eit vektor","menu.insert table":"Vlo\u017Eit tabulku","submenu.array.matrix delimiters":"Odd\u011Blova\u010De matic","menu.array.add row above":"P\u0159idat \u0159\xE1dek za","menu.array.add row below":"P\u0159idat \u0159\xE1dek p\u0159ed","menu.array.add column after":"P\u0159idat sloupec za","menu.array.add column before":"P\u0159idat sloupec d\u0159\xEDve","menu.array.delete row":"Odstranit \u0159\xE1dek","menu.array.delete rows":"Odstranit vybran\xE9 \u0159\xE1dky","menu.array.delete column":"Odstranit sloupec","menu.array.delete columns":"Odstranit vybran\xE9 sloupce","submenu.array.insert separator":"Vlo\u017Ete odd\u011Blova\u010D","submenu.table style":"Styl tabulky"},da:{"keyboard.tooltip.functions":"Funktioner","keyboard.tooltip.symbols":"Symboler","keyboard.tooltip.greek":"Gr\xE6ske bogstaver","keyboard.tooltip.command":"LaTeX kommandotilstand","keyboard.tooltip.numeric":"Numerisk","keyboard.tooltip.alphabetic":"Romerske breve","tooltip.copy to clipboard":"Kopier til udklipsholder","tooltip.redo":"Gentag igen","tooltip.toggle virtual keyboard":"Skift virtuelt tastatur","tooltip.undo":"Fortryd","menu.insert matrix":"Inds\xE6t matrix","menu.insert vector":"Inds\xE6t vektor","menu.insert table":"Inds\xE6t tabel","submenu.array.matrix delimiters":"Matrixafgr\xE6nsere","menu.array.add row above":"Tilf\xF8j r\xE6kke efter","menu.array.add row below":"Tilf\xF8j r\xE6kke f\xF8r","menu.array.add column after":"Tilf\xF8j kolonne efter","menu.array.add column before":"Tilf\xF8j kolonne f\xF8r","menu.array.delete row":"Slet r\xE6kke","menu.array.delete rows":"Slet valgte r\xE6kker","menu.array.delete column":"Slet kolonne","menu.array.delete columns":"Slet valgte kolonner","submenu.array.insert separator":"Inds\xE6t separator","submenu.table style":"Tabelstil"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.alphabetic":"R\xF6mische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen","menu.insert matrix":"Matrix einf\xFCgen","menu.insert vector":"Vektor einf\xFCgen","menu.insert table":"Tabelle einf\xFCgen","submenu.array.matrix delimiters":"Matrixtrennzeichen","menu.array.add row above":"Zeile hinzuf\xFCgen nach","menu.array.add row below":"Zeile hinzuf\xFCgen vor","menu.array.add column after":"Spalte hinzuf\xFCgen nach","menu.array.add column before":"Spalte hinzuf\xFCgen vor","menu.array.delete row":"Zeile l\xF6schen","menu.array.delete rows":"Ausgew\xE4hlte Zeilen l\xF6schen","menu.array.delete column":"Spalte l\xF6schen","menu.array.delete columns":"Ausgew\xE4hlte Spalten l\xF6schen","submenu.array.insert separator":"Trennzeichen einf\xFCgen","submenu.table style":"Tabellenstil"},el:{"keyboard.tooltip.functions":"\u03C3\u03C5\u03BD\u03B1\u03C1\u03C4\u03AE\u03C3\u03B5\u03B9\u03C2","keyboard.tooltip.symbols":"\u03C3\u03CD\u03BC\u03B2\u03BF\u03BB\u03B1","keyboard.tooltip.greek":"\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC \u03B3\u03C1\u03AC\u03BC\u03BC\u03B1\u03C4\u03B1","keyboard.tooltip.command":"\u039B\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03BD\u03C4\u03BF\u03BB\u03CE\u03BD LaTeX","keyboard.tooltip.numeric":"\u0391\u03C1\u03B9\u03B8\u03BC\u03B7\u03C4\u03B9\u03BA\u03CC\u03C2","keyboard.tooltip.alphabetic":"\u03A1\u03C9\u03BC\u03B1\u03CA\u03BA\u03AC \u03B3\u03C1\u03AC\u03BC\u03BC\u03B1\u03C4\u03B1","tooltip.copy to clipboard":"\u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE \u03C3\u03C4\u03BF \u03C0\u03C1\u03CC\u03C7\u03B5\u03B9\u03C1\u03BF","tooltip.redo":"\u039E\u03B1\u03BD\u03B1\u03BA\u03AC\u03BD\u03C9","tooltip.toggle virtual keyboard":"\u0395\u03BD\u03B1\u03BB\u03BB\u03B1\u03B3\u03AE \u03B5\u03B9\u03BA\u03BF\u03BD\u03B9\u03BA\u03BF\u03CD \u03C0\u03BB\u03B7\u03BA\u03C4\u03C1\u03BF\u03BB\u03BF\u03B3\u03AF\u03BF\u03C5","tooltip.undo":"\u039E\u03B5\u03BA\u03AC\u03BD\u03C9","menu.insert matrix":"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03BC\u03AE\u03C4\u03C1\u03B1","menu.insert vector":"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B4\u03B9\u03B1\u03BD\u03CD\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2","menu.insert table":"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1","submenu.array.matrix delimiters":"\u039F\u03C1\u03B9\u03BF\u03B8\u03AD\u03C4\u03B5\u03C2 \u03BC\u03AE\u03C4\u03C1\u03B1","menu.array.add row above":"\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C3\u03B5\u03B9\u03C1\u03AC\u03C2 \u03BC\u03B5\u03C4\u03AC","menu.array.add row below":"\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C3\u03B5\u03B9\u03C1\u03AC\u03C2 \u03C0\u03C1\u03B9\u03BD","menu.array.add column after":"\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2 \u03BC\u03B5\u03C4\u03AC","menu.array.add column before":"\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2 \u03C0\u03C1\u03B9\u03BD","menu.array.delete row":"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03C3\u03B5\u03B9\u03C1\u03AC\u03C2","menu.array.delete rows":"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03C9\u03BD \u03C3\u03B5\u03B9\u03C1\u03CE\u03BD","menu.array.delete column":"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2","menu.array.delete columns":"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03C9\u03BD \u03C3\u03C4\u03B7\u03BB\u03CE\u03BD","submenu.array.insert separator":"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B4\u03B9\u03B1\u03C7\u03C9\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03BF\u03CD","submenu.table style":"\u03A3\u03C4\u03C5\u03BB \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"S\xEDmbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Num\xE9rico","keyboard.tooltip.alphabetic":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer","menu.insert matrix":"A\xF1adir Matriz","menu.insert vector":"A\xF1adir Vector","menu.insert table":"Insertar Tabla","submenu.array.matrix delimiters":"Delimitadores de Matriz","menu.array.add row above":"A\xF1adir L\xEDnea Antes","menu.array.add row below":"A\xF1adir L\xEDnea Despues","menu.array.add column after":"A\xF1adir Columna Despues","menu.array.add column before":"A\xF1adir Columna Antes","menu.array.delete row":"Borrar L\xEDnea","menu.array.delete rows":"Borrar L\xEDneas Seleccionadas","menu.array.delete column":"Borrar Columna","menu.array.delete columns":"Borrar Columnas Seleccionadas","submenu.array.insert separator":"Insertar un Separador","submenu.table style":"Estilo de Tabla"},et:{"keyboard.tooltip.functions":"Funktsioonid","keyboard.tooltip.symbols":"S\xFCmbolid","keyboard.tooltip.greek":"Kreeka kirjad","keyboard.tooltip.command":"LaTeXi k\xE4sure\u017Eiim","keyboard.tooltip.numeric":"Numbriline","keyboard.tooltip.alphabetic":"Rooma kirjad","tooltip.copy to clipboard":"Kopeerida l\xF5ikelauale","tooltip.redo":"Tee uuesti","tooltip.toggle virtual keyboard":"L\xFClitage sisse virtuaalne klaviatuur","tooltip.undo":"V\xF5ta tagasi","menu.insert matrix":"Sisesta maatriks","menu.insert vector":"Sisesta vektor","menu.insert table":"Sisesta tabeli","submenu.array.matrix delimiters":"Maatriksi eraldajad","menu.array.add row above":"Lisa rida p\xE4rast","menu.array.add row below":"Lisa rida enne","menu.array.add column after":"Lisa veerg p\xE4rast","menu.array.add column before":"Lisa veerg enne","menu.array.delete row":"Kustuta rida","menu.array.delete rows":"Kustuta valitud read","menu.array.delete column":"Kustuta veerg","menu.array.delete columns":"Kustuta valitud veerud","submenu.array.insert separator":"Sisestage eraldaja","submenu.table style":"Tabeli stiilis"},fa:{"keyboard.tooltip.functions":"\u062A\u0648\u0627\u0628\u0639","keyboard.tooltip.symbols":"\u0646\u0645\u0627\u062F\u0647\u0627","keyboard.tooltip.greek":"\u062D\u0631\u0648\u0641 \u06CC\u0648\u0646\u0627\u0646\u06CC","keyboard.tooltip.command":"\u062D\u0627\u0644\u062A \u062F\u0633\u062A\u0648\u0631 \u0644\u0627\u062A\u06A9","keyboard.tooltip.numeric":"\u0639\u062F\u062F\u06CC","keyboard.tooltip.alphabetic":"\u062D\u0631\u0648\u0641 \u0631\u0648\u0645\u06CC","tooltip.copy to clipboard":"\u06A9\u067E\u06CC \u0628\u0647 \u06A9\u0644\u06CC\u067E\u0628\u0648\u0631\u062F","tooltip.redo":"\u0628\u0627\u0632\u06AF\u0634\u062A \u0628\u0647 \u0628\u0639\u062F","tooltip.toggle virtual keyboard":"\u0646\u0645\u0627\u06CC\u0634/\u0646\u0647\u0641\u062A\u0646 \u06A9\u06CC\u0628\u0648\u0631\u062F \u0645\u062C\u0627\u0632\u06CC","tooltip.undo":"\u0628\u0627\u0632\u06AF\u0634\u062A \u0628\u0647 \u0642\u0628\u0644","menu.insert matrix":"\u0645\u0627\u062A\u0631\u06CC\u0633 \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F","menu.insert vector":"\u062F\u0631\u062C \u0628\u0631\u062F\u0627\u0631","menu.insert table":"\u0642\u0631\u0627\u0631 \u062F\u0627\u062F\u0646 \u062C\u062F\u0648\u0644","submenu.array.matrix delimiters":"\u0645\u0631\u0632\u0647\u0627\u06CC \u0645\u0627\u062A\u0631\u06CC\u0633","menu.array.add row above":"\u0628\u0639\u062F \u0627\u0632 \u0622\u0646 \u0631\u062F\u06CC\u0641 \u0627\u0636\u0627\u0641\u0647 \u06A9\u0646\u06CC\u062F","menu.array.add row below":"\u0631\u062F\u06CC\u0641 \u0631\u0627 \u0642\u0628\u0644 \u0627\u0636\u0627\u0641\u0647 \u06A9\u0646\u06CC\u062F","menu.array.add column after":"\u0627\u0636\u0627\u0641\u0647 \u06A9\u0631\u062F\u0646 \u0633\u062A\u0648\u0646 \u0628\u0639\u062F","menu.array.add column before":"\u0633\u062A\u0648\u0646 \u0642\u0628\u0644 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06A9\u0646\u06CC\u062F","menu.array.delete row":"\u0631\u062F\u06CC\u0641 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F","menu.array.delete rows":"\u0631\u062F\u06CC\u0641 \u0647\u0627\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F","menu.array.delete column":"\u062D\u0630\u0641 \u0633\u062A\u0648\u0646","menu.array.delete columns":"\u0633\u062A\u0648\u0646 \u0647\u0627\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F","submenu.array.insert separator":"\u062F\u0631\u062C \u062C\u062F\u0627 \u06A9\u0646\u0646\u062F\u0647","submenu.table style":"\u0633\u0628\u06A9 \u0645\u06CC\u0632"},fi:{"keyboard.tooltip.functions":"Toiminnot","keyboard.tooltip.symbols":"Symbolit","keyboard.tooltip.greek":"Kreikkalaiset kirjeet","keyboard.tooltip.command":"LaTeX-komentotila","keyboard.tooltip.numeric":"Numeerinen","keyboard.tooltip.alphabetic":"Roomalaiset kirjeet","tooltip.copy to clipboard":"Kopioi leikep\xF6yd\xE4lle","tooltip.redo":"Tee uudelleen","tooltip.toggle virtual keyboard":"Vaihda virtuaalin\xE4pp\xE4imist\xF6","tooltip.undo":"Kumoa","menu.insert matrix":"Lis\xE4\xE4 matriisi","menu.insert vector":"Lis\xE4\xE4 vektori","menu.insert table":"Lis\xE4\xE4 taulukko","submenu.array.matrix delimiters":"Matriisin erottimet","menu.array.add row above":"Lis\xE4\xE4 rivi j\xE4lkeen","menu.array.add row below":"Lis\xE4\xE4 rivi ennen","menu.array.add column after":"Lis\xE4\xE4 sarake j\xE4lkeen","menu.array.add column before":"Lis\xE4\xE4 sarake ennen","menu.array.delete row":"Poista rivi","menu.array.delete rows":"Poista valitut rivit","menu.array.delete column":"Poista sarake","menu.array.delete columns":"Poista valitut sarakkeet","submenu.array.insert separator":"Aseta erotin","submenu.table style":"Taulukon tyyli"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Num\xE9rique","keyboard.tooltip.alphabetic":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"R\xE9tablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler","menu.insert matrix":"Ins\xE9rer une Matrice","menu.insert vector":"Ins\xE9rer un Vecteur","menu.insert table":"Ins\xE9rer une Table","submenu.array.matrix delimiters":"D\xE9limiteurs de la Matrice","menu.array.add row above":"Ajouter une Ligne Avant","menu.array.add row below":"Ajouter une Ligne Apr\xE8s","menu.array.add column before":"Ajouter une Colonne Avant","menu.array.add column after":"Ajouter une Colonne Apr\xE8s","menu.array.delete row":"Enlever une Ligne","menu.array.delete rows":"Enlever les Lignes S\xE9lection\xE9es","menu.array.delete column":"Enlever une Colone","menu.array.delete columns":"Enlever les Colonnes S\xE9lection\xE9es","submenu.array.insert separator":"Ins\xE9rer un S\xE9parateur","submenu.table style":"Style de la Table"},ga:{"keyboard.tooltip.functions":"Feidhmeanna","keyboard.tooltip.symbols":"Siombail\xED","keyboard.tooltip.greek":"Litreacha na Gr\xE9ige","keyboard.tooltip.command":"M\xF3d Ord\xFA LaTeX","keyboard.tooltip.numeric":"Uimhri\xFAil","keyboard.tooltip.alphabetic":"Litreacha R\xF3mh\xE1nacha","tooltip.copy to clipboard":"C\xF3ipe\xE1il chuig an Ghearrthaisce","tooltip.redo":"Athdh\xE9an","tooltip.toggle virtual keyboard":"M\xE9archl\xE1ir F\xEDor\xFAil a Fh\xE1il","tooltip.undo":"Cealaigh","menu.insert matrix":"Cuir isteach Maitr\xEDs","menu.insert vector":"Cuir isteach Veicteoir","menu.insert table":"Ions\xE1igh T\xE1bla","submenu.array.matrix delimiters":"Delimiters Maitr\xEDs","menu.array.add row above":"Cuir Rae Tar \xE9is","menu.array.add row below":"Cuir Rae Roimh","menu.array.add column after":"Cuir Col\xFAn Tar \xE9is","menu.array.add column before":"Cuir Col\xFAn Roimh","menu.array.delete row":"Scrios Rae","menu.array.delete rows":"Scrios Sraitheanna Roghnaithe","menu.array.delete column":"Scrios Col\xFAn","menu.array.delete columns":"Scrios Col\xFAin Roghnaithe","submenu.array.insert separator":"Cuir Deighilteoir isteach","submenu.table style":"St\xEDl T\xE1bla"},he:{"keyboard.tooltip.functions":"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D5\u05EA","keyboard.tooltip.symbols":"\u05E1\u05DE\u05DC\u05D9\u05DD","keyboard.tooltip.greek":"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05D9\u05D5\u05D5\u05E0\u05D9\u05D5\u05EA","keyboard.tooltip.command":"\u05DE\u05E6\u05D1 \u05E4\u05E7\u05D5\u05D3\u05D4 \u05DC\u05D8\u05E7\u05E1","keyboard.tooltip.numeric":"\u05DE\u05E1\u05E4\u05E8\u05D9","keyboard.tooltip.alphabetic":"\u05DE\u05DB\u05EA\u05D1\u05D9\u05DD \u05E8\u05D5\u05DE\u05D9\u05D9\u05DD","tooltip.copy to clipboard":"\u05D4\u05E2\u05EA\u05E7 \u05DC\u05DC\u05D5\u05D7","tooltip.redo":"\u05DC\u05B7\u05E2\u05B2\u05E9\u05C2\u05D5\u05B9\u05EA \u05E9\u05C1\u05D5\u05BC\u05D1","tooltip.toggle virtual keyboard":"\u05D4\u05D7\u05DC\u05E3 \u05D0\u05EA \u05D4\u05DE\u05E7\u05DC\u05D3\u05EA \u05D4\u05D5\u05D5\u05D9\u05E8\u05D8\u05D5\u05D0\u05DC\u05D9\u05EA","tooltip.undo":"\u05DC\u05D1\u05D8\u05DC","menu.insert matrix":"\u05D4\u05DB\u05E0\u05E1 \u05DE\u05D8\u05E8\u05D9\u05E7\u05E1","menu.insert vector":"\u05D4\u05DB\u05E0\u05E1 \u05D5\u05E7\u05D8\u05D5\u05E8","menu.insert table":"\u05D4\u05DB\u05E0\u05E1 \u05D8\u05D1\u05DC\u05D4","submenu.array.matrix delimiters":"\u05DE\u05E4\u05E8\u05D9\u05D3\u05D9 \u05DE\u05D8\u05E8\u05D9\u05E7\u05E1","menu.array.add row above":"\u05D4\u05D5\u05E1\u05E3 \u05E9\u05D5\u05E8\u05D4 \u05D0\u05D7\u05E8\u05D9","menu.array.add row below":"\u05D4\u05D5\u05E1\u05E3 \u05E9\u05D5\u05E8\u05D4 \u05DC\u05E4\u05E0\u05D9","menu.array.add column after":"\u05D4\u05D5\u05E1\u05E3 \u05E2\u05DE\u05D5\u05D3\u05D4 \u05D0\u05D7\u05E8\u05D9","menu.array.add column before":"\u05D4\u05D5\u05E1\u05E3 \u05E2\u05DE\u05D5\u05D3\u05D4 \u05DC\u05E4\u05E0\u05D9","menu.array.delete row":"\u05DE\u05D7\u05E7 \u05E9\u05D5\u05E8\u05D4","menu.array.delete rows":"\u05DE\u05D7\u05E7 \u05E9\u05D5\u05E8\u05D5\u05EA \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5","menu.array.delete column":"\u05DE\u05D7\u05E7 \u05E2\u05DE\u05D5\u05D3\u05D4","menu.array.delete columns":"\u05DE\u05D7\u05E7 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5","submenu.array.insert separator":"\u05D4\u05DB\u05E0\u05E1 \u05DE\u05E4\u05E8\u05D9\u05D3","submenu.table style":"\u05D8\u05D1\u05DC\u05D4 \u05E1\u05B4\u05D2\u05B0\u05E0\u05D5\u05B9\u05DF"},hr:{"keyboard.tooltip.functions":"Funkcije","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Gr\u010Dka slova","keyboard.tooltip.command":"LaTeX naredbeni na\u010Din","keyboard.tooltip.numeric":"Numeri\u010Dki","keyboard.tooltip.alphabetic":"Rimska slova","tooltip.copy to clipboard":"Kopirati u me\u0111uspremnik","tooltip.redo":"Ponovi","tooltip.toggle virtual keyboard":"Uklju\u010Di / isklju\u010Di virtualnu tipkovnicu","tooltip.undo":"Poni\u0161ti","menu.insert matrix":"Umetni matricu","menu.insert vector":"Umetni vektor","menu.insert table":"Umetni tablicu","submenu.array.matrix delimiters":"Matri\u010Dni razdjelnici","menu.array.add row above":"Dodaj redak nakon","menu.array.add row below":"Dodaj redak prije","menu.array.add column after":"Dodaj stupac nakon","menu.array.add column before":"Dodaj stupac prije","menu.array.delete row":"Izbri\u0161i redak","menu.array.delete rows":"Izbri\u0161i odabrane retke","menu.array.delete column":"Izbri\u0161i stupac","menu.array.delete columns":"Izbri\u0161i odabrane stupce","submenu.array.insert separator":"Umetni separator","submenu.table style":"Stil tabele"},id:{"keyboard.tooltip.functions":"Fungsi","keyboard.tooltip.symbols":"Simbol","keyboard.tooltip.greek":"Huruf Yunani","keyboard.tooltip.command":"Mode Perintah LaTeX","keyboard.tooltip.numeric":"Numerik","keyboard.tooltip.alphabetic":"Surat Romawi","tooltip.copy to clipboard":"Menyalin ke clipboard","tooltip.redo":"Mengulangi","tooltip.toggle virtual keyboard":"Alihkan Keyboard Virtual","tooltip.undo":"Membuka","menu.insert matrix":"Sisipkan Matriks","menu.insert vector":"Sisipkan Vektor","menu.insert table":"Sisipkan Tabel","submenu.array.matrix delimiters":"Pembatas Matriks","menu.array.add row above":"Tambahkan Baris Setelah","menu.array.add row below":"Tambahkan Baris Sebelumnya","menu.array.add column after":"Tambahkan Kolom Setelah","menu.array.add column before":"Tambahkan Kolom Sebelumnya","menu.array.delete row":"Hapus Baris","menu.array.delete rows":"Hapus Baris yang Dipilih","menu.array.delete column":"Hapus Kolom","menu.array.delete columns":"Hapus Kolom yang Dipilih","submenu.array.insert separator":"Sisipkan Pemisah","submenu.table style":"Gaya Tabel"},hi:{"keyboard.tooltip.functions":"\u0915\u093E\u0930\u094D\u092F\u094B\u0902","keyboard.tooltip.symbols":"\u092A\u094D\u0930\u0924\u0940\u0915","keyboard.tooltip.greek":"\u0917\u094D\u0930\u0940\u0915 \u0905\u0915\u094D\u0937\u0930","keyboard.tooltip.command":"\u0932\u093E\u091F\u0947\u0915\u094D\u0938 \u0915\u092E\u093E\u0902\u0921 \u092E\u094B\u0921","keyboard.tooltip.numeric":"\u0938\u0902\u0916\u094D\u092F\u093E\u0924\u094D\u092E\u0915","keyboard.tooltip.alphabetic":"\u0930\u094B\u092E\u0928 \u092A\u0924\u094D\u0930","tooltip.copy to clipboard":"\u0915\u094D\u0932\u093F\u092A\u092C\u094B\u0930\u094D\u0921 \u092A\u0930 \u0915\u0949\u092A\u0940 \u0915\u0930\u0947\u0902","tooltip.redo":"\u092B\u093F\u0930 \u0938\u0947 \u0915\u0930\u0947\u0902","tooltip.toggle virtual keyboard":"\u0935\u0930\u094D\u091A\u0941\u0905\u0932 \u0915\u0940\u092C\u094B\u0930\u094D\u0921 \u091F\u0949\u0917\u0932 \u0915\u0930\u0947\u0902","tooltip.undo":"\u092A\u0942\u0930\u094D\u0935\u0935\u0924","menu.insert matrix":"\u092E\u0948\u091F\u094D\u0930\u093F\u0915\u094D\u0938 \u0921\u093E\u0932\u0947\u0902","menu.insert vector":"\u0935\u0947\u0915\u094D\u091F\u0930 \u0921\u093E\u0932\u0947\u0902","menu.insert table":"\u091F\u0947\u092C\u0932 \u0907\u0902\u0938\u0930\u094D\u091F \u0915\u0930\u0947\u0902","submenu.array.matrix delimiters":"\u092E\u0948\u091F\u094D\u0930\u093F\u0915\u094D\u0938 \u0938\u0940\u092E\u093E\u0902\u0915\u0915","menu.array.add row above":"\u092C\u093E\u0926 \u092E\u0947\u0902 \u092A\u0902\u0915\u094D\u0924\u093F \u091C\u094B\u0921\u093C\u0947\u0902","menu.array.add row below":"\u092A\u0939\u0932\u0947 \u092A\u0902\u0915\u094D\u0924\u093F \u091C\u094B\u0921\u093C\u0947\u0902","menu.array.add column after":"\u092C\u093E\u0926 \u092E\u0947\u0902 \u0915\u0949\u0932\u092E \u091C\u094B\u0921\u093C\u0947\u0902","menu.array.add column before":"\u092A\u0939\u0932\u0947 \u0915\u0949\u0932\u092E \u091C\u094B\u0921\u093C\u0947\u0902","menu.array.delete row":"\u092A\u0902\u0915\u094D\u0924\u093F \u0915\u094B \u0939\u091F\u093E\u090F\u0902","menu.array.delete rows":"\u091A\u092F\u0928\u093F\u0924 \u092A\u0902\u0915\u094D\u0924\u093F\u092F\u094B\u0902 \u0915\u094B \u0939\u091F\u093E\u090F\u0902","menu.array.delete column":"\u0915\u0949\u0932\u092E \u0939\u091F\u093E\u090F\u0902","menu.array.delete columns":"\u091A\u092F\u0928\u093F\u0924 \u0915\u0949\u0932\u092E \u0939\u091F\u093E\u090F\u0902","submenu.array.insert separator":"\u0935\u093F\u092D\u093E\u091C\u0915 \u0921\u093E\u0932\u0947\u0902","submenu.table style":"\u091F\u0947\u092C\u0932 \u0938\u094D\u091F\u093E\u0907\u0932"},hu:{"keyboard.tooltip.functions":"Funkci\xF3k","keyboard.tooltip.symbols":"Szimb\xF3lumok","keyboard.tooltip.greek":"G\xF6r\xF6g levelek","keyboard.tooltip.command":"LaTeX Parancs m\xF3d","keyboard.tooltip.numeric":"Numerikus","keyboard.tooltip.alphabetic":"R\xF3mai levelek","tooltip.copy to clipboard":"M\xE1solja a v\xE1g\xF3lapra","tooltip.redo":"\xDAjra","tooltip.toggle virtual keyboard":"V\xE1lt\xE1s a virtu\xE1lis billenty\u0171zetre","tooltip.undo":"Visszavon\xE1s","menu.insert matrix":"Helyezze be a M\xE1trixot","menu.insert vector":"Vektor besz\xFAr\xE1sa","menu.insert table":"Helyezze be a t\xE1bl\xE1zatot","submenu.array.matrix delimiters":"M\xE1trixhat\xE1rol\xF3k","menu.array.add row above":"Sor hozz\xE1ad\xE1sa ut\xE1n","menu.array.add row below":"Add Add Sor el\u0151tt","menu.array.add column after":"Oszlop hozz\xE1ad\xE1sa ut\xE1n","menu.array.add column before":"Add oszlop el\u0151tt","menu.array.delete row":"Sor t\xF6rl\xE9se","menu.array.delete rows":"Kijel\xF6lt sorok t\xF6rl\xE9se","menu.array.delete column":"Oszlop t\xF6rl\xE9se","menu.array.delete columns":"A kijel\xF6lt oszlopok t\xF6rl\xE9se","submenu.array.insert separator":"Helyezze be az elv\xE1laszt\xF3t","submenu.table style":"T\xE1bl\xE1zatos st\xEDlus"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalit\xE0 di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.alphabetic":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare","menu.insert matrix":"Inserisci una Matrice","menu.insert vector":"Inserisci Vettore","menu.insert table":"Inserisci Tabella","submenu.array.matrix delimiters":"Delimitatori di Matrice","menu.array.add row above":"Aggiungi una Riga Prima","menu.array.add row below":"Aggiungi una Riga Dopo","menu.array.add column before":"Aggiungi una Colonna Prima","menu.array.add column after":"Aggiungi una Colonna Dopo","menu.array.delete row":"Rimuovi una Riga","menu.array.delete rows":"Rimuovi le Righe Selezionate","menu.array.delete column":"Rimuovi una Colonna","menu.array.delete columns":"Rimuovi le Colonne Selezionate","submenu.array.insert separator":"Inserisci un Separatore","submenu.table style":"Stile tabella"},is:{"keyboard.tooltip.functions":"A\xF0ger\xF0ir","keyboard.tooltip.symbols":"T\xE1kn","keyboard.tooltip.greek":"Gr\xEDsk br\xE9f","keyboard.tooltip.command":"LaTeX stj\xF3rnunarstilling","keyboard.tooltip.numeric":"T\xF6lulegt","keyboard.tooltip.alphabetic":"R\xF3mversk br\xE9f","tooltip.copy to clipboard":"Afrita\xF0u \xE1 klemmuspjald","tooltip.redo":"Endurtaka","tooltip.toggle virtual keyboard":"Skiptu um s\xFDndarlyklabor\xF0","tooltip.undo":"Afturkalla","menu.insert matrix":"Settu fylki inn","menu.insert vector":"Settu inn Vector","menu.insert table":"Settu inn t\xF6flu","submenu.array.matrix delimiters":"Matrix afm\xF6rkun","menu.array.add row above":"B\xE6ta vi\xF0 r\xF6\xF0 \xE1 eftir","menu.array.add row below":"B\xE6ta vi\xF0 r\xF6\xF0 \xE1\xF0ur","menu.array.add column after":"B\xE6ta vi\xF0 d\xE1lki \xE1 eftir","menu.array.add column before":"B\xE6ta vi\xF0 d\xE1lki \xE1\xF0ur","menu.array.delete row":"Ey\xF0a r\xF6\xF0","menu.array.delete rows":"Ey\xF0a v\xF6ldum l\xEDnum","menu.array.delete column":"Ey\xF0a d\xE1lki","menu.array.delete columns":"Ey\xF0a v\xF6ldum d\xE1lkum","submenu.array.insert separator":"Settu skiljuna \xED","submenu.table style":"T\xF6flu st\xEDl"},ja:{"keyboard.tooltip.functions":"\u95A2\u6570","keyboard.tooltip.symbols":"\u30B7\u30F3\u30DC\u30EB","keyboard.tooltip.greek":"\u30AE\u30EA\u30B7\u30E3\u6587\u5B57","keyboard.tooltip.command":"\u30E9\u30C6\u30C3\u30AF\u30B9\u30B3\u30DE\u30F3\u30C9\u30E2\u30FC\u30C9","keyboard.tooltip.numeric":"\u6570\u5024","keyboard.tooltip.alphabetic":"\u30ED\u30FC\u30DE\u5B57","tooltip.copy to clipboard":"\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30B3\u30D4\u30FC","tooltip.redo":"\u3084\u308A\u76F4\u3057","tooltip.toggle virtual keyboard":"\u4EEE\u60F3\u30AD\u30FC\u30DC\u30FC\u30C9\u306E\u5207\u308A\u66FF\u3048","tooltip.undo":"\u5143\u306B\u623B\u3059","menu.insert matrix":"\u30DE\u30C8\u30EA\u30C3\u30AF\u30B9\u3092\u633F\u5165","menu.insert vector":"\u30D9\u30AF\u30C8\u30EB\u3092\u633F\u5165","menu.insert table":"\u30C6\u30FC\u30D6\u30EB\u3092\u633F\u5165","submenu.array.matrix delimiters":"\u884C\u5217\u533A\u5207\u308A\u6587\u5B57","menu.array.add row above":"\u5F8C\u306B\u884C\u3092\u8FFD\u52A0","menu.array.add row below":"\u524D\u306B\u884C\u3092\u8FFD\u52A0","menu.array.add column after":"\u5F8C\u306B\u5217\u3092\u8FFD\u52A0","menu.array.add column before":"\u524D\u306B\u5217\u3092\u8FFD\u52A0","menu.array.delete row":"\u884C\u3092\u524A\u9664","menu.array.delete rows":"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664\u3059\u308B","menu.array.delete column":"\u5217\u3092\u524A\u9664","menu.array.delete columns":"\u9078\u629E\u3057\u305F\u5217\u3092\u524A\u9664\u3059\u308B","submenu.array.insert separator":"\u30BB\u30D1\u30EC\u30FC\u30BF\u30FC\u3092\u633F\u5165","submenu.table style":"\u30C6\u30FC\u30D6\u30EB\u30B9\u30BF\u30A4\u30EB"},ko:{"keyboard.tooltip.functions":"\uAE30\uB2A5","keyboard.tooltip.symbols":"\uAE30\uD638","keyboard.tooltip.greek":"\uADF8\uB9AC\uC2A4 \uBB38\uC790","keyboard.tooltip.command":"\uC720\uC561 \uBA85\uB839 \uBAA8\uB4DC","keyboard.tooltip.numeric":"\uC22B\uC790","keyboard.tooltip.alphabetic":"\uB85C\uB9C8 \uBB38\uC790","tooltip.copy to clipboard":"\uD074\uB9BD \uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC","tooltip.redo":"\uB2E4\uC2DC \uD558\uB2E4","tooltip.toggle virtual keyboard":"\uAC00\uC0C1 \uD0A4\uBCF4\uB4DC \uC804\uD658","tooltip.undo":"\uC2E4\uD589 \uCDE8\uC18C","menu.insert matrix":"\uB9E4\uD2B8\uB9AD\uC2A4 \uC0BD\uC785","menu.insert vector":"\uBCA1\uD130 \uC0BD\uC785","menu.insert table":"\uD45C \uC0BD\uC785","submenu.array.matrix delimiters":"\uD589\uB82C \uAD6C\uBD84 \uAE30\uD638","menu.array.add row above":"\uB4A4\uC5D0 \uD589 \uCD94\uAC00","menu.array.add row below":"\uC55E\uC5D0 \uD589 \uCD94\uAC00","menu.array.add column after":"\uB4A4\uC5D0 \uC5F4 \uCD94\uAC00","menu.array.add column before":"\uC55E\uC5D0 \uC5F4 \uCD94\uAC00","menu.array.delete row":"\uD589 \uC0AD\uC81C","menu.array.delete rows":"\uC120\uD0DD\uD55C \uD589 \uC0AD\uC81C","menu.array.delete column":"\uC5F4 \uC0AD\uC81C","menu.array.delete columns":"\uC120\uD0DD\uD55C \uC5F4 \uC0AD\uC81C","submenu.array.insert separator":"\uAD6C\uBD84\uC790 \uC0BD\uC785","submenu.table style":"\uD14C\uC774\uBE14 \uC2A4\uD0C0\uC77C"},lv:{"keyboard.tooltip.functions":"Funkcijas","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Grie\u0137u burti","keyboard.tooltip.command":"LaTeX komandu re\u017E\u012Bms","keyboard.tooltip.numeric":"Ciparu skaitlis","keyboard.tooltip.alphabetic":"Romie\u0161u v\u0113stules","tooltip.copy to clipboard":"Kop\u0113t starpliktuv\u0113","tooltip.redo":"P\u0101rtais\u012Bt","tooltip.toggle virtual keyboard":"P\u0101rsl\u0113gt virtu\u0101lo tastat\u016Bru","tooltip.undo":"Atsaukt","menu.insert matrix":"Ievietojiet matricu","menu.insert vector":"Ievietot vektoru","menu.insert table":"Ievietojiet tabulu","submenu.array.matrix delimiters":"Matricas norobe\u017Eot\u0101ji","menu.array.add row above":"Pievienot rindu p\u0113c","menu.array.add row below":"Pievienot rindu pirms","menu.array.add column after":"Pievienot kolonnu p\u0113c","menu.array.add column before":"Pievienot kolonnu pirms","menu.array.delete row":"Dz\u0113st rindu","menu.array.delete rows":"Dz\u0113st atlas\u012Bt\u0101s rindas","menu.array.delete column":"Dz\u0113st kolonnu","menu.array.delete columns":"Dz\u0113st atlas\u012Bt\u0101s kolonnas","submenu.array.insert separator":"Ievietojiet atdal\u012Bt\u0101ju","submenu.table style":"Galda stils"},lt:{"keyboard.tooltip.functions":"Funkcijos","keyboard.tooltip.symbols":"Simboliai","keyboard.tooltip.greek":"Graiki\u0161kos raid\u0117s","keyboard.tooltip.command":"LaTeX komand\u0173 re\u017Eimas","keyboard.tooltip.numeric":"Skaitmeninis","keyboard.tooltip.alphabetic":"Romos lai\u0161kai","tooltip.copy to clipboard":"Nukopijuoti \u012F i\u0161karpin\u0119","tooltip.redo":"Perdaryti","tooltip.toggle virtual keyboard":"Perjungti virtuali\u0105j\u0105 klaviat\u016Br\u0105","tooltip.undo":"At\u0161aukti","menu.insert matrix":"Ievietojiet matricu","menu.insert vector":"Ievietot vektoru","menu.insert table":"Ievietojiet tabulu","submenu.array.matrix delimiters":"Matricas norobe\u017Eot\u0101ji","menu.array.add row above":"Pievienot rindu p\u0113c","menu.array.add row below":"Pievienot rindu pirms","menu.array.add column after":"Pievienot kolonnu p\u0113c","menu.array.add column before":"Pievienot kolonnu pirms","menu.array.delete row":"Dz\u0113st rindu","menu.array.delete rows":"Dz\u0113st atlas\u012Bt\u0101s rindas","menu.array.delete column":"Dz\u0113st kolonnu","menu.array.delete columns":"Dz\u0113st atlas\u012Bt\u0101s kolonnas","submenu.array.insert separator":"Ievietojiet atdal\u012Bt\u0101ju","submenu.table style":"Tabulas stili"},lu:{"keyboard.tooltip.functions":"Funktiounen","keyboard.tooltip.symbols":"Symboler","keyboard.tooltip.greek":"Griichesch Br\xE9iwer","keyboard.tooltip.command":"LaTeX Kommando Modus","keyboard.tooltip.numeric":"Numeresch","keyboard.tooltip.alphabetic":"R\xE9imesch Br\xE9iwer","tooltip.copy to clipboard":"Kop\xE9iert op Clipboard","tooltip.redo":"Nees nei maachen","tooltip.toggle virtual keyboard":"Wiesselt Virtuell Tastatur","tooltip.undo":"Undoen","menu.insert matrix":"Matrix asetzen","menu.insert vector":"Insert Vector","menu.insert table":"D\xEBsch anzeginn","submenu.array.matrix delimiters":"Matrix Ofgrenzer","menu.array.add row above":"Dob\xE4izemaachen Rei No","menu.array.add row below":"F\xFC\xFCgt Rei vir","menu.array.add column after":"Dob\xE4izemaachen Kolonn No","menu.array.add column before":"Kolonn derb\xE4i Virun","menu.array.delete row":"Rad l\xE4schen","menu.array.delete rows":"L\xE4scht Ausgewielte Reien","menu.array.delete column":"L\xE4scht Kolonn","menu.array.delete columns":"L\xE4scht Ausgewielte Kolonnen","submenu.array.insert separator":"Insert Separator","submenu.table style":"D\xEBsch Style"},nl:{"keyboard.tooltip.functions":"Functies","keyboard.tooltip.symbols":"Symbolen","keyboard.tooltip.greek":"Griekse letters","keyboard.tooltip.command":"LaTeX commando mode","keyboard.tooltip.numeric":"Numeriek","keyboard.tooltip.alphabetic":"Romeinse letters","tooltip.copy to clipboard":"Kopi\xEBren naar klembord","tooltip.redo":"Opnieuw","tooltip.toggle virtual keyboard":"Schakel naar virtueel toetsenbord","tooltip.undo":"Ongedaan maken","menu.insert matrix":"Matrix invoegen","menu.insert vector":"Vector invoegen","menu.insert table":"Tabel invoegen","submenu.array.matrix delimiters":"Matrixscheidingstekens","menu.array.add row above":"Rij toevoegen na","menu.array.add row below":"Rij toevoegen eerder","menu.array.add column after":"Kolom toevoegen na","menu.array.add column before":"Kolom toevoegen voor","menu.array.delete row":"Verwijder rij","menu.array.delete rows":"Geselecteerde rijen verwijderen","menu.array.delete column":"Kolom verwijderen","menu.array.delete columns":"Geselecteerde kolommen verwijderen","submenu.array.insert separator":"Scheidingsteken invoegen","submenu.table style":"Tabelstijl"},no:{"keyboard.tooltip.functions":"Funksjoner","keyboard.tooltip.symbols":"Symboler","keyboard.tooltip.greek":"Greske bokstaver","keyboard.tooltip.command":"LaTeX kommandomodus","keyboard.tooltip.numeric":"Numerisk","keyboard.tooltip.alphabetic":"Romerske bokstaver","tooltip.copy to clipboard":"Kopiere til utklippstavle","tooltip.redo":"Gj\xF8re om","tooltip.toggle virtual keyboard":"Bytt virtuelt tastatur","tooltip.undo":"Angre","menu.insert matrix":"Sett inn matrise","menu.insert vector":"Sett inn vektor","menu.insert table":"Sett inn tabell","submenu.array.matrix delimiters":"Matrix avgrensere","menu.array.add row above":"Legg til rad etter","menu.array.add row below":"Legg til rad f\xF8r","menu.array.add column after":"Legg til kolonne etter","menu.array.add column before":"Legg til kolonne f\xF8r","menu.array.delete row":"Slett rad","menu.array.delete rows":"Slett valgte rader","menu.array.delete column":"Slett kolonne","menu.array.delete columns":"Slett valgte kolonner","submenu.array.insert separator":"Sett inn skilletegn","submenu.table style":"Tabellstil"},mk:{"keyboard.tooltip.functions":"\u0424\u0443\u043D\u043A\u0446\u0438\u0438","keyboard.tooltip.symbols":"\u0421\u0438\u043C\u0431\u043E\u043B\u0438","keyboard.tooltip.greek":"\u0413\u0440\u0447\u043A\u0438 \u0431\u0443\u043A\u0432\u0438","keyboard.tooltip.command":"\u0420\u0435\u0436\u0438\u043C \u043D\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0432\u043E \u043B\u0430\u0442\u0435\u043A\u0441","keyboard.tooltip.numeric":"\u041D\u0443\u043C\u0435\u0440\u0438\u0447\u043A\u0438","keyboard.tooltip.alphabetic":"\u0420\u0438\u043C\u0441\u043A\u0438 \u043F\u0438\u0441\u043C\u0430","tooltip.copy to clipboard":"\u041A\u043E\u043F\u0438\u0440\u0430\u0458\u0442\u0435 \u0432\u043E \u043A\u043B\u0438\u043F\u0431\u043E\u0440\u0434","tooltip.redo":"\u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E","tooltip.toggle virtual keyboard":"\u0412\u043A\u043B\u0443\u0447\u0435\u0442\u0435 \u0458\u0430 \u0432\u0438\u0440\u0442\u0443\u0435\u043B\u043D\u0430\u0442\u0430 \u0442\u0430\u0441\u0442\u0430\u0442\u0443\u0440\u0430","tooltip.undo":"\u0412\u0440\u0430\u0442\u0438","menu.insert matrix":"\u0412\u043C\u0435\u0442\u043D\u0435\u0442\u0435 \u043C\u0430\u0442\u0440\u0438\u0446\u0430","menu.insert vector":"\u0412\u043C\u0435\u0442\u043D\u0438 \u0432\u0435\u043A\u0442\u043E\u0440","menu.insert table":"\u0412\u043C\u0435\u0442\u043D\u0438 \u0442\u0430\u0431\u0435\u043B\u0430","submenu.array.matrix delimiters":"\u0420\u0430\u0437\u0433\u0440\u0430\u043D\u0438\u0447\u0443\u0432\u0430\u0447\u0438 \u043D\u0430 \u043C\u0430\u0442\u0440\u0438\u0446\u0430","menu.array.add row above":"\u0414\u043E\u0434\u0430\u0434\u0435\u0442\u0435 \u0440\u0435\u0434 \u043F\u043E\u0441\u043B\u0435","menu.array.add row below":"\u0414\u043E\u0434\u0430\u0434\u0438 \u0440\u0435\u0434 \u043F\u0440\u0435\u0434 \u0442\u043E\u0430","menu.array.add column after":"\u0414\u043E\u0434\u0430\u0434\u0435\u0442\u0435 \u043A\u043E\u043B\u043E\u043D\u0430 \u043F\u043E\u0441\u043B\u0435","menu.array.add column before":"\u0414\u043E\u0434\u0430\u0434\u0435\u0442\u0435 \u043A\u043E\u043B\u043E\u043D\u0430 \u043F\u0440\u0435\u0434 \u0442\u043E\u0430","menu.array.delete row":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0433\u043E \u0440\u0435\u0434\u043E\u0442","menu.array.delete rows":"\u0418\u0437\u0431\u0440\u0438\u0448\u0435\u0442\u0435 \u0433\u0438 \u0438\u0437\u0431\u0440\u0430\u043D\u0438\u0442\u0435 \u0440\u0435\u0434\u043E\u0432\u0438","menu.array.delete column":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0458\u0430 \u043A\u043E\u043B\u043E\u043D\u0430\u0442\u0430","menu.array.delete columns":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0458\u0430 \u043A\u043E\u043B\u043E\u043D\u0430\u0442\u0430","submenu.array.insert separator":"\u0412\u043C\u0435\u0442\u043D\u0435\u0442\u0435 \u0441\u0435\u043F\u0430\u0440\u0430\u0442\u043E\u0440","submenu.table style":"\u0422\u0430\u0431\u0435\u043B\u0430 \u0441\u0442\u0438\u043B"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb polece\u0144 LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.alphabetic":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywr\xF3\u0107","tooltip.toggle virtual keyboard":"Prze\u0142\u0105cz wirtualn\u0105 klawiatur\u0119","tooltip.undo":"Cofnij","menu.insert matrix":"Wstaw macierz","menu.insert vector":"Wstaw wektor","menu.insert table":"Wype\u0142nij tabel\u0119","submenu.array.matrix delimiters":"Ograniczniki macierzy","menu.array.add row above":"Dodaj wiersz po","menu.array.add row below":"Dodaj wiersz przed","menu.array.add column after":"Dodaj kolumn\u0119 po","menu.array.add column before":"Dodaj kolumn\u0119 przed","menu.array.delete row":"Usu\u0144 wiersz","menu.array.delete rows":"Usu\u0144 wybrane wiersze","menu.array.delete column":"Usu\u0144 kolumn\u0119","menu.array.delete columns":"Usu\u0144 wybrane kolumny","submenu.array.insert separator":"Wstaw separator","submenu.table style":"Styl tabel\u0119"},pt:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"S\xEDmbolos","keyboard.tooltip.greek":"Letras gregas","keyboard.tooltip.command":"Modo de Comando LaTeX","keyboard.tooltip.numeric":"Num\xE9rico","keyboard.tooltip.alphabetic":"Letras romanas","tooltip.copy to clipboard":"Copiar para \xE1rea de transfer\xEAncia","tooltip.redo":"Refazer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Desfazer","menu.insert matrix":"Inserir Matriz","menu.insert vector":"Inserir vetor","menu.insert table":"Insira a tabela","submenu.array.matrix delimiters":"Delimitadores de matriz","menu.array.add row above":"Adicionar linha depois","menu.array.add row below":"Adicionar linha antes","menu.array.add column after":"Adicionar coluna depois","menu.array.add column before":"Adicionar coluna antes","menu.array.delete row":"Excluir linha","menu.array.delete rows":"Excluir linhas selecionadas","menu.array.delete column":"Apagar Coluna","menu.array.delete columns":"Excluir Colunas Selecionadas","submenu.array.insert separator":"Inserir Separador","submenu.table style":"Estilo tabela"},ro:{"keyboard.tooltip.functions":"Func\u021Bii","keyboard.tooltip.symbols":"Simboluri","keyboard.tooltip.greek":"Scrisori grece\u0219ti","keyboard.tooltip.command":"Modul de comand\u0103 latex","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.alphabetic":"Scrisori romane","tooltip.copy to clipboard":"Copia\u021Bi \xEEn clipboard","tooltip.redo":"A reface","tooltip.toggle virtual keyboard":"Comuta\u021Bi tastatura virtual\u0103","tooltip.undo":"Anula","menu.insert matrix":"Introduce\u021Bi Matrix","menu.insert vector":"Insera\u021Bi Vector","menu.insert table":"Introduce\u021Bi tabelul","submenu.array.matrix delimiters":"Delimitatori de matrice","menu.array.add row above":"Ad\u0103uga\u021Bi r\xE2ndul dup\u0103","menu.array.add row below":"Ad\u0103uga\u021Bi r\xE2ndul \xEEnainte","menu.array.add column after":"Ad\u0103uga\u021Bi o coloan\u0103 dup\u0103","menu.array.add column before":"Ad\u0103uga\u021Bi o coloan\u0103 \xEEnainte","menu.array.delete row":"\u0218terge\u021Bi r\xE2ndul","menu.array.delete rows":"\u0218terge\u021Bi r\xE2ndurile selectate","menu.array.delete column":"\u0218terge\u021Bi coloana","menu.array.delete columns":"\u0218terge\u021Bi coloanele selectate","submenu.array.insert separator":"Introduce\u021Bi separatorul","submenu.table style":"Table style"},ru:{"keyboard.tooltip.functions":"\u0424\u0443\u043D\u043A\u0446\u0438\u0438","keyboard.tooltip.symbols":"\u0421\u0438\u043C\u0432\u043E\u043B\u044B","keyboard.tooltip.greek":"\u0413\u0440\u0435\u0447\u0435\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B","keyboard.tooltip.command":"\u0420\u0435\u0436\u0438\u043C \u043A\u043E\u043C\u0430\u043D\u0434\u043D\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438 \u041B\u0430\u0442\u0435\u043A\u0441","keyboard.tooltip.numeric":"\u0447\u0438\u0441\u043B\u043E\u0432\u043E\u0439","keyboard.tooltip.alphabetic":"\u041B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B","tooltip.copy to clipboard":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430","tooltip.redo":"\u043F\u0435\u0440\u0435\u0434\u0435\u043B\u044B\u0432\u0430\u0442\u044C","tooltip.toggle virtual keyboard":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0432\u0438\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0443\u044E \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443","tooltip.undo":"\u0440\u0430\u0441\u0441\u0442\u0435\u0433\u0438\u0432\u0430\u0442\u044C","menu.insert matrix":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043C\u0430\u0442\u0440\u0438\u0446\u0443","menu.insert vector":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0432\u0435\u043A\u0442\u043E\u0440","menu.insert table":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0442\u0430\u0431\u043B\u0438\u0446\u0443","submenu.array.matrix delimiters":"\u041C\u0430\u0442\u0440\u0438\u0447\u043D\u044B\u0435 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u0438","menu.array.add row above":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0441\u043B\u0435","menu.array.add row below":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u0435\u0440\u0435\u0434","menu.array.add column after":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u043F\u043E\u0441\u043B\u0435","menu.array.add column before":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u043F\u0435\u0440\u0435\u0434","menu.array.delete row":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443","menu.array.delete rows":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438","menu.array.delete column":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446","menu.array.delete columns":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u043E\u043B\u0431\u0446\u044B","submenu.array.insert separator":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C","submenu.table style":"\u0422\u0430\u0431\u043B\u0438\u0447\u043D\u044B\u0439 \u0441\u0442\u0438\u043B\u044C"},sk:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symboly","keyboard.tooltip.greek":"Gr\xE9cke listy","keyboard.tooltip.command":"Pr\xEDkazov\xFD re\u017Eim LaTeX","keyboard.tooltip.numeric":"Numerick\xE9","keyboard.tooltip.alphabetic":"R\xEDmske listy","tooltip.copy to clipboard":"Skop\xEDrova\u0165 do schr\xE1nky","tooltip.redo":"Znova","tooltip.toggle virtual keyboard":"Prepn\xFA\u0165 virtu\xE1lnu kl\xE1vesnicu","tooltip.undo":"Vr\xE1tenie sp\xE4\u0165","menu.insert matrix":"Vlo\u017Ete maticu","menu.insert vector":"Vlo\u017Ete vektor","menu.insert table":"Vlo\u017Ete tabu\u013Eku","submenu.array.matrix delimiters":"Odde\u013Eova\u010De mat\xEDc","menu.array.add row above":"Pridajte riadok za","menu.array.add row below":"Pridajte riadok pred","menu.array.add column after":"Prida\u0165 st\u013Apec za","menu.array.add column before":"Pridajte st\u013Apec predt\xFDm","menu.array.delete row":"Odstr\xE1ni\u0165 riadok","menu.array.delete rows":"Odstr\xE1ni\u0165 vybrat\xE9 riadky","menu.array.delete column":"Odstr\xE1ni\u0165 st\u013Apec","menu.array.delete columns":"Odstr\xE1ni\u0165 vybrat\xE9 st\u013Apce","submenu.array.insert separator":"Vlo\u017Ete odde\u013Eova\u010D","submenu.table style":"\u0160t\xFDl tabu\u013Eky"},sl:{"keyboard.tooltip.functions":"Funkcije","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Gr\u0161ka pisma","keyboard.tooltip.command":"Ukazni na\u010Din LaTeX","keyboard.tooltip.numeric":"\u0160tevilsko","keyboard.tooltip.alphabetic":"Rimska pisma","tooltip.copy to clipboard":"Kopirati v odlo\u017Ei\u0161\u010De","tooltip.redo":"Ponovi","tooltip.toggle virtual keyboard":"Preklop navidezne tipkovnice","tooltip.undo":"Razveljavi","menu.insert matrix":"Vstavi matrico","menu.insert vector":"Vstavi vektor","menu.insert table":"Vstavi tabelo","submenu.array.matrix delimiters":"Matri\u010Dni lo\u010Devalniki","menu.array.add row above":"Dodaj vrstico po","menu.array.add row below":"Dodaj vrstico prej","menu.array.add column after":"Dodaj stolpec po","menu.array.add column before":"Dodaj stolpec prej","menu.array.delete row":"Izbri\u0161i vrstico","menu.array.delete rows":"Izbri\u0161i izbrane vrstice","menu.array.delete column":"Izbri\u0161i stolpec","menu.array.delete columns":"Izbri\u0161i izbrane stolpce","submenu.array.insert separator":"Vstavi lo\u010Dilo","submenu.table style":"Tabela slog"},sq:{"keyboard.tooltip.functions":"Funksione","keyboard.tooltip.symbols":"Simbolet","keyboard.tooltip.greek":"Letrat Greke","keyboard.tooltip.command":"Modaliteti i komand\xEBs latex","keyboard.tooltip.numeric":"Numerike","keyboard.tooltip.alphabetic":"Letrat romake","tooltip.copy to clipboard":"Kopjoni n\xEB Clipboard","tooltip.redo":"Riparo","tooltip.toggle virtual keyboard":"Aktivizo tastier\xEBn virtuale","tooltip.undo":"Zhb\xEBj","menu.insert matrix":"Vendosni Matric\xEBn","menu.insert vector":"Vendos vektorin","menu.insert table":"Vendos tabel\xEBn","submenu.array.matrix delimiters":"P\xEBrcaktuesit e matric\xEBs","menu.array.add row above":"Shto Rreshtin Pas","menu.array.add row below":"Shto Rreshtin Para","menu.array.add column after":"Shto kolon\xEBn pas","menu.array.add column before":"Shto kolon\xEBn para","menu.array.delete row":"Fshi Rreshtin","menu.array.delete rows":"Fshi rreshtat e zgjedhur","menu.array.delete column":"Fshi kolon\xEBn","menu.array.delete columns":"Fshi kolonat e zgjedhura","submenu.array.insert separator":"Vendos Ndar\xEBsin","submenu.table style":"Stili tabel\xEBn"},sr:{"keyboard.tooltip.functions":"\u0424\u0443\u043D\u043A\u0446\u0438\u0458\u0435","keyboard.tooltip.symbols":"\u0421\u0438\u043C\u0431\u043E\u043B\u0438","keyboard.tooltip.greek":"\u0413\u0440\u0435\u0435\u043A \u041B\u0435\u0442\u0442\u0435\u0440\u0441","keyboard.tooltip.command":"\u041B\u0430\u0422\u0435\u041A\u0441 \u043A\u043E\u043C\u0430\u043D\u0434\u043D\u0438 \u0440\u0435\u0436\u0438\u043C","keyboard.tooltip.numeric":"\u041D\u0443\u043C\u0435\u0440\u0438\u0447\u043A\u0438","keyboard.tooltip.alphabetic":"\u0420\u0438\u043C\u0441\u043A\u0430 \u043F\u0438\u0441\u043C\u0430","tooltip.copy to clipboard":"\u041A\u043E\u043F\u0438\u0440\u0430\u0458\u0442\u0435 \u0443 \u043C\u0435\u0452\u0443\u0441\u043F\u0440\u0435\u043C\u043D\u0438\u043A","tooltip.redo":"\u041F\u043E\u043D\u043E\u0432\u0438","tooltip.toggle virtual keyboard":"\u0423\u043A\u0459\u0443\u0447\u0438 / \u0438\u0441\u043A\u0459\u0443\u0447\u0438 \u0432\u0438\u0440\u0442\u0443\u0435\u043B\u043D\u0443 \u0442\u0430\u0441\u0442\u0430\u0442\u0443\u0440\u0443","tooltip.undo":"\u041E\u043F\u043E\u0437\u043E\u0432\u0438","menu.insert matrix":"\u0423\u043C\u0435\u0442\u043D\u0438 \u043C\u0430\u0442\u0440\u0438\u0446\u0443","menu.insert vector":"\u0423\u043C\u0435\u0442\u043D\u0438 \u0432\u0435\u043A\u0442\u043E\u0440","menu.insert table":"\u0423\u0431\u0430\u0446\u0438 \u0442\u0430\u0431\u0435\u043B\u0443","submenu.array.matrix delimiters":"\u041C\u0430\u0442\u0440\u0438\u043A \u0414\u0435\u043B\u0438\u043C\u0438\u0442\u0435\u0440\u0441","menu.array.add row above":"\u0414\u043E\u0434\u0430\u0458 \u0440\u0435\u0434 \u043F\u043E\u0441\u043B\u0435","menu.array.add row below":"\u0414\u043E\u0434\u0430\u0458 \u0440\u0435\u0434 \u043F\u0440\u0435","menu.array.add column after":"\u0414\u043E\u0434\u0430\u0458 \u043A\u043E\u043B\u043E\u043D\u0443 \u043F\u043E\u0441\u043B\u0435","menu.array.add column before":"\u0414\u043E\u0434\u0430\u0458 \u043A\u043E\u043B\u043E\u043D\u0443 \u043F\u0440\u0435","menu.array.delete row":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0440\u0435\u0434","menu.array.delete rows":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0438\u0437\u0430\u0431\u0440\u0430\u043D\u0435 \u0440\u0435\u0434\u043E\u0432\u0435","menu.array.delete column":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u043A\u043E\u043B\u043E\u043D\u0443","menu.array.delete columns":"\u0418\u0437\u0431\u0440\u0438\u0448\u0438 \u0438\u0437\u0430\u0431\u0440\u0430\u043D\u0435 \u043A\u043E\u043B\u043E\u043D\u0435","submenu.array.insert separator":"\u0423\u043C\u0435\u0442\u043D\u0438 \u0441\u0435\u043F\u0430\u0440\u0430\u0442\u043E\u0440","submenu.table style":"\u0422\u0430\u0431\u0435\u043B\u0430\u0440\u043D\u0438 \u0441\u0442\u0438\u043B"},sv:{"keyboard.tooltip.functions":"Funktioner","keyboard.tooltip.symbols":"Symboler","keyboard.tooltip.greek":"Grekiska bokst\xE4ver","keyboard.tooltip.command":"LaTeX kommandol\xE4ge","keyboard.tooltip.numeric":"Numerisk","keyboard.tooltip.alphabetic":"Romerska bokst\xE4ver","tooltip.copy to clipboard":"Kopiera till Urklipp","tooltip.redo":"G\xF6ra om","tooltip.toggle virtual keyboard":"V\xE4xla virtuellt tangentbord","tooltip.undo":"\xC5ngra","menu.insert matrix":"S\xE4tt in matris","menu.insert vector":"Infoga vektor","menu.insert table":"Infoga tabell","submenu.array.matrix delimiters":"Matrisavgr\xE4nsare","menu.array.add row above":"L\xE4gg till rad efter","menu.array.add row below":"L\xE4gg till rad f\xF6re","menu.array.add column after":"L\xE4gg till kolumn efter","menu.array.add column before":"L\xE4gg till kolumn f\xF6re","menu.array.delete row":"Radera rad","menu.array.delete rows":"Ta bort valda rader","menu.array.delete column":"Ta bort kolumn","menu.array.delete columns":"Ta bort valda kolumner","submenu.array.insert separator":"S\xE4tt i separator","submenu.table style":"Tabellstil"},th:{"keyboard.tooltip.functions":"\u0E1F\u0E31\u0E07\u0E01\u0E4C\u0E0A\u0E31\u0E48\u0E19","keyboard.tooltip.symbols":"\u0E2A\u0E31\u0E0D\u0E25\u0E31\u0E01\u0E29\u0E13\u0E4C","keyboard.tooltip.greek":"\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E01\u0E23\u0E35\u0E01","keyboard.tooltip.command":"\u0E42\u0E2B\u0E21\u0E14\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07 \u0E19\u0E49\u0E33\u0E22\u0E32\u0E07","keyboard.tooltip.numeric":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02","keyboard.tooltip.alphabetic":"\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E42\u0E23\u0E21\u0E31\u0E19","tooltip.copy to clipboard":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E17\u0E35\u0E48\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14","tooltip.redo":"\u0E17\u0E33\u0E0B\u0E49\u0E33","tooltip.toggle virtual keyboard":"\u0E2A\u0E25\u0E31\u0E1A\u0E41\u0E1B\u0E49\u0E19\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E2A\u0E21\u0E37\u0E2D\u0E19","tooltip.undo":"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33","menu.insert matrix":"\u0E41\u0E17\u0E23\u0E01\u0E40\u0E21\u0E17\u0E23\u0E34\u0E01\u0E0B\u0E4C","menu.insert vector":"\u0E41\u0E17\u0E23\u0E01\u0E40\u0E27\u0E01\u0E40\u0E15\u0E2D\u0E23\u0E4C","menu.insert table":"\u0E41\u0E17\u0E23\u0E01\u0E15\u0E32\u0E23\u0E32\u0E07","submenu.array.matrix delimiters":"\u0E15\u0E31\u0E27\u0E04\u0E31\u0E48\u0E19\u0E40\u0E21\u0E17\u0E23\u0E34\u0E01\u0E0B\u0E4C","menu.array.add row above":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E41\u0E16\u0E27\u0E2B\u0E25\u0E31\u0E07","menu.array.add row below":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E41\u0E16\u0E27\u0E01\u0E48\u0E2D\u0E19","menu.array.add column after":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2B\u0E25\u0E31\u0E07","menu.array.add column before":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E01\u0E48\u0E2D\u0E19","menu.array.delete row":"\u0E25\u0E1A\u0E41\u0E16\u0E27","menu.array.delete rows":"\u0E25\u0E1A\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01","menu.array.delete column":"\u0E25\u0E1A\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C","menu.array.delete columns":"\u0E25\u0E1A\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01","submenu.array.insert separator":"\u0E15\u0E31\u0E27\u0E04\u0E31\u0E48\u0E19\u0E41\u0E17\u0E23\u0E01","submenu.table style":"\u0E2A\u0E44\u0E15\u0E25\u0E4C\u0E15\u0E32\u0E23\u0E32\u0E07"},tr:{"keyboard.tooltip.functions":"Fonksiyonlar","keyboard.tooltip.symbols":"Semboller","keyboard.tooltip.greek":"Yunan harfleri","keyboard.tooltip.command":"LaTeX Komut Modu","keyboard.tooltip.numeric":"Say\u0131sal","keyboard.tooltip.alphabetic":"Roma Harfleri","tooltip.copy to clipboard":"Panoya kopyala","tooltip.redo":"Yeniden yap","tooltip.toggle virtual keyboard":"Sanal Klavyeyi A\xE7/Kapat","tooltip.undo":"Geri alma","menu.insert matrix":"Matris Ekle","menu.insert vector":"Vekt\xF6r Ekle","menu.insert table":"Tablo Ekle","submenu.array.matrix delimiters":"Matris S\u0131n\u0131rlay\u0131c\u0131lar","menu.array.add row above":"Sat\u0131rdan Sonra Ekle","menu.array.add row below":"\xD6nce Sat\u0131r Ekle","menu.array.add column after":"Sonra S\xFCtun Ekle","menu.array.add column before":"\xD6nce S\xFCtun Ekle","menu.array.delete row":"S\u0131ray\u0131 sil","menu.array.delete rows":"Se\xE7ili Sat\u0131rlar\u0131 Sil","menu.array.delete column":"S\xFCtunu Sil","menu.array.delete columns":"Se\xE7ili S\xFCtunlar\u0131 Sil","submenu.array.insert separator":"Ay\u0131r\u0131c\u0131 Ekle","submenu.table style":"Tablo Stili"},uk:{"keyboard.tooltip.functions":"\u0424\u0443\u043D\u043A\u0446\u0456\u0457","keyboard.tooltip.symbols":"\u0421\u0438\u043C\u0432\u043E\u043B\u0438","keyboard.tooltip.greek":"\u0413\u0440\u0435\u0446\u044C\u043A\u0456 \u043B\u0456\u0442\u0435\u0440\u0438","keyboard.tooltip.command":"\u041A\u043E\u043C\u0430\u043D\u0434\u043D\u0438\u0439 \u0440\u0435\u0436\u0438\u043C \u043B\u0430\u0442\u0435\u043A\u0441\u0443","keyboard.tooltip.numeric":"\u0427\u0438\u0441\u043B\u043E\u0432\u0438\u0439","keyboard.tooltip.alphabetic":"\u0420\u0438\u043C\u0441\u044C\u043A\u0456 \u043B\u0456\u0442\u0435\u0440\u0438","tooltip.copy to clipboard":"\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0456\u043D\u0443","tooltip.redo":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438","tooltip.toggle virtual keyboard":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u0438 \u0432\u0456\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0443 \u043A\u043B\u0430\u0432\u0456\u0430\u0442\u0443\u0440\u0443","tooltip.undo":"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438","menu.insert matrix":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043C\u0430\u0442\u0440\u0438\u0446\u044E","menu.insert vector":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0432\u0435\u043A\u0442\u043E\u0440","menu.insert table":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E","submenu.array.matrix delimiters":"\u041C\u0430\u0442\u0440\u0438\u0447\u043D\u0456 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A\u0438","menu.array.add row above":"\u0414\u043E\u0434\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u043F\u0456\u0441\u043B\u044F","menu.array.add row below":"\u0414\u043E\u0434\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u0434\u043E","menu.array.add column after":"\u0414\u043E\u0434\u0430\u0442\u0438 \u0441\u0442\u043E\u0432\u043F\u0435\u0446\u044C \u043F\u0456\u0441\u043B\u044F","menu.array.add column before":"\u0414\u043E\u0434\u0430\u0442\u0438 \u0441\u0442\u043E\u0432\u043F\u0435\u0446\u044C \u043F\u0435\u0440\u0435\u0434","menu.array.delete row":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0440\u044F\u0434\u043E\u043A","menu.array.delete rows":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0456 \u0440\u044F\u0434\u043A\u0438","menu.array.delete column":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0441\u0442\u043E\u0432\u043F\u0435\u0446\u044C","menu.array.delete columns":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0456 \u0441\u0442\u043E\u0432\u043F\u0446\u0456","submenu.array.insert separator":"\u0412\u0441\u0442\u0430\u0432\u0442\u0435 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A","submenu.table style":"\u0421\u0442\u0438\u043B\u044C \u0442\u0430\u0431\u043B\u0438\u0446\u0456"},vi:{"keyboard.tooltip.functions":"Ch\u1EE9c n\u0103ng","keyboard.tooltip.symbols":"K\xFD hi\u1EC7u","keyboard.tooltip.greek":"Ch\u1EEF Hy L\u1EA1p","keyboard.tooltip.command":"Ch\u1EBF \u0111\u1ED9 l\u1EC7nh LaTeX","keyboard.tooltip.numeric":"S\u1ED1","keyboard.tooltip.alphabetic":"Ch\u1EEF c\xE1i La m\xE3","tooltip.copy to clipboard":"Sao ch\xE9p v\xE0o clipboard","tooltip.redo":"L\xE0m l\u1EA1i","tooltip.toggle virtual keyboard":"Chuy\u1EC3n \u0111\u1ED5i b\xE0n ph\xEDm \u1EA3o","tooltip.undo":"Ho\xE0n t\xE1c","menu.insert matrix":"Ch\xE8n ma tr\u1EADn","menu.insert vector":"Insert Vector","menu.insert table":"Ch\xE8n b\u1EA3ng","submenu.array.matrix delimiters":"D\u1EA5u ph\xE2n c\xE1ch ma tr\u1EADn","menu.array.add row above":"Th\xEAm h\xE0ng sau","menu.array.add row below":"Th\xEAm h\xE0ng tr\u01B0\u1EDBc","menu.array.add column after":"Th\xEAm c\u1ED9t sau","menu.array.add column before":"Th\xEAm c\u1ED9t tr\u01B0\u1EDBc","menu.array.delete row":"X\xF3a h\xE0ng","menu.array.delete rows":"X\xF3a h\xE0ng \u0111\xE3 ch\u1ECDn","menu.array.delete column":"X\xF3a c\u1ED9t","menu.array.delete columns":"X\xF3a c\xE1c c\u1ED9t \u0111\xE3 ch\u1ECDn","submenu.array.insert separator":"Ch\xE8n d\u1EA5u ph\xE2n c\xE1ch","submenu.table style":"Ki\u1EC3u b\u1EA3ng"},zh_cn:{"keyboard.tooltip.functions":"\u804C\u80FD","keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.command":"\u4E73\u80F6 \u547D\u4EE4\u6A21\u5F0F","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.insert vector":"\u63D2\u5165\u5411\u91CF","menu.insert table":"\u63D2\u5165\u8868\u683C","submenu.array.matrix delimiters":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","submenu.array.insert separator":"\u63D2\u5165\u5206\u9694\u7B26","submenu.table style":"\u8868\u683C\u6837\u5F0F"},zh_tw:{"keyboard.tooltip.functions":"\u8077\u80FD","keyboard.tooltip.symbols":"\u7B26\u865F","keyboard.tooltip.greek":"\u5E0C\u81D8\u5B57\u6BCD","keyboard.tooltip.command":"\u4E73\u81A0\u547D\u4EE4\u6A21\u5F0F","keyboard.tooltip.numeric":"\u6578\u5B57","keyboard.tooltip.alphabetic":"\u7F85\u99AC\u5B57\u6BCD","tooltip.copy to clipboard":"\u8907\u88FD\u5230\u526A\u8CBC\u677F","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u63DB\u865B\u64EC\u9375\u76E4","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9663","menu.insert vector":"\u63D2\u5165\u5411\u91CF","menu.insert table":"\u63D2\u5165\u8868\u683C","submenu.array.matrix delimiters":"\u77E9\u9663\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u5F8C\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u5F8C\u9762\u6DFB\u52A0\u5217","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u522A\u9664\u884C","menu.array.delete rows":"\u522A\u9664\u9078\u5B9A\u884C","menu.array.delete column":"\u522A\u9664\u5217","menu.array.delete columns":"\u522A\u9664\u9078\u5B9A\u7684\u5217","submenu.array.insert separator":"\u63D2\u5165\u5206\u9694\u7B26","submenu.table style":"\u8868\u683C\u6A23\u5F0F"}};function pe(){return"window"in globalThis&&"document"in globalThis}function nc(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function oo(){return typeof navigator.vibrate=="function"}function mt(){var e,r;if(!pe())return"other";let t=(r=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?r:navigator.platform;return/^mac/i.test(t)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(t)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function oc(){if(!pe())return!0;if(/firefox/i.test(navigator.userAgent)){let t=navigator.userAgent.match(/firefox\/(\d+)/i);return t?parseInt(t[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){let t=navigator.userAgent.match(/edg\/(\d+)/i);return t?parseInt(t[1])>=79:!1}return!0}var O={strings:ic,_root:null,_locale:"",_dirty:!1,get root(){return O._root||(O._root=document.querySelector("#l10n")),O._root},set root(t){O._root=t,O._dirty||(O._dirty=!0,setTimeout(()=>O.update(),0))},get locale(){return O._locale||(O._locale=pe()?navigator.language.slice(0,5):"en-US"),O._locale},set locale(t){O._locale=t,O._dirty||(O._dirty=!0,setTimeout(()=>O.update(),0))},merge(t,e){if(typeof t=="string"&&e)O.strings[t]=p(p({},O.strings[t]),e),O._dirty||(O._dirty=!0,setTimeout(()=>O.update(),0));else for(let r of Object.keys(t))O.merge(r,t[r])},update(){if(!O._dirty||!O._root)return;O._dirty=!1;let t=O._root.querySelectorAll("[data-l10n-tooltip]");for(let e of t){let r=e.getAttribute("data-l10n-tooltip");if(r){let i=he(r);i&&e.setAttribute("data-tooltip",i)}}t=O._root.querySelectorAll("[data-l10n-arial-label]");for(let e of t){let r=e.getAttribute("data-l10n-arial-label");if(r){let i=he(r);i&&e.setAttribute("aria-label",i)}}}};function he(t){if(t===void 0)return;let e="",r=O.locale;O.strings[r]&&(e=O.strings[r][t]);let i=r.slice(0,2);if(!e&&O.strings[i]&&(e=O.strings[i][t]),e||(e=O.strings.en[t]),!!e)return e}var _p={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},Sp={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ht={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},Wt={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},ac={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},Ap={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"};function Mr(t){var u,d,m,h,f,x;let e=t.split("!"),r,i,n,o=255,a=255,s=255,l=-1,c=e.length>0&&e[0].startsWith("-");c&&(e[0]=e[0].slice(1));for(let M=0;M=0&&(o=(1-l)*o+l*r,a=(1-l)*a+l*i,s=(1-l)*s+l*n,l=-1),M+1=0&&(o=l*o+(1-l)*r,a=l*a+(1-l)*i,s=l*s+(1-l)*n),c&&(o=255-o,a=255-a,s=255-s),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(a).toString(16)).slice(-2)+("00"+Math.round(s).toString(16)).slice(-2)}function li(t){var e,r;return t=t.trim(),(r=(e=Ht[t.toLowerCase()])!=null?e:Ht[ac[t]])!=null?r:Mr(t)}function Lp(t){if(!t||t[0]!=="#")return;t=t.slice(1);let e;return t.length<=4?(e={r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16)},t.length===4&&(e.a=parseInt(t[3]+t[3],16)/255)):(e={r:parseInt(t[0]+t[1],16),g:parseInt(t[2]+t[3],16),b:parseInt(t[4]+t[5],16)},t.length===8&&(e.a=parseInt(t[6]+t[7],16)/255)),e&&e.a===void 0&&(e.a=1),e}function es(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(e-t)*r+t:r<3?e:r<4?(e-t)*(4-r)+t:t}function Cp(t){let[e,r,i]=[t.h,t.s,t.l];e=(e+360)%360/60,i=Math.max(0,Math.min(i,1)),r=Math.max(0,Math.min(r,1));let n=i<=.5?i*(r+1):i+r-i*r,o=i*2-n;return{r:Math.round(255*es(o,n,e+2)),g:Math.round(255*es(o,n,e)),b:Math.round(255*es(o,n,e-2))}}function ts(t){return t<0?0:t>255?255:Math.round(t)}function Ep(t){let{r:e,g:r,b:i}=t,n=((1<<24)+(ts(e)<<16)+(ts(r)<<8)+ts(i)).toString(16).slice(1);return n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&n[6]===n[7]&&(n=n[0]+n[2]+n[4]),"#"+n}function Tp(t){let{r:e,g:r,b:i}=t;e=e/255,r=r/255,i=i/255;let n=Math.min(e,r,i),o=Math.max(e,r,i),a=o-n,s,l;o===n?s=0:e===o?s=(r-i)/a:r===o?s=2+(i-e)/a:i===o&&(s=4+(e-r)/a),s=Math.min(s*60,360),s<0&&(s+=360);let c=(n+o)/2;return o===n?l=0:c<=.5?l=a/(o+n):l=a/(2-o-n),{h:s,s:l,l:c}}function sc(t){let e=Lp(t);if(!e)return t;let{h:r,s:i,l:n}=Tp(e);return i+=.1,n-=.1,Ep(Cp({h:r,s:i,l:n}))}var rs={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},lc=[{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:"main",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 ao(t,e,r){if(!/[A-Za-z\d]/.test(t)||(r==="up"&&(r=void 0),!e&&!r))return t;let i=t.codePointAt(0);if(i===void 0)return t;for(let n of lc)if((!e||n.variant===e)&&(!r||n.style===r)&&i>=n.offset&&i120831)&&(t<8448||t>8527))return{char:String.fromCodePoint(t)};for(let r in rs)if(rs[r]===t){t=(e=r.codePointAt(0))!=null?e:0;break}for(let r of lc)if(t>=r.start&&t`|$%#&^" ]/,co,_r;oc()?(co=new RegExp("\\p{Letter}","u"),_r=new RegExp("[0-9\\p{Letter}]","u")):(co=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,_r=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function is(t,e,r="mord",i){e!==void 0&&(an[t]={definitionType:"symbol",type:r,variant:i,codepoint:e},lo[e]||(lo[e]=t))}function ue(t,e,r){if(typeof t=="string"){for(let i=0;i{var l,c;return a.frequency===s.frequency?a.match.length===s.match.length?a.matcha.match)}function uc(t){let e="auto",r=t.match(/:([^=]+)/);return r&&(e=r[1].trim()),e}function uo(t){if(!t)return[];let e=[],r=t.split("]");if(r[0].startsWith("[")){e.push({isOptional:!0,type:uc(r[0].slice(1))});for(let i=1;i<=r.length;i++)e.push(...uo(r[i]))}else if(r=t.split("}"),r[0].startsWith("{")){e.push({isOptional:!1,type:uc(r[0].slice(1))});for(let i=1;i<=r.length;i++)e.push(...uo(r[i]))}return e}function as(t){if(!t)return"";let e="",r=!0;for(let i of t)typeof i.value=="string"?e+=i.value:r=!1;return r?e:""}function ss(t,e){typeof t=="string"&&(t=[t]);let r={tabular:!1,params:[],createAtom:e};for(let i of t)ns[i]=r}function pt(t,e,r){typeof t=="string"&&(t=[t]);let n={tabular:!0,params:uo(e),createAtom:r};for(let o of t)ns[o]=n}function v(t,e,r){var n,o;r||(r={});let i={definitionType:"function",params:uo(e),ifMode:r.ifMode,isFunction:(n=r.isFunction)!=null?n:!1,applyMode:r.applyMode,infix:(o=r.infix)!=null?o:!1,createAtom:r.createAtom,applyStyle:r.applyStyle,serialize:r.serialize,render:r.render};if(typeof t=="string")ui["\\"+t]=i;else for(let a of t)ui["\\"+a]=i}var so;function di(t){return so||(so=mo(Pp)),t?mo(p(p({},so),t)):so}function dc(t,e){var r,i,n,o;if(typeof t=="string"){let a=0,s=t;return/(^|[^\\])#1/.test(s)&&(a=1),/(^|[^\\])#2/.test(s)&&(a=2),/(^|[^\\])#3/.test(s)&&(a=3),/(^|[^\\])#4/.test(s)&&(a=4),/(^|[^\\])#5/.test(s)&&(a=5),/(^|[^\\])#6/.test(s)&&(a=6),/(^|[^\\])#7/.test(s)&&(a=7),/(^|[^\\])#8/.test(s)&&(a=8),/(^|[^\\])#9/.test(s)&&(a=9),{expand:(r=e==null?void 0:e.expand)!=null?r:!0,captureSelection:(i=e==null?void 0:e.captureSelection)!=null?i:!0,args:a,def:s}}return p({expand:(n=e==null?void 0:e.expand)!=null?n:!0,captureSelection:(o=e==null?void 0:e.captureSelection)!=null?o:!0,args:0},t)}function mo(t){if(!t)return{};let e={};for(let r of Object.keys(t)){let i=t[r];if(i==null)delete e[r];else if(typeof i=="object"&&"package"in i)for(let n of Object.keys(i.package))e[n]=dc(i.package[n],{expand:!i.primitive,captureSelection:i.captureSelection});else e[r]=dc(i)}return e}function G(t,e="math"){if(!t||t.length===0)return null;let r=null;if(t.startsWith("\\")){if(r=ui[t],r)return!r.ifMode||r.ifMode===e?r:null;e==="math"?r=an[t]:ci[t]&&(r={definitionType:"symbol",type:"mord",codepoint:ci[t]})}else if(e==="math"){if(r=an[t],!r&&t.length===1){let i=sn("math",t.codePointAt(0));return i.startsWith("\\")?g(p({},G(i,"math")),{command:i}):null}}else ci[t]?r={definitionType:"symbol",type:"mord",codepoint:ci[t]}:e==="text"&&(r={definitionType:"symbol",type:"mord",codepoint:t.codePointAt(0)});return r&&r.definitionType==="symbol"&&r.type==="mord"&&(r.codepoint===102||r.codepoint===103||r.codepoint===104)&&(r.isFunction=!0),r!=null?r:null}function po(t,e){if(!t.startsWith("\\"))return null;let r=t.slice(1);return e[r]}function fc(t,e){var o;if(t==="text")return(o=sn(t,e.codePointAt(0)))!=null?o:e;let r;if(r=sn(t,e.codePointAt(0)),r)return r;let i=e.codePointAt(0),n=cc(i);return!n.style&&!n.variant?"":(r=n.char,n.variant&&(r="\\"+n.variant+"{"+r+"}"),n.style==="bold"?r="\\mathbf{"+r+"}":n.style==="italic"?r="\\mathit{"+r+"}":n.style==="bolditalic"&&(r="\\mathbfit{"+r+"}"),"\\mathord{"+r+"}")}function sn(t,e){if(e===void 0)return"";if(t==="math"&&lo[e])return lo[e];if(t==="text"){let r=Object.keys(ci).find(i=>ci[i]===e);return r||String.fromCodePoint(e)}return String.fromCodePoint(e)}var Ne=[0,.68889,0,0,.72222],Sr=[0,.68889,0,0,.66667],ls=[0,.68889,0,0,.77778],ho=[0,.68889,0,0,.61111],gc=[.16667,.68889,0,0,.77778],ln=[0,.68889,0,0,.55556],$=[0,0,0,0,.25],yc=[0,.825,0,0,2.33334],bc=[0,.9,0,0,2.33334],fo=[0,.68889,0,0,.54028],cs=[-.03598,.46402,0,0,.5],ve=[-.13313,.36687,0,0,1],go=[.01354,.52239,0,0,1],xc=[.01354,.52239,0,0,1.11111],vc=[0,.54986,0,0,1],yo=[0,.69224,0,0,.5],us=[0,.43056,0,0,1],Ut=[.08198,.58198,0,0,.77778],bo=[.19444,.69224,0,0,.41667],xo=[.1808,.675,0,0,1],wc=[.19444,.69224,0,0,.83334],kc=[.13667,.63667,0,0,1],Mc=[-.064,.437,0,0,1.334],jt=[.08167,.58167,0,0,.77778],cn=[0,.69224,0,0,.72222],ds=[0,.69224,0,0,.66667],vo=[-.13313,.36687,0,0,.77778],_c=[.06062,.54986,0,0,.77778],wo=[0,.69224,0,0,.77778],mi=[.25583,.75583,0,0,.77778],ht=[.25142,.75726,0,0,.77778],pi=[.20576,.70576,0,0,.77778],Ze=[.30274,.79383,0,0,.77778],un=[.22958,.72958,0,0,.77778],Sc=[.1808,.675,0,0,.77778],ft=[.13667,.63667,0,0,.77778],Be=[.13597,.63597,0,0,.77778],Jt=[.03517,.54986,0,0,.77778],hi=[0,.675,0,0,.77778],Ac=[.19444,.69224,0,0,.61111],Lc=[0,.54986,0,0,.76042],Cc=[0,.54986,0,0,.66667],Gt=[.0391,.5391,0,0,.77778],Ec=[.03517,.54986,0,0,1.33334],Tc=[.38569,.88569,0,0,.77778],ko=[.23222,.74111,0,0,.77778],Dc=[.19444,.69224,0,0,.77778],Kc=[0,.37788,0,0,.5],Mo=[0,.54986,0,0,.72222],Bc=[0,.69224,0,0,.83334],Pc=[.11111,.69224,0,0,.66667],fi=[.26167,.75726,0,0,.77778],Oc=[.48256,.98256,0,0,.77778],zc=[.28481,.79383,0,0,.77778],Ic=[.08167,.58167,0,0,.22222],Rc=[.08167,.58167,0,0,.38889],Nc=[0,.43056,.04028,0,.66667],Fc=[.41951,.91951,0,0,.77778],Vc=[.24982,.74947,0,0,.38865],$c=[.08319,.58283,0,0,.75623],qc=[0,.10803,0,0,.27764],ms=[0,.47534,0,0,.50181],dn=[.18906,.47534,0,0,.50181],Hc=[0,.69141,0,0,.50181],Wc=[.24982,.74947,0,0,.27764],ps=[0,.69141,0,0,.21471],_o=[.25,.75,0,0,.44722],Fe=[0,.64444,0,0,.575],gi=[.08556,.58556,0,0,.89444],So=[0,.69444,0,0,.89444],Ao=[0,.68611,0,0,.9],hs=[0,.68611,0,0,.86944],Xt=[.25,.75,0,0,.575],Lo=[.25,.75,0,0,.31944],Ar=[0,.69444,0,0,.63889],yi=[0,.69444,0,0,.31944],Uc=[0,.44444,0,0,.63889],jc=[0,.44444,0,0,.51111],Zt=[0,.69444,0,0,.575],Ye=[.13333,.63333,0,0,.89444],Jc=[0,.44444,0,0,.31944],Gc=[0,.69444,0,0,.86944],Xc=[0,.68611,0,0,.69166],Co=[0,.68611,0,0,.83055],fs=[0,.68611,0,0,.89444],gs=[0,.69444,0,0,.60278],Zc=[.19444,.69444,0,0,.51111],Yc=[0,.69444,0,0,.83055],gt=[-.10889,.39111,0,0,1.14999],Qc=[.19444,.69444,0,0,.575],mn=[.19444,.69444,0,0,1.14999],eu=[.19444,.69444,0,0,.70277],tu=[.05556,.75,0,0,.575],ys=[0,.68611,0,0,.95833],ru=[.08556,.58556,0,0,.76666],bs=[-.02639,.47361,0,0,.575],iu=[0,.44444,0,0,.89444],Lr=[0,.55556,0,0,.76666],nu=[-.10889,.39111,0,0,.89444],xs=[.00222,.50222,0,0,.89444],Yt=[.19667,.69667,0,0,.89444],ou=[.08556,.58556,0,0,1.14999],vs=[0,.69444,0,0,.70277],Eo=[-.02778,.47222,0,0,.575],To=[.25,.75,0,0,.51111],au=[-.13889,.36111,0,0,1.14999],su=[.19444,.69444,0,0,1.02222],Do=[.12963,.69444,0,0,.89444],lu=[.19444,.69444,0,0,.44722],Qt=[0,.64444,.13167,0,.59111],cu=[.19444,.64444,.13167,0,.59111],ws=[0,.68611,.17208,0,.8961],uu=[.19444,.44444,.105,0,.53222],du=[0,.44444,.085,0,.82666],mu=[0,.69444,.06709,0,.59111],Ko=[0,.69444,.12945,0,.35555],pu=[0,.69444,0,0,.94888],ks=[0,.69444,.11472,0,.59111],hu=[0,.68611,.10778,0,.88555],fu=[0,.69444,.07939,0,.62055],Bo=[0,.69444,.12417,0,.30667],er=[0,.64444,.13556,0,.51111],gu=[.19444,.64444,.13556,0,.51111],Po=[0,.68333,.16389,0,.74333],yu=[.19444,.43056,.08847,0,.46],bu=[0,.43056,.07514,0,.71555],xu=[0,.69444,.06646,0,.51111],vu=[0,.69444,0,0,.83129],wu=[0,.69444,.1225,0,.51111],ku=[0,.68333,.09403,0,.76666],Mu=[0,.68333,.11111,0,.76666],_u=[0,.69444,.06961,0,.51444],Et=[0,.69444,0,0,.27778],bi=[.25,.75,0,0,.38889],Ve=[0,.64444,0,0,.5],Cr=[0,.69444,0,0,.77778],Er=[0,.68333,0,0,.75],pn=[0,.68333,0,0,.77778],Su=[0,.68333,0,0,.68056],hn=[0,.68333,0,0,.72222],Tt=[.25,.75,0,0,.5],Oo=[.25,.75,0,0,.27778],de=[0,.69444,0,0,.5],xi=[0,.69444,0,0,.55556],Ms=[0,.43056,0,0,.44445],fn=[0,.43056,0,0,.5],Au=[.19444,.43056,0,0,.55556],Lu=[0,.43056,0,0,.55556],$e=[.08333,.58333,0,0,.77778],Cu=[0,.43056,0,0,.27778],Eu=[0,.66786,0,0,.27778],Tu=[0,.69444,0,0,.75],Du=[0,.66786,0,0,.5],Ku=[0,.68333,0,0,.625],_s=[.19444,.69444,0,0,.44445],gn=[0,.69444,0,0,.72222],Bu=[.19444,.69444,0,0,.5],yn=[.19444,.69444,0,0,1],Pu=[.011,.511,0,0,1.126],Ss=[.19444,.69444,0,0,.61111],As=[.05556,.75,0,0,.5],Ou=[0,.68333,0,0,.83334],zu=[.0391,.5391,0,0,.66667],Ls=[-.05555,.44445,0,0,.5],Iu=[0,.43056,0,0,.77778],Tr=[0,.55556,0,0,.66667],zo=[-.03625,.46375,0,0,.77778],Ru=[-.01688,.48312,0,0,.77778],Nu=[.0391,.5391,0,0,1],tr=[0,.69444,0,0,.61111],Io=[-.03472,.46528,0,0,.5],Ro=[.25,.75,0,0,.44445],Fu=[-.14236,.35764,0,0,1],No=[.244,.744,0,0,.412],Vu=[.19444,.69444,0,0,.88889],Fo=[.12963,.69444,0,0,.77778],$u=[.19444,.69444,0,0,.38889],qu=[.011,.511,0,0,1.638],Hu=[.19444,.69444,0,0,0],Vo=[0,.44444,0,0,.575],bn=[.19444,.44444,0,0,.575],Wu=[0,.68611,0,0,.75555],Uu=[0,.69444,0,0,.66759],ju=[0,.68611,0,0,.80555],Ju=[0,.68611,.08229,0,.98229],Gu=[0,.68611,0,0,.76666],Xu=[0,.44444,0,0,.58472],Zu=[.19444,.44444,0,0,.6118],xn=[.19444,.43056,0,0,.5],Yu=[0,.68333,.02778,.08334,.76278],Qu=[0,.68333,.08125,.05556,.83125],ed=[0,.43056,0,.05556,.48472],td=[.19444,.43056,0,.08334,.51702],rd=[.25,.75,0,0,.42778],ye=[0,.69444,0,0,.55],Dt=[0,.69444,0,0,.73334],rr=[0,.69444,0,0,.79445],id=[0,.69444,0,0,.51945],Cs=[0,.69444,0,0,.70278],nd=[0,.69444,0,0,.76389],od=[.25,.75,0,0,.34306],Es=[0,.69444,0,0,.56111],ad=[0,.69444,0,0,.25556],sd=[.19444,.45833,0,0,.56111],ld=[0,.45833,0,0,.56111],$o=[0,.69444,0,0,.30556],cd=[0,.69444,0,0,.58056],ud=[0,.69444,0,0,.67223],Ts=[0,.69444,0,0,.85556],Ds=[0,.69444,0,0,.55834],yt=[0,.65556,.11156,0,.5],Ks=[0,.69444,.08094,0,.70834],Bs=[.17014,0,0,0,.44445],dd=[0,.69444,.0799,0,.5],md=[0,.69444,0,0,.73752],pd=[0,.69444,.09205,0,.5],hd=[0,.69444,.09031,0,.77778],Ps=[0,.69444,.07816,0,.27778],fd=[0,.69444,.00316,0,.5],gd=[.19444,.69444,0,0,.83334],yd=[.05556,.75,0,0,.83334],bd=[0,.75,0,0,.5],xd=[.125,.08333,0,0,.27778],vd=[0,.08333,0,0,.27778],bt=[0,.65556,0,0,.5],Os=[0,.69444,0,0,.47222],Kt=[0,.69444,0,0,.66667],wd=[0,.69444,0,0,.59722],zs=[0,.69444,0,0,.54167],Is=[0,.69444,0,0,.70834],kd=[.25,.75,0,0,.28889],Rs=[0,.69444,0,0,.51667],Md=[0,.44444,0,0,.44445],_d=[.19444,.44444,0,0,.51667],Sd=[0,.44444,0,0,.38333],Ad=[0,.44444,0,0,.51667],Ld=[0,.69444,0,0,.83334],Cd=[.35001,.85,0,0,.45834],Ed=[.35001,.85,0,0,.57778],Td=[.35001,.85,0,0,.41667],Dd=[.35001,.85,0,0,.58334],qo=[0,.72222,0,0,.55556],Kd=[1e-5,.6,0,0,.66667],Bd=[1e-5,.6,0,0,.77778],Pd=[.25001,.75,0,0,.94445],Od=[.306,.805,.19445,0,.47222],zd=[.30612,.805,.19445,0,.47222],vi=[.25001,.75,0,0,.83334],wi=[.35001,.85,0,0,.47222],Ns=[.25001,.75,0,0,1.11111],Id=[.65002,1.15,0,0,.59722],Rd=[.65002,1.15,0,0,.81111],Nd=[.65002,1.15,0,0,.47222],Fd=[.65002,1.15,0,0,.66667],Ho=[0,.75,0,0,1],Vd=[.55001,1.05,0,0,1.27778],$d=[.862,1.36,.44445,0,.55556],qd=[.86225,1.36,.44445,0,.55556],ki=[.55001,1.05,0,0,1.11111],Wo=[.65002,1.15,0,0,.52778],Hd=[.65002,1.15,0,0,.61111],Fs=[.55001,1.05,0,0,1.51112],Wd=[.95003,1.45,0,0,.73611],Ud=[.95003,1.45,0,0,1.04445],jd=[.95003,1.45,0,0,.52778],Uo=[.95003,1.45,0,0,.75],jo=[0,.75,0,0,1.44445],Jo=[.95003,1.45,0,0,.58334],Jd=[1.25003,1.75,0,0,.79167],Gd=[1.25003,1.75,0,0,1.27778],Xd=[1.25003,1.75,0,0,.58334],Go=[1.25003,1.75,0,0,.80556],Xo=[0,.825,0,0,1.8889],Zo=[1.25003,1.75,0,0,.63889],Yo=[.64502,1.155,0,0,.875],Zd=[1e-5,.6,0,0,.875],Vs=[-99e-5,.601,0,0,.66667],Qo=[.64502,1.155,0,0,.66667],Yd=[1e-5,.9,0,0,.88889],Qd=[.65002,1.15,0,0,.88889],e0=[.90001,0,0,0,.88889],t0=[-.00499,.605,0,0,1.05556],ea=[0,.12,0,0,.45],C=[0,.61111,0,0,.525],Qe=[.08333,.69444,0,0,.525],r0=[-.08056,.53055,0,0,.525],i0=[-.05556,.55556,0,0,.525],Le=[0,.43056,0,0,.525],vn=[.22222,.43056,0,0,.525],n0=[0,0,0,0,.525],o0={"AMS-Regular":{32:$,65:Ne,66:Sr,67:Ne,68:Ne,69:Sr,70:ho,71:ls,72:ls,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:ls,76:Sr,77:[0,.68889,0,0,.94445],78:Ne,79:gc,80:ho,81:gc,82:Ne,83:ln,84:Sr,85:Ne,86:Ne,87:[0,.68889,0,0,1],88:Ne,89:Ne,90:Sr,107:ln,160:$,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ln,295:fo,710:yc,732:bc,770:yc,771:bc,989:jt,1008:Nc,8245:[0,.54986,0,0,.275],8463:fo,8487:Ne,8498:ln,8502:Sr,8503:[0,.68889,0,0,.44445],8504:Sr,8513:[0,.68889,0,0,.63889],8592:cs,8594:cs,8602:ve,8603:ve,8606:go,8608:go,8610:xc,8611:xc,8619:vc,8620:vc,8621:[-.13313,.37788,0,0,1.38889],8622:ve,8624:yo,8625:yo,8630:us,8631:us,8634:Ut,8635:Ut,8638:bo,8639:bo,8642:bo,8643:bo,8644:xo,8646:xo,8647:xo,8648:wc,8649:xo,8650:wc,8651:go,8652:go,8653:ve,8654:ve,8655:ve,8666:kc,8667:kc,8669:[-.13313,.37788,0,0,1],8672:Mc,8674:Mc,8705:[0,.825,0,0,.5],8708:ln,8709:jt,8717:[0,.43056,0,0,.42917],8722:cs,8724:[.08198,.69224,0,0,.77778],8726:jt,8733:wo,8736:cn,8737:cn,8738:[.03517,.52239,0,0,.72222],8739:Ic,8740:[.25142,.74111,0,0,.27778],8741:Rc,8742:[.25142,.74111,0,0,.5],8756:ds,8757:ds,8764:vo,8765:[-.13313,.37788,0,0,.77778],8769:vo,8770:zo,8774:Ze,8776:Ru,8778:jt,8782:_c,8783:_c,8785:Ut,8786:Ut,8787:Ut,8790:wo,8791:un,8796:[.08198,.91667,0,0,.77778],8806:mi,8807:mi,8808:ht,8809:ht,8812:[.25583,.75583,0,0,.5],8814:pi,8815:pi,8816:Ze,8817:Ze,8818:un,8819:un,8822:Sc,8823:Sc,8828:ft,8829:ft,8830:un,8831:un,8832:pi,8833:pi,8840:Ze,8841:Ze,8842:Be,8843:Be,8847:Jt,8848:Jt,8858:Ut,8859:Ut,8861:Ut,8862:hi,8863:hi,8864:hi,8865:hi,8872:[0,.69224,0,0,.61111],8873:cn,8874:[0,.69224,0,0,.88889],8876:ho,8877:ho,8878:Ne,8879:Ne,8882:Jt,8883:Jt,8884:ft,8885:ft,8888:[0,.54986,0,0,1.11111],8890:Au,8891:Ac,8892:Ac,8901:[0,.54986,0,0,.27778],8903:jt,8905:jt,8906:jt,8907:wo,8908:wo,8909:[-.03598,.46402,0,0,.77778],8910:Lc,8911:Lc,8912:Jt,8913:Jt,8914:Cc,8915:Cc,8916:ds,8918:Gt,8919:Gt,8920:Ec,8921:Ec,8922:Tc,8923:Tc,8926:ft,8927:ft,8928:Ze,8929:Ze,8934:ko,8935:ko,8936:ko,8937:ko,8938:pi,8939:pi,8940:Ze,8941:Ze,8994:Dc,8995:Dc,9416:[.15559,.69224,0,0,.90222],9484:yo,9488:yo,9492:Kc,9496:Kc,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:hi,9633:hi,9650:Mo,9651:Mo,9654:Jt,9660:Mo,9661:Mo,9664:Jt,9674:Pc,9733:[.19444,.69224,0,0,.94445],10003:Bc,10016:Bc,10731:Pc,10846:[.19444,.75583,0,0,.61111],10877:ft,10878:ft,10885:mi,10886:mi,10887:Be,10888:Be,10889:fi,10890:fi,10891:Oc,10892:Oc,10901:ft,10902:ft,10933:ht,10934:ht,10935:fi,10936:fi,10937:fi,10938:fi,10949:mi,10950:mi,10955:zc,10956:zc,57350:Ic,57351:Rc,57352:jt,57353:Nc,57356:ht,57357:ht,57358:Fc,57359:Ze,57360:Ze,57361:Fc,57366:ht,57367:ht,57368:ht,57369:ht,57370:Be,57371:Be},"Caligraphic-Regular":{32:$,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:$},"Fraktur-Regular":{32:$,33:[0,.69141,0,0,.29574],34:ps,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Vc,41:Vc,42:[0,.62119,0,0,.27764],43:$c,44:qc,45:$c,46:qc,47:[.24982,.74947,0,0,.50181],48:ms,49:ms,50:ms,51:dn,52:dn,53:dn,54:Hc,55:dn,56:Hc,57:dn,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:Wc,93:Wc,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:$,8216:ps,8217:ps,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:$,33:[0,.69444,0,0,.35],34:gs,35:[.19444,.69444,0,0,.95833],36:tu,37:[.05556,.75,0,0,.95833],38:So,39:yi,40:_o,41:_o,42:[0,.75,0,0,.575],43:Ye,44:[.19444,.15556,0,0,.31944],45:Sd,46:[0,.15556,0,0,.31944],47:Xt,48:Fe,49:Fe,50:Fe,51:Fe,52:Fe,53:Fe,54:Fe,55:Fe,56:Fe,57:Fe,58:Jc,59:[.19444,.44444,0,0,.31944],60:gi,61:nu,62:gi,63:[0,.69444,0,0,.54305],64:So,65:hs,66:[0,.68611,0,0,.81805],67:Co,68:[0,.68611,0,0,.88194],69:Wu,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Ao,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Xc,77:[0,.68611,0,0,1.09166],78:Ao,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:hs,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Lo,92:Xt,93:Lo,94:Zt,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Ar,99:jc,100:Ar,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Ar,105:yi,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:yi,109:[0,.44444,0,0,.95833],110:Uc,111:Vo,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Uc,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:jc,123:Xt,124:Lo,125:Xt,126:[.35,.34444,0,0,.575],160:$,163:[0,.69444,0,0,.86853],168:Zt,172:[0,.44444,0,0,.76666],176:Gc,177:Ye,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Ye,216:[.04861,.73472,0,0,.89444],223:wd,230:[0,.44444,0,0,.83055],247:Ye,248:[.09722,.54167,0,0,.575],305:Jc,338:[0,.68611,0,0,1.16944],339:iu,567:[.19444,.44444,0,0,.35139],710:Zt,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Zt,715:Zt,728:Zt,729:yi,730:Gc,732:Zt,733:Zt,915:Xc,916:ys,920:fs,923:ju,926:Gu,928:Ao,931:Co,933:fs,934:Co,936:fs,937:Co,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:yi,8217:yi,8220:gs,8221:gs,8224:Zc,8225:Zc,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Uu,8465:Yc,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Yc,8501:vs,8592:gt,8593:Qc,8594:gt,8595:Qc,8596:gt,8597:Xt,8598:mn,8599:mn,8600:mn,8601:mn,8636:gt,8637:gt,8640:gt,8641:gt,8656:gt,8657:eu,8658:gt,8659:eu,8660:gt,8661:[.25,.75,0,0,.70277],8704:Ar,8706:[0,.69444,.06389,0,.62847],8707:Ar,8709:tu,8711:ys,8712:ru,8715:ru,8722:Ye,8723:Ye,8725:Xt,8726:Xt,8727:Eo,8728:bs,8729:bs,8730:[.18,.82,0,0,.95833],8733:iu,8734:[0,.44444,0,0,1.14999],8736:cn,8739:Lo,8741:Xt,8743:Lr,8744:Lr,8745:Lr,8746:Lr,8747:[.19444,.69444,.12778,0,.56875],8764:nu,8768:[.19444,.69444,0,0,.31944],8771:xs,8776:[.02444,.52444,0,0,.89444],8781:xs,8801:xs,8804:Yt,8805:Yt,8810:ou,8811:ou,8826:gi,8827:gi,8834:gi,8835:gi,8838:Yt,8839:Yt,8846:Lr,8849:Yt,8850:Yt,8851:Lr,8852:Lr,8853:Ye,8854:Ye,8855:Ye,8856:Ye,8857:Ye,8866:vs,8867:vs,8868:So,8869:So,8900:bs,8901:[-.02639,.47361,0,0,.31944],8902:Eo,8968:To,8969:To,8970:To,8971:To,8994:au,8995:au,9651:su,9657:Eo,9661:su,9667:Eo,9711:mn,9824:Do,9825:Do,9826:Do,9827:Do,9837:[0,.75,0,0,.44722],9838:lu,9839:lu,10216:_o,10217:_o,10815:Ao,10927:Yt,10928:Yt,57376:Hu},"Main-BoldItalic":{32:$,33:[0,.69444,.11417,0,.38611],34:fu,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Ko,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:Qt,49:Qt,50:Qt,51:Qt,52:cu,53:Qt,54:Qt,55:cu,56:Qt,57:Qt,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:ks,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:ws,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:ws,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:mu,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:uu,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:uu,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:$,168:[0,.69444,.11473,0,.59111],176:pu,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:du,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:du,567:[.19444,.44444,.04611,0,.385],710:mu,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:Ko,730:pu,732:ks,733:ks,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:ws,931:[0,.68611,.11431,0,.82666],933:hu,934:[0,.68611,.05632,0,.82666],936:hu,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Ko,8217:Ko,8220:[0,.69444,.16772,0,.62055],8221:fu},"Main-Italic":{32:$,33:Bo,34:_u,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Bo,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:er,49:er,50:er,51:er,52:gu,53:er,54:er,55:gu,56:er,57:er,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:wu,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:Po,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:Po,79:ku,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:Po,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:xu,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:yu,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:yu,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:$,168:[0,.66786,.10474,0,.51111],176:vu,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:bu,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:bu,710:xu,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:vu,732:[0,.66786,.11585,0,.51111],733:wu,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:ku,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Po,931:[0,.68333,.12028,0,.71555],933:Mu,934:[0,.68333,.05986,0,.71555],936:Mu,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Bo,8217:Bo,8220:[0,.69444,.1685,0,.51444],8221:_u,8463:fo},"Main-Regular":{32:$,33:Et,34:de,35:gd,36:As,37:yd,38:Cr,39:Et,40:bi,41:bi,42:bd,43:$e,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Tt,48:Ve,49:Ve,50:Ve,51:Ve,52:Ve,53:Ve,54:Ve,55:Ve,56:Ve,57:Ve,58:Cu,59:[.19444,.43056,0,0,.27778],60:Gt,61:vo,62:Gt,63:Os,64:Cr,65:Er,66:[0,.68333,0,0,.70834],67:hn,68:[0,.68333,0,0,.76389],69:Su,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Er,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:pn,76:Ku,77:[0,.68333,0,0,.91667],78:Er,79:pn,80:Su,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:hn,85:Er,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Er,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Oo,92:Tt,93:Oo,94:de,95:[.31,.12056,.02778,0,.5],97:fn,98:xi,99:Ms,100:xi,101:Ms,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:xi,105:Eu,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Et,109:[0,.43056,0,0,.83334],110:Lu,111:fn,112:Au,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Lu,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:Ms,123:Tt,124:Oo,125:Tt,126:[.35,.31786,0,0,.5],160:$,163:[0,.69444,0,0,.76909],167:_s,168:Du,172:[0,.43056,0,0,.66667],176:Tu,177:$e,182:Ss,184:Bs,198:[0,.68333,0,0,.90278],215:$e,216:[.04861,.73194,0,0,.77778],223:de,230:[0,.43056,0,0,.72222],247:$e,248:[.09722,.52778,0,0,.5],305:Cu,338:[0,.68333,0,0,1.01389],339:Iu,567:[.19444,.43056,0,0,.30556],710:de,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:de,715:de,728:de,729:Eu,730:Tu,732:Du,733:de,915:Ku,916:Ou,920:pn,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Er,931:hn,933:pn,934:hn,936:pn,937:hn,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Et,8217:Et,8220:de,8221:de,8224:_s,8225:_s,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:fo,8465:gn,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:gn,8501:tr,8592:ve,8593:Bu,8594:ve,8595:Bu,8596:ve,8597:Tt,8598:yn,8599:yn,8600:yn,8601:yn,8614:[.011,.511,0,0,1],8617:Pu,8618:Pu,8636:ve,8637:ve,8640:ve,8641:ve,8652:[.011,.671,0,0,1],8656:ve,8657:Ss,8658:ve,8659:Ss,8660:ve,8661:[.25,.75,0,0,.61111],8704:xi,8706:[0,.69444,.05556,.08334,.5309],8707:xi,8709:As,8711:Ou,8712:zu,8715:zu,8722:$e,8723:$e,8725:Tt,8726:Tt,8727:Io,8728:Ls,8729:Ls,8730:[.2,.8,0,0,.83334],8733:Iu,8734:us,8736:cn,8739:Oo,8741:Tt,8743:Tr,8744:Tr,8745:Tr,8746:Tr,8747:[.19444,.69444,.11111,0,.41667],8764:vo,8768:[.19444,.69444,0,0,.27778],8771:zo,8773:[-.022,.589,0,0,1],8776:Ru,8781:zo,8784:[-.133,.67,0,0,.778],8801:zo,8804:Be,8805:Be,8810:Nu,8811:Nu,8826:Gt,8827:Gt,8834:Gt,8835:Gt,8838:Be,8839:Be,8846:Tr,8849:Be,8850:Be,8851:Tr,8852:Tr,8853:$e,8854:$e,8855:$e,8856:$e,8857:$e,8866:tr,8867:tr,8868:Cr,8869:Cr,8872:[.249,.75,0,0,.867],8900:Ls,8901:[-.05555,.44445,0,0,.27778],8902:Io,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Ro,8969:Ro,8970:Ro,8971:Ro,8994:Fu,8995:Fu,9136:No,9137:No,9651:Vu,9657:Io,9661:Vu,9667:Io,9711:yn,9824:Fo,9825:Fo,9826:Fo,9827:Fo,9837:[0,.75,0,0,.38889],9838:$u,9839:$u,10216:bi,10217:bi,10222:No,10223:No,10229:[.011,.511,0,0,1.609],10230:qu,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:qu,10815:Er,10927:Be,10928:Be,57376:Hu},"Math-BoldItalic":{32:$,48:Vo,49:Vo,50:Vo,51:bn,52:bn,53:bn,54:Fe,55:bn,56:Fe,57:bn,65:hs,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:Ju,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Wu,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:Uu,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Xu,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:$,915:[0,.68611,.15972,0,.65694],916:ys,920:[0,.68611,.03194,0,.86722],923:ju,926:[0,.68611,.07458,0,.84125],928:Ju,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Gu,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Xu,960:[0,.44444,.03704,0,.68241],961:Zu,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:Zu,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:$,48:fn,49:fn,50:fn,51:xn,52:xn,53:xn,54:Ve,55:xn,56:Ve,57:xn,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:Qu,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Yu,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:ed,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:$,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Yu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Qu,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:ed,960:[0,.43056,.03588,0,.57003],961:td,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:td,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:$,33:[0,.69444,0,0,.36667],34:Ds,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:$o,40:rd,41:rd,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:ye,49:ye,50:ye,51:ye,52:ye,53:ye,54:ye,55:ye,56:ye,57:ye,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:id,64:Dt,65:Dt,66:Dt,67:Cs,68:rr,69:[0,.69444,0,0,.64167],70:tr,71:Dt,72:rr,73:[0,.69444,0,0,.33056],74:id,75:nd,76:cd,77:[0,.69444,0,0,.97778],78:rr,79:rr,80:Cs,81:[.10556,.69444,0,0,.79445],82:Cs,83:tr,84:Dt,85:nd,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Dt,89:[0,.69444,.0275,0,.73334],90:ud,91:od,93:od,94:ye,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Es,99:[0,.45833,0,0,.48889],100:Es,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Es,105:ad,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:ad,109:[0,.45833,0,0,.86667],110:ld,111:[0,.45833,0,0,.55],112:sd,113:sd,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:ld,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:$,168:ye,176:Dt,180:ye,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:ye,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:ye,729:$o,730:Dt,732:ye,733:ye,915:cd,916:[0,.69444,0,0,.91667],920:Ts,923:ud,926:Dt,928:rr,931:rr,933:Ts,934:rr,936:Ts,937:rr,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:$o,8217:$o,8220:Ds,8221:Ds},"SansSerif-Italic":{32:$,33:[0,.69444,.05733,0,.31945],34:fd,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Ps,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:xd,45:[0,.44444,.01946,0,.33333],46:vd,47:[.25,.75,.13164,0,.5],48:yt,49:yt,50:yt,51:yt,52:yt,53:yt,54:yt,55:yt,56:yt,57:yt,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Kt,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:Ks,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:zs,77:[0,.69444,.08094,0,.875],78:Ks,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:dd,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:$,168:[0,.67937,.06385,0,.5],176:md,184:Bs,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:dd,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:pd,715:de,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:md,732:[0,.67659,.08826,0,.5],733:pd,915:[0,.69444,.13372,0,.54167],916:Ld,920:[0,.69444,.07555,0,.77778],923:tr,926:[0,.69444,.12816,0,.66667],928:Ks,931:[0,.69444,.11983,0,.72222],933:hd,934:[0,.69444,.04603,0,.72222],936:hd,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Ps,8217:Ps,8220:[0,.69444,.14205,0,.5],8221:fd},"SansSerif-Regular":{32:$,33:[0,.69444,0,0,.31945],34:de,35:gd,36:As,37:yd,38:[0,.69444,0,0,.75834],39:Et,40:bi,41:bi,42:bd,43:$e,44:xd,45:[0,.44444,0,0,.33333],46:vd,47:Tt,48:bt,49:bt,50:bt,51:bt,52:bt,53:bt,54:bt,55:bt,56:bt,57:bt,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Os,64:Kt,65:Kt,66:Kt,67:Ar,68:[0,.69444,0,0,.72223],69:wd,70:[0,.69444,0,0,.56945],71:Kt,72:Is,73:Et,74:Os,75:[0,.69444,0,0,.69445],76:zs,77:[0,.69444,0,0,.875],78:Is,79:[0,.69444,0,0,.73611],80:Ar,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:xi,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Kt,89:[0,.69444,.025,0,.66667],90:tr,91:kd,93:kd,94:de,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Rs,99:Md,100:Rs,101:Md,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Rs,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Ad,111:[0,.44444,0,0,.5],112:_d,113:_d,114:[0,.44444,.01389,0,.34167],115:Sd,116:[0,.57143,0,0,.36111],117:Ad,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:$,168:[0,.67937,0,0,.5],176:Kt,184:Bs,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:de,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:de,715:de,728:de,729:[0,.67937,0,0,.27778],730:Kt,732:[0,.67659,0,0,.5],733:de,915:zs,916:Ld,920:Cr,923:tr,926:Kt,928:Is,931:gn,933:Cr,934:gn,936:Cr,937:gn,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Et,8217:Et,8220:de,8221:de},"Script-Regular":{32:$,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:$},"Size1-Regular":{32:$,40:Cd,41:Cd,47:Ed,91:Td,92:Ed,93:Td,123:Dd,125:Dd,160:$,710:qo,732:qo,770:qo,771:qo,8214:[-99e-5,.601,0,0,.77778],8593:Kd,8595:Kd,8657:Bd,8659:Bd,8719:Pd,8720:Pd,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:zd,8748:Od,8749:Od,8750:zd,8896:vi,8897:vi,8898:vi,8899:vi,8968:wi,8969:wi,8970:wi,8971:wi,9168:Vs,10216:wi,10217:wi,10752:Ns,10753:Ns,10754:Ns,10756:vi,10758:vi},"Size2-Regular":{32:$,40:Id,41:Id,47:Rd,91:Nd,92:Rd,93:Nd,123:Fd,125:Fd,160:$,710:Ho,732:Ho,770:Ho,771:Ho,8719:Vd,8720:Vd,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:qd,8748:$d,8749:$d,8750:qd,8896:ki,8897:ki,8898:ki,8899:ki,8968:Wo,8969:Wo,8970:Wo,8971:Wo,10216:Hd,10217:Hd,10752:Fs,10753:Fs,10754:Fs,10756:ki,10758:ki},"Size3-Regular":{32:$,40:Wd,41:Wd,47:Ud,91:jd,92:Ud,93:jd,123:Uo,125:Uo,160:$,710:jo,732:jo,770:jo,771:jo,8730:[.95003,1.45,0,0,1],8968:Jo,8969:Jo,8970:Jo,8971:Jo,10216:Uo,10217:Uo},"Size4-Regular":{32:$,40:Jd,41:Jd,47:Gd,91:Xd,92:Gd,93:Xd,123:Go,125:Go,160:$,710:Xo,732:Xo,770:Xo,771:Xo,8730:[1.25003,1.75,0,0,1],8968:Zo,8969:Zo,8970:Zo,8971:Zo,9115:Yo,9116:Zd,9117:Yo,9118:Yo,9119:Zd,9120:Yo,9121:Qo,9122:Vs,9123:Qo,9124:Qo,9125:Vs,9126:Qo,9127:Yd,9128:Qd,9129:e0,9130:[0,.3,0,0,.88889],9131:Yd,9132:Qd,9133:e0,9143:[.88502,.915,0,0,1.05556],10216:Go,10217:Go,57344:t0,57345:t0,57680:ea,57681:ea,57682:ea,57683:ea},"Typewriter-Regular":{32:n0,33:C,34:C,35:C,36:Qe,37:Qe,38:C,39:C,40:Qe,41:Qe,42:[0,.52083,0,0,.525],43:r0,44:[.13889,.125,0,0,.525],45:r0,46:[0,.125,0,0,.525],47:Qe,48:C,49:C,50:C,51:C,52:C,53:C,54:C,55:C,56:C,57:C,58:Le,59:[.13889,.43056,0,0,.525],60:i0,61:[-.19549,.41562,0,0,.525],62:i0,63:C,64:C,65:C,66:C,67:C,68:C,69:C,70:C,71:C,72:C,73:C,74:C,75:C,76:C,77:C,78:C,79:C,80:C,81:[.13889,.61111,0,0,.525],82:C,83:C,84:C,85:C,86:C,87:C,88:C,89:C,90:C,91:Qe,92:Qe,93:Qe,94:C,95:[.09514,0,0,0,.525],96:C,97:Le,98:C,99:Le,100:C,101:Le,102:C,103:vn,104:C,105:C,106:[.22222,.61111,0,0,.525],107:C,108:C,109:Le,110:Le,111:Le,112:vn,113:vn,114:Le,115:Le,116:[0,.55358,0,0,.525],117:Le,118:Le,119:Le,120:Le,121:vn,122:Le,123:Qe,124:Qe,125:Qe,126:C,127:C,160:n0,176:C,184:[.19445,0,0,0,.525],305:Le,567:vn,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:C,715:C,728:C,730:C,770:C,771:C,776:C,915:C,916:C,920:C,923:C,926:C,928:C,931:C,933:C,934:C,936:C,937:C,8216:C,8217:C,8242:C,9251:[.11111,.21944,0,0,.525]}};var Op=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,xt=10,Ce=.25,s0=1.2,qe=.431,$s={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[qe,qe,qe],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],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:[Ce,Ce,Ce],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},wn=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Mi=5,a0={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function ir(t,e){t===void 0&&(t=77);let r=o0[e][t];if(r)return{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]};if(t===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};let i=String.fromCodePoint(t);if(i in a0)t=a0[i].codePointAt(0);else if(Op.test(i))return t=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var qs={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Hs={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},l0={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160 + c -179 0 -524 -115 -524 -115 + c -5 -1 -9 -5 -9 -10 + c 0 -1 1 -2 1 -3 + l 4 -22 + c 1 -5 5 -9 11 -9 + h 2 + s 338 93 512 92 + c 174 0 513 -92 513 -92 + h 2 + c 5 0 9 4 11 9 + l 5 22 + c 1 6 -2 12 -8 13 + c 0 0 -342 115 -520 115 + z + `,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function c0(t){if(Hs[t]){let[c,u,d]=Hs[t],m=``;return`${m}`}let[e,r,i,n]=qs[t],o,a,s=i/1e3;e.length===3?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],a=["xMinYMin","xMidYMin","xMaxYMin"]):e.length===2?(o=["slice-1-of-2","slice-2-of-2"],a=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],a=[n]);let l=e.map((c,u)=>``).join("");return`${l}`}function u0(t){return qs[t]?qs[t][2]/1e3:Hs[t][2]}function zp(t){let e=[];for(let r=0;r=55296&&i<=56319){let n=t.charCodeAt(r+1);if(n>=56320&&n<=57343){let o=i-55296,a=n-56320;i=2**16+o*2**10+a,r++}}e.push(i)}return e}var ra=8205,Ip=[[ra,1],[65038,2],[127995,5],[129456,4],[917536,96]],ta,d0=[127462,127487];function m0(t){var e;if(ta===void 0){ta={};for(let r of Ip)for(let i=r[0];i<=r[0]+r[1]-1;i++)ta[i]=!0}return(e=ta[t])!=null?e:!1}function Rp(t){return t>=d0[0]&&t<=d0[1]}function ia(t){if(/^[\u0020-\u00FF]*$/.test(t))return t;let e=[],r=zp(t),i=0;for(;i=this.s.length}get(){return this.pos";let e=this.get();if(e==="\\"){if(!this.end()){let r=this.match(/^[a-zA-Z\*]+/);return r?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):r=this.get(),"\\"+r}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();let r=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(r)return String.fromCodePoint(Number.parseInt(r.slice(r.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let r=!1;if(/[\d?@]/.test(this.peek())&&(r=!0,this.pos+1"):"<$>"}return e}};function Np(t,e){var n,o,a,s;let r=[],i=t.next();if(i&&i!=="\\relax"){if(i==="\\noexpand")i=t.next(),i&&r.push(i);else if(i==="\\obeyspaces")t.obeyspaces=!0;else if(i==="\\bgroup")r.push("<{>");else if(i==="\\egroup")r.push("<}>");else if(i==="\\string"){if(i=t.next(),i)if(i.startsWith("\\"))for(let l of i)r.push(l==="\\"?"\\backslash":l);else i==="<{>"?r.push("\\{"):i===""?r.push("~"):i==="<}>"&&r.push("\\}")}else if(i==="\\csname"){for(;t.peek()==="";)t.next();let l="",c=!1,u=[];do{if(u.length===0)if(/^#[\d?@]$/.test(t.peek())){let d=t.get().slice(1);u=kn((o=(n=e==null?void 0:e(d))!=null?n:e==null?void 0:e("?"))!=null?o:"\\placeholder{}",e),i=u[0]}else i=t.next(),u=i?[i]:[];c=u.length===0,!c&&i==="\\endcsname"&&(c=!0,u.shift()),c||(c=i==="<$>"||i==="<$$>"||i==="<{>"||i==="<}>"||typeof i=="string"&&i.length>1&&i.startsWith("\\")),c||(l+=u.shift())}while(!c);l&&r.push("\\"+l),r.push(...u)}else if(i!=="\\endcsname")if(i.length>1&&i.startsWith("#")){let l=i.slice(1);r.push(...kn((s=(a=e==null?void 0:e(l))!=null?a:e==null?void 0:e("?"))!=null?s:"\\placeholder{}",e))}else r.push(i)}return r}function kn(t,e=null){let r=[],i="";for(let a of t.toString().split(/\r?\n/)){i&&r.push(i),i=" ";let s=a.match(/((?:\\%)|[^%])*/);s!==null&&r.push(s[0])}let n=new Ws(r.join("")),o=[];do o.push(...Np(n,e));while(!n.end());return o}function B(t){let e="",r=[];for(let i of t)i&&(e&&/^[a-zA-Z\*]/.test(i)&&r.push(e),r.push(i),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(i)&&r.push(" "),e=/\\[a-zA-Z]+\*?$/.test(i)?" ":"");return r.join("")}function F(t,...e){return t.startsWith("\\"),e.length===0?t:B([t,...e.map(r=>`{${r}}`)])}function nr(t){return B(t.map(e=>{var r;return(r={"":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[e])!=null?r:e}))}var Dr=class Dr{constructor(e){Dr._registry[e]=this}static createAtom(e,r,i){return Dr._registry[e].createAtom(r,G(r,e),i)}static serialize(e,r){var i;if(!e||e.length===0)return"";if((i=r.skipStyles)!=null&&i){let n=[];for(let o of h0(e)){let a=Dr._registry[o[0].mode];n.push(...a.serialize(o,r))}return B(n)}return B(Vp(e,r))}static getFont(e,r,i){return Dr._registry[e].getFont(r,i)}};Dr._registry={};var le=Dr;function h0(t){let e=[],r=[],i="NONE";for(let n of t)n.type!=="first"&&(n.mode!==i?(r.length>0&&e.push(r),r=[n],i=n.mode):r.push(n));return r.length>0&&e.push(r),e}function vt(t,e){let r=[],i=[],n;for(let o of t)if(o.type!=="first"&&o.style){let a;e==="variant"?(a=o.style.variant,o.style.variantStyle&&o.style.variantStyle!=="up"&&(a+="-"+o.style.variantStyle)):a=o.style[e],a===n?i.push(o):(i.length>0&&r.push(i),i=[o],n=a)}return i.length>0&&r.push(i),r}function p0(t,e){var o;let{parent:r}=t[0],i=r==null?void 0:r.computedStyle.color,n=[];for(let a of h0(t)){let s=e.defaultMode;for(let l of vt(a,"color")){let c=l[0].computedStyle,u=le._registry[l[0].mode].serialize(l,g(p({},e),{defaultMode:s==="text"?"text":"math"}));!e.skipStyles&&c.color&&c.color!=="none"&&(!r||i!==c.color)?n.push(F("\\textcolor",(o=c.verbatimColor)!=null?o:c.color,B(u))):n.push(B(u))}}return n}function Fp(t,e){let{parent:r}=t[0],i=r==null?void 0:r.computedStyle.backgroundColor;return vt(t,"backgroundColor").map(n=>{var o;if(n.length>0||n[0].type!=="box"){let a=n[0].computedStyle;if(a.backgroundColor&&a.backgroundColor!=="none"&&(!r||i!==a.backgroundColor))return F("\\colorbox",(o=a.verbatimBackgroundColor)!=null?o:a.backgroundColor,B(p0(n,g(p({},e),{defaultMode:"text"}))))}return B(p0(n,e))})}function Vp(t,e){if(t.length===0)return[];let{parent:r}=t[0],i=r==null?void 0:r.computedStyle.fontSize,n=[];for(let o of vt(t,"fontSize")){let a=o[0].computedStyle.fontSize,s=Fp(o,e);s&&(a&&a!=="auto"&&(!r||i!==a)?n.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][a],...s):n.push(...s))}return n}function na(t){return t?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[t]:void 0}function Kr(t){if(t.length===0)return"ord";let e=na(t[0].type),r=na(t[t.length-1].type);return e&&e===r?e:"ord"}function Mn(t,e){if(typeof t=="string")return t;if(typeof t=="number"){Number.isFinite(t);let r=Math.ceil(100*t)/100;return r===0?"0":r.toString()+(e!=null?e:"")}return""}var w=class t{constructor(e,r){var n,o,a,s,l;if(typeof e=="number"?this.value=String.fromCodePoint(e):typeof e=="string"?this.value=e:ee(e)?this.children=e.filter(c=>c!==null):e&&e instanceof t&&(this.children=[e]),this.children)for(let c of this.children)c.parent=this;this.type=(n=r==null?void 0:r.type)!=null?n:"ignore",this.isSelected=(r==null?void 0:r.isSelected)===!0,r!=null&&r.caret&&(this.caret=r.caret),this.classes=(o=r==null?void 0:r.classes)!=null?o:"",this.isTight=(a=r==null?void 0:r.isTight)!=null?a:!1,r!=null&&r.attributes&&(this.attributes=r.attributes);let i=r==null?void 0:r.fontFamily;r!=null&&r.style&&this.value&&(i=(l=le.getFont((s=r.mode)!=null?s:"math",this,g(p({variant:"normal"},r.style),{letterShapeStyle:r.letterShapeStyle})))!=null?l:void 0),i||(i="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(r==null?void 0:r.maxFontSize)!==void 0&&(this.maxFontSize=r.maxFontSize),$p(this,i)}set atomID(e){e===void 0||e.length===0||(this.id=e)}selected(e){if(this.isSelected!==e&&(this.isSelected=e,this.children))for(let r of this.children)r.selected(e)}setStyle(e,r,i){if(r===void 0)return;let n=Mn(r,i);n.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[e]=n)}setTop(e){Number.isFinite(e)&&Math.abs(e)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Mn(e,"em"),this.height-=e,this.depth+=e)}get left(){var e;return(e=this.cssProperties)!=null&&e["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(e){Number.isFinite(e)&&(e===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Mn(e,"em")))}set right(e){Number.isFinite(e)&&(e===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Mn(e,"em")))}set bottom(e){Number.isFinite(e)&&(e===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Mn(e,"em")))}get width(){return this._width*this.scale}set width(e){this._width=e,this.hasExplicitWidth=!0}set softWidth(e){}get height(){return this._height*this.scale}set height(e){this._height=e}get depth(){return this._depth*this.scale}set depth(e){this._depth=e}wrap(e){let r=e.parent;if(!r)return this;e.isPhantom&&this.setStyle("opacity",0);let i=e.color;i&&i!==r.color&&this.setStyle("color",i);let n=e.backgroundColor;this.isSelected&&(n=sc(n)),n&&n!==r.backgroundColor&&(this.setStyle("background-color",n),this.setStyle("display","inline-block"));let o=e.scalingFactor;return this.scale=o,this.skew*=o,this.italic*=o,this}toMarkup(){var c,u,d,m;let e=(c=this.value)!=null?c:"";if(this.children)for(let h of this.children)e+=h.toMarkup();let r="";if(this.svgBody)r=c0(this.svgBody);else if(this.svgOverlay){r='',r+=e,r+="",r+='${this.svgOverlay}`}let i="",n=this.classes.split(" ");n.push((d={latex:"ML__latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?d:""),this.caret==="latex"&&n.push("ML__latex-caret"),this.isSelected&&n.push("ML__selected");let o=n.length===1?n[0]:n.filter((h,f,x)=>h.length>0&&x.indexOf(h)===f).join(" ");if(o.length>0&&(i+=` class="${o}"`),this.id&&(i+=` data-atom-id=${this.id}`),this.cssId&&(i+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(i+=" "+Object.keys(this.attributes).map(h=>`${h}="${this.attributes[h]}"`).join(" ")),this.htmlData){let h=this.htmlData.split(",");for(let f of h){let x=f.match(/([^=]+)=(.+$)/);if(x){let M=x[1].trim().replace(/ /g,"-");M&&(i+=` data-${M}="${x[2]}" `)}else{let M=f.trim().replace(/ /g,"-");M&&(i+=` data-${M} `)}}}let a=(m=this.cssProperties)!=null?m:{};this.hasExplicitWidth&&a.width===void 0&&(a.width=`${Math.ceil(this._width*100)/100}em`);let s=Object.keys(a).map(h=>`${h}:${a[h]}`);if(this.scale!==void 0&&this.scale!==1&&(e.length>0||r.length>0)&&s.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){let h=this.htmlStyle.split(";"),f="";for(let x of h){let M=x.match(/([^=]+):(.+$)/);if(M){let b=M[1].trim().replace(/ /g,"-");b&&(f+=`${b}:${M[2]};`)}}f&&(i+=` style="${f}"`)}s.length>0&&(i+=` style="${s.join(";")}"`);let l="";return i.length>0||r.length>0?l=`${e}${r}`:l=e,this.caret==="text"?l+='':this.caret==="math"&&(l+=''),l}tryCoalesceWith(e){if(this.svgBody||!this.value||e.svgBody||!e.value)return!1;let r=this.children&&this.children.length>0,i=e.children&&e.children.length>0;if(r||i)return!1;if(e.cssProperties||this.cssProperties){for(let l of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(e.cssProperties&&l in e.cssProperties||this.cssProperties&&l in this.cssProperties)return!1}let n=this.cssProperties?Object.keys(this.cssProperties).length:0,o=e.cssProperties?Object.keys(e.cssProperties).length:0;if(n!==o)return!1;if(n>0){for(let l of Object.keys(this.cssProperties))if(this.cssProperties[l]!==e.cssProperties[l])return!1}let a=this.classes.trim().replace(/\s+/g," ").split(" "),s=e.classes.trim().replace(/\s+/g," ").split(" ");if(a.length!==s.length)return!1;a.sort(),s.sort();for(let[l,c]of a.entries())if(c==="vertical-separator"||c!==s[l])return!1;return this.value+=e.value,this.height=Math.max(this.height,e.height),this.depth=Math.max(this.depth,e.depth),this._width=this._width+e._width,this.maxFontSize=Math.max(this.maxFontSize,e.maxFontSize),this.italic=e.italic,!0}};function Us(t){if(!t||t.length===0)return[];t[0].children=Us(t[0].children);let e=[t[0]];for(let r=1;r0){let i=-1/0,n=-1/0,o=0;for(let a of t.children)a.height>i&&(i=a.height),a.depth>n&&(n=a.depth),o=Math.max(o,(r=a.maxFontSize)!=null?r:0);t.height=i,t.depth=n,t._width=t.children.reduce((a,s)=>a+s.width,0),t.maxFontSize=o}}function qp(t){if("individualShift"in t){let e=t.individualShift,r=e[0],i=[r],n=-r.shift-r.box.depth,o=n;for(let a=1;a{f.softWidth=c});let u=new w(o,{classes:"vlist"});if(u.softWidth=c,u.height=s,u.setStyle("height",s,"em"),a>=0)return[[new w(u,{classes:"vlist-r"})],s,-a];let d=new w(new w(null),{classes:"vlist"});d.height=-a,d.setStyle("height",-a,"em");let m=new w(8203,{classes:"vlist-s",maxFontSize:0});return m.softWidth=0,m.height=0,m.depth=0,[[new w([u,m],{classes:"vlist-r"}),new w(d,{classes:"vlist-r"})],s,-a]}var H=class extends w{constructor(e,r){var a;let[i,n,o]=Hp(e);super(i.length===1?i[0]:i,{type:r==null?void 0:r.type,classes:((a=r==null?void 0:r.classes)!=null?a:"")+" vlist-t"+(i.length===2?" vlist-t2":"")}),this.height=n,this.depth=o,this.softWidth=i.reduce((s,l)=>Math.max(s,l.width),0)}};function f0(t,e){var c,u,d,m,h;let r=t.metrics,i=new w(e.base),n=(c=e.baseShift)!=null?c:0,o=(u=e.slant)!=null?u:0,a=0,s=0;e.above&&(a=(d=e.aboveShift)!=null?d:Math.max(r.bigOpSpacing1,r.bigOpSpacing3-e.above.depth)),e.below&&(s=(m=e.belowShift)!=null?m:Math.max(r.bigOpSpacing2,r.bigOpSpacing4-e.below.height));let l=null;if(e.below&&e.above){let f=r.bigOpSpacing5+e.below.height+e.below.depth+s+i.depth+n;l=new H({bottom:f,children:[r.bigOpSpacing5,{box:e.below,marginLeft:-o,classes:["ML__center"]},s,{box:i,classes:["ML__center"]},a,{box:e.above,marginLeft:o,classes:["ML__center"]},r.bigOpSpacing5]}).wrap(t)}else if(e.below&&!e.above)l=new H({top:i.height-n,children:[r.bigOpSpacing5,{box:e.below,marginLeft:-o,classes:["ML__center"]},s,{box:i,classes:["ML__center"]}]}).wrap(t);else if(!e.below&&e.above){let f=i.depth+n;l=new H({bottom:f,children:[{box:i,classes:["ML__center"]},a,{box:e.above,marginLeft:o,classes:["ML__center"]},r.bigOpSpacing5]}).wrap(t)}else{let f=i.depth+n;l=new H({bottom:f,children:[{box:i},r.bigOpSpacing5]}).wrap(t)}return new w(l,{type:(h=e.type)!=null?h:"op"})}var oa=7,Sn=6,An=5,sr=4,Br=3,Pe=2,lr=1,be=0,wt=class{constructor(e,r,i){this.id=e,this.sizeDelta=r,this.cramped=i;let n={"-4":2,"-3":1,0:0}[r];this.metrics=Object.keys($s).reduce((o,a)=>g(p({},o),{[a]:$s[a][n]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return et[[be,lr,be,lr,Pe,Br,Pe,Br][this.id]]}get sub(){return et[[be,be,be,be,Pe,Pe,Pe,Pe][this.id]]}get fracNum(){return et[[be,lr,be,lr,Pe,Br,sr,An][this.id]]}get fracDen(){return et[[be,be,be,be,Pe,Pe,sr,sr][this.id]]}get cramp(){return et[[be,be,Pe,Pe,sr,sr,Sn,Sn][this.id]]}get isTight(){return this.sizeDelta<0}},_n={7:new wt(oa,0,!1),6:new wt(Sn,0,!0),5:new wt(An,0,!1),4:new wt(sr,0,!0),3:new wt(Br,-3,!1),2:new wt(Pe,-3,!0),1:new wt(lr,-4,!1),0:new wt(be,-4,!0)},et=g(p({},_n),{displaystyle:_n[oa],textstyle:_n[An],scriptstyle:_n[Br],scriptscriptstyle:_n[lr]});function Js(t,e){var i;if(!t)return 0;let r={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:xt,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(i=t.unit)!=null?i:"pt"];if(Number.isFinite(e)){let n=10**e;return Math.round(t.dimension/xt*r*n)/n}return t.dimension*r}function aa(t,e){if(t===null)return 0;let r=Js(t)/xt;if(Number.isFinite(e)){let i=10**e;return Math.round(r*i)/i}return r}function js(t){var e;return`${t.dimension}${(e=t.unit)!=null?e:"pt"}`}function Wp(t){let e=js(t.glue);return t.grow&&t.grow.dimension!==0&&(e+=` plus ${js(t.grow)}`),t.shrink&&t.shrink.dimension!==0&&(e+=` minus ${js(t.shrink)}`),e}function ce(t){var r,i;if(t==null)return null;let e="";if("dimension"in t&&(e=`${t.dimension}${(r=t.unit)!=null?r:"pt"}`),"glue"in t&&(e=Wp(t)),"number"in t)if(!("base"in t)||t.base==="decimal")e=Number(t.number).toString();else if(t.base==="alpha")e=`\`${String.fromCodePoint(t.number)}`;else{let n=Math.round(t.number)>>>0;t.base==="hexadecimal"?(e=Number(n).toString(16).toUpperCase(),n<=255?e=e.padStart(2,"0"):n<=65535?e=e.padStart(4,"0"):n<=16777215?e=e.padStart(6,"0"):e=e.padStart(8,"0"),e=`"${e}`):t.base==="octal"&&(e=Number(n).toString(8),n<=63?e=e.padStart(2,"0"):n<=30583?e=e.padStart(4,"0"):e=e.padStart(8,"0"),e=`'${e}`)}return"register"in t&&("factor"in t&&(t.factor===-1?e="-":t.factor!==1&&(e=Number(t.factor).toString())),"global"in t&&t.global&&(e+="\\global"),e+=`\\${t.register}`),"string"in t&&(e=t.string),(i=t.relax)!=null&&i&&(e+="\\relax"),e}function tt(t,e){return t==null?null:"number"in t?g(p({},t),{number:t.number*e}):"register"in t?"factor"in t&&t.factor?g(p({},t),{factor:t.factor*e}):g(p({},t),{factor:e}):"dimension"in t?g(p({},t),{dimension:t.dimension*e}):"glue"in t?t.shrink&&t.grow?{glue:tt(t.glue,e),shrink:tt(t.shrink,e),grow:tt(t.grow,e)}:t.shrink?{glue:tt(t.glue,e),shrink:tt(t.shrink,e)}:t.grow?{glue:tt(t.glue,e),grow:tt(t.grow,e)}:{glue:tt(t.glue,e)}:null}var Up={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function sa(){return p({},Up)}function Ln(){return{registers:sa(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:O.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Mr,backgroundColorMap:li,getMacro:t=>po(t,di())}}var T=class t{constructor(e,r){var o,a,s,l,c,u,d,m,h,f,x,M,b,k,_;let i;e!=null&&e.parent?(this.parent=e.parent,i=e.parent,this.registers={}):(i=p(p({},Ln()),(o=e==null?void 0:e.from)!=null?o:{}),this.registers=i.registers),i.atomIdsSettings&&(this.atomIdsSettings=p({},i.atomIdsSettings)),this.renderPlaceholder=i.renderPlaceholder,this.isPhantom=(l=(s=e==null?void 0:e.isPhantom)!=null?s:(a=this.parent)==null?void 0:a.isPhantom)!=null?l:!1,this.letterShapeStyle=i.letterShapeStyle,this.minFontScale=i.minFontScale,r!=null&&r.color&&r.color!=="none"?this.color=r.color:this.color=(u=(c=this.parent)==null?void 0:c.color)!=null?u:"",r!=null&&r.backgroundColor&&r.backgroundColor!=="none"?this.backgroundColor=r.backgroundColor:this.backgroundColor=(m=(d=this.parent)==null?void 0:d.backgroundColor)!=null?m:"",r!=null&&r.fontSize&&r.fontSize!=="auto"&&r.fontSize!==((h=this.parent)==null?void 0:h.size)?this.size=r.fontSize:this.size=(x=(f=this.parent)==null?void 0:f.size)!=null?x:Mi;let n=(b=(M=this.parent)==null?void 0:M.mathstyle)!=null?b:et.displaystyle;if(typeof(e==null?void 0:e.mathstyle)=="string"){if(i instanceof t)switch(e.mathstyle){case"cramp":n=n.cramp;break;case"superscript":n=n.sup;break;case"subscript":n=n.sub;break;case"numerator":n=n.fracNum;break;case"denominator":n=n.fracDen;break}switch(e.mathstyle){case"textstyle":n=et.textstyle;break;case"displaystyle":n=et.displaystyle;break;case"scriptstyle":n=et.scriptstyle;break;case"scriptscriptstyle":n=et.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=n,this.smartFence=i.smartFence,this.placeholderSymbol=i.placeholderSymbol,this.colorMap=(k=i.colorMap)!=null?k:A=>A,this.backgroundColorMap=(_=i.backgroundColorMap)!=null?_:A=>A,this.getMacro=i.getMacro,this.parent!==void 0||this.registers}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;let e=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,e}scale(e){return e*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===oa||this.mathstyle.id===Sn}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(wn[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(e){var r;if((r=this.registers)!=null&&r[e])return this.registers[e];if(this.parent)return this.parent.getRegister(e)}getRegisterAsNumber(e){let r=this.getRegister(e);if(typeof r=="number")return r;if(typeof r=="string")return Number(r)}getRegisterAsGlue(e){var r;if((r=this.registers)!=null&&r[e]){let i=this.registers[e];return typeof i=="object"&&"glue"in i?i:typeof i=="object"&&"dimension"in i?{glue:{dimension:i.dimension}}:typeof i=="number"?{glue:{dimension:i}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(e)}getRegisterAsEm(e,r){return aa(this.getRegisterAsDimension(e),r)}getRegisterAsDimension(e){var r;if((r=this.registers)!=null&&r[e]){let i=this.registers[e];return typeof i=="object"&&"glue"in i?i.glue:typeof i=="object"&&"dimension"in i?i:typeof i=="number"?{dimension:i}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(e)}setRegister(e,r){if(r===void 0){delete this.registers[e];return}this.registers[e]=r}evaluate(e){if(!e||!("register"in e))return e;let r=this;if("global"in e&&e.global)for(;r.parent;)r=r.parent;let i=1;"factor"in e&&e.factor!==1&&e.factor!==void 0&&(i=e.factor);let n=r.getRegister(e.register);if(n===void 0)return;if(typeof n=="string")return{string:Number(n).toString()+n};if(typeof n=="number")return{number:i*n};let o=r.evaluate(n);if(o!==void 0)return"string"in o?{string:Number(n).toString()+o.string}:"number"in o?{number:i*o.number}:"dimension"in o?g(p({},o),{dimension:i*o.dimension}):"glue"in o?g(p({},o),{glue:g(p({},o.glue),{dimension:i*o.glue.dimension}),shrink:o.shrink?g(p({},o.shrink),{dimension:i*o.shrink.dimension}):void 0,grow:o.grow?g(p({},o.grow),{dimension:i*o.grow.dimension}):void 0}):e}toDimension(e){let r=this.evaluate(e);return r===void 0?null:"dimension"in r?r:"glue"in r?r.glue:"number"in r?{dimension:r.number}:null}toEm(e,r){if(e===null)return 0;let i=this.toDimension(e);return i===null?0:Js(i,r)/xt}toNumber(e){if(e===null)return null;let r=this.evaluate(e);return r===void 0?null:"number"in r?r.number:"dimension"in r?r.dimension:"glue"in r?r.glue.dimension:"string"in r?Number(r.string):null}toColor(e){var i,n;if(e===null)return null;let r=this.evaluate(e);return r===void 0?null:"string"in r?(n=(i=this.colorMap)==null?void 0:i.call(this,r.string))!=null?n:r.string:null}toBackgroundColor(e){var i,n;if(e===null)return null;let r=this.evaluate(e);return r===void 0?null:"string"in r?(n=(i=this.backgroundColorMap)==null?void 0:i.call(this,r.string))!=null?n:r.string:null}};var ur=["body","above","below","superscript","subscript"];function cr(t){return typeof t=="string"&&ur.includes(t)}function Cn(t){return t!==void 0&&Array.isArray(t)&&t.length===2}var y=class t{constructor(e){this.subsupPlacement=void 0;this.explicitSubsupPlacement=!1;var r,i,n,o,a,s,l,c,u;this.type=e.type,typeof e.value=="string"&&(this.value=e.value),this.command=(i=(r=e.command)!=null?r:this.value)!=null?i:"",this.mode=(n=e.mode)!=null?n:"math",this.isFunction=(o=e.isFunction)!=null?o:!1,this.subsupPlacement=e.limits,this.style=(a=p({},e.style))!=null?a:{},this.displayContainsHighlight=(s=e.displayContainsHighlight)!=null?s:!1,this.captureSelection=(l=e.captureSelection)!=null?l:!1,this.skipBoundary=(c=e.skipBoundary)!=null?c:!1,this.verbatimLatex=(u=e.verbatimLatex)!=null?u:void 0,e.args&&(this.args=e.args),e.body&&(this.body=e.body),this._changeCounter=0}static createBox(e,r,i){var s;if(!r)return null;let n=jp(r),o=[];for(let l of n){let c=l[0].style,u=Jp(e,l,{style:{color:c.color,backgroundColor:c.backgroundColor,fontSize:c.fontSize}});u&&o.push(u)}if(o.length===0)return null;let a=((s=i==null?void 0:i.classes)!=null?s:"").trim();return o.length===1&&!a&&!(i!=null&&i.type)?o[0].wrap(e):new w(o,{classes:a,type:i==null?void 0:i.type}).wrap(e)}static serialize(e,r){return le.serialize(e,r)}static commonAncestor(e,r){if(e===r||e.parent===r.parent)return e.parent;let i=new WeakSet,{parent:n}=e;for(;n;)i.add(n),n=n.parent;for(n=r.parent;n;){if(i.has(n))return n;n=n.parent}}static fromJson(e){return typeof e=="string"?new t({type:"mord",value:e,mode:"math"}):new t(e)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){let e={};if(this.type&&(e.type=this.type),this.mode!=="math"&&(e.mode=this.mode),this.command&&this.command!==this.value&&(e.command=this.command),this.value!==void 0&&(e.value=this.value),this.style&&Object.keys(this.style).length>0&&(e.style=p({},this.style)),this.verbatimLatex!==void 0&&(e.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(e.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(e.explicitSubsupPlacement=!0),this.isFunction&&(e.isFunction=!0),this.displayContainsHighlight&&(e.displayContainsHighlight=!0),this.isExtensibleSymbol&&(e.isExtensibleSymbol=!0),this.skipBoundary&&(e.skipBoundary=!0),this.captureSelection&&(e.captureSelection=!0),this.args&&(e.args=Gp(this.args)),this._branches)for(let r of Object.keys(this._branches))this._branches[r]&&(e[r]=this._branches[r].filter(i=>i.type!=="first").map(i=>i.toJson()));return e.type==="mord"&&Object.keys(e).length===2&&"value"in e?e.value:e}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(e){if(e){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:r}=this;for(;r;)r.parent||r._changeCounter++,"verbatimLatex"in r&&(r.verbatimLatex=void 0),r._children=void 0,r=r.parent}}_serialize(e){var i;if(!(e.expandMacro||e.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let r=G(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,e):this.body&&this.command?B([F(this.command,this.bodyToLatex(e)),this.supsubToLatex(e)]):this.body?B([this.bodyToLatex(e),this.supsubToLatex(e)]):!this.value||this.value==="\u200B"?"":(i=this.command)!=null?i:fc(this.mode,this.value)}bodyToLatex(e){var r;return le.serialize(this.body,g(p({},e),{defaultMode:(r=e.defaultMode)!=null?r:this.latexMode}))}aboveToLatex(e){return le.serialize(this.above,e)}belowToLatex(e){return le.serialize(this.below,e)}supsubToLatex(e){let r="";if(e=g(p({},e),{defaultMode:"math"}),this.branch("subscript")!==void 0){let i=le.serialize(this.subscript,e);i.length===0?r+="_{}":i.length===1?/^[0-9]$/.test(i)?r+=`_${i}`:r+=`_{${i}}`:r+=`_{${i}}`}if(this.branch("superscript")!==void 0){let i=le.serialize(this.superscript,e);i.length===0?r+="^{}":i.length===1?i==="\u2032"?r+="^\\prime ":i==="\u2033"?r+="^\\doubleprime ":/^[0-9]$/.test(i)?r+=`^${i}`:r+=`^{${i}}`:r+=`^{${i}}`}return r}get treeDepth(){let e=1,r=this.parent;for(;r;)r=r.parent,e+=1;return e}get inCaptureSelection(){let e=this;for(;e;){if(e.captureSelection)return!0;e=e.parent}return!1}get parentPrompt(){let e=this.parent;for(;e;){if(e.type==="prompt"&&!e.captureSelection)return e;e=e.parent}return null}branch(e){if(cr(e)&&this._branches)return this._branches[e]}get branches(){if(!this._branches)return[];let e=[];for(let r of ur)this._branches[r]&&e.push(r);return e}createBranch(e){return cr(e),cr(e)?(this._branches?this._branches[e]||(this._branches[e]=[this.makeFirstAtom(e)]):this._branches={[e]:[this.makeFirstAtom(e)]},this.isDirty=!0,this._branches[e]):[]}get row(){return Cn(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Cn(this.parentBranch)?this.parentBranch[1]:-1}get body(){var e;return(e=this._branches)==null?void 0:e.body}set body(e){this.setChildren(e,"body")}get superscript(){var e;return(e=this._branches)==null?void 0:e.superscript}set superscript(e){this.setChildren(e,"superscript")}get subscript(){var e;return(e=this._branches)==null?void 0:e.subscript}set subscript(e){this.setChildren(e,"subscript")}get above(){var e;return(e=this._branches)==null?void 0:e.above}set above(e){this.setChildren(e,"above")}get below(){var e;return(e=this._branches)==null?void 0:e.below}set below(e){this.setChildren(e,"below")}get computedStyle(){var n,o;let e=typeof this.style.verbatimColor=="string",r=typeof this.style.verbatimBackgroundColor=="string",i=p(p({},(o=(n=this.parent)==null?void 0:n.computedStyle)!=null?o:{}),this.style);return delete i.variant,delete i.variantStyle,r||delete i.verbatimBackgroundColor,e||delete i.verbatimColor,i}applyStyle(e){this.isDirty=!0,this.style=p(p({},this.style),e),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(let r of this.children)r.applyStyle(e)}getInitialBaseElement(){var e,r,i;return this.hasEmptyBranch("body")?this:((e=this.body)==null||e[0].type,(i=(r=this.body[1])==null?void 0:r.getInitialBaseElement())!=null?i:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(e){let r=this.branch(e);return r?(r.length>0,r[0].type,r.length===1):!0}setChildren(e,r){var n;if(!e||(cr(r),!cr(r)))return;(n=e[0])==null||n.type;let i=[this.makeFirstAtom(r),...e];this._branches?this._branches[r]=i:this._branches={[r]:i};for(let o of e)o.parent=this,o.parentBranch=r;this.isDirty=!0}makeFirstAtom(e){let r=new t({type:"first",mode:this.mode});return r.parent=this,r.parentBranch=e,r}addChild(e,r){e.type,this.createBranch(r).push(e),this.isDirty=!0,e.parent=this,e.parentBranch=r}addChildBefore(e,r){r.parentBranch;let i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r),0,e),this.isDirty=!0,e.parent=this,e.parentBranch=r.parentBranch}addChildAfter(e,r){r.parentBranch;let i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r)+1,0,e),this.isDirty=!0,e.parent=this,e.parentBranch=r.parentBranch}addChildren(e,r){let i=this.createBranch(r);for(let n of e)n.parent=this,n.parentBranch=r,i.push(n);this.isDirty=!0}addChildrenAfter(e,r){e.length===0||e[0].type,r.parentBranch;let i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r)+1,0,...e),this.isDirty=!0;for(let n of e)n.parent=this,n.parentBranch=r.parentBranch;return e[e.length-1]}removeBranch(e){let r=this.branch(e);if(cr(e)&&(this._branches[e]=void 0),!r)return[];for(let i of r)i.parent=void 0,i.parentBranch=void 0;return r[0].type,r.shift(),this.isDirty=!0,r}removeChild(e){if(e.parent,e.type==="first")return;let r=this.branch(e.parentBranch),i=r.indexOf(e);i>=0,r.splice(i,1),this.isDirty=!0,e.parent=void 0,e.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){let{siblings:e}=this;return e[e.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){this.parent;let e=this.parent.branch(this.parentBranch);return e[e.indexOf(this)-1]}get rightSibling(){this.parent;let e=this.parent.branch(this.parentBranch);return e[e.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return this.hasChildren,this.children[0]}get lastChild(){this.hasChildren;let{children:e}=this;return e[e.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];let e=[];for(let r of ur)if(this._branches[r])for(let i of this._branches[r])e.push(...i.children),e.push(i);return this._children=e,e}render(e){if(this.type==="first"&&!e.atomIdsSettings)return null;let r=G(this.command,this.mode);if(r!=null&&r.render)return r.render(this,e);let i=new T({parent:e},this.style),n=this.createBox(i,{classes:this.parent?"":"ML__base"});return n?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(n=this.attachSupsub(i,{base:n})),n.wrap(i)):null}attachSupsub(e,r){var f;let i=r.base,n=this.superscript,o=this.subscript;if(!n&&!o)return i;let a=null,s=null,l=(f=r.isCharacterBox)!=null?f:this.isCharacterBox(),c=0;if(n){let x=new T({parent:e,mathstyle:"superscript"});a=t.createBox(x,n),l||(c=i.height-e.metrics.supDrop*x.scalingFactor)}let u=0;if(o){let x=new T({parent:e,mathstyle:"subscript"});s=t.createBox(x,o),l||(u=i.depth+e.metrics.subDrop*x.scalingFactor)}let d;e.isDisplayStyle?d=e.metrics.sup1:e.isCramped?d=e.metrics.sup3:d=e.metrics.sup2;let m=.5/xt/e.scalingFactor,h=null;if(s&&a){c=Math.max(c,d,a.depth+.25*e.metrics.xHeight),u=Math.max(u,e.metrics.sub2);let x=e.metrics.defaultRuleThickness;if(c-a.depth-(s.height-u)<4*x){u=4*x-(c-a.depth)+s.height;let b=.8*e.metrics.xHeight-(c-a.depth);b>0&&(c+=b,u-=b)}let M=this.isExtensibleSymbol&&i.italic?-i.italic:0;h=new H({individualShift:[{box:s,shift:u,marginLeft:M},{box:a,shift:-c}]}).wrap(e)}else s&&!a?(u=Math.max(u,e.metrics.sub1,s.height-.8*qe),h=new H({shift:u,children:[{box:s,marginRight:m,marginLeft:this.isCharacterBox()?-i.italic:0}]})):!s&&a&&(c=Math.max(c,d,a.depth+.25*qe),h=new H({shift:-c,children:[{box:a,marginRight:m}]}));return new w([i,new w(h,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:r.type})}attachLimits(e,r){let i=this.superscript?t.createBox(new T({parent:e,mathstyle:"superscript"},this.style),this.superscript):null,n=this.subscript?t.createBox(new T({parent:e,mathstyle:"subscript"},this.style),this.subscript):null;return!i&&!n?r.base.wrap(e):f0(e,g(p({},r),{above:i,below:n}))}bind(e,r){if(!r||e.isPhantom||this.value==="\u200B")return r;let i=this.parent;for(;i&&!i.captureSelection;)i=i.parent;return i!=null&&i.captureSelection||(this.id||(this.id=e.makeID()),r.atomID=this.id),r}createBox(e,r){var s,l,c,u;let i=(s=this.value)!=null?s:this.body,n=(l=r==null?void 0:r.boxType)!=null?l:na(this.type),o=(c=r==null?void 0:r.classes)!=null?c:"";this.mode==="text"&&(o+=" ML__text");let a=typeof i=="string"||i===void 0?new w(i!=null?i:null,{type:n,isSelected:this.isSelected,mode:this.mode,maxFontSize:e.scalingFactor,style:g(p({variant:"normal"},this.style),{fontSize:Math.max(1,e.size+e.mathstyle.sizeDelta)}),letterShapeStyle:e.letterShapeStyle,classes:o}):(u=t.createBox(e,i,{type:n,classes:o}))!=null?u:new w(null);return e.isTight&&(a.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(a.italic=0),a.right=a.italic,this.bind(e,a),this.caret&&!this.superscript&&!this.subscript&&(a.caret=this.caret),a}isDigit(){var e;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((e=this.body)==null?void 0:e.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var e;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((e=this.body)==null?void 0:e.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function jp(t){let e,r=[],i=[];for(let n of t)if(!e&&!n.style)i.push(n);else{let o=n.computedStyle;e&&o.color===e.color&&o.backgroundColor===e.backgroundColor&&o.fontSize===e.fontSize?i.push(n):(i.length>0&&r.push(i),i=[n],e=o)}return i.length>0&&r.push(i),r}function Jp(t,e,r){var s,l,c,u,d;if(!e||e.length===0)return null;let i=new T({parent:t},r.style),n=!((s=i.atomIdsSettings)!=null&&s.groupNumbers),o=[];if(e.length===1){let m=e[0],h=m.render(i);h&&(n&&m.isSelected&&h.selected(!0),o=[h])}else{let m="",h=!0;for(let f of e){(l=i.atomIdsSettings)!=null&&l.groupNumbers&&m&&(h&&f.isDigit()||!h&&Gs(f))&&(i.atomIdsSettings.overrideID=m);let x=f.render(i);i.atomIdsSettings&&(i.atomIdsSettings.overrideID=void 0),x&&((c=i.atomIdsSettings)!=null&&c.groupNumbers&&((f.isDigit()||Gs(f))&&(!m||h!==f.isDigit())&&(h=f.isDigit(),m=(u=f.id)!=null?u:""),m&&(!(f.isDigit()||Gs(f))||!f.hasEmptyBranch("superscript")||!f.hasEmptyBranch("subscript"))&&(m="")),n&&f.isSelected&&x.selected(!0),o.push(x))}}if(o.length===0)return null;let a=new w(o,g(p({isTight:i.isTight},r),{type:(d=r.type)!=null?d:"lift"}));return a.isSelected=o.every(m=>m.isSelected),a.wrap(i)}function Gs(t){return t.mode==="text"}function Gp(t){return t.map(e=>e===null?"":Array.isArray(e)&&e[0]instanceof y?{atoms:e.map(r=>r.toJson())}:typeof e=="object"&&"group"in e?{group:e.group.map(r=>r.toJson())}:e)}var He=class t extends y{constructor(e,r,i){super({type:"text",command:e,mode:"text",displayContainsHighlight:!0}),this.value=r,this.verbatimLatex=r,this.applyStyle(i)}static fromJson(e){return new t(e.command,e.value,e.style)}render(e){let r=this.createBox(e);return this.caret&&(r.caret=this.caret),r}_serialize(e){var r;return(r=this.verbatimLatex)!=null?r:sn("text",this.value.codePointAt(0))}};function g0(t,e){if(t.direction===e.direction){let r=t.ranges.length;if(e.ranges.length===r){let i=0;for(;i=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",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:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Or(t,e){var i;let r=(i=e==null?void 0:e.format)!=null?i:"auto";return r==="auto"&&([r,t]=Yp(t)),r==="ascii-math"?(t=t.replace(/\u2061/gu,""),t=t.replace(/\u3016/gu,"{"),t=t.replace(/\u3017/gu,"}"),t=t.replace(/([^\\])sinx/g,"$1\\sin x"),t=t.replace(/([^\\])cosx/g,"$1\\cos x "),t=t.replace(/\u2013/g,"-"),["ascii-math",Ee(t,{inlineShortcuts:e==null?void 0:e.inlineShortcuts})]):["latex",t]}function Ee(t,e){var o,a,s;if(!t)return"";let r=!1,i,n=(o=e.inlineShortcuts)!=null?o:la;if(!r&&(t.startsWith("^")||t.startsWith("_"))&&(i=Pr(t.slice(1),{inlineShortcuts:n,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=Ee(i.rest,e),r=!0),r||(i=t.match(/^(sqrt|\u221A)(.*)/),i&&(i=Pr(i[2],{inlineShortcuts:n,noWrap:!0}),t="\\sqrt{"+((a=i.match)!=null?a:"\\placeholder{}")+"}",t+=Ee(i.rest,e),r=!0)),r||(i=t.match(/^(\\cbrt|\u221B)(.*)/),i&&(i=Pr(i[2],{inlineShortcuts:n,noWrap:!0}),t="\\sqrt[3]{"+((s=i.match)!=null?s:"\\placeholder{}")+"}",t+=Ee(i.rest,e),r=!0)),r||(i=t.match(/^abs(.*)/),i&&(i=Pr(i[1],{inlineShortcuts:n,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=Ee(i.rest,e),r=!0)),r||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=Ee(i[2],e),r=!0)),r||(i=t.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),i&&(t=y0(i[1],n),t+=Ee(i[2],e),r=!0)),!r&&/^([fgh])[^a-zA-Z]/.test(t)&&(i=Pr(t.slice(1),{inlineShortcuts:n,noWrap:!0}),t=t[1]==="("?t[0]+"\\left("+i.match+"\\right)":t[0]+i.match,t+=Ee(i.rest,e),r=!0),r||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=y0(i[1],n),t+=Ee(i[2],e),r=!0)),!r)if(i=Pr(t,{inlineShortcuts:n,noWrap:!0}),i.match&&i.rest[0]==="/"){let l=Pr(i.rest.slice(1),{inlineShortcuts:n,noWrap:!0});l.match&&(t="\\frac{"+i.match+"}{"+l.match+"}"+Ee(l.rest,e)),r=!0}else i.match&&(t=t.startsWith("(")?"\\left("+i.match+"\\right)"+Ee(i.rest,e):i.match+Ee(i.rest,e),r=!0);return r||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+Ee(i[2],e),r=!0)),t}function Pr(t,e){let r="";t=t.trim();let i=t,n=t.charAt(0),o={"(":")","{":"}","[":"]"}[n];if(o){let a=1,s=1;for(;s0;)t[s]===n&&a++,t[s]===o&&a--,s++;a===0?(e.noWrap&&n==="("?r=Ee(t.substring(1,s-1),e):(n==="{"&&o==="}"&&(n="\\{",o="\\}"),r="\\left"+n+Ee(t.substring(1,s-1),e)+"\\right"+o),i=t.slice(Math.max(0,s))):(r=t.substring(1,s),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=En(null,t,e.inlineShortcuts);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.slice(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.slice(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.slice(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.slice(a[1].length),r=a[1]))}return{match:r,rest:i}}function y0(t,e){let r=En(null,t,e);return r?(r=r.replace("_{#?}",""),r=r.replace("^{#?}",""),r+=" "):r=t,r}var Xs=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function ca(t){let e=t.trim();for(let r of Xs)if(e.startsWith(r[0])&&e.endsWith(r[1]))return[!0,e.substring(r[0].length,e.length-r[1].length)];return[!1,t]}function Yp(t){if(t=t.trim(),t.length<=1)return["latex",t];let e;return[e,t]=ca(t),e?["latex",t]:t.startsWith("`")&&t.endsWith("`")?(t=t.substring(1,t.length-1),["ascii-math",t]):t.includes("\\")?["latex",t]:/\$.+\$/.test(t)?["latex",`\\text{${t}}`]:[void 0,t]}var Qp="$$",eh="$$",b0=(t,e,r)=>(Xs.some(i=>e.startsWith(i[0])&&e.endsWith(i[1]))||(e=`${Qp} ${e} ${eh}`),e),Si=class Si{constructor(e){Si._modes[e]=this}static onPaste(e,r,i){var o;if(!r.contentEditable&&r.userSelect==="none")return r.model.announce("plonk"),!1;if(typeof i=="string"){let a=new DataTransfer;a.setData("text/plain",i),i=a}let n=new ClipboardEvent("paste",{clipboardData:i,cancelable:!0});return(o=r.host)!=null&&o.dispatchEvent(n)?Si._modes[e].onPaste(r,i):!1}static copyToClipboard(e,r){if(!e.contentEditable&&e.userSelect==="none"){e.model.announce("plonk");return}let i=e.model,n=i.selectionIsCollapsed?[0,i.lastOffset]:Y(i.selection),o=i.getValue(n,r);navigator.clipboard.writeText(o).then(()=>{},()=>e.model.announce("plonk"))}static onCopy(e,r){var a;if(!r.clipboardData)return;if(!e.contentEditable&&e.userSelect==="none"){e.model.announce("plonk");return}let i=e.model,n=i.selectionIsCollapsed?[0,i.lastOffset]:Y(i.selection),o=i.getAtoms(n);if(o.every(s=>s.mode==="text"||!s.mode))r.clipboardData.setData("text/plain",o.filter(s=>s instanceof He).map(s=>s.value).join(""));else if(o.every(s=>s.mode==="latex"))r.clipboardData.setData("text/plain",i.getAtoms(n,{includeChildren:!0}).map(s=>{var l;return(l=s.value)!=null?l:""}).join(""));else{let s;o.length===1&&o[0].verbatimLatex!==void 0?s=o[0].verbatimLatex:s=i.getValue(n,"latex-expanded"),r.clipboardData.setData("application/x-latex",s);try{r.clipboardData.setData("text/plain",e.options.onExport(e,s,n))}catch(l){}if(o.length===1){let l=o[0];(l.type==="root"||l.type==="group")&&(o=l.body.filter(c=>c.type!=="first"))}try{r.clipboardData.setData("application/json+mathlive",JSON.stringify(o.map(l=>l.toJson())))}catch(l){}if((a=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&a.ComputeEngine){let l=window.MathfieldElement.computeEngine;if(l)try{let c=l.jsonSerializationOptions;l.jsonSerializationOptions={metadata:["latex"]};let u=l.parse(i.getValue(n,"latex-unstyled"));l.jsonSerializationOptions=c;let d=JSON.stringify(u.json);d&&r.clipboardData.setData("application/json",d)}catch(c){}}}r.preventDefault()}static insert(e,r,i={}){var o;let n=i.mode==="auto"?e.mode:(o=i.mode)!=null?o:e.mode;return Si._modes[n].insert(e,r,i)}onPaste(e,r){return!1}insert(e,r,i){return!1}};Si._modes={};var N=Si;var x0=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]}],v0={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Bt(t){var e;return((e=t.element)==null?void 0:e.mathfield)===t}function th(t){var e,r;return(r=(e=t.querySelector(".ML__caret"))!=null?e:t.querySelector(".ML__text-caret"))!=null?r:t.querySelector(".ML__latex-caret")}function Ai(t){let e=th(t);if(!e)return null;let r=e.getBoundingClientRect();return{x:r.right,y:r.bottom,height:r.height}}function rh(t){var r;if(!t.parent)return"root";let e=(r=t.parent.id)!=null?r:"";return e+=typeof t.parentBranch=="string"?"-"+t.parentBranch:`-${t.parentBranch[0]}/${t.parentBranch[0]}`,e}function Zs(t,e,r){if(!e)return null;let i=t.field.getBoundingClientRect(),n=e.right-e.left,o=e.bottom-e.top,a=Math.ceil(e.left-i.left+t.field.scrollLeft*r),s=Math.ceil(e.top-i.top);return{left:a,right:a+n,top:s,bottom:s+o}}function w0(t){let e=t.getBoundingClientRect(),r=parseInt(getComputedStyle(t).marginRight),i={top:e.top-1,bottom:e.bottom,left:e.left,right:e.right-1+r};if(t.children.length===0||t.tagName.toUpperCase()==="SVG")return i;for(let n of t.children)if(n.nodeType===1&&"atomId"in n.dataset&&!n.classList.contains("pstrut")){let o=w0(n);i.left=Math.min(i.left,o.left),i.right=Math.max(i.right,o.right),i.top=Math.min(i.top,o.top),i.bottom=Math.max(i.bottom,o.bottom)}return i}function dr(t,e){var n,o;if(!e.id)return null;let r=(o=(n=t.atomBoundsCache)==null?void 0:n.get(e.id))!=null?o:null;if(r!==null)return r;let i=t.fieldContent.querySelector(`[data-atom-id="${e.id}"]`);return r=i?w0(i):null,t.atomBoundsCache&&(r?t.atomBoundsCache.set(e.id,r):t.atomBoundsCache.delete(e.id)),r!=null?r:null}function ih(t,e,r){let i=new Map;for(let n of t.model.getAtoms(e,{includeChildren:!0})){if(r!=null&&r.excludeAtomsWithBackground&&n.style.backgroundColor)continue;let o=t.field,a=parseFloat(getComputedStyle(o).width),l=o.getBoundingClientRect().width/a;l=isNaN(l)?1:l;let c=Zs(t,dr(t,n),l);if(c){let u=rh(n);if(i.has(u)){let d=i.get(u);i.set(u,{left:Math.min(d.left,c.left),right:Math.max(d.right,c.right),top:Math.min(d.top,c.top),bottom:Math.max(d.bottom,c.bottom)})}else i.set(u,c)}}return[...i.values()]}function ua(t,e){return t.model.selection.ranges.reduce((r,i)=>r.concat(...ih(t,i,e)),[])}function Li(t,e){return t==="*"||e==="none"?!0:e==="same-origin"?!window.origin||t===window.origin:typeof e=="function"?e(t):!1}function Ys(t){let e=0,r=0,i=t.offsetWidth,n=t.offsetHeight;for(;t instanceof HTMLElement;)e+=t.offsetTop,r+=t.offsetLeft,t=t.offsetParent;return new DOMRect(r,e,i,n)}var k0=`@keyframes ML__caret-blink { + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0; + } +} +.ML__container { + display: inline-flex; + flex-flow: row; + justify-content: space-between; + align-items: flex-end; + min-height: 39px; + /* Need some room for the virtual keyboard toggle */ + width: 100%; + /* Encourage browsers to consider allocating a hardware accelerated + layer for this element. */ + isolation: isolate; + /* Prevent the browser from trying to interpret touch gestures in the field */ + /* "Disabling double-tap to zoom removes the need for browsers to + delay the generation of click events when the user taps the screen." */ + touch-action: none; + --_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%)); + --_selection-color: var(--selection-color, #000); + --_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%)); + --_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1)); + --_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%)); + --_smart-fence-color: var(--smart-fence-color, currentColor); + --_smart-fence-opacity: var(--smart-fence-opacity, 0.5); + --_latex-color: var(--latex-color, hsl(var(--_hue), 40%, 50%)); + --_correct-color: var(--correct-color, #10a000); + --_incorrect-color: var(--incorrect-color, #a01b00); + --_composition-background-color: var(--composition-background-color, #fff1c2); + --_composition-text-color: var(--composition-text-color, black); + --_composition-underline-color: var(--composition-underline-color, transparent); +} +/* This is the actual field content (formula) */ +.ML__content { + display: flex; + align-items: center; + align-self: center; + position: relative; + overflow: hidden; + padding: 2px 0 2px 1px; + width: 100%; +} +.ML__virtual-keyboard-toggle, +.ML__menu-toggle { + box-sizing: border-box; + display: flex; + align-self: center; + align-items: center; + flex-shrink: 0; + flex-direction: column; + justify-content: center; + width: 34px; + height: 34px; + padding: 0; + margin-right: 4px; + cursor: pointer; + /* Avoid some weird blinking with :hover */ + border-radius: 8px; + border: 1px solid transparent; + transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); + color: hsl(var(--_hue), 40%, 50%); + fill: currentColor; + background: transparent; +} +.ML__virtual-keyboard-toggle:hover, +.ML__menu-toggle:hover { + background: hsla(0, 0%, 70%, 0.3); + color: #333; + fill: currentColor; +} +.ML__virtual-keyboard-toggle > span, +.ML__menu-toggle > span { + display: flex; + align-self: center; + align-items: center; +} +/* The invisible element used to capture keyboard events. We're just trying + really hard to make sure it doesn't show. */ +.ML__keyboard-sink { + display: inline-block; + resize: none; + outline: none; + border: none; + /* Need these for Microsoft Edge */ + position: fixed; + clip: rect(0 0 0 0); + /* Need this to prevent iOS Safari from auto-zooming */ + font-size: 1em; + font-family: KaTeX_Main; +} +.ML__composition { + background: var(--_composition-background-color); + color: var(--_composition-text-color); + text-decoration: underline var(--_composition-underline-color); +} +.ML__caret:after { + content: ''; + border: none; + border-radius: 2px; + border-right: 2px solid var(--_caret-color); + margin-right: -2px; + position: relative; + left: -1px; + animation: ML__caret-blink 1.05s step-end forwards infinite; +} +.ML__text-caret:after { + content: ''; + border: none; + border-radius: 1px; + border-right: 1px solid var(--_caret-color); + margin-right: -1px; + position: relative; + left: 0; + animation: ML__caret-blink 1.05s step-end forwards infinite; +} +.ML__latex-caret:after { + content: ''; + border: none; + border-radius: 2px; + border-right: 2px solid var(--_caret-color); + margin-right: -2px; + position: relative; + left: -1px; + color: var(--_caret-color); + animation: ML__caret-blink 1.05s step-end forwards infinite; +} +.ML__focused .ML__text { + background: var(--_text-highlight-background-color); +} +/* When using smartFence, the anticipated closing fence is displayed +with this style */ +.ML__smart-fence__close { + opacity: var(--_smart-fence-opacity); + color: var(--_smart-fence-color); +} +.ML__selected, +.ML__focused .ML__selected .ML__contains-caret, +.ML__focused .ML__selected .ML__smart-fence__close, +.ML__focused .ML__selected .ML__placeholder { + color: var(--_selection-color); + opacity: 1; +} +:host(:focus) .ML__selection { + box-sizing: border-box; + background: var(--_selection-background-color) !important; +} +.ML__contains-caret.ML__close, +.ML__contains-caret.ML__open, +.ML__contains-caret > .ML__close, +.ML__contains-caret > .ML__open, +.ML__contains-caret .ML__sqrt-sign, +.ML__contains-caret .ML__sqrt-line { + color: var(--_caret-color); +} +.ML__contains-highlight { + background: var(--_contains-highlight-background-color); + box-sizing: border-box; +} +.ML__latex { + font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace; + font-weight: 400; + color: var(--_latex-color); +} +.ML__suggestion { + opacity: 0.5; +} +.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover { + background: hsl(var(--_hue), 25%, 35%); + color: #fafafa; + fill: currentColor; +} +.ML__virtual-keyboard-toggle:focus { + outline: none; + border-radius: 8px; + border: 2px solid hsl(var(--_hue), 40%, 50%); +} +.ML__virtual-keyboard-toggle.is-pressed, +.ML__virtual-keyboard-toggle.is-active:hover, +.ML__virtual-keyboard-toggle.is-active { + background: hsl(var(--_hue), 25%, 35%); + color: #fafafa; + fill: currentColor; +} +/* Add an attribute 'data-tooltip' to automatically show a + tooltip over a element on hover. +*/ +[data-tooltip] { + position: relative; +} +[data-tooltip]::after { + content: attr(data-tooltip); + position: absolute; + display: block; + z-index: 2; + pointer-events: none; + right: auto; + top: calc(-100% - 4px); + width: max-content; + max-width: 200px; + padding: 8px 8px; + border-radius: 4px; + background: #616161; + color: #fff; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + text-align: center; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-style: normal; + font-weight: 400; + font-size: 13px; + /* Phone */ + opacity: 0; + transform: scale(0.5); +} +@media only screen and (max-width: 767px) { + [data-tooltip]::after { + padding: 8px 16px; + font-size: 16px; + } +} +[data-tooltip]:hover { + position: relative; +} +[data-tooltip]:hover::after { + visibility: visible; + opacity: 1; + transform: scale(1); + transition-property: opacity, scale; + transition-duration: 0.15s; + transition-delay: 1s; + transition-timing-function: cubic-bezier(0.4, 0, 1, 1); +} +.tracking [data-tooltip]:hover::after { + display: none; +} +.ML__prompt { + border-radius: 2px; +} +.ML__editablePromptBox { + outline: 1px solid #acacac; + border-radius: 2px; + z-index: -1; +} +.ML__focusedPromptBox { + outline: highlight auto 1px; +} +.ML__lockedPromptBox { + background-color: rgba(142, 142, 141, 0.4); + z-index: -1; +} +.ML__correctPromptBox { + outline: 1px solid var(--_correct-color); + box-shadow: 0 0 5px var(--_correct-color); +} +.ML__incorrectPromptBox { + outline: 1px solid var(--_incorrect-color); + box-shadow: 0 0 5px var(--_incorrect-color); +} +.menu-container-variant { + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + column-count: 3; + column-gap: 8px; + padding: 8px; + margin: 8px; +} +.menu-container-variant [part=menu-item] { + font-size: 2rem; + text-align: center; + margin: 0; +} +.menu-container-insert-matrix { + column-count: 5; + column-gap: 0; +} +.menu-container-insert-matrix [part=menu-item] { + font-size: 21px; + border: none; + border-radius: 2px; + line-height: 1; + text-align: center; + padding: 4px; + margin: 0; +} +.menu-container-border [part=menu-item] { + font-size: 2rem; + line-height: 1.2; + text-align: center; +} +.menu-container-swatches { + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + flex-wrap: wrap; + column-count: 4; + column-gap: 0; + padding: 8px; + margin: 8px; + max-width: calc(4 * (2rem + 18px)); +} +.menu-swatch { + width: fit-content; + height: fit-content; + margin: 2px; + padding: 0; + box-sizing: border-box; + background: var(--neutral-200); +} +.menu-swatch > span { + padding: 0; + margin: 0; + line-height: 0; +} +.menu-swatch > span > span { + display: inline-block; + margin: 6px; + min-width: 2rem; + min-height: 2rem; + border-radius: 50%; +} +.menu-swatch:hover { + background: var(--neutral-100); +} +.menu-swatch:hover > span > span { + border-radius: 2px; +} +`;var M0=`.ML__container { + min-height: auto !important; + --_hue: var(--hue, 212); + --_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%)); + --_placeholder-opacity: var(--placeholder-opacity, 0.4); + --_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif); +} +.ML__sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + clip-path: inset(50%); + white-space: nowrap; + border: 0; +} +.ML__is-inline { + display: inline-block; +} +.ML__base { + visibility: inherit; + display: inline-block; + position: relative; + cursor: text; + padding: 0; + margin: 0; + box-sizing: content-box; + border: 0; + outline: 0; + vertical-align: baseline; + font-weight: inherit; + font-family: inherit; + font-style: inherit; + text-decoration: none; + width: min-content; +} +.ML__strut, +.ML__strut--bottom { + display: inline-block; + min-height: 0.5em; +} +.ML__small-delim { + font-family: KaTeX_Main; +} +/* Text mode */ +.ML__text { + font-family: var(--_text-font-family); + white-space: pre; +} +/* Use cmr for 'math upright' */ +.ML__cmr { + font-family: KaTeX_Main; + font-style: normal; +} +.ML__mathit { + font-family: KaTeX_Math; + /* The KaTeX_Math font is italic by default, so the font-style below is only + useful when a fallback font is used + */ + font-style: italic; +} +.ML__mathbf { + font-family: KaTeX_Main; + font-weight: bold; +} +/* Lowercase greek symbols should stick to math font when \\mathbf is applied + to match TeX idiosyncratic behavior */ +.lcGreek.ML__mathbf { + font-family: KaTeX_Math; + font-weight: normal; +} +.ML__mathbfit { + font-family: KaTeX_Math; + font-weight: bold; + font-style: italic; +} +.ML__ams { + font-family: KaTeX_AMS; +} +/* Blackboard */ +.ML__bb { + font-family: KaTeX_AMS; +} +.ML__cal { + font-family: KaTeX_Caligraphic; +} +.ML__frak { + font-family: KaTeX_Fraktur; +} +.ML__tt { + font-family: KaTeX_Typewriter; +} +.ML__script { + font-family: KaTeX_Script; +} +.ML__sans { + font-family: KaTeX_SansSerif; +} +.ML__series_ul { + font-weight: 100; +} +.ML__series_el { + font-weight: 100; +} +.ML__series_l { + font-weight: 200; +} +.ML__series_sl { + font-weight: 300; +} +.ML__series_sb { + font-weight: 500; +} +.ML__bold, +.ML__boldsymbol { + font-weight: 700; +} +.ML__series_eb { + font-weight: 800; +} +.ML__series_ub { + font-weight: 900; +} +.ML__series_uc { + font-stretch: ultra-condensed; +} +.ML__series_ec { + font-stretch: extra-condensed; +} +.ML__series_c { + font-stretch: condensed; +} +.ML__series_sc { + font-stretch: semi-condensed; +} +.ML__series_sx { + font-stretch: semi-expanded; +} +.ML__series_x { + font-stretch: expanded; +} +.ML__series_ex { + font-stretch: extra-expanded; +} +.ML__series_ux { + font-stretch: ultra-expanded; +} +.ML__it { + font-style: italic; +} +.ML__shape_ol { + -webkit-text-stroke: 1px black; + text-stroke: 1px black; + color: transparent; +} +.ML__shape_sc { + font-variant: small-caps; +} +.ML__shape_sl { + font-style: oblique; +} +/* First level emphasis */ +.ML__emph { + color: #bc2612; +} +/* Second level emphasis */ +.ML__emph .ML__emph { + color: #0c7f99; +} +.ML__highlight { + color: #007cb2; + background: #edd1b0; +} +.ML__center { + text-align: center; +} +.ML__label_padding { + padding: 0 0.5em; +} +.ML__frac-line { + width: 100%; + min-height: 1px; +} +.ML__frac-line:after { + content: ''; + display: block; + margin-top: max(-1px, -0.04em); + min-height: max(1px, 0.04em); + /* Ensure the line is visible when printing even if "turn off background images" is on*/ + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + /* There's a bug since Chrome 62 where + sub-pixel border lines don't draw at some zoom + levels (110%, 90%). + Setting the min-height used to work around it, but that workaround + broke in Chrome 84 or so. + Setting the background (and the min-height) seems to work for now. + */ + background: currentColor; + box-sizing: content-box; + /* Vuetify sets the box-sizing to inherit + causes the fraction line to not draw at all sizes (see #26) */ + /* On some versions of Firefox on Windows, the line fails to + draw at some zoom levels, but setting the transform triggers + the hardware accelerated path, which works */ + transform: translate(0, 0); +} +.ML__sqrt { + display: inline-block; +} +.ML__sqrt-sign { + display: inline-block; + position: relative; +} +.ML__sqrt-line { + display: inline-block; + height: max(1px, 0.04em); + width: 100%; +} +.ML__sqrt-line:before { + content: ''; + display: block; + margin-top: min(-1px, -0.04em); + min-height: max(1px, 0.04em); + /* Ensure the line is visible when printing even if "turn off background images" is on*/ + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + background: currentColor; + /* On some versions of Firefox on Windows, the line fails to + draw at some zoom levels, but setting the transform triggers + the hardware accelerated path, which works */ + transform: translate(0, 0); +} +.ML__sqrt-line:after { + border-bottom-width: 1px; + content: ' '; + display: block; + margin-top: -0.1em; +} +.ML__sqrt-index { + margin-left: 0.27777778em; + margin-right: -0.55555556em; +} +.ML__delim-size1 { + font-family: KaTeX_Size1; +} +.ML__delim-size2 { + font-family: KaTeX_Size2; +} +.ML__delim-size3 { + font-family: KaTeX_Size3; +} +.ML__delim-size4 { + font-family: KaTeX_Size4; +} +.ML__delim-mult .delim-size1 > span { + font-family: KaTeX_Size1; +} +.ML__delim-mult .delim-size4 > span { + font-family: KaTeX_Size4; +} +.ML__accent-body > span { + font-family: KaTeX_Main; + width: 0; +} +.ML__accent-vec { + position: relative; + left: 0.24em; +} +.ML__mathlive { + display: inline-block; + direction: ltr; + text-align: left; + text-indent: 0; + text-rendering: auto; + font-family: KaTeX_Main, 'Times New Roman', serif; + font-style: normal; + font-size-adjust: none; + font-stretch: normal; + font-variant-caps: normal; + letter-spacing: normal; + line-height: 1.2; + word-wrap: normal; + word-spacing: normal; + white-space: nowrap; + text-shadow: none; + -webkit-user-select: none; + user-select: none; + width: min-content; +} +.ML__mathlive .style-wrap { + position: relative; +} +.ML__mathlive .mfrac { + display: inline-block; +} +.ML__mathlive .left-right { + display: inline-block; +} +.ML__mathlive .vlist-t { + display: inline-table; + table-layout: fixed; + border-collapse: collapse; +} +.ML__mathlive .vlist-r { + display: table-row; +} +.ML__mathlive .vlist { + display: table-cell; + vertical-align: bottom; + position: relative; +} +.ML__mathlive .vlist > span { + display: block; + height: 0; + position: relative; +} +.ML__mathlive .vlist > span > span { + display: inline-block; +} +.ML__mathlive .vlist > span > .pstrut { + overflow: hidden; + width: 0; +} +.ML__mathlive .vlist-t2 { + margin-right: -2px; +} +.ML__mathlive .vlist-s { + display: table-cell; + vertical-align: bottom; + font-size: 1px; + width: 2px; + min-width: 2px; +} +.ML__mathlive .msubsup { + text-align: left; +} +.ML__mathlive .negativethinspace { + display: inline-block; + margin-left: -0.16667em; + height: 0.71em; +} +.ML__mathlive .thinspace { + display: inline-block; + width: 0.16667em; + height: 0.71em; +} +.ML__mathlive .mediumspace { + display: inline-block; + width: 0.22222em; + height: 0.71em; +} +.ML__mathlive .thickspace { + display: inline-block; + width: 0.27778em; + height: 0.71em; +} +.ML__mathlive .enspace { + display: inline-block; + width: 0.5em; + height: 0.71em; +} +.ML__mathlive .quad { + display: inline-block; + width: 1em; + height: 0.71em; +} +.ML__mathlive .qquad { + display: inline-block; + width: 2em; + height: 0.71em; +} +.ML__mathlive .llap, +.ML__mathlive .rlap { + width: 0; + position: relative; + display: inline-block; +} +.ML__mathlive .llap > .inner, +.ML__mathlive .rlap > .inner { + position: absolute; +} +.ML__mathlive .llap > .fix, +.ML__mathlive .rlap > .fix { + display: inline-block; +} +.ML__mathlive .llap > .inner { + right: 0; +} +.ML__mathlive .rlap > .inner { + left: 0; +} +.ML__mathlive .rule { + display: inline-block; + border: solid 0; + position: relative; + box-sizing: border-box; +} +.ML__mathlive .overline .overline-line, +.ML__mathlive .underline .underline-line { + width: 100%; +} +.ML__mathlive .overline .overline-line:before, +.ML__mathlive .underline .underline-line:before { + content: ''; + border-bottom-style: solid; + border-bottom-width: max(1px, 0.04em); + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + display: block; +} +.ML__mathlive .overline .overline-line:after, +.ML__mathlive .underline .underline-line:after { + border-bottom-style: solid; + border-bottom-width: max(1px, 0.04em); + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + content: ''; + display: block; + margin-top: -1px; +} +.ML__mathlive .stretchy { + display: block; + position: absolute; + width: 100%; + left: 0; + overflow: hidden; +} +.ML__mathlive .stretchy:before, +.ML__mathlive .stretchy:after { + content: ''; +} +.ML__mathlive .stretchy svg { + display: block; + position: absolute; + width: 100%; + height: inherit; + fill: currentColor; + stroke: currentColor; + fill-rule: nonzero; + fill-opacity: 1; + stroke-width: 1; + stroke-linecap: butt; + stroke-linejoin: miter; + stroke-miterlimit: 4; + stroke-dasharray: none; + stroke-dashoffset: 0; + stroke-opacity: 1; +} +.ML__mathlive .slice-1-of-2 { + display: inline-flex; + position: absolute; + left: 0; + width: 50.2%; + overflow: hidden; +} +.ML__mathlive .slice-2-of-2 { + display: inline-flex; + position: absolute; + right: 0; + width: 50.2%; + overflow: hidden; +} +.ML__mathlive .slice-1-of-3 { + display: inline-flex; + position: absolute; + left: 0; + width: 25.1%; + overflow: hidden; +} +.ML__mathlive .slice-2-of-3 { + display: inline-flex; + position: absolute; + left: 25%; + width: 50%; + overflow: hidden; +} +.ML__mathlive .slice-3-of-3 { + display: inline-flex; + position: absolute; + right: 0; + width: 25.1%; + overflow: hidden; +} +.ML__mathlive .slice-1-of-1 { + display: inline-flex; + position: absolute; + width: 100%; + left: 0; + overflow: hidden; +} +.ML__mathlive .nulldelimiter { + display: inline-block; +} +.ML__mathlive .op-group { + display: inline-block; +} +.ML__mathlive .op-symbol { + position: relative; +} +.ML__mathlive .op-symbol.small-op { + font-family: KaTeX_Size1; +} +.ML__mathlive .op-symbol.large-op { + font-family: KaTeX_Size2; +} +.ML__mathlive .mtable .vertical-separator { + display: inline-block; + min-width: 1px; + box-sizing: border-box; +} +.ML__mathlive .mtable .arraycolsep { + display: inline-block; +} +.ML__mathlive .mtable .col-align-m > .vlist-t { + text-align: center; +} +.ML__mathlive .mtable .col-align-c > .vlist-t { + text-align: center; +} +.ML__mathlive .mtable .col-align-l > .vlist-t { + text-align: left; +} +.ML__mathlive .mtable .col-align-r > .vlist-t { + text-align: right; +} +.ML__error { + display: inline-block; + background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%); + background-color: hsla(341, 100%, 40%, 0.1); + background-repeat: repeat-x; + background-size: 3px 3px; + padding-bottom: 3px; + background-position: 0 100%; +} +.ML__error > .ML__error { + background: transparent; + padding: 0; +} +.ML__placeholder { + color: var(--_placeholder-color); + opacity: var(--_placeholder-opacity); + padding-left: 0.4ex; + padding-right: 0.4ex; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; +} +.ML__notation { + position: absolute; + box-sizing: border-box; + line-height: 0; +} +/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands + For UI elements, see \`[data-ML__tooltip]\` +*/ +.ML__tooltip-container { + position: relative; + transform: scale(0); +} +.ML__tooltip-container .ML__tooltip-content { + position: fixed; + display: inline-table; + visibility: hidden; + z-index: 2; + width: max-content; + max-width: 400px; + padding: 12px 12px; + border-radius: 8px; + background: #616161; + --_selection-color: #fff; + color: #fff; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + opacity: 0; + transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1); +} +.ML__tooltip-container .ML__tooltip-content .ML__text { + white-space: normal; +} +.ML__tooltip-container .ML__tooltip-content .ML__base { + display: contents; +} +.ML__tooltip-container:hover .ML__tooltip-content { + visibility: visible; + opacity: 1; + font-size: 0.75em; + transform: scale(1) translate(0, 3em); +} +`;var _0=`#mathlive-environment-popover.is-visible { + visibility: visible; +} +#mathlive-environment-popover { + --_environment-panel-height: var(--environment-panel-height, 70px); + --_accent-color: var(--accent-color, #aaa); + --_background: var(--environment-panel-background, #fff); + --_button-background: var(--environment-panel-button-background, white); + --_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7); + --_button-background-active: var(--environment-panel-button-background-active, #f5f5f7); + --_button-text: var(--environment-panel-button-text, #e3e4e8); + position: absolute; + width: calc(var(--_environment-panel-height) * 2); + height: var(--_environment-panel-height); + border-radius: 4px; + border: 1.5px solid var(--_accent-color); + background-color: var(--_background); + box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4)); + pointer-events: all; + visibility: hidden; +} +#mathlive-environment-popover .MLEP__array-buttons { + height: calc(var(--_environment-panel-height) * 5/4); + width: calc(var(--_environment-panel-height) * 5/4); + margin-left: calc(0px - var(--_environment-panel-height) * 0.16); + margin-top: calc(0px - var(--_environment-panel-height) * 0.19); +} +#mathlive-environment-popover .MLEP__array-buttons .font { + fill: white; +} +#mathlive-environment-popover .MLEP__array-buttons circle { + fill: #7f7f7f; + transition: fill 300ms; +} +#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background { + fill-opacity: 1; + fill: var(--_background); + stroke: var(--_accent-color); + stroke-width: 3px; +} +#mathlive-environment-popover .MLEP__array-buttons line { + stroke: var(--_accent-color); + stroke-opacity: 0; + stroke-width: 40; + pointer-events: none; + transition: stroke-opacity 300ms; + stroke-linecap: round; +} +#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle { + fill: var(--_accent-color); +} +#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line { + stroke-opacity: 1; +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls { + height: 100%; + width: 50%; +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options { + width: var(--_environment-panel-height); + height: var(--_environment-panel-height); + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: space-around; +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg { + pointer-events: all; + margin-top: 2px; + width: calc(var(--_environment-panel-height) / 3 * 28 / 24); + height: calc(var(--_environment-panel-height) / 3 - 2px); + border-radius: calc(var(--_environment-panel-height) / 25); + background-color: var(--_button-background); +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover { + background-color: var(--_button-background-hover); +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path, +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line { + stroke: var(--_button-text); + stroke-width: 2; + stroke-linecap: round; +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect, +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path { + fill-opacity: 0; +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active { + pointer-events: none; + background-color: var(--_button-background-active); +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path, +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line { + stroke: var(--_accent-color); +} +#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle { + fill: var(--_accent-color); +} +`;var S0=`/* The element that display info while in latex mode */ +#mathlive-suggestion-popover { + background-color: rgba(97, 97, 97); + color: #fff; + text-align: center; + border-radius: 8px; + position: fixed; + z-index: 1; + display: none; + flex-direction: column; + justify-content: center; + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); +} +#mathlive-suggestion-popover.top-tip::after { + content: ''; + position: absolute; + top: -15px; + left: calc(50% - 15px); + width: 0; + height: 0; + border-left: 15px solid transparent; + border-right: 15px solid transparent; + border-bottom: 15px solid rgba(97, 97, 97); + font-size: 1rem; +} +#mathlive-suggestion-popover.bottom-tip::after { + content: ''; + position: absolute; + bottom: -15px; + left: calc(50% - 15px); + width: 0; + height: 0; + border-left: 15px solid transparent; + border-right: 15px solid transparent; + border-top: 15px solid rgba(97, 97, 97); + font-size: 1rem; +} +#mathlive-suggestion-popover.is-animated { + transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); + animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s; +} +#mathlive-suggestion-popover.is-visible { + display: flex; +} +@keyframes ML__fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +/* The wrapper class for the entire content of the popover panel */ +#mathlive-suggestion-popover ul { + display: flex; + flex-flow: column; + list-style: none; + margin: 0; + padding: 0; + align-items: flex-start; + max-height: 400px; + overflow-y: auto; +} +#mathlive-suggestion-popover li { + display: flex; + flex-direction: row; + justify-content: space-between; + margin: 8px; + padding: 8px; + width: calc(100% - 16px - 16px); + column-gap: 1em; + border-radius: 8px; + cursor: pointer; + /* Since the content can be clicked on, provide feedback on hover */ +} +#mathlive-suggestion-popover li a { + color: #5ea6fd; + padding-top: 0.3em; + margin-top: 0.4em; + display: block; +} +#mathlive-suggestion-popover li a:hover { + color: #5ea6fd; + text-decoration: underline; +} +#mathlive-suggestion-popover li:hover, +#mathlive-suggestion-popover li.is-pressed, +#mathlive-suggestion-popover li.is-active { + background: rgba(255, 255, 255, 0.1); +} +/* The command inside a popover (inside a #mathlive-suggestion-popover) */ +.ML__popover__command { + font-size: 1.6rem; + font-family: KaTeX_Main; +} +.ML__popover__current { + background: #5ea6fd; + color: #fff; +} +.ML__popover__latex { + font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace; + align-self: center; +} +/* The keyboard shortcuts for a symbol as displayed in the popover */ +.ML__popover__keybinding { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: 0.8em; + opacity: 0.7; +} +/* Style for the character that joins the modifiers of a keyboard shortcut +(usually a "+" sign)*/ +.ML__shortcut-join { + opacity: 0.5; +} +`;var A0=`/* The element that displays the keys as the user type them */ +#mathlive-keystroke-caption-panel { + visibility: hidden; + /*min-width: 160px;*/ + /*background-color: rgba(97, 97, 200, .95);*/ + background: var(--secondary, hsl(var(--_hue), 19%, 26%)); + border-color: var(--secondary-border, hsl(0, 0%, 91%)); + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + text-align: center; + border-radius: 6px; + padding: 16px; + position: absolute; + z-index: 1; + display: flex; + flex-direction: row-reverse; + justify-content: center; + --keystroke: white; + --on-keystroke: #555; + --keystroke-border: #f7f7f7; +} +@media (prefers-color-scheme: dark) { + body:not([theme='light']) #mathlive-keystroke-caption-panel { + --keystroke: hsl(var(--_hue), 50%, 30%); + --on-keystroke: hsl(0, 0%, 98%); + --keystroke-border: hsl(var(--_hue), 50%, 25%); + } +} +body[theme='dark'] #mathlive-keystroke-caption-panel { + --keystroke: hsl(var(--_hue), 50%, 30%); + --on-keystroke: hsl(0, 0%, 98%); + --keystroke-border: hsl(var(--_hue), 50%, 25%); +} +#mathlive-keystroke-caption-panel > span { + min-width: 14px; + /*height: 8px;*/ + margin: 0 8px 0 0; + padding: 4px; + background-color: var(--keystroke); + color: var(--on-keystroke); + fill: currentColor; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: 1em; + border-radius: 6px; + border: 2px solid var(--keystroke-border); + /*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/ +} +`;var L0=`.ML__keyboard { + --_keyboard-height: 0; + --_keyboard-zindex: var(--keyboard-zindex, 105); + --_accent-color: var(--keyboard-accent-color, #0c75d8); + --_background: var(--keyboard-background, #cacfd7); + --_border: var(--keyboard-border, #ddd); + --_padding-horizontal: var(--keyboard-padding-horizontal, 0px); + --_padding-top: var(--keyboard-padding-top, 5px); + --_padding-bottom: var(--keyboard-padding-bottom, 0px); + --_row-padding-left: var(--keyboard-row-padding-left, 0px); + --_row-padding-right: var(--keyboard-row-padding-right, 0px); + --_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f); + --_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color)); + --_toolbar-background: var(--keyboard-toolbar-background, transparent); + --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee); + --_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent); + --_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%'); + --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff); + --_keycap-background: var(--keycap-background, white); + --_keycap-background-hover: var(--keycap-background-hover, #f5f5f7); + --_keycap-background-active: var(--keycap-background-active, var(--_accent-color)); + --_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color)); + --_keycap-border: var(--keycap-border, #e5e6e9); + --_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92); + --_keycap-text: var(--keycap-text, #000); + --_keycap-text-active: var(--keycap-text-active, #fff); + --_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text)); + --_keycap-text-pressed: var(--keycap-text-pressed, #fff); + --_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color)); + --_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color)); + --_keycap-primary-text: var(--keycap-primary-text, #ddd); + --_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2); + --_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8); + --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795); + --_keycap-secondary-text: var(--keycap-secondary-text, #060707); + --_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0); + --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6); + --_keycap-height: var(--keycap-height, 60px); + /* Keycap width (incl. margin) */ + --_keycap-max-width: var(--keycap-max-width, 100px); + --_keycap-gap: var(--keycap-gap, 8px); + --_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px)); + --_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8)); + --_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42)); + --_variant-panel-background: var(--variant-panel-background, #fff); + --_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text)); + --_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active)); + --_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color)); + --_variant-keycap-length: var(--variant-keycap-length, 70px); + --_variant-keycap-font-size: var(--variant-keycap-font-size, 30px); + --_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px); + --_keycap-shift-font-size: var(--keycap-shift-font-size, 16px); + --_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color)); + --_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color)); + --_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed)); +} +.is-math-mode .MLK__rows .if-text-mode, +.is-text-mode .MLK__rows .if-math-mode { + display: none; +} +.if-can-undo, +.if-can-redo, +.if-can-copy, +.if-can-cut, +.if-can-paste { + opacity: 0.4; + pointer-events: none; +} +.can-undo .if-can-undo, +.can-redo .if-can-redo, +.can-copy .if-can-copy, +.can-cut .if-can-cut, +.can-paste .if-can-paste { + opacity: 1; + pointer-events: all; +} +body > .ML__keyboard { + position: fixed; + --_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0)); +} +body > .ML__keyboard.is-visible > .MLK__backdrop { + box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08); + border-top: 1px solid var(--_border); +} +body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop { + box-shadow: none; + border: none; +} +body > .ML__keyboard.is-visible.animate > .MLK__backdrop { + transition: 0.28s cubic-bezier(0, 0, 0.2, 1); + transition-property: transform, opacity; + transition-timing-function: cubic-bezier(0.4, 0, 1, 1); +} +.ML__keyboard { + position: relative; + overflow: hidden; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: var(--_keyboard-zindex); + box-sizing: border-box; + outline: none; + border: none; + margin: 0; + padding: 0; + line-height: 1; + overflow-wrap: unset; + text-align: left; + vertical-align: baseline; + cursor: auto; + white-space: pre; + box-shadow: none; + opacity: 1; + transform: none; + pointer-events: none; +} +.ML__keyboard :where(div) { + box-sizing: border-box; + outline: none; + border: none; + margin: 0; + padding: 0; + line-height: 1; + overflow-wrap: unset; + text-align: left; + vertical-align: baseline; + cursor: auto; + white-space: pre; + box-shadow: none; + transform: none; +} +.MLK__backdrop { + position: absolute; + bottom: calc(-1 * var(--_keyboard-height)); + width: 100%; + height: var(--_keyboard-height); + box-sizing: border-box; + padding-top: var(--_padding-top); + padding-bottom: var(--_padding-bottom); + padding-left: var(--_padding-horizontal); + padding-right: var(--_padding-horizontal); + opacity: 0; + visibility: hidden; + transform: translate(0, 0); + background: var(--_background); +} +.backdrop-is-transparent .MLK__backdrop { + background: transparent; +} +/* If a custom layout has a custom container/backdrop + (backdrop-is-transparent), make sure to let pointer event go through. */ +.backdrop-is-transparent .MLK__plate { + background: transparent; + pointer-events: none; +} +/* If a custom layout has a custom container/backdrop, make sure to + allow pointer events on it. */ +.backdrop-is-transparent .MLK__layer > div > div { + pointer-events: all; +} +.ML__keyboard.is-visible > .MLK__backdrop { + transform: translate(0, calc(-1 * var(--_keyboard-height))); + opacity: 1; + visibility: visible; +} +.caps-lock-indicator { + display: none; + width: 8px; + height: 8px; + background: #0cbc0c; + box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48; + border-radius: 8px; + right: 8px; + top: 8px; + position: absolute; +} +.ML__keyboard.is-caps-lock .caps-lock-indicator { + display: block; +} +.ML__keyboard.is-caps-lock .shift { + background: var(--_keycap-background-active); + color: var(--_keycap-text-active); +} +.MLK__plate { + position: absolute; + top: var(--_padding-top); + left: var(--_padding-horizontal); + width: calc(100% - 2 * var(--_padding-horizontal)); + margin: 0; + padding: 0; + box-sizing: border-box; + container-type: inline-size; + touch-action: none; + -webkit-user-select: none; + user-select: none; + pointer-events: all; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: 16px; + /* Size of toolbar labels */ + font-weight: 400; + text-shadow: none; +} +.ML__box-placeholder { + color: var(--_box-placeholder-color); +} +.MLK__tex { + font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important; +} +.MLK__tex-math { + font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important; + font-style: italic; +} +.MLK__layer { + display: none; + outline: none; +} +.MLK__layer.is-visible { + display: flex; + flex-flow: column; +} +/* Keyboard layouts are made or rows of keys... */ +.MLK__rows { + --_keycap-width: min(var(--_keycap-max-width), 10cqw); + display: flex; + flex-flow: column; + align-items: center; + border-collapse: separate; + clear: both; + border: 0; + margin: 0; + margin-bottom: var(--_keycap-gap); + gap: var(--_keycap-gap); + /* If the styling include, e.g., some shadows, they will be + cut off by the overflow. In that case, set the padding to + compensate. */ + padding-left: var(--_row-padding-left); + padding-right: var(--_row-padding-right); + overflow: visible; + touch-action: none; +} +.MLK__rows > .row { + display: flex; + flex-flow: row; + justify-content: center; + width: 100%; + gap: var(--_keycap-gap); + margin: 0; + padding: 0; + /* For the alignment of the text on some modifiers (e.g. shift) */ + /* Extra spacing between two adjacent keys */ + /** A regular keycap */ +} +.MLK__rows > .row .tex { + font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important; +} +.MLK__rows > .row .tex-math { + font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important; +} +.MLK__rows > .row .big-op { + font-size: calc(1.25 * var(--_keycap-font-size)); +} +.MLK__rows > .row .small { + font-size: var(--_keycap-small-font-size); +} +.MLK__rows > .row .bottom { + justify-content: flex-end; +} +.MLK__rows > .row .left { + align-items: flex-start; + padding-left: 12px; +} +.MLK__rows > .row .right { + align-items: flex-end; + padding-right: 12px; +} +.MLK__rows > .row .w0 { + width: 0; +} +.MLK__rows > .row .w5 { + width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap)); +} +.MLK__rows > .row .w15 { + width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap)); +} +.MLK__rows > .row .w20 { + width: calc(2 * var(--_keycap-width) - var(--_keycap-gap)); +} +.MLK__rows > .row .w40 { + width: calc(4 * var(--_keycap-width) - var(--_keycap-gap)); +} +.MLK__rows > .row .w50 { + width: calc(5 * var(--_keycap-width) - var(--_keycap-gap)); +} +.MLK__rows > .row .MLK__keycap.w50 { + font-size: 80%; + padding-top: 10px; + font-weight: 100; +} +.MLK__rows > .row .separator { + background: transparent; + border: none; + pointer-events: none; +} +.MLK__rows > .row .horizontal-rule { + height: 6px; + margin-top: 3px; + margin-bottom: 0; + width: 100%; + border-radius: 0; + border-top: var(--_horizontal-rule); +} +.MLK__rows > .row .ghost { + background: var(--_toolbar-background); + border: none; + color: var(--_toolbar-text); +} +.MLK__rows > .row .ghost:hover { + background: var(--_toolbar-background-hover); +} +.MLK__rows > .row .bigfnbutton { + font-size: var(--_keycap-extra-small-font-size); +} +.MLK__rows > .row .shift, +.MLK__rows > .row .action { + color: var(--_keycap-secondary-text); + background: var(--_keycap-secondary-background); + border-color: var(--_keycap-secondary-border); + border-bottom-color: var(--_keycap-secondary-border-bottom); + line-height: 0.8; + font-size: min(1rem, var(--_keycap-small-font-size)); + font-weight: 600; + padding: 8px 12px 8px 12px; +} +.MLK__rows > .row .shift:hover, +.MLK__rows > .row .action:hover { + background: var(--_keycap-secondary-background-hover); +} +.MLK__rows > .row .action.primary { + background: var(--_keycap-primary-background); + color: var(--_keycap-primary-text); +} +.MLK__rows > .row .action.primary:hover { + background: var(--_keycap-primary-background-hover); + color: var(--_keycap-primary-text); +} +.MLK__rows > .row .shift.selected, +.MLK__rows > .row .action.selected { + color: var(--_toolbar-text-active); +} +.MLK__rows > .row .shift.selected.is-pressed, +.MLK__rows > .row .action.selected.is-pressed, +.MLK__rows > .row .shift.selected.is-active, +.MLK__rows > .row .action.selected.is-active { + color: white; +} +.MLK__rows > .row .warning { + background: #cd0030; + color: white; +} +.MLK__rows > .row .warning svg.svg-glyph { + width: 24px; + height: 24px; + min-height: 24px; +} +.MLK__rows > .row div { + display: flex; + flex-flow: column; + align-items: center; + justify-content: space-evenly; + width: calc(var(--_keycap-width) - var(--_keycap-gap)); + height: var(--_keycap-height); + box-sizing: border-box; + padding: 0; + vertical-align: top; + text-align: center; + float: left; + color: var(--_keycap-text); + fill: currentColor; + font-size: var(--_keycap-font-size); + background: var(--_keycap-background); + border: 1px solid var(--_keycap-border); + border-bottom-color: var(--_keycap-border-bottom); + border-radius: 6px; + cursor: pointer; + touch-action: none; + /* Keys with a variants panel */ + position: relative; + overflow: hidden; + -webkit-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; +} +.MLK__rows > .row div:hover { + overflow: visible; + background: var(--_keycap-background-hover); +} +.MLK__rows > .row div .ML__mathlive { + pointer-events: none; + touch-action: none; +} +.MLK__rows > .row div svg.svg-glyph { + margin: 8px 0; + width: 20px; + height: 20px; + min-height: 20px; +} +.MLK__rows > .row div svg.svg-glyph-lg { + margin: 8px 0; + width: 24px; + height: 24px; + min-height: 24px; +} +.MLK__rows > .row div.MLK__tex-math { + font-size: 25px; +} +.MLK__rows > .row div.is-pressed { + background: var(--_keycap-background-pressed); + color: var(--_keycap-text-pressed); + --_box-placeholder-color: var(--_box-placeholder-pressed-color); +} +.MLK__rows > .row div.MLK__keycap.is-active, +.MLK__rows > .row div.action.is-active, +.MLK__rows > .row div.MLK__keycap.is-pressed, +.MLK__rows > .row div.action.is-pressed { + z-index: calc(var(--_keyboard-zindex) - 5); +} +.MLK__rows > .row div.MLK__keycap.is-active aside, +.MLK__rows > .row div.action.is-active aside, +.MLK__rows > .row div.MLK__keycap.is-pressed aside, +.MLK__rows > .row div.action.is-pressed aside { + display: none; +} +.MLK__rows > .row div.MLK__keycap.is-active .MLK__shift, +.MLK__rows > .row div.action.is-active .MLK__shift, +.MLK__rows > .row div.MLK__keycap.is-pressed .MLK__shift, +.MLK__rows > .row div.action.is-pressed .MLK__shift { + display: none; +} +.MLK__rows > .row div.shift.is-pressed, +.MLK__rows > .row div.MLK__keycap.is-pressed, +.MLK__rows > .row div.action.is-pressed { + background: var(--_keycap-background-pressed); + color: var(--_keycap-text-pressed); +} +.MLK__rows > .row div.shift.is-active, +.MLK__rows > .row div.MLK__keycap.is-active, +.MLK__rows > .row div.action.is-active { + background: var(--_keycap-background-active); + color: var(--_keycap-text-active); + --_box-placeholder-color: var(--_box-placeholder-pressed-color); +} +.MLK__rows > .row div small { + color: var(--_keycap-secondary-text); +} +.MLK__rows > .row div aside { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: 10px; + line-height: 10px; + color: var(--_keycap-secondary-text); +} +/* Add an attribute 'data-tooltip' to display a tooltip on hover. +Note there are a different set of tooltip rules for the keyboard toggle +(it's in a different CSS tree) */ +.ML__keyboard [data-tooltip] { + position: relative; +} +.ML__keyboard [data-tooltip]::after { + position: absolute; + display: inline-table; + content: attr(data-tooltip); + top: inherit; + bottom: 100%; + width: max-content; + max-width: 200px; + padding: 8px 8px; + background: #616161; + color: #fff; + text-align: center; + z-index: 2; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + border-radius: 2px; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-weight: 400; + font-size: 12px; + transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s; + opacity: 0; + transform: scale(0.5); +} +.ML__keyboard [data-tooltip]:hover { + position: relative; +} +.ML__keyboard [data-tooltip]:hover::after { + opacity: 1; + transform: scale(1); +} +.MLK__toolbar { + align-self: center; + display: flex; + flex-flow: row; + justify-content: space-between; + width: 100%; + max-width: 996px; + min-height: 32px; + /* Icons for undo/redo, etc. */ +} +.MLK__toolbar svg { + height: 20px; + width: 20px; +} +.MLK__toolbar > .left { + position: relative; + display: flex; + justify-content: flex-start; + flex-flow: row; +} +.MLK__toolbar > .right { + display: flex; + justify-content: flex-end; + flex-flow: row; +} +.MLK__toolbar > div > div { + /* "button" in the toolbar */ + display: flex; + align-items: center; + justify-content: center; + color: var(--_toolbar-text); + fill: currentColor; + background: var(--_toolbar-background); + font-size: var(--_toolbar-font-size); + padding: 4px 15px; + cursor: pointer; + width: max-content; + min-width: 42px; + min-height: 34px; + border: none; + padding-left: 10px; + padding-right: 10px; + padding-bottom: 8px; + padding-top: 8px; + margin-top: 0; + margin-bottom: 4px; + margin-left: 4px; + margin-right: 4px; + border-radius: 8px; + box-shadow: none; + border-bottom: 2px solid transparent; +} +.MLK__toolbar > div > div:not(.disabled):not(.selected):hover { + background: var(--_toolbar-background-hover); +} +.MLK__toolbar > div > div.disabled svg, +.MLK__toolbar > div > div.disabled:hover svg, +.MLK__toolbar > div > div.disabled.is-pressed svg { + color: var(--_toolbar-text); + opacity: 0.2; +} +.MLK__toolbar > div > div:hover, +.MLK__toolbar > div > div:active, +.MLK__toolbar > div > div.is-pressed, +.MLK__toolbar > div > div.is-active { + color: var(--_toolbar-text-active); +} +.MLK__toolbar > div > div.selected { + color: var(--_toolbar-text-active); + background: var(--_toolbar-background-selected); + border-radius: 0; + border-bottom-color: var(--_toolbar-text-active); + padding-bottom: 4px; + margin-bottom: 8px; +} +/* This is the element that displays variants on press+hold */ +.MLK__variant-panel { + visibility: hidden; + position: fixed; + display: flex; + flex-flow: row wrap-reverse; + justify-content: center; + align-content: center; + margin: 0; + padding: 0; + bottom: auto; + top: 0; + box-sizing: content-box; + transform: none; + z-index: calc(var(--_keyboard-zindex) + 1); + touch-action: none; + max-width: 350px; + background: var(--_variant-panel-background); + text-align: center; + border-radius: 6px; + padding: 6px; + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + transition: none; +} +.MLK__variant-panel.is-visible { + visibility: visible; +} +.MLK__variant-panel.compact { + --_variant-keycap-length: var(--variant-keycap-length, 50px); + --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px); + --_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px); +} +.MLK__variant-panel .item { + display: flex; + flex-flow: column; + align-items: center; + justify-content: center; + font-size: var(--_variant-keycap-font-size); + height: var(--_variant-keycap-length); + width: var(--_variant-keycap-length); + margin: 0; + box-sizing: border-box; + border-radius: 5px; + border: 1px solid transparent; + background: transparent; + pointer-events: all; + cursor: pointer; + color: var(--_variant-keycap-text); + fill: currentColor; +} +@media (max-height: 412px) { + .MLK__variant-panel .item { + --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px); + --_variant-keycap-length: var(--variant-keycap-length, 50px); + } +} +.MLK__variant-panel .item .ML__mathlive { + pointer-events: none; +} +.MLK__variant-panel .item.is-active { + background: var(--_variant-keycap-background-active); + color: var(--_variant-keycap-text-active); +} +.MLK__variant-panel .item.is-pressed { + background: var(--_variant-keycap-background-pressed); + color: var(--_variant-keycap-text-pressed); +} +.MLK__variant-panel .item.small { + font-size: var(--_keycap-small-font-size); +} +.MLK__variant-panel .item.swatch-button { + box-sizing: border-box; + background: #fbfbfb; +} +.MLK__variant-panel .item.swatch-button > span { + display: inline-block; + margin: 6px; + width: calc(100% - 12px); + height: calc(100% - 12px); + border-radius: 50%; +} +.MLK__variant-panel .item.swatch-button:hover { + background: #f0f0f0; +} +.MLK__variant-panel .item.swatch-button:hover > span { + border-radius: 2px; +} +.MLK__variant-panel .item.box > div, +.MLK__variant-panel .item.box > span { + border: 1px dashed rgba(0, 0, 0, 0.24); +} +.MLK__variant-panel .item .warning { + min-height: 60px; + min-width: 60px; + background: #cd0030; + color: white; + padding: 5px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 5px; +} +.MLK__variant-panel .item .warning.is-pressed, +.MLK__variant-panel .item .warning.is-active { + background: red; +} +.MLK__variant-panel .item .warning svg.svg-glyph { + width: 50px; + height: 50px; +} +.MLK__variant-panel .item aside { + font-size: var(--_variant-keycap-aside-font-size); + line-height: 12px; + opacity: 0.78; + padding-top: 2px; +} +.MLK__keycap { + position: relative; +} +.MLK__shift { + display: block; + position: absolute; + right: 4px; + top: 4px; + font-size: var(--_keycap-shift-font-size); + color: var(--_keycap-shift-color); +} +.hide-shift .MLK__shift { + display: none; +} +@media (max-width: 414px) { + .MLK__variant-panel { + max-width: 350px; + --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px); + --_variant-keycap-length: var(--variant-keycap-length, 50px); + } +} +/* @xs breakpoint: iPhone 5 */ +@container (max-width: 414px) { + .MLK__rows { + --_keycap-gap: max(var(--_keycap-gap, 2px), 2px); + --_keycap-height: max(var(--_keycap-height), 42px); + --_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px); + } + .MLK__toolbar > div > div { + font-size: 100%; + margin-left: 2px; + margin-right: 2px; + } + .MLK__rows .shift, + .MLK__rows .action { + font-size: 65%; + } + .MLK__rows .warning svg.svg-glyph { + width: 14px; + height: 14px; + min-height: 14px; + } +} +@container (max-width: 744px) { + .MLK__rows { + --_keycap-gap: max(var(--keycap-gap, 2px), 2px); + --_keycap-height: max(var(--keycap-height, 52px), 52px); + --_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px); + } + .MLK__toolbar > div > div { + padding-left: 0; + padding-right: 0; + } + .MLK__tooltip::after { + padding: 8px 16px; + font-size: 16px; + } + .MLK__rows > .row > div.fnbutton { + font-size: 16px; + } + .MLK__rows > .row > div.bigfnbutton { + font-size: calc(var(--_keycap-extra-small-font-size) / 1.55); + } + .MLK__rows > .row > div.small { + font-size: 13px; + } + .MLK__rows > .row > div > aside { + display: none; + } + .MLK__shift { + display: none; + } +} +/* Medium breakpoint: larger phones */ +@container (max-width: 768px) { + .MLK__rows { + --_keycap-height: max(var(--keycap-height, 42px), 42px); + } + .MLK__rows > .row > div > small { + font-size: 14px; + } +} +@media (max-height: 768px) { + .MLK__rows { + --_keycap-height: max(var(--keycap-height, 42px), 42px); + } + .MLK__rows > .row > div > small { + font-size: 14px; + } +} +@container (max-width: 1444px) { + .MLK__rows .if-wide { + display: none; + } +} +@media (prefers-color-scheme: dark) { + .ML__keyboard { + --_accent-color: var(--keyboard-accent-color, #0b5c9c); + --_background: var(--keyboard-background, #151515); + --_border: var(--keyboard-border, transparent); + --_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8); + --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030); + --keyboard-toolbar-background-hover: #303030; + --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030); + --_keycap-background: var(--keycap-background, #1f2022); + --_keycap-background-hover: var(--keycap-background-hover, #2f3032); + --_keycap-border: var(--_keycap-border, transparent); + --_keycap-border-bottom: var(--_keycap-border-bottom, transparent); + --_keycap-text: var(--keycap-text, #e3e4e8); + --_keycap-secondary-background: var(--keycap-secondary-background, #3d4144); + --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154); + --_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee); + --keycap-secondary-border: transparent; + --keycap-secondary-border-bottom: transparent; + --_keycap-secondary-border: var(--keycap-secondary-border, transparent); + --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent); + --_variant-panel-background: var(--variant-panel-background, #303030); + --_variant-keycap-text-active: var(--variant-keycap-text-active, #fff); + } +} +/* Same as the media query, but with a class */ +[theme='dark'] .ML__keyboard { + --_accent-color: var(--keyboard-accent-color, #0b5c9c); + --_background: var(--keyboard-background, #151515); + --_border: var(--keyboard-border, transparent); + --_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8); + --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030); + --keyboard-toolbar-background-hover: #303030; + --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030); + --_keycap-background: var(--keycap-background, #1f2022); + --_keycap-background-hover: var(--keycap-background-hover, #2f3032); + --_keycap-border: var(--_keycap-border, transparent); + --_keycap-border-bottom: var(--_keycap-border-bottom, transparent); + --_keycap-text: var(--keycap-text, #e3e4e8); + --_keycap-secondary-background: var(--keycap-secondary-background, #3d4144); + --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154); + --_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee); + --keycap-secondary-border: transparent; + --keycap-secondary-border-bottom: transparent; + --_keycap-secondary-border: var(--keycap-secondary-border, transparent); + --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent); + --_variant-panel-background: var(--variant-panel-background, #303030); + --_variant-keycap-text-active: var(--variant-keycap-text-active, #fff); +} +[theme='light'] .ML__keyboard { + --_accent-color: var(--keyboard-accent-color, #0c75d8); + --_background: var(--keyboard-background, #cacfd7); + --_border: var(--keyboard-border, #ddd); + --_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f); + --_toolbar-background: var(--keyboard-toolbar-background, transparent); + --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee); + --_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent); + --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff); + --_keycap-background: var(--keycap-background, white); + --_keycap-background-hover: var(--keycap-background-hover, #f5f5f7); + --_keycap-background-active: var(--keycap-background-active, var(--_accent-color)); + --_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color)); + --_keycap-border: var(--_keycap-border, #e5e6e9); + --_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92); + --_keycap-text: var(--keycap-text, #000); + --_keycap-text-active: var(--keycap-text-active, #fff); + --_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text)); + --_keycap-text-pressed: var(--keycap-text-pressed, #fff); + --_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color)); + --_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8); + --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795); + --_keycap-secondary-text: var(--keycap-secondary-text, #060707); + --_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0); + --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6); + --_variant-panel-background: var(--variant-panel-background, #fff); + --_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text)); + --_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active)); + --_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color)); +} +`;var C0=`:host { + --primary-color: #5898ff; + --primary-color-dimmed: #c0c0f0; + --primary-color-dark: var(--blue-500); + --primary-color-light: var(--blue-100); + --primary-color-reverse: #ffffff; + --secondary-color: #ff8a65; + --secondary-color-dimmed: #f0d5c5; + --secondary-color-dark: var(--orange-500); + --secondary-color-light: var(--orange-100); + --secondary-color-reverse: #ffffff; + --link-color: #5898ff; + --link-color-dimmed: #c5c5c5; + --link-color-dark: #121212; + --link-color-light: #e2e2e2; + --link-color-reverse: #ffffff; + --semantic-blue: var(--blue-700); + --semantic-red: var(--red-400); + --semantic-orange: var(--orange-400); + --semantic-green: var(--green-700); + --neutral-100: #f5f5f5; + --neutral-200: #eeeeee; + --neutral-300: #e0e0e0; + --neutral-400: #bdbdbd; + --neutral-500: #9e9e9e; + --neutral-600: #757575; + --neutral-700: #616161; + --neutral-800: #424242; + --neutral-900: #212121; + --red-25: #fff5f5; + --red-50: #ffefee; + --red-100: #ffd6d5; + --red-200: #ffb3b4; + --red-300: #ff8f91; + --red-400: #ff6f71; + --red-500: #ff4f52; + --red-600: #f93f42; + --red-700: #e33539; + --red-800: #c92c30; + --red-900: #a71f23; + --orange-25: #fff7f2; + --orange-50: #fff8f2; + --orange-100: #ffebd9; + --orange-200: #ffdcb8; + --orange-300: #ffc694; + --orange-400: #ffa96d; + --orange-500: #ff8f3f; + --orange-600: #f57e33; + --orange-700: #d86e2a; + --orange-800: #b95e22; + --orange-900: #8f4217; + --brown-25: #fffaf5; + --brown-50: #f7f2e8; + --brown-100: #e7d8c9; + --brown-200: #d1b7a5; + --brown-300: #b78a76; + --brown-400: #9e604c; + --brown-500: #844027; + --brown-600: #733721; + --brown-700: #622c1d; + --brown-800: #4f2218; + --brown-900: #3f1913; + --yellow-25: #fffdf5; + --yellow-50: #fff9e7; + --yellow-100: #fff2c4; + --yellow-200: #ffe59e; + --yellow-300: #ffd875; + --yellow-400: #ffc53d; + --yellow-500: #ffb900; + --yellow-600: #e6a100; + --yellow-700: #bf8f00; + --yellow-800: #997d00; + --yellow-900: #7d6700; + --lime-25: #f9f9e8; + --lime-50: #f5f9e8; + --lime-100: #eaf2c6; + --lime-200: #d9e6a1; + --lime-300: #c5d377; + --lime-400: #b1c24c; + --lime-500: #92b215; + --lime-600: #7ea612; + --lime-700: #6d8f0f; + --lime-800: #5c6d0b; + --lime-900: #3f4a05; + --green-25: #f2f9e8; + --green-50: #e4f7e7; + --green-100: #bceac4; + --green-200: #90dd9d; + --green-300: #64cf75; + --green-400: #42c458; + --green-500: #21ba3a; + --green-600: #1da736; + --green-700: #199533; + --green-800: #137c2e; + --green-900: #0b5726; + --teal-25: #e8f9f9; + --teal-50: #e3f9f9; + --teal-100: #b9f1f1; + --teal-200: #8be7e7; + --teal-300: #5ddddd; + --teal-400: #3ad6d6; + --teal-500: #17cfcf; + --teal-600: #14b7b7; + --teal-700: #129f9f; + --teal-800: #0e7f7f; + --teal-900: #094e4e; + --cyan-25: #e8f9fd; + --cyan-50: #e3f4fd; + --cyan-100: #b8e5f9; + --cyan-200: #89d3f6; + --cyan-300: #5ac1f2; + --cyan-400: #36b4ef; + --cyan-500: #13a7ec; + --cyan-600: #1197d3; + --cyan-700: #1088ba; + --cyan-800: #0e7398; + --cyan-900: #0a5366; + --blue-25: #e8f5fd; + --blue-50: #e2f0fd; + --blue-100: #b6d9fb; + --blue-200: #86c0f9; + --blue-300: #56a6f6; + --blue-400: #3193f4; + --blue-500: #0d80f2; + --blue-600: #0c75d8; + --blue-700: #0c6abe; + --blue-800: #0b5c9c; + --blue-900: #094668; + --indigo-25: #f0e8fd; + --indigo-50: #ede7f9; + --indigo-100: #d1c2f0; + --indigo-200: #b399e6; + --indigo-300: #9470db; + --indigo-400: #7d52d4; + --indigo-500: #6300ff; + --indigo-600: #5b2fb6; + --indigo-700: #502b9f; + --indigo-800: #422581; + --indigo-900: #2c1d54; + --purple-25: #f9e8fd; + --purple-50: #f4e3fc; + --purple-100: #e3baf8; + --purple-200: #d18cf3; + --purple-300: #be5eee; + --purple-400: #b03cea; + --purple-500: #a219e6; + --purple-600: #9118cd; + --purple-700: #8116b3; + --purple-800: #6b1492; + --purple-900: #49115f; + --magenta-25: #fde8fd; + --magenta-50: #fde9f3; + --magenta-100: #f9c8e0; + --magenta-200: #f5a3cc; + --magenta-300: #f17eb8; + --magenta-400: #ee63a8; + --magenta-500: #eb4799; + --magenta-600: #d83f88; + --magenta-700: #c53777; + --magenta-800: #ac2d60; + --magenta-900: #861d3d; +} +@media (prefers-color-scheme: dark) { + :host { + --semantic-blue: var(--blue-700); + --semantic-red: var(--red-400); + --semantic-orange: var(--orange-400); + --semantic-green: var(--green-700); + --semantic-bg-blue: var(--blue-25); + --semantic-bg-red: var(--red-25); + --semantic-bg-orange: var(--orange-25); + --semantic-bg-green: var(--green-25); + --neutral-100: #121212; + --neutral-200: #424242; + --neutral-300: #616161; + --neutral-400: #757575; + --neutral-500: #9e9e9e; + --neutral-600: #bdbdbd; + --neutral-700: #e0e0e0; + --neutral-800: #eeeeee; + --neutral-900: #f5f5f5; + } +} +/* @media (prefers-color-scheme: dark) { + :host { + --label-color: #fff; + --active-label-color: #000; + --menu-bg: #525252; + --active-bg: #5898ff; + --active-bg-dimmed: #5c5c5c; + } +} */ +:host { + --ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, + 'Segoe UI', Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono', + 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace; + --ui-layer-1: var(--neutral-100); + --ui-layer-2: var(--neutral-200); + --ui-layer-3: var(--neutral-300); + --ui-layer-4: var(--neutral-400); + --ui-layer-5: var(--neutral-500); + --ui-layer-6: var(--neutral-600); + --ui-border-color: var(--primary-color); + --ui-border-radius: 4px; + --ui-text: var(--neutral-900); + --ui-text-secondary: var(--neutral-700); + --ui-text-placeholder: var(--neutral-500); + --ui-text-muted: var(--neutral-300); + /** A field is a UI element in which a user can type data, for + * example an input or textarea element. + */ + --ui-field-bg: var(--neutral-100); + --ui-field-bg-hover: var(--neutral-100); + --ui-field-bg-disabled: var(--neutral-300); + --ui-field-bg-invalid: var(--red-100); + --ui-field-bg-focus: var(--neutral-100); + --ui-field-border: 0.5px solid var(--border-color); + --ui-field-border-hover: 0.5px solid var(--border-color); + --ui-field-border-disabled: 0.5px solid var(--border-color); + --ui-field-border-invalid: 0.5px solid var(--border-color); + --ui-field-border-focus: 0.5px solid var(--border-color); + --ui-menu-bg: var(--neutral-100); + --ui-menu-text: var(--neutral-900); + --ui-menu-bg-hover: var(--neutral-200); + --ui-menu-text-hover: var(--neutral-900); + /** The \`active\` state is used for the state of menu items + * when they are selected. + */ + --ui-menu-bg-active: var(--primary-color); + --ui-menu-text-active: var(--primary-color-reverse); + /** The \`active-muted\` set is used for the state of + * submenus when they are open. + */ + --ui-menu-bg-active-muted: var(--neutral-300); + --ui-menu-text-active-muted: var(--neutral-900); + /* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302), +0 2px 6px 2px rgba(60, 64, 67, 0.149); */ + --ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, .2); + --ui-menu-divider: 0.5px solid #c7c7c7; + /* var(--neutral-300); */ + --ui-menu-z-index: 10000; + --page-bg: var(--neutral-100); + --content-bg: var(--neutral-200); +} +@media (prefers-color-scheme: dark) { + :host { + --ui-menu-bg: var(--neutral-200); + } +} +/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font. + Noto is a Linux/Android font. +*/ +:lang(zh-cn), +:lang(zh-sg), +:lang(zh-my), +:lang(zh) { + --ui-font-family: -apple-system, system-ui, + "PingFang SC", "Hiragino Sans GB", + "Noto Sans CJK SC", "Noto Sans SC", "Noto Sans", + "Microsoft Yahei UI", "Microsoft YaHei New", "Microsoft Yahei", + "\u5FAE\u8F6F\u96C5\u9ED1", SimSun, "\u5B8B\u4F53", STXihei, "\u534E\u6587\u7EC6\u9ED1", sans-serif; + font-size: 24px; + line-height: 1.7; +} +:lang(zh-tw), +:lang(zh-hk), +:lang(zh-mo) { + --ui-font-family: -apple-system, system-ui, + "Noto Sans", + "Microsoft JhengHei UI", "Microsoft JhengHei", + "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4", "\u65B0\u7D30\u660E\u9AD4", "PMingLiU", "\u7D30\u660E\u9AD4", "MingLiU", sans-serif; + font-size: 24px; + line-height: 1.7; +} +:lang(ja), +:lang(ja-jp), +:lang(ja-jp-mac) { + --ui-font-family: -apple-system, system-ui, + "Hiragino Sans", "Hiragino Kaku Gothic ProN", + "Noto Sans CJK JP", "Noto Sans JP", "Noto Sans", + "\u6E38\u30B4\u30B7\u30C3\u30AF", "\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53", YuGothic, "Yu Gothic", "\u30E1\u30A4\u30EA\u30AA", Meiryo, + "\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF", "MS PGothic", sans-serif; + font-size: 24px; + line-height: 1.7; +} +:lang(ko), +:lang(ko-kr), +:lang(ko-kr-std) { + --ui-font-family: -apple-system, system-ui, + "Noto Sans CJK KR", "Noto Sans KR", "Noto Sans", + "Malgun Gothic", "\uB9D1\uC740 \uACE0\uB515", "Apple SD Gothic Neo", + "\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo", "Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo", + "\uB3CB\uC6C0", Dotum, sans-serif; + font-size: 24px; + line-height: 1.7; +} +:lang(ko-kr-apple) { + --ui-font-family: -apple-system, system-ui, + "Noto Sans CJK KR", "Noto Sans KR", "Noto Sans", + "Apple SD Gothic Neo", "\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo", "Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo", + "\uB3CB\uC6C0", Dotum, sans-serif; + font-size: 24px; + line-height: 1.7; +} +`;var E0=`.ui-menu *, +.ui-menu ::before, +.ui-menu ::after { + box-sizing: border-box; +} +.ui-menu { + display: none; + color-scheme: light dark; + -webkit-user-select: none; + /* Important: Safari iOS doesn't respect user-select */ + user-select: none; + cursor: default; + -webkit-touch-callout: none; + -webkit-tap-highlight-color: rgba(0 0 0 0); + --active-label-color: #fff; + /* ui-menu-text-active */ + --label-color: #121212; + /* ui-menu-text */ + --menu-bg: #e2e2e2; + /* ui-menu-background */ + --active-bg: #5898ff; + /* ui-menu-background-active */ + --active-bg-dimmed: #c5c5c5; + /* ui-menu-background-active-muted */ +} +/** Use the :where pseudo selector to make the specificity of the + * selector 0, so that it can be overridden by the user. + */ +:where(.ui-menu-container) { + position: absolute; + width: auto; + height: auto; + z-index: 10000; + border-radius: 8px; + background: var(--ui-menu-bg); + box-shadow: var(--ui-menu-shadow); + list-style: none; + padding: 6px 0 6px 0; + margin: 0; + user-select: none; + cursor: default; + color: var(--ui-menu-text); + font-weight: normal; + font-style: normal; + text-shadow: none; + text-transform: none; + letter-spacing: 0; + outline: none; + opacity: 1; +} +:where(.ui-menu-container > li) { + display: flex; + flex-flow: row; + align-items: center; + padding: 1px 7px 1px 7px; + margin-top: 0; + margin-left: 6px; + margin-right: 6px; + border-radius: 4px; + white-space: nowrap; + position: relative; + outline: none; + fill: currentColor; + user-select: none; + cursor: default; + text-align: left; + color: inherit; + font-family: var(--ui-font-family); + font-size: 13px; + line-height: 16px; + letter-spacing: 0.007em; +} +:where(.ui-menu-container > li > .label) { + appearance: none; + background: none; + outline: none; + width: 100%; + margin: 0; + padding: 1px 2px 1px 1px; + overflow: visible; + border: 1px solid transparent; + white-space: nowrap; +} +:where(.ui-menu-container > li > .label.indent) { + margin-left: 12px; +} +:where(.ui-menu-container > li[role='divider']) { + border-bottom: 1px solid var(--ui-menu-divider); + border-radius: 0; + padding: 0; + margin-left: 15px; + margin-right: 15px; + padding-top: 5px; + margin-bottom: 5px; + width: calc(100% - 30px); + /** 100% - (margin-left + margin-right) */ +} +:where(.ui-menu-container > li[aria-disabled='true']) { + opacity: 0.5; +} +:where(.ui-menu-container > li.active) { + background: var(--ui-menu-bg-active); + background: -apple-system-control-accent; + color: var(--ui-menu-text-active); +} +:where(.ui-menu-container > li.active.is-submenu-open) { + background: var(--ui-menu-bg-active-muted); + color: inherit; +} +:where(.ui-menu-container > li[aria-haspopup='true'] > .label) { + padding-right: 0; +} +:where(.ui-menu-container > li[aria-haspopup='true'].active::after) { + color: white; +} +/** Keyboard shortcut */ +.ui-menu-container > li > kbd { + font-family: var(--ui-font-family); + opacity: 0.4; +} +.ui-right-chevron { + margin-left: 24px; + width: 10px; + height: 10px; + margin-bottom: 4px; +} +.ui-checkmark { + margin-right: -11px; + margin-left: -4px; + margin-top: 2px; + width: 16px; + height: 16px; +} +`;var mr;function pr(t){let e="";switch(t){case"mathfield-element":e=` + :host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;} + :host([hidden]) { display: none; } + :host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; } + :host(:focus), :host(:focus-within) { + outline: Highlight auto 1px; /* For Firefox */ + outline: -webkit-focus-ring-color auto 1px; + } + :host([readonly]:focus), :host([readonly]:focus-within), + :host([read-only]:focus), :host([read-only]:focus-within) { + outline: none; + } + @media (hover: none) and (pointer: coarse) { + :host(:not(:focus)) :first-child { pointer-events: none !important; } + }`;break;case"core":e=M0;break;case"mathfield":e=k0;break;case"environment-popover":e=_0;break;case"suggestion-popover":e=S0;break;case"keystroke-caption":e=A0;break;case"virtual-keyboard":e=L0;break;case"ui":e=C0;break;case"menu":e=E0;break;default:}return e}function zr(t){return mr||(mr={}),mr[t]||(mr[t]=new CSSStyleSheet,mr[t].replaceSync(pr(t))),mr[t]}var kt;function Oe(t){var e;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${t}`))return;let r=window.document.createElement("style");r.id=`mathlive-style-${t}`,r.append(window.document.createTextNode(pr(t))),window.document.head.appendChild(r);return}if(kt||(kt={}),((e=kt[t])!=null?e:0)!==0)kt[t]+=1;else{let r=zr(t);document.adoptedStyleSheets=[...document.adoptedStyleSheets,r],kt[t]=1}}function We(t){if("adoptedStyleSheets"in document&&kt!=null&&kt[t]&&(kt[t]-=1,kt[t]<=0)){let e=mr[t];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==e)}}var hr=class t extends y{constructor(r){var i;super(g(p({},r),{type:"accent",body:(i=r.body)!=null?i:void 0}));r.accentChar?this.accent=r.accentChar:this.svgAccent=r==null?void 0:r.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(r){return new t(r)}toJson(){return g(p({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(r){var c;let i=new T({parent:r,mathstyle:"cramp"},this.style),n=(c=y.createBox(i,this.body))!=null?c:new w("\u25A2",{style:this.style}),o=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(o=n.skew);let a=Math.min(n.height,qe),s;if(this.svgAccent)s=_i(this.svgAccent),a=i.metrics.bigOpSpacing1-a;else if(this.accent){let u=new w(this.accent,{fontFamily:"Main-Regular"});u.italic=0;let d=this.accent===8407?" ML__accent-vec":"";s=new w(new w(u),{classes:"ML__accent-body"+d})}s=new H({shift:0,children:[{box:new w(n)},-a,{box:s,marginLeft:n.left+2*o,classes:["ML__center"]}]});let l=new w(s,{type:"lift"});return this.caret&&(l.caret=this.caret),this.bind(i,l.wrap(i)),this.attachSupsub(i,{base:l})}};var Ci={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},Ei=Object.fromEntries(Object.entries(Ci).map(([t,e])=>[e,t]));function da(t){var e;return(e={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[t])!=null?e:t.codePointAt(0)}function mh(t,e,r,i){var a;let o=new w(da(t),{fontFamily:"Main-Regular",isSelected:i.isSelected,classes:"ML__small-delim "+((a=i.classes)!=null?a:"")}).wrap(e);return r&&o.setTop((1-e.scalingFactor)*Ce),o}function T0(t,e,r,i,n){var s,l;let o=new T({parent:i,mathstyle:"textstyle"},n==null?void 0:n.style),a=new w(da(t),{fontFamily:`Size${e}-Regular`,isSelected:n.isSelected,classes:((s=n.classes)!=null?s:"")+` ML__delim-size${e}`,type:(l=n.type)!=null?l:"ignore"}).wrap(o);return r&&a.setTop((1-o.scalingFactor)*Ce),a}function D0(t,e,r,i,n){var qt;let o,a,s,l;o=s=l=da(t),a=null;let c="Size1-Regular";t==="\\vert"||t==="\\lvert"||t==="\\rvert"||t==="\\mvert"||t==="\\mid"?s=o=l=8739:t==="\\Vert"||t==="\\lVert"||t==="\\rVert"||t==="\\mVert"||t==="\\|"?s=o=l=8741:t==="\\uparrow"?s=l=9168:t==="\\Uparrow"?s=l=8214:t==="\\downarrow"?o=s=9168:t==="\\Downarrow"?o=s=8214:t==="\\updownarrow"?(o=8593,s=9168,l=8595):t==="\\Updownarrow"?(o=8657,s=8214,l=8659):t==="["||t==="\\lbrack"?(o=9121,s=9122,l=9123,c="Size4-Regular"):t==="]"||t==="\\rbrack"?(o=9124,s=9125,l=9126,c="Size4-Regular"):t==="\\lfloor"||t==="\u230A"?(s=o=9122,l=9123,c="Size4-Regular"):t==="\\lceil"||t==="\u2308"?(o=9121,s=l=9122,c="Size4-Regular"):t==="\\rfloor"||t==="\u230B"?(s=o=9125,l=9126,c="Size4-Regular"):t==="\\rceil"||t==="\u2309"?(o=9124,s=l=9125,c="Size4-Regular"):t==="("||t==="\\lparen"?(o=9115,s=9116,l=9117,c="Size4-Regular"):t===")"||t==="\\rparen"?(o=9118,s=9119,l=9120,c="Size4-Regular"):t==="\\{"||t==="\\lbrace"?(o=9127,a=9128,l=9129,s=9130,c="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o=9131,a=9132,l=9133,s=9130,c="Size4-Regular"):t==="\\lgroup"||t==="\u27EE"?(o=9127,l=9129,s=9130,c="Size4-Regular"):t==="\\rgroup"||t==="\u27EF"?(o=9131,l=9133,s=9130,c="Size4-Regular"):t==="\\lmoustache"||t==="\u23B0"?(o=9127,l=9133,s=9130,c="Size4-Regular"):t==="\\rmoustache"||t==="\u23B1"?(o=9131,l=9129,s=9130,c="Size4-Regular"):t==="\\surd"?(o=57345,l=9143,s=57344,c="Size4-Regular"):t==="\\ulcorner"?(o=9484,s=l=32):t==="\\urcorner"?(o=9488,s=l=32):t==="\\llcorner"?(l=9492,s=o=32):t==="\\lrcorner"&&(o=9496,s=o=32);let u=ir(o,c),d=u.height+u.depth,m=ir(s,c),h=m.height+m.depth,f=ir(l,c),x=f.height+f.depth,M=0,b=1;if(a!==null){let ge=ir(a,c);M=ge.height+ge.depth,b=2}let k=d+x+M,_=Math.max(0,Math.ceil((e-k)/(b*h))),A=k+_*b*h,E=Ce;r&&(E=E*i.scalingFactor);let D=A/2-E,K=.008,P=[];P.push({box:new w(l,{fontFamily:c})}),P.push(-K);let se=new w(s,{fontFamily:c});if(a===null)for(let ge=0;ge<_;ge++)P.push({box:se});else{for(let ge=0;ge<_;ge++)P.push({box:se});P.push(-K),P.push({box:new w(a,{fontFamily:c})}),P.push(-K);for(let ge=0;ge<_;ge++)P.push({box:se})}P.push(-K),P.push({box:new w(o,{fontFamily:c})});let _e="";c==="Size1-Regular"?_e=" delim-size1":c==="Size4-Regular"&&(_e=" delim-size4");let ut=new H({bottom:D,children:P},{classes:_e});return new w(ut,g(p({},n!=null?n:{}),{classes:((qt=n==null?void 0:n.classes)!=null?qt:"")+" ML__delim-mult"}))}var K0=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),ph=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),B0=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),hh=[0,1.2,1.8,2.4,3];function P0(t,e,r,i){return t===void 0||t==="."?Pt(r,i.classes):(t==="<"||t==="\\lt"||t==="\u27E8"?t="\\langle":(t===">"||t==="\\gt"||t==="\u27E9")&&(t="\\rangle"),K0.has(t)||B0.has(t)?T0(t,e,!1,r,i):ph.has(t)?D0(t,hh[e],!1,r,i):(""+t,null))}var fh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],gh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],yh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function bh(t){return t.type==="small"?"Main-Regular":t.type==="large"?"Size"+t.size+"-Regular":(t.type,"Size4-Regular")}function xh(t,e,r,i){let n={"-4":0,"-3":1,0:2}[i.mathstyle.sizeDelta];for(let o=n;oe)return r[o]}return r[r.length-1]}function Ti(t,e,r,i,n,o){if(!e||e.length===0||e===".")return Pt(n);e==="<"||e==="\\lt"?e="\\langle":(e===">"||e==="\\gt")&&(e="\\rangle");let a;B0.has(e)?a=fh:K0.has(e)?a=yh:a=gh;let s=xh(da(e),r,a,n),l=new T({parent:n,mathstyle:s.mathstyle},o==null?void 0:o.style);return s.type==="small"?mh(e,l,i,g(p({},o),{type:t})):s.type==="large"?T0(e,s.size,i,l,g(p({},o),{type:t})):(s.type,D0(e,r,i,l,g(p({},o),{type:t})))}function Ir(t,e,r,i,n,o){if(e===".")return Pt(n,o==null?void 0:o.classes);let a=Ce*n.scalingFactor,s=901,l=5/xt,c=Math.max(r-a,i+a),u=Math.max(c/500*s,2*c-l);return Ti(t,e,u,!0,n,o)}function Pt(t,e){let r=new w(null,{classes:" nulldelimiter "+(e!=null?e:""),type:"ignore"});return r.width=t.getRegisterAsEm("nulldelimiterspace"),r.wrap(new T({parent:t,mathstyle:"textstyle"}))}var xe=class t extends y{constructor(e){var r;super({type:"placeholder",command:"\\placeholder",mode:(r=e==null?void 0:e.mode)!=null?r:"math",style:e==null?void 0:e.style}),this.captureSelection=!0}static fromJson(e){return new t(e)}toJson(){return super.toJson()}render(e){let r;return this.value=e.placeholderSymbol,typeof e.renderPlaceholder=="function"?r=e.renderPlaceholder(e):r=this.createBox(e),this.caret&&(r.classes+=" ML__placeholder-selected"),r}_serialize(){return"\\placeholder{}"}};var O0=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],z0=["cases","dcases","rcases"],I0=["align","align*","aligned","gather","gathered","split"],vh=["array","subequations","eqnarray"];function R0(t){return vh.concat(I0).concat(z0).concat(O0).includes(t)}function ma(t){return O0.includes(t)}function N0(t){return z0.includes(t)}function F0(t){return I0.includes(t)}function wh(t,e,r){let i=0;for(let c of r)"align"in c&&(i+=1);let n=0,o=[];for(let c of e){let u=0;for(n=Math.max(n,Math.min(c.length,i));uf.type==="first"),d.push(h)),u+=1}o.push(d)}}o.length>0&&o[o.length-1].length===1&&o[o.length-1][0].length===1&&o[o.length-1][0][0].type==="first"&&o.pop();let a=[];for(let c of o){if(c.length!==n)for(let u=c.length;ui.map(n=>n.map(o=>o.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(r.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(r.arraycolsep=this.arraycolsep),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}branch(r){var i;if(Cn(r))return(i=this.array[r[0]][r[1]])!=null?i:void 0}createBranch(r){var i;return Cn(r)?(this.isDirty=!0,(i=this.branch(r))!=null?i:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(r=>!!r.align).length}removeBranch(r){if(cr(r))return super.removeBranch(r);let i=this.branch(r);return this.array[r[0]][r[1]]=void 0,i.forEach(n=>{n.parent=void 0,n.parentBranch=void 0}),i[0].type,i.shift(),this.isDirty=!0,i}get hasChildren(){return this.children.length>0}get children(){let r=[];for(let i of this.array)for(let n of i)if(n)for(let o of n)r.push(...o.children),r.push(o);return[...r,...super.children]}render(r){var $t,qt,ge,rn,nn,on;let i=new T({parent:r,mathstyle:this.mathstyleName},this.style),n=i.getRegisterAsEm("arrayrulewidth"),o=i.getRegisterAsEm("arraycolsep"),a=i.getRegisterAsEm("doublerulesep"),s=(qt=($t=this.arraystretch)!=null?$t:i.getRegisterAsNumber("arraystretch"))!=null?qt:1,l=typeof this.arraycolsep=="number"?this.arraycolsep:o;this.colSeparationType==="small"&&(l=.2778*(new T({parent:r,mathstyle:"scriptstyle"}).scalingFactor/r.scalingFactor));let c=s*s0,u=.7*c,d=.3*c,m=0,h=[],f=0,x=this.array.length;for(let ie=0;ie0&&(Ae+=d,Re=Math.max(Re,Ae),Ae=0),ie0&&b.push(new H({individualShift:me}))}let k=[],_=!1,A=!1,E=0,D=!this.leftDelim,{colFormat:K}=this;for(let ie of K){if("align"in ie&&E>=b.length)break;if("align"in ie)_?k.push(ha(2*l)):(A||D)&&k.push(ha(l)),k.push(new w(b[E],{classes:"col-align-"+ie.align})),E++,_=!0,A=!1,D=!1;else if("gap"in ie){if(typeof ie.gap=="number")k.push(ha(ie.gap));else{let me=kh(r,h,M,ie.gap);me&&k.push(me)}_=!1,A=!1,D=!1}else if("separator"in ie){let me=new w(null,{classes:"vertical-separator"});me.height=m,me.setStyle("height",m,"em"),me.setStyle("border-right",`${n}em ${ie.separator} currentColor`),me.setStyle("vertical-align",-(m-M),"em");let Se=0;A?Se=a-n:_&&(Se=l-n),me.left=Se,k.push(me),_=!1,A=!0,D=!1}}_&&!this.rightDelim&&k.push(ha(l));let P=new w(k,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(P.caret=this.caret),this.bind(r,P);let se=P.height,_e=P.depth,ut=this.bind(r,new w([this.bind(r,Ir("open",(nn=this.leftDelim)!=null?nn:".",se,_e,i,{isSelected:this.isSelected})),P,this.bind(r,Ir("close",(on=this.rightDelim)!=null?on:".",se,_e,i,{isSelected:this.isSelected}))],{type:"ord"}));return ut?(this.caret&&(ut.caret=this.caret),this.bind(r,this.attachSupsub(r,{base:ut}))):null}_serialize(r){var n;let i=[`\\begin{${this.environmentName}}`];if(this.environmentName==="array"){if(i.push("{"),this.colFormat!==void 0)for(let o of this.colFormat)"align"in o&&typeof o.align=="string"?i.push(o.align):"separator"in o&&o.separator==="solid"?i.push("|"):"separator"in o&&o.separator==="dashed"&&i.push(":");i.push("}")}for(let o=0;o0&&i.push(" & "),i.push(y.serialize(this.array[o][a],r));if(or;let i=this.array.splice(r,1);for(let n of i)for(let o of n)if(o)for(let a of o)a.parent=void 0,a.parentBranch=void 0;for(let n=r;nr;for(let i of this.array){let n=i.splice(r,1);for(let o of n)if(o)for(let a of o)a.parent=void 0,a.parentBranch=void 0}for(let i=0;io.type!=="first"));return r}};function pa(t){let e=new y({type:"first",mode:t.mode});e.parent=t;let r=new xe;return r.parent=t,[e,r]}function ha(t){let e=new w(null,{classes:"arraycolsep"});return e.width=t,e}function kh(t,e,r,i){if(!i)return null;let n=[];for(let o of e){let a=y.createBox(t,i,{type:"ignore"});a&&(a.depth=o.depth,a.height=o.height,n.push({box:a,shift:o.pos-r}))}return new H({individualShift:n}).wrap(t)}var Ue=class t extends y{constructor(r){super({mode:r.mode,command:r.command,style:r.style,body:r.body,type:"box"});this.framecolor=r.framecolor,this.backgroundcolor=r.backgroundcolor,this.padding=r.padding,this.offset=r.offset,this.border=r.border}static fromJson(r){return new t(r)}toJson(){return g(p({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(r){var c,u,d,m;let i=y.createBox(r,this.body,{type:"lift"});if(!i)return null;let n=r.toEm((c=this.offset)!=null?c:{dimension:0});i.depth+=n,i.setStyle("display","inline-block"),i.setStyle("position","relative"),i.setStyle("height",Math.floor(100*i.height+i.depth)/100,"em"),i.setStyle("vertical-align",-Math.floor(100*i.height)/100,"em");let o=new T({parent:r},this.style),a=o.toEm((u=this.padding)!=null?u:{register:"fboxsep"}),s=new w(null,{classes:"ML__box"});s.height=i.height+a,s.depth=i.depth+a,s.setStyle("box-sizing","border-box"),s.setStyle("position","absolute"),s.setStyle("top",-a+.3,"em"),s.setStyle("left",0),s.setStyle("height",s.height+s.depth,"em"),s.setStyle("width","100%"),this.backgroundcolor&&s.setStyle("background-color",(d=o.toColor(this.backgroundcolor))!=null?d:"transparent"),this.framecolor&&s.setStyle("border",`${o.getRegisterAsEm("fboxrule",2)}em solid ${(m=o.toColor(this.framecolor))!=null?m:"black"}`),this.border&&s.setStyle("border",this.border);let l=new w([s,i],{type:"lift"});return l.setStyle("display","inline-block"),l.setStyle("position","relative"),l.setStyle("line-height",0),l.height=i.height+a+(n>0?n:0),l.depth=i.depth+a+(n<0?-n:0),l.setStyle("padding-left",a,"em"),l.setStyle("padding-right",a,"em"),l.setStyle("height",Math.floor(100*(i.height+i.depth+2*a+Math.abs(n)))/100,"em"),l.setStyle("margin-top",-a,"em"),l.setStyle("top",Math.floor(100*(i.depth-i.height+2*a-n))/100,"em"),l.setStyle("vertical-align",Math.floor(100*(i.depth+2*a))/100,"em"),this.caret&&(l.caret=this.caret),this.attachSupsub(r,{base:l})}_serialize(r){return r.skipStyles?B([this.bodyToLatex(r),this.supsubToLatex(r)]):super._serialize(r)}};var Di=class t extends y{constructor(e,r){var i;super({type:"composition",mode:(i=r==null?void 0:r.mode)!=null?i:"math",value:e})}static fromJson(e){return new t(e.value,e)}toJson(){return super.toJson()}get computedStyle(){return{}}render(e){let r=new w(this.value,{classes:"ML__composition",type:"composition"});return this.bind(e,r),this.caret&&(r.caret=this.caret),r}_serialize(e){return""}};var rt=class t extends y{constructor(e){super({type:"error",value:e,command:e,mode:"math"}),this.verbatimLatex=e}static fromJson(e){return new t(e.command)}toJson(){return super.toJson()}render(e){let r=this.createBox(e,{classes:"ML__error"});return this.caret&&(r.caret=this.caret),r}};var Ki=class t extends y{constructor(r,i,n){super({type:"group",mode:i,style:n});this.body=r,this.boxType=r.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,r&&r.length===1&&r[0].command===","&&(this.captureSelection=!0)}static fromJson(r){return new t(r.body,r.mode,r.style)}render(r){let i=y.createBox(r,this.body,{type:this.boxType});return i?(this.caret&&(i.caret=this.caret),this.bind(r,i)):null}_serialize(r){if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,r):`{${this.bodyToLatex(r)}}`}};var q=class t extends y{constructor(r,i,n){super({type:"leftright",style:n.style,displayContainsHighlight:!0});this.variant=r,this.body=i,this.leftDelim=n.leftDelim,this.rightDelim=n.rightDelim}static fromJson(r){var i;return new t((i=r.variant)!=null?i:"",r.body,r)}toJson(){let r=super.toJson();return this.variant&&(r.variant=this.variant),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}_serialize(r){var n,o;let i=this.matchingRightDelim();return this.variant==="left...right"?B(["\\left",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(r),"\\right",i]):this.variant==="mleft...mright"?B(["\\mleft",(o=this.leftDelim)!=null?o:".",this.bodyToLatex(r),"\\mright",i]):B([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(r),i])}matchingRightDelim(){var i,n;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;let r=(i=this.leftDelim)!=null?i:".";return(n=Ci[r])!=null?n:r}render(r){var d,m,h;let i=new T({parent:r},this.style);this.body;let n=new T({parent:r,mathstyle:"textstyle"},this.style),o=(d=y.createBox(i,this.body,{type:"inner"}))!=null?d:new w(null,{type:"inner"}),a=o.height/n.scalingFactor,s=o.depth/n.scalingFactor,l=[];if(this.leftDelim&&l.push(this.bind(n,Ir("open",this.leftDelim,a,s,n,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),o&&(V0(o.children,this,i,a,s),l.push(o)),this.rightDelim){let f=this.containsCaret?" ML__contains-caret":"",x=this.rightDelim;x==="?"&&(i.smartFence?(x=this.matchingRightDelim(),f+=" ML__smart-fence__close"):x="."),l.push(this.bind(n,Ir("close",x,a,s,n,{isSelected:this.isSelected,classes:f+" ML__close",mode:this.mode,style:this.style})))}let c=(h=this.variant==="mleft...mright"||((m=this.leftSibling)==null?void 0:m.isFunction))!=null?h:!1,u=new w(l,{type:c?"close":"inner",classes:"left-right"});return u.setStyle("margin-top",`${-o.depth}em`),u.setStyle("height",`${o.height+o.depth}em`),this.caret&&(u.caret=this.caret),this.bind(i,u.wrap(i))}};function V0(t,e,r,i,n){if(t)for(let o=0;oi.type!=="first").map(i=>i.toJson())),this.correctness&&(r.correctness=this.correctness),r.locked=this.locked,r}render(r){let i=new T({parent:r}),n=i.getRegisterAsEm("fboxsep"),o=n,a=n,s=y.createBox(r,this.body);if(!s)return null;s.height||(s.height=i.metrics.xHeight),s.setStyle("vertical-align",-s.height,"em"),this.correctness==="correct"?s.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&s.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");let l=new w(s,{type:"ord"});l.setStyle("display","inline-block"),l.setStyle("height",s.height+s.depth,"em"),l.setStyle("vertical-align",-a,"em");let c="ML__prompt ";this.locked?c+=" ML__lockedPromptBox ":c+=" ML__editablePromptBox ",this.correctness==="correct"?c+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(c+=" ML__incorrectPromptBox "),this.containsCaret&&(c+=" ML__focusedPromptBox ");let u=new w(null,{classes:c,attributes:{part:"prompt"}});u.height=l.height+a,u.depth=l.depth+a,u.width=l.width+2*o,u.setStyle("box-sizing","border-box"),u.setStyle("position","absolute"),u.setStyle("height",l.height+l.depth+2*a,"em"),o===0&&u.setStyle("width","100%"),o!==0&&(u.setStyle("width",`calc(100% + ${2*o}em)`),u.setStyle("top",n,"em"),u.setStyle("left",-o,"em")),(!this.body||this.body.length===1)&&(u.width=3*o,u.setStyle("width",`calc(100% + ${3*o}em)`),u.setStyle("left",-1.5*o,"em"));let d="";this.correctness==="incorrect"&&(d+=''),d&&(u.svgOverlay=d);let m=new w([u,l],{classes:"ML__prompt-atom"});return m.setStyle("position","relative"),m.setStyle("display","inline-block"),m.setStyle("line-height",0),m.height=l.height+a+.2,m.depth=l.depth+a,m.left=o,m.right=o,m.setStyle("height",l.height+a,"em"),m.setStyle("top",l.depth-l.height,"em"),m.setStyle("vertical-align",l.depth+a,"em"),m.setStyle("margin-left",.5,"em"),m.setStyle("margin-right",.5,"em"),this.caret&&(m.caret=this.caret),this.bind(i,this.attachSupsub(r,{base:m}))}_serialize(r){var o;let i=(o=this.bodyToLatex(r))!=null?o:"",n="\\placeholder";return this.placeholderId&&(n+=`[${this.placeholderId}]`),this.correctness==="correct"?n+="[correct]":this.correctness==="incorrect"&&(n+="[incorrect]"),this.locked&&(n+="[locked]"),F(n,i)}};var Ot=class t extends y{constructor(e){super({type:"subsup",style:e==null?void 0:e.style}),this.subsupPlacement="auto"}static fromJson(e){let r=new t(e);for(let i of ur)e[i]&&r.setChildren(e[i],i);return r}render(e){var a;let r=new T({parent:e,isPhantom:!0}),i=this.leftSibling,n=(a=i.render(r))!=null?a:new w(null),o=new w(null);return o.height=n.height,o.depth=n.depth,this.attachSupsub(e,{base:o,isCharacterBox:i.isCharacterBox(),type:"ignore"})}_serialize(e){return this.supsubToLatex(e)}};function Oi(t){return t?!/^(<$$>|<$>||<{>|<}>|#[0-9\?]|\\.+)$/.test(t):!1}var ga=class{constructor(e,r,i){this.errors=[];this.index=0;this.endCount=0;var n,o,a,s;i!=null||(i={}),this.tokens=e,this.context=r instanceof T&&!(i!=null&&i.parseMode)&&!i.mathstyle?r:new T({from:r,mathstyle:i.mathstyle},i.style),this.args=(n=i.args)!=null?n:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(o=i.style)!=null?o:{},parseMode:(a=i.parseMode)!=null?a:"math",mathstyle:(s=i.mathstyle)!=null?s:"displaystyle",tabular:!1}}beginContext(e){var n,o,a;let r=this.parsingContext,i={parent:r,mathlist:[],style:p({},r.style),parseMode:(n=e==null?void 0:e.mode)!=null?n:r.parseMode,mathstyle:(o=e==null?void 0:e.mathstyle)!=null?o:r.mathstyle,tabular:(a=e==null?void 0:e.tabular)!=null?a:!1};this.parsingContext=i}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(p({before:nr(this.tokens.slice(this.index,this.index+10)),after:nr(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return p({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new Ot({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var r;let{index:e}=this;if(e"););}skipUntilToken(e){let r=this.tokens[this.index];for(;r&&r!==e;)r=this.tokens[++this.index];r===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match(""););}matchKeyword(e){let r=this.index,i=this.end(),n="";for(;!i;){let a=this.get();Oi(a)?(n+=a,i=this.end()||n.length>=e.length):i=!0}let o=e.toUpperCase()===n.toUpperCase();return o||(this.index=r),o}scanString(){let e="";for(;!this.end();){let r=this.peek();if(r==="]")return e;if(r==="")e+=" ";else if(r.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=r.substring(1);else if(Oi(r))e+=r;else return e;this.next()}return e}scanBalancedString(){let e="",r=this.end(),i=1;for(;!r;){let n=this.get();n===""?e+=" ":n==="<{>"?(e+="{",i+=1):n==="<}>"?(i-=1,i>0?e+="}":this.index-=1):n==="<$>"?e+="$":n==="<$$>"?e+="$$":e+=n,r=i===0||this.end()}return e}scanLiteralGroup(){var i;if(!this.match("<{>"))return"";let e="",r=1;for(;r>0&&!this.end();){let n=this.get();n==="<}>"?(r-=1,r>0&&(e+="}")):n==="<{>"?(r+=1,e+="{"):(/\\[a-zA-Z]+$/.test(e)&&/^[a-zA-Z]/.test(n)&&(e+=" "),e+=(i={"":" ","<$$>":"$$","<$>":"$"}[n])!=null?i:n)}return e}scanNumber(e=!0){var l,c;let r=!1,i=this.peek();for(;i===""||i==="+"||i==="-";)this.get(),i==="-"&&(r=!r),i=this.peek();e=!!e;let n=10,o=/\d/;if(this.match("'"))n=8,o=/[0-7]/,e=!0;else if(this.match('"'))n=16,o=/[\dA-F]/,e=!0;else if(this.match("x"))n=16,o=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return i=this.get(),i?i.length===2&&i.startsWith("\\")?{number:(r?-1:1)*((l=i.codePointAt(1))!=null?l:0),base:"alpha"}:{number:(r?-1:1)*((c=i.codePointAt(0))!=null?c:0),base:"alpha"}:null;let a="";for(;this.hasPattern(o);)a+=this.get();if(!e&&(this.match(".")||this.match(",")))for(a+=".";this.hasPattern(o);)a+=this.get();let s=e?Number.parseInt(a,n):Number.parseFloat(a);return Number.isNaN(s)?null:{number:r?-s:s,base:n===16?"hexadecimal":n===8?"octal":"decimal"}}scanRegister(){var o;let e=this.index,r=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return r;let i=!1;if(r===null)for(;;){let a=this.peek();if(a==="-")i=!i;else if(a!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();let a=this.get();return a.startsWith("\\")?r?{register:a,global:!0,factor:(i?-1:1)*r.number}:i?{register:a,global:!0,factor:-1}:{register:a,global:!0}:(this.index=e,null)}let n=this.get();return n!=null&&n.startsWith("\\")?(n=n.substring(1),this.context.registers[n]?!i||r!==null?{register:n,factor:(i?-1:1)*((o=r==null?void 0:r.number)!=null?o:1)}:{register:n}:(this.index=e,null)):(this.index=e,null)}scanValue(){let e=this.scanRegister();if(e)return e;let r=this.index,i=this.scanGlueOrDimen();if(i&&("unit"in i||"glue"in i&&"unit"in i.glue))return i;this.index=r;let n=this.scanNumber();if(n)return n;if(this.end()||!Oi(this.peek()))return null;let o=this.scanString();return o.length>0?{string:o}:null}scanDimen(){let e=this.scanNumber(!1);if(e===null)return null;let r=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let i;return this.matchKeyword("pt")?i="pt":this.matchKeyword("mm")?i="mm":this.matchKeyword("cm")?i="cm":this.matchKeyword("ex")?i="ex":this.matchKeyword("px")?i="px":this.matchKeyword("em")?i="em":this.matchKeyword("bp")?i="bp":this.matchKeyword("dd")?i="dd":this.matchKeyword("pc")?i="pc":this.matchKeyword("in")?i="in":this.matchKeyword("mu")&&(i="mu"),i?{dimension:r,unit:i}:{dimension:r}}scanGlueOrDimen(){let e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;let r={glue:e};if(this.matchKeyword("plus")){let i=this.scanDimen();if(i)r.grow=i;else return r}if(this.skipWhitespace(),this.match("\\relax"))return r;if(this.skipWhitespace(),this.matchKeyword("minus")){let i=this.scanDimen();if(i)r.shrink=i;else return r}return!r.grow&&!r.shrink?e:r}scanColspec(){this.skipWhitespace();let e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){let r=this.get();r==="c"||r==="r"||r==="l"?e.push({align:r}):r==="|"?e.push({separator:"solid"}):r===":"?e.push({separator:"dashed"}):r==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(i=>i==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});let r=this.scan(i=>i===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});let r=this.scan(i=>i===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanEnvironment(){if(!this.match("\\begin"))return null;let e=this.scanArgument("string");if(!e)return null;let r=pc(e);if(!r)return this.onError({code:"unknown-environment",arg:e}),null;let i=[];if(r.params)for(let l of r.params)if(l.isOptional)i.push(this.scanOptionalArgument(l.type));else{let c=this.scanArgument(l.type);c||this.onError({code:"missing-argument",arg:e}),i.push(c)}this.beginContext({tabular:r.tabular});let n=[],o=[],a=[],s=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s)if(this.matchColumnSeparator())a.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){a.push(this.mathlist),this.mathlist=[];let l=null;this.skipWhitespace(),this.match("[")&&(l=this.scanDimen(),this.skipWhitespace(),this.match("]")),o.push(l!=null?l:{dimension:0}),n.push(a),a=[]}else this.mathlist.push(...this.scan(l=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(l)));while(!s);return a.push(this.mathlist),a.length>0&&n.push(a),this.endContext(),r.createAtom(e,n,o,i)}scanExpression(){let e=this.mathlist;if(this.mathlist=[],this.parseExpression()){let r=this.mathlist;return this.mathlist=e,r}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=s=>s==="<}>");let r="",i=null,n=[],o=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!r?(r=this.get(),i=G(r,"math"),i&&(n=this.scanArguments(i)[1]),o=this.mathlist,this.mathlist=[]):this.parseExpression();let a;return r?(n.unshift(this.mathlist),o&&n.unshift(o),a=[i.createAtom({command:r,args:n,style:this.style,mode:this.parseMode})]):a=this.mathlist,this.endContext(),a}scanGroup(){let e=this.index;if(!this.match("<{>"))return null;let r=this.scan(n=>n==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});let i=new Ki(r,this.parseMode,this.style);return i.verbatimLatex=nr(this.tokens.slice(e,this.index)),i}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();let r=new q("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),r}scanDelim(){this.skipWhitespace();let e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Oi(e)&&!e.startsWith("\\"))return null;this.next();let r=G(e,"math");return r?r.definitionType==="function"&&r.ifMode&&!r.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):r.definitionType==="symbol"&&(r.type==="mopen"||r.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var o;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new rt("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new rt("\\mright");let e="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;e="\\mright"}let r=this.scanDelim();if(!r)return this.onError({code:"unexpected-delimiter"}),new rt(e==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(e);)this.parseExpression();let i=this.mathlist;this.endContext();let n=(o=this.scanDelim())!=null?o:".";return new q(e==="\\right"?"left...right":"mleft...mright",i,{leftDelim:r,rightDelim:n,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;let r=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?r.addChild(new y({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):r.addChild(new y({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&r.addChildren(L(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;let e=this.match("\\limits"),r=!e&&this.match("\\nolimits"),i=!r&&!e&&this.match("\\displaylimits");if(!e&&!r&&!i)return!1;let n=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return n===null?!1:(n.explicitSubsupPlacement=!0,e&&(n.subsupPlacement="over-under"),r&&(n.subsupPlacement="adjacent"),i&&(n.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let r,i=[],n=e.infix?2:0;for(;n["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(a))):o.isOptional?i.push(this.scanOptionalArgument(o.type)):o.type.endsWith("*")?r=o.type.slice(0,-1):i.push(this.scanArgument(o.type)),n+=1}return[r,i]}scanSymbolOrLiteral(){let e=this.peek();if(!e)return null;this.next();let r;if(Oi(e)){let i=le.createAtom(this.parseMode,e,p({},this.style));return i?[i]:null}if(r=this.scanMacro(e),r)return[r];if(e.startsWith("\\")){let i=G(e,this.parseMode);if(!i)return this.onError({code:"unknown-command",arg:e}),[new rt(e)];if(i.definitionType==="symbol"){let n=p({},this.style);i.variant&&(n.variant=i.variant),r=new y({type:i.type,command:e,style:n,value:String.fromCodePoint(i.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(i.applyMode||i.applyStyle||i.infix)return this.onError({code:"invalid-command",arg:e}),[new rt(e)];i.createAtom&&(r=i.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return r?[r]:null}scanArgument(e){var n;this.skipFiller();let r=this.parseMode;if(e==="auto"&&(e=r),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(n=this.scanDelim())!=null?n:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==r&&this.beginContext({mode:"math"});let o=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),o}if(e==="text"){e!==r&&this.beginContext({mode:"text"});let o=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),o}return null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let o=this.mathlist;return this.endContext(),{group:o}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let o=this.mathlist;return this.endContext(),{group:o}}let i=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let o=this.mathlist;return this.endContext(),{group:o}}return e==="string"?i=this.scanString():e==="balanced-string"?i=this.scanBalancedString():e==="colspec"?i=this.scanColspec():e==="value"&&(i=this.scanValue()),this.skipUntilToken("<}>"),i}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let r=null;for(;!this.end()&&!this.match("]");)if(e==="string")r=this.scanString();else if(e==="value")r=this.scanValue();else if(e==="colspec")r=this.scanColspec();else if(e==="bbox"){let i={},n=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(let o of n){let a=o.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(a)i.padding={dimension:parseInt(a[1]),unit:a[2]};else{let s=o.match(/^\s*border\s*:\s*(.*)/);s?i.border=s[1]:i.backgroundcolor={string:o}}}r=i}else e==="math"&&(this.beginContext({mode:"math"}),r=this.mathlist.concat(this.scan(i=>i==="]")),this.endContext());return r}scanSymbolOrCommand(e){var o,a;if(e==="\\placeholder"){let s=this.scanOptionalArgument("string"),l=this.scanOptionalArgument("math"),c=y.serialize(l,{defaultMode:"math"}),u=[],d;!d&&c==="correct"?d="correct":!d&&c==="incorrect"?d="incorrect":c!==""&&(u=l);let m=this.scanOptionalArgument("string")==="locked",h=this.scanArgument("auto"),f;return h&&Array.isArray(h)&&h.length>0?f=h:h&&typeof h=="object"&&"group"in h?f=h.group:f=u,s?[new Pi(s,d,m,f!=null?f:u,{mode:this.parseMode,style:this.style})]:[new xe({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){let s=this.index,l=this.scanLiteralGroup()||this.next();if(!l)return null;if(this.context.registers[l.substring(1)]){let c=this.scanArgument("string");c!==null&&(this.context.registers[l.substring(1)]=c);let u=B([e,nr(this.tokens.slice(s,this.index))]);return[new y({type:"text",value:"",verbatimLatex:u})]}}let r=this.scanMacro(e);if(r)return[r];let i=G(e,this.parseMode);if(!i)return this.onError({code:"unknown-command",arg:e}),this.parseMode==="text"?[...e].map(s=>new y({type:"text",value:s,mode:"text",style:this.style})):[new rt(e)];let n=this.index;if(i.definitionType==="symbol"){let s=p({},this.style);i.variant&&(s.variant=i.variant),r=new y({type:i.type,command:e,style:s,value:String.fromCodePoint(i.codepoint),mode:this.parseMode})}else{if(i.ifMode&&!i.ifMode.includes(this.parseMode))return[];let s=this.parseMode;i.applyMode&&(this.parseMode=i.applyMode);let[l,c]=this.scanArguments(i);if(this.parseMode=s,i.applyMode&&!i.applyStyle&&!i.createAtom)return L(c[0]);if(i.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof i.createAtom=="function")r=i.createAtom({command:e,args:c,style:this.style,mode:this.parseMode}),l&&(r.body=L(this.scanArgument(l)));else if(typeof i.applyStyle=="function"){let u=p(p({},this.style),i.applyStyle(e,c,this.context)),d=this.parseMode;if(i.applyMode&&(this.parseMode=i.applyMode),l){let m=this.style;this.style=u;let h=this.scanArgument(l);return this.style=m,this.parseMode=d,L(h)}this.style=u}else r=new y({type:"mord",command:(o=i.command)!=null?o:e,style:p({},this.style),value:e,mode:(a=i.applyMode)!=null?a:this.parseMode})}if(!r)return null;if(r instanceof y&&r.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){let s=B([e,nr(this.tokens.slice(n,this.index))]);s&&(r.verbatimLatex=s)}if(r.verbatimLatex===null&&(r.verbatimLatex=void 0),r.isFunction&&this.smartFence){let s=this.scanSmartFence();if(s)return[r,s]}return[r]}scanSymbolCommandOrLiteral(){let e=this.get();if(!e)return null;if(Oi(e)){let r=le.createAtom(this.parseMode,e,p({},this.style));if(!r)return null;if(r.isFunction&&this.smartFence){let i=this.scanSmartFence();if(i)return[r,i]}return[r]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e===""?this.parseMode==="text"?[new He(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var a;let r=this.context.getMacro(e);if(!r)return null;let i=this.index,n=r.args,o={"?":(a=this.args)==null?void 0:a.call(this,"?")};for(let s=1;s<=n;s++){let l=this.scanLiteralGroup();if(!l){let c=this.index;this.scanExpression(),l=nr(this.tokens.slice(c,this.index))}o[s]=l}return new Bi(e,{expand:r.expand,captureSelection:r.captureSelection,args:i===this.index?null:nr(this.tokens.slice(i,this.index)),style:this.parsingContext.style,body:ne(r.def,{context:this.context,parseMode:this.parseMode,args:s=>o[s],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var r,i,n,o;let e=(o=(n=(i=(r=this.scanEnvironment())!=null?r:this.scanModeShift())!=null?i:this.scanModeSet())!=null?n:this.scanGroup())!=null?o:this.scanLeftRight();if(e===null){if(this.parseSupSub()||this.parseLimits())return!0;e=this.scanSymbolCommandOrLiteral()}return e?(Array.isArray(e)?this.mathlist.push(...e):this.mathlist.push(e),!0):!1}};function ne(t,e){var o,a,s,l;let r=(o=e==null?void 0:e.args)!=null?o:void 0,i=new ga(kn(t,r),e==null?void 0:e.context,{args:r,mathstyle:(a=e==null?void 0:e.mathstyle)!=null?a:"displaystyle",parseMode:(s=e==null?void 0:e.parseMode)!=null?s:"math",style:(l=e==null?void 0:e.style)!=null?l:{}}),n=[];for(;!i.end();)n.push(...i.scan(()=>!1));return n}function ya(t,e){var i;let r=new ga(kn(t,null),e==null?void 0:e.context,{mathstyle:"displaystyle",parseMode:(i=e==null?void 0:e.parseMode)!=null?i:"math"});for(;!r.end();)r.scan();return r.errors}var Tn=class t extends y{constructor(r,i){super({type:"chem"},{command:r,mode:"math"});let n=X.go(S.go(i,r==="\\pu"?"pu":"ce"),!1);this.body=ne(n),this._verbatimLatex=r+"{"+i+"}",this.arg=i,this.captureSelection=!0}static fromJson(r){return new t(r.command,r.arg)}set verbatimLatex(r){}get verbatimLatex(){return this._verbatimLatex}toJson(){return g(p({},super.toJson()),{arg:this.arg})}render(r){let i=y.createBox(r,this.body,{type:"inner"});return this.caret&&(i.caret=this.caret),this.bind(r,i)}_serialize(r){return this.verbatimLatex,this.verbatimLatex}};v(["ce","pu"],"{chemformula:balanced-string}",{createAtom:t=>{var e;return new Tn(t.command,(e=t.args[0])!=null?e:"")}});var S={go:function(t,e){if(!t)return[];e===void 0&&(e="ce");var r="0",i={};i.parenthesisLevel=0,t=t.replace(/\n/g," "),t=t.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),t=t.replace(/[\u2026]/g,"...");for(var n,o=10,a=[];;){n!==t?(o=10,n=t):o--;var s=S.stateMachines[e],l=s.transitions[r]||s.transitions["*"];e:for(var c=0;c0){if(d.revisit||(t=u.remainder),!d.toContinue)break e}else return a}}if(o<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Object.prototype.toString.call(e)==="[object Array]")for(var r=0;r":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return S.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return S.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return S.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return S.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return S.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return S.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return S.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),e)return{match_:e[0],remainder:t.substr(e[0].length)};var r=S.patterns.findObserveGroups(t,"","$","$","");return r&&(e=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),e)?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,r,i,n,o,a,s,l,c){var u=function(b,k){if(typeof k=="string")return b.indexOf(k)!==0?null:k;var _=b.match(k);return _?_[0]:null},d=function(b,k,_){for(var A=0;k0,null},m=u(t,e);if(m===null||(t=t.substr(m.length),m=u(t,r),m===null))return null;var h=d(t,m.length,i||n);if(h===null)return null;var f=t.substring(0,i?h.endMatchEnd:h.endMatchBegin);if(o||a){var x=this.findObserveGroups(t.substr(h.endMatchEnd),o,a,s,l);if(x===null)return null;var M=[f,x.match_];return{match_:c?M.join(""):M,remainder:x.remainder}}else return{match_:f,remainder:t.substr(h.endMatchEnd)}},match_:function(t,e){var r=S.patterns.patterns[t];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+t+")"];if(typeof r=="function")return S.patterns.patterns[t](e);var i=e.match(r);if(i){var n;return i[2]?n=[i[1],i[2]]:i[1]?n=i[1]:n=i[0],{match_:n,remainder:e.substr(i[0].length)}}return null}},actions:{"a=":function(t,e){t.a=(t.a||"")+e},"b=":function(t,e){t.b=(t.b||"")+e},"p=":function(t,e){t.p=(t.p||"")+e},"o=":function(t,e){t.o=(t.o||"")+e},"q=":function(t,e){t.q=(t.q||"")+e},"d=":function(t,e){t.d=(t.d||"")+e},"rm=":function(t,e){t.rm=(t.rm||"")+e},"text=":function(t,e){t.text_=(t.text_||"")+e},insert:function(t,e,r){return{type_:r}},"insert+p1":function(t,e,r){return{type_:r,p1:e}},"insert+p1+p2":function(t,e,r){return{type_:r,p1:e[0],p2:e[1]}},copy:function(t,e){return e},rm:function(t,e){return{type_:"rm",p1:e||""}},text:function(t,e){return S.go(e,"text")},"{text}":function(t,e){var r=["{"];return S.concatArray(r,S.go(e,"text")),r.push("}"),r},"tex-math":function(t,e){return S.go(e,"tex-math")},"tex-math tight":function(t,e){return S.go(e,"tex-math tight")},bond:function(t,e,r){return{type_:"bond",kind_:r||e}},"color0-output":function(t,e){return{type_:"color0",color:e[0]}},ce:function(t,e){return S.go(e)},"1/2":function(t,e){var r=[];e.match(/^[+\-]/)&&(r.push(e.substr(0,1)),e=e.substr(1));var i=e.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return i[1]=i[1].replace(/\$/g,""),r.push({type_:"frac",p1:i[1],p2:i[2]}),i[3]&&(i[3]=i[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:i[3]})),r},"9,9":function(t,e){return S.go(e,"9,9")}},createTransitions:function(t){var e,r,i,n,o={};for(e in t)for(r in t[e])for(i=r.split("|"),t[e][r].stateArray=i,n=0;n":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var r;if((t.d||"").match(/^[0-9]+$/)){var i=t.d;t.d=void 0,r=this.output(t),t.b=i}else r=this.output(t);return S.actions["o="](t,e),r},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var r=[];return S.concatArray(r,this.output(t)),S.concatArray(r,S.actions.bond(t,e,"-")),r}else t.d=e},"- after o/d":function(t,e,r){var i=S.patterns.match_("orbital",t.o||""),n=S.patterns.match_("one lowercase greek letter $",t.o||""),o=S.patterns.match_("one lowercase latin letter $",t.o||""),a=S.patterns.match_("$one lowercase latin letter$ $",t.o||""),s=e==="-"&&(i&&i.remainder===""||n||o||a);s&&!t.a&&!t.b&&!t.p&&!t.d&&!t.q&&!i&&o&&(t.o="$"+t.o+"$");var l=[];return s?(S.concatArray(l,this.output(t)),l.push({type_:"hyphen"})):(i=S.patterns.match_("digits",t.d||""),r&&i&&i.remainder===""?(S.concatArray(l,S.actions["d="](t,e)),S.concatArray(l,this.output(t))):(S.concatArray(l,this.output(t)),S.concatArray(l,S.actions.bond(t,e,"-")))),l},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:S.go(e,"o")}},comma:function(t,e){var r=e.replace(/\s*$/,""),i=r!==e;return i&&t.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(t,e,r){var i;if(!t.r)i=[],!t.a&&!t.b&&!t.p&&!t.o&&!t.q&&!t.d&&!r||(t.sb&&i.push({type_:"entitySkip"}),!t.o&&!t.q&&!t.d&&!t.b&&!t.p&&r!==2?(t.o=t.a,t.a=void 0):!t.o&&!t.q&&!t.d&&(t.b||t.p)?(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):t.o&&t.dType==="kv"&&S.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&t.dType==="kv"&&!t.q&&(t.dType=void 0),i.push({type_:"chemfive",a:S.go(t.a,"a"),b:S.go(t.b,"bd"),p:S.go(t.p,"pq"),o:S.go(t.o,"o"),q:S.go(t.q,"pq"),d:S.go(t.d,t.dType==="oxidation"?"oxidation":"bd"),dType:t.dType}));else{var n;t.rdt==="M"?n=S.go(t.rd,"tex-math"):t.rdt==="T"?n=[{type_:"text",p1:t.rd||""}]:n=S.go(t.rd);var o;t.rqt==="M"?o=S.go(t.rq,"tex-math"):t.rqt==="T"?o=[{type_:"text",p1:t.rq||""}]:o=S.go(t.rq),i={type_:"arrow",r:t.r,rd:n,rq:o}}for(var a in t)a!=="parenthesisLevel"&&a!=="beginsWithBond"&&delete t[a];return i},"oxidation-output":function(t,e){var r=["{"];return S.concatArray(r,S.go(e,"oxidation")),r.push("}"),r},"frac-output":function(t,e){return{type_:"frac-ce",p1:S.go(e[0]),p2:S.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:S.go(e[0]),p2:S.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:S.go(e[0]),p2:S.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:S.go(e[0]),p2:S.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:S.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,r){return{type_:"operator",kind_:r||e}}}},a:{transitions:S.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:S.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:S.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var r in t)delete t[r];return e}}}},pq:{transitions:S.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:S.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:S.go(e[1],"pq")}}}},bd:{transitions:S.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:S.go(e[1],"bd")}}}},oxidation:{transitions:S.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:S.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return e}}}},"tex-math tight":{transitions:S.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return e}}}},"9,9":{transitions:S.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:S.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var r=[];return e[0]==="+-"||e[0]==="+/-"?r.push("\\pm "):e[0]&&r.push(e[0]),e[1]&&(S.concatArray(r,S.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?S.concatArray(r,S.go(e[2],"pu-9,9")):r.push(e[2])),(e[3]||e[4])&&(e[3]==="e"||e[4]==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),e[5]&&r.push("10^{"+e[5]+"}"),r},"number^":function(t,e){var r=[];return e[0]==="+-"||e[0]==="+/-"?r.push("\\pm "):e[0]&&r.push(e[0]),S.concatArray(r,S.go(e[1],"pu-9,9")),r.push("^{"+e[2]+"}"),r},operator:function(t,e,r){return{type_:"operator",kind_:r||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,r=S.patterns.match_("{(...)}",t.d||"");r&&r.remainder===""&&(t.d=r.match_);var i=S.patterns.match_("{(...)}",t.q||"");if(i&&i.remainder===""&&(t.q=i.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var n={d:S.go(t.d,"pu"),q:S.go(t.q,"pu")};t.o==="//"?e={type_:"pu-frac",p1:n.d,p2:n.q}:(e=n.d,n.d.length>1||n.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),S.concatArray(e,n.q))}else e=S.go(t.d,"pu-2");for(var o in t)delete t[o];return e}}},"pu-2":{transitions:S.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var r=S.patterns.match_("{(...)}",t.rm||"");r&&r.remainder===""?e=S.go(r.match_,"pu"):e={type_:"rm",p1:t.rm}}for(var i in t)delete t[i];return e}}},"pu-9,9":{transitions:S.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var r=t.text_.length%3;r===0&&(r=3);for(var i=t.text_.length-3;i>0;i-=3)e.push(t.text_.substr(i,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,r)),e.reverse()}else e.push(t.text_);for(var n in t)delete t[n];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var r=t.text_.length-3,i=0;i"||t.r==="<=>>"||t.r==="<<=>"||t.r==="<-->"?(a="\\long"+a,o.rd&&(a="\\overset{"+o.rd+"}{"+a+"}"),o.rq&&(t.r==="<-->"?a="\\underset{\\lower2mu{"+o.rq+"}}{"+a+"}":a="\\underset{\\lower6mu{"+o.rq+"}}{"+a+"}"),a=" {}\\mathrel{"+a+"}{} "):(o.rq&&(a+="[{"+o.rq+"}]"),a+="{"+o.rd+"}",a=" {}\\mathrel{\\x"+a+"}{} "):a=" {}\\mathrel{\\long"+a+"}{} ",e=a;break;case"operator":e=X._getOperator(t.kind_);break;case"1st-level escape":e=t.p1+" ";break;case"space":e=" ";break;case"entitySkip":e="~";break;case"pu-space-1":e="~";break;case"pu-space-2":e="\\mkern3mu ";break;case"1000 separator":e="\\mkern2mu ";break;case"commaDecimal":e="{,}";break;case"comma enumeration L":e="{"+t.p1+"}\\mkern6mu ";break;case"comma enumeration M":e="{"+t.p1+"}\\mkern3mu ";break;case"comma enumeration S":e="{"+t.p1+"}\\mkern1mu ";break;case"hyphen":e="\\text{-}";break;case"addition compound":e="\\,{\\cdot}\\,";break;case"electron dot":e="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":e="{\\times}";break;case"prime":e="\\prime ";break;case"cdot":e="\\cdot ";break;case"tight cdot":e="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":e="\\times ";break;case"circa":e="{\\sim}";break;case"^":e="uparrow";break;case"v":e="downarrow";break;case"ellipsis":e="\\ldots ";break;case"/":e="/";break;case" / ":e="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return e},_getArrow:function(t){switch(t){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};var zi=class t extends y{constructor(r){super(g(p({},r),{type:"delim"}));this.value=r.delim,this.size=r.size}static fromJson(r){return new t(r)}toJson(){return g(p({},super.toJson()),{delim:this.value,size:this.size})}render(r){return new w(this.value,{type:"middle"})}_serialize(r){if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,r):F(this.command,this.value)}},Ii=class t extends y{constructor(r){super(g(p({},r),{type:"sizeddelim",value:r.delim}));this.delimType=r.delimType,this.size=r.size}static fromJson(r){return new t(r)}toJson(){return g(p({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(r){let i=P0(this.value,this.size,r,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return i?(i=this.bind(r,i),this.caret&&(i.caret=this.caret),i):null}_serialize(r){if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,r):F(this.command,this.value)}};var zt=class t extends y{constructor(r,i,n,o){var a,s;super({type:"enclose",command:r,style:o.style});this.body=i,this.backgroundcolor=o.backgroundcolor,n.updiagonalarrow&&(n.updiagonalstrike=!1),n.box&&(n.left=!1,n.right=!1,n.bottom=!1,n.top=!1),this.notation=n,this.shadow=(a=o.shadow)!=null?a:"none",this.strokeWidth=(s=o.strokeWidth)!=null?s:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=o.strokeStyle,this.svgStrokeStyle=o.svgStrokeStyle,this.strokeColor=o.strokeColor,this.borderStyle=o.borderStyle,this.padding=o.padding,this.captureSelection=!1}static fromJson(r){return new t(r.command,r.body,r.notation,r)}toJson(){return g(p({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(r){var o;if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,r);let n=(o=this.command)!=null?o:"";if(this.command==="\\enclose"){n+="{"+Object.keys(this.notation).join(" ")+"}";let a="",s="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(a+=s+'mathbackground="'+this.backgroundcolor+'"',s=","),this.shadow&&this.shadow!=="auto"&&(a+=s+'shadow="'+this.shadow+'"',s=","),this.strokeWidth||this.strokeStyle!=="solid"?(a+=s+this.borderStyle,s=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(a+=s+'mathcolor="'+this.strokeColor+'"',s=","),a&&(n+=`[${a}]`)}return F(n,this.bodyToLatex(r))}render(r){let i=new T({parent:r},this.style),n=y.createBox(i,this.body);if(!n)return null;let o=Mh(this.borderStyle),a=i.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});n.setStyle("position","relative"),n.setStyle("display","inline-block"),n.setStyle("top",a,"em"),n.setStyle("height",n.height+n.depth,"em"),n.setStyle("width",n.width,"em");let s=new w(null,{classes:"ML__notation"}),l=n.height+n.depth+2*a,c=n.width+2*a,u="";if(this.notation.horizontalstrike&&(u+=this.line(3,50,97,50)),this.notation.verticalstrike&&(u+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(u+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(u+=this.line(3,3,97,97)),this.notation.updiagonalarrow){u+=this.line(a.toString(),(a+n.depth+n.height).toString(),(a+n.width).toString(),a.toString());let h=1,x=.03*Math.sqrt(c*c+l*l)*h,M=n.width*x,b=(n.depth+n.height)*x,k=a+n.width,_=a;_+b-.4*M<0&&(_=.4*M-b),u+='`}};function ba(t){return typeof t=="number"?`${Math.floor(100*t)/100}%`:t}function Mh(t){if(!t)return"1px";let e=t.match(/([0-9][a-zA-Z\%]+)/);return e===null?"1px":e[1]}function _h(t){return(Math.floor(100*t.metrics.sqrtRuleThickness/t.scalingFactor)/100/10).toString()+"em"}function $0(t){let e=t.isDisplayStyle?qe:t.metrics.defaultRuleThickness;return t.metrics.defaultRuleThickness+t.scalingFactor*e/4}var Mt=class t extends y{constructor(r,i,n){var o,a;super(g(p({},n),{type:"genfrac",displayContainsHighlight:!0}));this.above=r,this.below=i,this.hasBarLine=(o=n==null?void 0:n.hasBarLine)!=null?o:!0,this.continuousFraction=(a=n==null?void 0:n.continuousFraction)!=null?a:!1,this.numerPrefix=n==null?void 0:n.numerPrefix,this.denomPrefix=n==null?void 0:n.denomPrefix,this.mathstyleName=n==null?void 0:n.mathstyleName,this.leftDelim=n==null?void 0:n.leftDelim,this.rightDelim=n==null?void 0:n.rightDelim,this.fractionNavigationOrder=n==null?void 0:n.fractionNavigationOrder}static fromJson(r){return new t(r.above,r.below,r)}toJson(){let r={};return this.continuousFraction&&(r.continuousFraction=!0),this.numerPrefix&&(r.numerPrefix=this.numerPrefix),this.denomPrefix&&(r.denomPrefix=this.denomPrefix),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),this.hasBarLine||(r.hasBarLine=!1),this.mathstyleName&&(r.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(r.fractionNavigationOrder=this.fractionNavigationOrder),p(p({},super.toJson()),r)}get children(){if(this._children)return this._children;let r=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(let i of this.below)r.push(...i.children),r.push(i);for(let i of this.above)r.push(...i.children),r.push(i)}else{for(let i of this.above)r.push(...i.children),r.push(i);for(let i of this.below)r.push(...i.children),r.push(i)}return this._children=r,r}render(r){var D,K;let i=new T({parent:r,mathstyle:this.mathstyleName},this.style),n=i.metrics,o=new T({parent:i,mathstyle:this.continuousFraction?"":"numerator"},this.style),a=this.numerPrefix?new w([new w(this.numerPrefix),y.createBox(o,this.above)],{isTight:o.isTight,type:"ignore"}):(D=y.createBox(o,this.above,{type:"ignore"}))!=null?D:new w(null,{type:"ignore"}),s=new T({parent:i,mathstyle:this.continuousFraction?"":"denominator"},this.style),l=this.denomPrefix?new w([new w(this.denomPrefix),y.createBox(s,this.below,{type:"ignore"})]):(K=y.createBox(s,this.below,{type:"ignore"}))!=null?K:new w(null,{type:"ignore"}),c=this.hasBarLine?n.defaultRuleThickness:0,u,d=0,m;i.isDisplayStyle?(u=o.metrics.num1,d=c>0?3*c:7*c,m=s.metrics.denom1):(c>0?(u=o.metrics.num2,d=c):(u=o.metrics.num3,d=3*n.defaultRuleThickness),m=s.metrics.denom2);let h=[];this.isSelected&&h.push("ML__selected");let f=a.depth,x=l.height,M;if(c<=0){let P=u-f-(x-m);Pnew Z(r)),this.skipBoundary=!1}static fromJson(e){return new t("")}toJson(){return super.toJson()}render(e){let r=y.createBox(e,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(e,r)):null}_serialize(e){var r,i;return(i=(r=this.body)==null?void 0:r.map(n=>n.value).join(""))!=null?i:""}};var Rr=class t extends y{constructor(r,i){super(g(p({},i),{type:"extensible-symbol",isFunction:i==null?void 0:i.isFunction}));this.value=r,this.variant=i==null?void 0:i.variant,this.subsupPlacement=i==null?void 0:i.limits}static fromJson(r){return new t(r.symbol,r)}toJson(){let r=super.toJson();return this.variant&&(r.variant=this.variant),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),this.value&&(r.symbol=this.value),r}render(r){var l;let i=r.isDisplayStyle&&this.value!=="\\smallint",n=new w(this.value,{fontFamily:i?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(i?"large-op":"small-op"),type:"op",maxFontSize:r.scalingFactor,isSelected:this.isSelected});if(!n)return null;n.right=n.italic;let o=(n.height-n.depth)/2-Ce*r.scalingFactor,a=n.italic;n.setTop(o);let s=n;if(this.superscript||this.subscript){let c=(l=this.subsupPlacement)!=null?l:"auto";s=c==="over-under"||c==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:n,baseShift:o,slant:a}):this.attachSupsub(r,{base:n})}return new w(this.bind(r,s),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,r);let n=[];return n.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(r)),B(n)}};var it=class t extends y{constructor(r){let i=r.body;super(g(p({},r),{type:"overlap",body:typeof i=="string"?[new y({value:i})]:i,style:r==null?void 0:r.style}));this.skipBoundary=!0,this.align=r==null?void 0:r.align,this.boxType=r==null?void 0:r.boxType}static fromJson(r){return new t(r)}toJson(){let r={};return this.align&&(r.align=this.align),this.boxType&&(r.boxType=this.boxType),p(p({},super.toJson()),r)}render(r){let i=y.createBox(r,this.body,{classes:"inner"});return i?(this.caret&&(i.caret=this.caret),this.bind(r,new w([i,new w(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}};var fe=class t extends y{constructor(r){var i,n,o,a;super({type:"overunder",command:r.command,style:r.style,mode:r.mode,body:r.body,skipBoundary:(i=r.skipBoundary)!=null?i:!0});this.subsupPlacement=r.supsubPlacement,this.svgAbove=r.svgAbove,this.svgBelow=r.svgBelow,this.svgBody=r.svgBody,this.above=r.above,this.below=r.below,this.boxType=(n=r.boxType)!=null?n:"ord",this.paddedBody=(o=r.paddedBody)!=null?o:!1,this.paddedLabels=(a=r.paddedLabels)!=null?a:!1}static fromJson(r){return new t(r)}toJson(){let r=super.toJson();return this.skipBoundary||(r.skipBoundary=!1),this.subsupPlacement&&(r.subsupPlacement=this.subsupPlacement),this.svgAbove&&(r.svgAbove=this.svgAbove),this.svgBelow&&(r.svgBelow=this.svgBelow),this.svgBody&&(r.svgBody=this.svgBody),this.boxType!=="ord"&&(r.boxType=this.boxType),this.paddedBody&&(r.paddedBody=!0),this.paddedLabels&&(r.paddedLabels=!0),r}render(r){let i=this.svgBody?_i(this.svgBody):y.createBox(r,this.body,{type:"ignore"}),n=new T({parent:r,mathstyle:"scriptstyle"},this.style),o=null;this.svgAbove?o=_i(this.svgAbove):this.above&&(o=y.createBox(n,this.above,{type:"ignore"}));let a=null;this.svgBelow?a=_i(this.svgBelow):this.below&&(a=y.createBox(n,this.below,{type:"ignore"})),this.paddedBody&&(i=new w([Pt(r,"open"),i,Pt(r,"close")],{type:"ignore"}));let s=Sh(r,{base:i,above:o,below:a,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return s?(this.subsupPlacement==="over-under"?s=this.attachLimits(r,{base:s,type:s.type}):s=this.attachSupsub(r,{base:s}),this.caret&&(s.caret=this.caret),this.bind(r,s)):null}};function Sh(t,e){if(!e.base)return null;if(!e.above&&!e.below){let s=new w(e.base,{type:e.type});return s.setStyle("position","relative"),s}let r=0;e.above&&(r=t.metrics.bigOpSpacing5);let i=null,n=e.base,o=0,a=["ML__center"];if(e.paddedAboveBelow&&a.push("ML__label_padding"),e.below&&e.above){let s=t.metrics.bigOpSpacing5+e.below.height+e.below.depth+n.depth+o;i=new H({bottom:s,children:[t.metrics.bigOpSpacing5,{box:e.below,classes:a},{box:n,classes:["ML__center"]},r,{box:e.above,classes:a},t.metrics.bigOpSpacing5]})}else e.below?i=new H({top:n.height-o,children:[t.metrics.bigOpSpacing5,{box:e.below,classes:a},{box:n,classes:["ML__center"]}]}):e.above&&(i=new H({bottom:n.depth+o,children:[{box:n,classes:["ML__center"]},r,{box:e.above,classes:a},t.metrics.bigOpSpacing5]}));return new w(i,{type:e.type})}var It=class t extends y{constructor(r){var i,n,o,a;super(g(p({},r),{type:"phantom"}));this.captureSelection=!0,this.isInvisible=(i=r.isInvisible)!=null?i:!1,this.smashDepth=(n=r.smashDepth)!=null?n:!1,this.smashHeight=(o=r.smashHeight)!=null?o:!1,this.smashWidth=(a=r.smashWidth)!=null?a:!1}static fromJson(r){return new t(r)}toJson(){let r={};return this.isInvisible&&(r.isInvisible=!0),this.smashDepth&&(r.smashDepth=!0),this.smashHeight&&(r.smashHeight=!0),this.smashWidth&&(r.smashWidth=!0),p(p({},super.toJson()),r)}render(r){let i=new T({parent:r,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return this.isInvisible,y.createBox(i,this.body,{classes:"inner"});let n=y.createBox(this.isInvisible?i:r,this.body);if(!n)return null;if(this.smashWidth){let o=new w(null,{classes:"fix"});return new w([n,o],{classes:"rlap"}).wrap(r)}if(!this.smashHeight&&!this.smashDepth)return n;if(this.smashHeight&&(n.height=0),this.smashDepth&&(n.depth=0),n.children)for(let o of n.children)this.smashHeight&&(o.height=0),this.smashDepth&&(o.depth=0);return new H({firstBaseline:[{box:n}]},{type:n.type}).wrap(r)}};var St=class t extends y{constructor(r){var i;super(p({type:"spacing"},r));this.width=r==null?void 0:r.width,this._braced=(i=r==null?void 0:r.braced)!=null?i:!1}static fromJson(r){return new t(r)}toJson(){let r=super.toJson();return this.width!==void 0&&(r.width=this.width),this._braced&&(r.braced=!0),r}render(r){var n;if(this.command==="space")return new w(this.mode==="math"?null:" ");let i;if(this.width!==void 0)i=new w(null,{classes:"mspace"}),i.left=r.toEm(this.width);else{let o=(n={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?n:"mediumspace";i=new w(null,{classes:o})}return i=this.bind(r,i),this.caret&&(i.caret=this.caret),i}_serialize(r){var o;if(!r.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,r);let n=(o=this.command)!=null?o:"";return this.width===void 0?n:this._braced&&!("register"in this.width)?`${n}{${ce(this.width)}}`:`${n}${ce(this.width)}`}};var Ri=class t extends y{constructor(e){var r;super(g(p({},e),{type:"surd",mode:(r=e.mode)!=null?r:"math",style:e.style,displayContainsHighlight:!0,body:e.body})),this.above=e.index}static fromJson(e){return new t(g(p({},e),{index:e.above}))}_serialize(e){if(!(e.expandMacro||e.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let r=G(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,e);let i=this.command,n=this.bodyToLatex(e);return this.above&&!this.hasEmptyBranch("above")?F(`${i}[${this.aboveToLatex(e)}]`,n):/^[0-9]$/.test(n)?`${i}${n}`:F(i,n)}get children(){if(this._children)return this._children;let e=[];if(this.above)for(let r of this.above)e.push(...r.children),e.push(r);if(this.body)for(let r of this.body)e.push(...r.children),e.push(r);return this._children=e,e}render(e){var k;let r=new T({parent:e,mathstyle:"cramp"},this.style),i=(k=y.createBox(r,this.body,{type:"inner"}))!=null?k:new w(null),n=r.scalingFactor,o=r.metrics.defaultRuleThickness/n,a=e.isDisplayStyle?qe:o,s=new w(null,{classes:"ML__sqrt-line",style:this.style});s.height=o,s.softWidth=i.width;let l=n*(o+a/4),u=Math.max(n*2*a,i.height+i.depth)+l+o,d=new T({parent:e},this.style),m=this.bind(d,new w(Ti("inner","\\surd",u,!1,d,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!m)return null;let h=m.height+m.depth-o;h>i.height+i.depth+l&&(l=(l+h-(i.height+i.depth))/2),m.setTop(m.height-i.height-l);let f=this.bind(e,new H({firstBaseline:[{box:new w(i)},l-2*o,{box:s},o]})),x=y.createBox(new T({parent:e,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!x){let _=new w([m,f],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return _.setStyle("display","inline-block"),_.setStyle("height",_.height+_.depth,"em"),this.caret&&(_.caret=this.caret),this.bind(e,_)}let M=new H({shift:-.6*(Math.max(m.height,f.height)-Math.max(m.depth,f.depth)),children:[{box:x}]}),b=new w([new w(M,{classes:"ML__sqrt-index",type:"ignore"}),m,f],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return b.height=m.height,b.depth=m.depth,this.caret&&(b.caret=this.caret),this.bind(e,b)}};var Qs=class extends w{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return``}};function Dn(t,e){if(!t.parent)return;let r=t.parent.children,i=r.indexOf(t),n=i-1;for(;n>=0&&r[n].type==="ignore";)n-=1;if(n<0&&t.parent.parent&&t.parent.type==="lift"){Dn(t.parent,e);return}i>0&&r[i-1].type==="skip"?r[i-1].width+=e:r.splice(i,0,new Qs(e))}var Ah={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},Lh={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function Ch(t){Kn(t,(e,r)=>{r.type==="bin"&&(!e||/^(middle|bin|op|rel|open|punct)$/.test(e.type))&&(r.type="ord"),(e==null?void 0:e.type)==="bin"&&/^(rel|close|punct)$/.test(r.type)&&(e.type="ord"),r.type!=="ignore"&&(e=r)})}function At(t,e){if(!t.children)return t;let r=t.children;Ch(r);let i=e.getRegisterAsEm("thinmuskip"),n=e.getRegisterAsEm("medmuskip"),o=e.getRegisterAsEm("thickmuskip");return Kn(r,(a,s)=>{var d,m,h;if(!a)return;let l=a.type,c=s.isTight?(d=Lh[l])!=null?d:null:(m=Ah[l])!=null?m:null,u=(h=c==null?void 0:c[s.type])!=null?h:null;u===3&&Dn(s,i),u===4&&Dn(s,n),u===5&&Dn(s,o)}),t}function Kn(t,e,r=void 0){if(!t)return r;t=[...t];for(let i of t)i.type==="lift"?r=Kn(i.children,e,r):i.type==="ignore"?Kn(i.children,e):(e(r,i),Kn(i.children,e),r=i);return r}var Nr=class t extends y{constructor(r){super({type:"tooltip",command:r.command,mode:r.mode,style:r.style,body:r.body,displayContainsHighlight:!0});this.tooltip=new y({type:"root",mode:r.content,body:r.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(r){return new t(g(p({},r),{tooltip:nt(r.tooltip)}))}toJson(){var i;let r=(i=this.tooltip.body)==null?void 0:i.filter(n=>n.type!=="first").map(n=>n.toJson());return g(p({},super.toJson()),{tooltip:r})}render(r){let i=y.createBox(new T,this.body);if(!i)return null;let n=new T({parent:r,mathstyle:"displaystyle"},{fontSize:Mi}),o=or(At(new w(this.tooltip.render(n),{classes:"ML__tooltip-content"}),n)),a=new w([o,i],{classes:"ML__tooltip-container"});return this.caret&&(a.caret=this.caret),this.bind(r,a)}};var ot=class t extends y{constructor(r,i){super(g(p({},i),{type:"operator",isFunction:i==null?void 0:i.isFunction}));this.value=r,this.variant=i==null?void 0:i.variant,this.variantStyle=i==null?void 0:i.variantStyle,this.subsupPlacement=i==null?void 0:i.limits}static fromJson(r){return new t(r.symbol,r)}toJson(){let r=super.toJson();return this.variant&&(r.variant=this.variant),this.variantStyle&&(r.variantStyle=this.variantStyle),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.value&&(r.symbol=this.value),r}render(r){var o;let i=new w(this.value,{type:"op",mode:"math",maxFontSize:r.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:r.letterShapeStyle}),n=i;if(this.superscript||this.subscript){let a=(o=this.subsupPlacement)!=null?o:"auto";n=a==="over-under"||a==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:i}):this.attachSupsub(r,{base:i})}return new w(this.bind(r,n),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=G(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,r);let n=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(r)),B(n)}};function nt(t){if(ee(t))return t.map(i=>nt(i));if(typeof t=="string")return y.fromJson(t);t=p({},t);for(let i of ur)t[i]&&(t[i]=nt(t[i]));t.args&&(t.args=Eh(t.args)),t.array&&(t.array=nt(t.array));let e=t.type,r;e==="accent"&&(r=hr.fromJson(t)),e==="array"&&(r=I.fromJson(t)),e==="box"&&(r=Ue.fromJson(t)),e==="chem"&&(r=Tn.fromJson(t)),e==="composition"&&(r=Di.fromJson(t)),e==="delim"&&(r=zi.fromJson(t)),e==="enclose"&&(r=zt.fromJson(t)),e==="error"&&(r=rt.fromJson(t)),e==="extensible-symbol"&&(r=Rr.fromJson(t)),e==="genfrac"&&(r=Mt.fromJson(t)),e==="group"&&(r=Ki.fromJson(t)),e==="latex"&&(r=Z.fromJson(t)),e==="latexgroup"&&(r=_t.fromJson(t)),e==="leftright"&&(r=q.fromJson(t)),e==="macro"&&(r=Bi.fromJson(t)),e==="macro-argument"&&(r=fa.fromJson(t)),e==="operator"&&(r=ot.fromJson(t)),e==="overlap"&&(r=it.fromJson(t)),e==="overunder"&&(r=fe.fromJson(t)),e==="placeholder"&&(r=xe.fromJson(t)),e==="prompt"&&(r=Pi.fromJson(t)),e==="phantom"&&(r=It.fromJson(t)),e==="sizeddelim"&&(r=Ii.fromJson(t)),e==="spacing"&&(r=St.fromJson(t)),e==="subsup"&&(r=Ot.fromJson(t)),e==="surd"&&(r=Ri.fromJson(t)),e==="text"&&(r=He.fromJson(t)),e==="tooltip"&&(r=Nr.fromJson(t)),r||(!e||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(e),`${e}`,r=y.fromJson(t));for(let i of ur)t[i]&&r.setChildren(t[i],i);return t.verbatimLatex!==void 0&&(r.verbatimLatex=t.verbatimLatex),t.subsupPlacement&&(r.subsupPlacement=t.subsupPlacement),t.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),t.isFunction&&(r.isFunction=!0),t.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),t.skipBoundary&&(r.skipBoundary=!0),t.captureSelection&&(r.captureSelection=!0),r}function Eh(t){if(t&&Array.isArray(t))return t.map(e=>e===""?null:typeof e=="object"&&"group"in e?{group:e.group.map(r=>nt(r))}:typeof e=="object"&&"atoms"in e?e.atoms.map(r=>nt(r)):e)}var q0={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},xa={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},W0=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,Th=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,Dh=[/^[a-z]$/,/^[A-Z]$/,W0,Th],Kh={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},el=class extends le{constructor(){super("math")}createAtom(e,r,i){var o,a,s,l,c;if(r===null)return new y({type:"mord",mode:"math",command:e,value:e,style:i});if(r.definitionType==="symbol"){let u=new y({type:(o=r.type)!=null?o:"mord",mode:"math",command:(a=r.command)!=null?a:e,value:String.fromCodePoint(r.codepoint),style:i});return(s=r.isFunction)!=null&&s&&(u.isFunction=!0),e.startsWith("\\")&&(u.verbatimLatex=e),u}let n=new y({type:"mord",mode:"math",command:(l=r.command)!=null?l:e,value:e,style:i});return(c=r.isFunction)!=null&&c&&(n.isFunction=!0),e.startsWith("\\")&&(n.verbatimLatex=e),n}serialize(e,r){let i=Bh(e,g(p({},r),{defaultMode:"math"}));return i.length===0||r.defaultMode!=="text"?i:["$ ",...i," $"]}getFont(e,r){r.variant;let{variant:i}=r,{variantStyle:n}=r;i==="normal"&&!n&&/[\u00A3\u0131\u0237]/.test(e.value)&&(i="main",n="italic"),i==="normal"&&!n&&e.value.length===1&&Dh.forEach((l,c)=>{var u;l.test(e.value)&&Kh[(u=r.letterShapeStyle)!=null?u:"tex"][c]==="it"&&(n="italic")}),n==="up"&&(n=void 0);let o=n?i+"-"+n:i;q0[o];let[a,s]=q0[o];return xa[i]&&!xa[i].test(e.value)?(e.value=ao(e.value,i,n),null):(W0.test(e.value)&&(e.classes+=" lcGreek"),s&&(e.classes+=" "+s),a)}};function Bh(t,e){let{parent:r}=t[0],i=H0(r);return vt(t,"variant").map(n=>{let o=H0(n[0]),a="";o&&o!==i&&(a={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[o]);let s=B(n.map(l=>l._serialize(e)));return a?F(a,s):s})}function H0(t){if(!t)return"";let{style:e}=t;if(e.variant===void 0)return"";let r=e.variant;return e.variantStyle&&e.variantStyle!=="up"&&(r+="-"+e.variantStyle),r}new el;function Ph(t,e){return t.map(r=>r._serialize(e))}function Oh(t,e){return vt(t,"fontShape").map(r=>{let i=Ph(r,e),{fontShape:n}=r[0].style,o="";return n==="it"&&(o="\\textit"),n==="sl"&&(o="\\textsl"),n==="sc"&&(o="\\textsc"),n==="n"&&(o="\\textup"),!o&&n?`{${F("\\fontshape",n)}${B(i)}}`:o?F(o,B(i)):B(i)})}function zh(t,e){return vt(t,"fontSeries").map(r=>{let i=Oh(r,e),{fontSeries:n}=r[0].style,o="";return n==="b"&&(o="\\textbf"),n==="l"&&(o="\\textlf"),n==="m"&&(o="\\textmd"),n&&!o?`{${F("\\fontseries",n)}${B(i)}}`:o?F(o,B(i)):B(i)})}function Ih(t,e){return vt(t,"fontSize").map(r=>{var o,a;let i=zh(r,e),n=(a=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(o=r[0].style.fontSize)!=null?o:""])!=null?a:"";return n?`${n} ${B(i)}`:B(i)})}function Rh(t,e){return vt(t,"fontFamily").map(r=>{var o,a;let i=Ih(r,e),n=(a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(o=r[0].style.fontFamily)!=null?o:""])!=null?a:"";return n?`\\${n}{${B(i)}}`:r[0].style.fontFamily?`{\\fontfamily{${r[0].style.fontFamily}} ${B(i)}}`:B(i)})}var U0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},tl=class extends le{constructor(){super("text")}createAtom(e,r,i){return r&&r.definitionType==="symbol"?new He(e,String.fromCodePoint(r.codepoint),i!=null?i:{}):null}serialize(e,r){let i=Rh(e,g(p({},r),{defaultMode:"text"}));return i.length===0||r.defaultMode==="text"?i:["\\text{",...i,"}"]}getFont(e,r){var n,o,a,s,l;let{fontFamily:i}=r;if(U0[i]?e.classes+=" "+U0[i]:i&&e.setStyle("font-family",i),r.fontShape&&(e.classes+=" ",e.classes+=(n={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[r.fontShape])!=null?n:""),r.fontSeries){let c=r.fontSeries.match(/(.?[lbm])?(.?[cx])?/);c&&(e.classes+=" ",e.classes+=(a={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"}[(o=c[1])!=null?o:""])!=null?a:"",e.classes+=" ",e.classes+=(l={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"}[(s=c[2])!=null?s:""])!=null?l:"")}return"Main-Regular"}};new tl;var rl=class extends le{constructor(){super("latex")}createAtom(e){return new Z(e)}serialize(e,r){return e.filter(i=>i instanceof Z&&!i.isSuggestion).map(i=>i.value)}getFont(){return null}};new rl;var j0={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}};var va={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},il={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},nl={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};var J0={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},G0={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},X0={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}};var Z0={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Y0={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Q0={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}};var em={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},tm={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},rm={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function ol(t){let e=t.split("+"),r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:e.pop()};return e.includes("shift")&&(r.shift=!0),e.includes("alt")&&(r.alt=!0),e.includes("ctrl")&&(r.ctrl=!0),e.includes("cmd")&&(r.cmd=!0),e.includes("win")&&(r.win=!0),e.includes("meta")&&(r.meta=!0),r}function Vr(t){let e="";return t.shift&&(e+="shift+"),t.alt&&(e+="alt+"),t.ctrl&&(e+="ctrl+"),t.cmd&&(e+="cmd+"),t.win&&(e+="win+"),t.meta&&(e+="meta+"),e+t.key}var Nh={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Bn=[],Fr;function al(){switch(mt()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function ze(t){(!t.platform||t.platform===al())&&Bn.push(t)}function im(t,e){var i;let r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!t)return r;for(let[n,o]of Object.entries(e.mapping)){if(o[0]===t)return r.key=`[${n}]`,r;if(o[1]===t)return r.shift=!0,r.key=`[${n}]`,r;if(o[2]===t)return r.alt=!0,r.key=`[${n}]`,r;if(o[3]===t)return r.shift=!0,r.alt=!0,r.key=`[${n}]`,r}return r.key=(i=Nh[t])!=null?i:"",r}function nm(t){if(t.code)return t;let e=Object.entries(fr().mapping),r=!1,i=!1,n="";for(let o=0;o<4;o++){for(let[a,s]of e)if(s[o]===t.key){n=a,o===3?(r=!0,i=!0):o===2?r=!0:o===1&&(i=!0);break}if(n)break}return new KeyboardEvent(t.type,g(p({},t),{altKey:r,shiftKey:i,code:n}))}function om(t){var r,i;if(!t||t.key==="Unidentified"||t.key==="Dead")return;let e=t.shiftKey&&t.altKey?3:t.altKey?2:t.shiftKey?1:0;for(let n of Bn)((r=n.mapping[t.code])==null?void 0:r[e])===t.key?n.score+=1:(i=n.mapping[t.code])!=null&&i[e]&&(n.score=0);Bn.sort((n,o)=>o.score-n.score)}function am(t){Fr=Bn.find(e=>t.startsWith(e.locale))}function fr(){return Fr!=null?Fr:Bn[0]}function sm(){switch(al()){case"apple":return va;case"windows":return il;case"linux":return nl}return va}switch(al()){case"apple":ze(va),ze(J0),ze(em),ze(Z0);break;case"windows":ze(il),ze(G0),ze(tm),ze(Y0);break;case"linux":ze(nl),ze(X0),ze(rm),ze(Q0);break}ze(j0);function Ni(t){var n;let e=/macos|ios/.test(mt()),r=t.split("+"),i="";for(let o of r)i&&(i+=e?"\u2009":'+'),o.startsWith("[Key")?i+=o.slice(4,5):o.startsWith("Key")?i+=o.slice(3,4):o.startsWith("[Digit")?i+=o.slice(6,7):o.startsWith("Digit")?i+=o.slice(5,6):i+=(n={cmd:"\u2318",meta:e?"\u2318":"Ctrl",shift:e?"\u21E7":"Shift",alt:e?"\u2325":"Alt",ctrl:e?"\u2303":"Ctrl","\n":e?"\u23CE":"Return","[return]":e?"\u23CE":"Return","[enter]":e?"\u2324":"Enter","[tab]":e?"\u21E5":"Tab","[escape]":"Esc","[backspace]":e?"\u232B":"Backspace","[delete]":e?"\u2326":"Del","[pageup]":e?"\u21DE":"Page Up","[pagedown]":e?"\u21DF":"Page Down","[home]":e?"\u2912":"Home","[end]":e?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[o.toLowerCase()])!=null?n:o.toUpperCase();return i}function Pn(t){if(t instanceof MouseEvent)return{x:t.clientX,y:t.clientY};if(t instanceof TouchEvent){let e=[...t.touches].reduce((i,n)=>({x:i.x+n.clientX,y:i.y+n.clientY}),{x:0,y:0}),r=t.touches.length;return{x:e.x/r,y:e.y/r}}}function we(t){let e={alt:!1,control:!1,shift:!1,meta:!1};return(t instanceof MouseEvent||t instanceof TouchEvent||t instanceof KeyboardEvent)&&(t.altKey&&(e.alt=!0),t.ctrlKey&&(e.control=!0),t.metaKey&&(e.meta=!0),t.shiftKey&&(e.shift=!0)),e}function sl(t,e){return!t&&e||t&&!e?!1:!t&&!e?!0:t.alt===e.alt&&t.control===e.control&&t.shift===e.shift&&t.meta===e.meta}var Fh=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function gr(t){return t.ctrlKey||t.metaKey||["Dead","Process"].includes(t.key)?!1:t.code===""?!0:Fh.has(t.code)}function On(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var Te=class{constructor(e){var r,i;this.preventOverlayClose=(r=e==null?void 0:e.preventOverlayClose)!=null?r:!1,this.translucent=(i=e==null?void 0:e.translucent)!=null?i:!1,this.state="closed"}get element(){if(this._element)return this._element;let e=document.createElement("div");return e.setAttribute("role","presentation"),e.style.position="fixed",e.style.contain="content",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.zIndex="var(--scrim-zindex, 10099)",e.style.outline="none",this.translucent?(e.style.background="rgba(255, 255, 255, .2)",e.style.backdropFilter="contrast(40%)"):e.style.background="transparent",this._element=e,e}open(e){var o;if(this.state!=="closed")return;this.state="opening",this.savedActiveElement=On();let{element:r}=this;((o=e==null?void 0:e.root)!=null?o:document.body).appendChild(r),r.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);let i=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";let n=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${n+i}px`,e!=null&&e.child&&r.append(e.child),this.state="open"}close(){var r,i,n,o;if(this.state!=="open"){this.element.parentElement;return}this.state="closing",typeof this.onClose=="function"&&this.onClose();let{element:e}=this;e.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),e.remove(),document.body.style.overflow=(r=this.savedOverflow)!=null?r:"",document.body.style.marginRight=(i=this.savedMarginRight)!=null?i:"",On()!==this.savedActiveElement&&((o=(n=this.savedActiveElement)==null?void 0:n.focus)==null||o.call(n)),e.innerHTML="",this.state="closed"}handleEvent(e){this.preventOverlayClose||(e.target===this._element&&e.type==="click"?(this.close(),e.preventDefault(),e.stopPropagation()):e.target===document&&(e.type==="touchmove"||e.type==="scroll")&&(this.close(),e.preventDefault(),e.stopPropagation()))}};function lm(t,e,r){let i=null,n=null,o=!1,a=!1,s=!1,l=new AbortController,c=l.signal;return t.addEventListener("keydown",u=>{if(o||u.key==="Process"||u.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(u.code)){i=null;return}i=u,n=null,r.onKeystroke(u)?t.textContent="":i=null},{capture:!0,signal:c}),t.addEventListener("keypress",u=>{o||(i&&n&&r.onKeystroke(i),n=u)},{capture:!0,signal:c}),t.addEventListener("compositionstart",u=>{t.textContent="",o=!0,r.onCompositionStart(u.data)},{capture:!0,signal:c}),t.addEventListener("compositionupdate",u=>{o&&r.onCompositionUpdate(u.data)},{capture:!0,signal:c}),t.addEventListener("compositionend",u=>{t.textContent="",o&&(o=!1,r.onCompositionEnd(u.data))},{capture:!0,signal:c}),t.addEventListener("beforeinput",u=>u.stopImmediatePropagation(),{signal:c}),t.addEventListener("input",u=>{var d;if(!o&&(t.textContent="",u.inputType!=="insertCompositionText")){if(u.inputType==="insertFromPaste"){u.preventDefault(),u.stopPropagation();return}r.onInput((d=u.data)!=null?d:""),u.preventDefault(),u.stopPropagation()}},{signal:c}),t.addEventListener("paste",u=>{t.focus({preventScroll:!0}),t.textContent="",r.onPaste(u)||u.preventDefault(),u.stopImmediatePropagation()},{signal:c}),t.addEventListener("cut",u=>r.onCut(u),{capture:!0,signal:c}),t.addEventListener("copy",u=>r.onCopy(u),{capture:!0,signal:c}),t.addEventListener("blur",u=>{var m,h,f;if(((h=(m=u.relatedTarget)==null?void 0:m._mathfield)==null?void 0:h.element)===e){t.focus({preventScroll:!0}),u.preventDefault(),u.stopPropagation();return}let d=(f=Te.scrim)==null?void 0:f.state;if(d==="open"||d==="opening"){u.preventDefault(),u.stopPropagation();return}if(u.relatedTarget===u.target.getRootNode().host){u.preventDefault(),u.stopPropagation();return}s||a||(s=!0,i=null,n=null,r.onBlur(),s=!1)},{capture:!0,signal:c}),t.addEventListener("focus",u=>{s||a||(a=!0,r.onFocus(),a=!1)},{capture:!0,signal:c}),{dispose:()=>l.abort(),cancelComposition:()=>{o&&(t.blur(),requestAnimationFrame(()=>t.focus({preventScroll:!0})))},blur:()=>{typeof t.blur=="function"&&t.blur()},focus:()=>{!a&&typeof t.focus=="function"&&t.focus({preventScroll:!0})},hasFocus:()=>On()===t,setAriaLabel:u=>t.setAttribute("aria-label",u),setValue:u=>{var d;t.textContent=u,t.style.left="-1000px",(d=window.getSelection())==null||d.selectAllChildren(t)},moveTo:(u,d)=>{t.style.top=`${d}px`,t.style.left=`${u}px`}}}function yr(t){var r;if(!t||!gr(t))return"";let e;return t.key==="Unidentified"&&t.target&&(e=t.target.value),e=(r=e!=null?e:t.key)!=null?r:t.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e}function wa(t){t=nm(t);let e=[];return t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),t.altKey&&e.push("alt"),t.shiftKey&&e.push("shift"),e.length===0?`[${t.code}]`:(e.push(`[${t.code}]`),e.join("+"))}function Vh(t){if(pe()){let e=mt(),r=t.startsWith("!"),i=t.endsWith(e);if(r&&!i||!r&&i)return!0}return t==="!other"?!1:t==="other"}function um(t,e,r){if(t.length===0)return"";let i=Vr(ol(wa(r))),n=Vr({key:r.key,shift:r.shiftKey,alt:r.altKey,ctrl:r.ctrlKey,meta:r.metaKey||r.ctrlKey&&/macos|ios/.test(mt()),cmd:!1,win:!1});for(let o=t.length-1;o>=0;o--)if((t[o].key===i||t[o].key===n)&&(!t[o].ifMode||t[o].ifMode===e))return t[o].command;return""}function cm(t){let e=t;return ee(e)&&(e=e.length>0?e[0]+"("+e.slice(1).join("")+")":""),e}function dm(t,e){let r=[];if(typeof e=="string"){let o=v0[e];ee(o)?r=o.slice():o&&r.push(o)}let i=cm(e),n=new RegExp("^"+i.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(let o of t)n.test(cm(o.command))&&r.push(o.key);return r.map(Ni)}function $h(t,e){if(t.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(t.ifPlatform))throw new Error(`Unexpected platform "${t.ifPlatform}" for keybinding ${t.key}`);if(t.ifLayout!==void 0&&(e.score===0||!t.ifLayout.includes(e.id)))return;let r=ol(t.key),i=t.ifPlatform;if(r.cmd){if(i&&i!=="macos"&&i!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+i+`" +"cmd" modifier can only be used with macOS or iOS platform.`);i||(i=mt()==="ios"?"ios":"macos"),r.win=!1,r.cmd=!1,r.meta=!0}if(r.win){if(i&&i!=="windows")throw new Error('Unexpected "win" modifier with platform "'+i+`" +"win" modifier can only be used with Windows platform.`);i="windows",r.win=!1,r.cmd=!1,r.meta=!0}if(i&&!Vh(i))return;if(/^\[.+\]$/.test(r.key))return g(p({},t),{key:Vr(r)});let n=im(r.key,e);if(!n)return g(p({},t),{key:Vr(r)});if(n.shift&&r.shift||n.alt&&r.alt)throw new Error(`The keybinding ${t.key} (${ll(t.command)}) is conflicting with the key combination ${Vr(n)} using the ${e.displayName} keyboard layout`);return n.shift=n.shift||r.shift,n.alt=n.alt||r.alt,n.meta=r.meta,n.ctrl=r.ctrl,g(p({},t),{key:Vr(n)})}function ll(t){if(Array.isArray(t)){let e=[...t];return e.shift()+"("+e.map(r=>typeof r=="string"?`"${r}"`:r.toString()).join(", ")+")"}return t}function mm(t,e){let r=[],i=[];for(let n of t)try{let o=$h(n,e);if(!o)continue;let a=i.find(s=>s.key===o.key&&s.ifMode===o.ifMode);if(a)throw new Error(`Ambiguous key binding ${n.key} (${ll(n.command)}) matches ${a.key} (${ll(a.command)}) with the ${e.displayName} keyboard layout`);i.push(o)}catch(o){o instanceof Error&&r.push(o.message)}return[i,r]}var cl=class extends N{constructor(){super("latex")}createAtom(e){return new Z(e)}onPaste(e,r){if(!r)return!1;let i=typeof r=="string"?r:r.getData("application/x-latex")||r.getData("text/plain");return i&&e.model.contentWillChange({inputType:"insertFromPaste",data:i})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,i)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),W(e)),e.startRecording(),!0):!1}insert(e,r,i){if(!e.contentWillChange({data:r,inputType:"insertText"}))return!1;i||(i={}),i.insertionMode||(i.insertionMode="replaceSelection"),i.selectionMode||(i.selectionMode="placeholder");let{silenceNotifications:n}=e;i.silenceNotifications&&(e.silenceNotifications=!0);let o=e.silenceNotifications;e.silenceNotifications=!0,i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Y(e.selection)):i.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):i.insertionMode==="insertBefore"?e.collapseSelection("backward"):i.insertionMode==="insertAfter"&&e.collapseSelection("forward");let a=[];for(let c of r)mc.test(c)&&a.push(new Z(c));let s=e.at(e.position);if(s instanceof _t&&(s=s.lastChild),!(s.parent instanceof _t)){let c=new _t("");s.parent.addChildAfter(c,s),s=c.firstChild}let l=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=o,i.selectionMode==="before"||(i.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(l)):l&&(e.position=e.offsetOf(l))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=n,!0}};function pm(t){return t.atoms.find(e=>e.type==="latexgroup")}function $r(t){var r,i;let e=t.atoms.find(n=>n.type==="latexgroup");return e?(i=(r=e.body)==null?void 0:r.filter(n=>n.type==="latex"))!=null?i:[]:[]}function ka(t,e){var s;let r=0,i=!1,n=Number.isFinite(e==null?void 0:e.before)?(s=e==null?void 0:e.before)!=null?s:0:t.lastOffset;for(;r<=n&&!i;){let l=t.at(r);i=l instanceof Z&&l.isSuggestion,i||r++}if(!i)return[void 0,void 0];let o=r,a=!1;for(;o<=n&&!a;){let l=t.at(o);a=!(l instanceof Z&&l.isSuggestion),a||o++}return[r-1,o-1]}new cl;function qr(t){let e=$r(t.model).filter(r=>r.isSuggestion);if(e.length!==0){t.model.position=t.model.offsetOf(e[0].leftSibling);for(let r of e)r.parent.removeChild(r)}}function br(t,e){var c;let{model:r}=t;qr(t);for(let u of $r(r))u.isError=!1;if(!r.selectionIsCollapsed||t.options.popoverPolicy==="off"){Fi(t);return}let i=[],n=r.at(r.position);for(;n&&n instanceof Z&&/^[a-zA-Z\*]$/.test(n.value);)n=n.leftSibling;if(n&&n instanceof Z&&n.value==="\\")for(i.push(n),n=n.rightSibling;n&&n instanceof Z&&/^[a-zA-Z\*]$/.test(n.value);)i.push(n),n=n.rightSibling;let o=i.map(u=>u.value).join(""),a=hc(t,o);if(a.length===0){if(/^\\[a-zA-Z\*]+$/.test(o))for(let u of i)u.isError=!0;Fi(t);return}let s=(c=e==null?void 0:e.atIndex)!=null?c:0;t.suggestionIndex=s<0?a.length-1:s%a.length;let l=a[t.suggestionIndex];if(l!==o){let u=i[i.length-1];u.parent.addChildrenAfter([...l.slice(o.length-l.length)].map(d=>new Z(d,{isSuggestion:!0})),u),at(t,{interactive:!0})}hm(t,a)}function ul(t){let[e,r]=ka(t,{before:t.position});if(e===void 0||r===void 0)return!1;let i=!1;return t.getAtoms([e,r]).forEach(n=>{n.isSuggestion&&(n.isSuggestion=!1,i=!0)}),i}function xr(t,e="accept",r){var s,l;Fi(t);let i=pm(t.model);if(!i)return!1;if(e==="accept-suggestion"){let c=$r(t.model).filter(u=>u.isSuggestion);if(c.length===0)return!1;for(let u of c)u.isSuggestion=!1;return t.model.position=t.model.offsetOf(c[c.length-1]),!0}let o=$r(t.model).filter(c=>!c.isSuggestion).map(c=>c.value).join(""),a=i.leftSibling;return i.parent.removeChild(i),t.model.position=t.model.offsetOf(a),t.model.mode=(s=r==null?void 0:r.mode)!=null?s:"math",e==="reject"||(N.insert(t.model,o,{selectionMode:(l=r==null?void 0:r.selectItem)!=null&&l?"item":"placeholder",format:"latex",mode:"math"}),t.snapshot(),t.model.announce("replacement"),t.switchMode("math")),!0}function Hr(t){var r;let e=document.getElementById(t);return e?e.dataset.refcount=Number(Number.parseInt((r=e.dataset.refcount)!=null?r:"0")+1).toString():(e=document.createElement("div"),e.setAttribute("aria-hidden","true"),e.dataset.refcount="1",e.id=t,document.body.append(e)),e}function Vi(t){var i;let e=document.getElementById(t);if(!e)return;let r=Number.parseInt((i=e.getAttribute("data-refcount"))!=null?i:"0");r<=1?e.remove():e.dataset.refcount=Number(r-1).toString()}function qh(t,e){let r=new T({from:t.context}),i=new y({mode:"math",type:"root",body:ne(e,{context:r})}),n=or(At(new w(i.render(r),{classes:"ML__base"}),r));return ar(n,{classes:"ML__mathlive"}).toMarkup()}function hm(t,e){var n;if(e.length===0){Fi(t);return}let r="";for(let[o,a]of e.entries()){let s=a,l=qh(t,a),c=dm(t.keybindings,s).join("
");r+=`
  • ${s}${l}`,c&&(r+=`${c}`),r+="
  • "}let i=Hh(t,`
      ${r}
    `);dl()&&((n=i.querySelector(".ML__popover__current"))==null||n.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var o;i&&!dl()&&(i.classList.add("is-visible"),$i(t),(o=i.querySelector(".ML__popover__current"))==null||o.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function dl(){let t=document.getElementById("mathlive-suggestion-popover");return t?t.classList.contains("is-visible"):!1}function $i(t,e){var d;if(!t.element||t.element.mathfield!==t||!dl())return;if(((d=t.model.at(t.model.position))==null?void 0:d.type)!=="latex"){Fi(t);return}if(e!=null&&e.deferred){setTimeout(()=>$i(t),32);return}let r=Ai(t.field);if(!r)return;let i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerWidth-document.documentElement.clientWidth,a=window.innerHeight-document.documentElement.clientHeight,s=window.mathVirtualKeyboard.boundingRect.height,l=document.getElementById("mathlive-suggestion-popover");r.x+l.offsetWidth/2>n-o?l.style.left=`${n-l.offsetWidth-o}px`:r.x-l.offsetWidth/2<0?l.style.left="0":l.style.left=`${r.x-l.offsetWidth/2}px`;let c=r.y-r.height;i-a-s-r.yi.preventDefault()),r.addEventListener("click",i=>{let n=i.target;for(;n&&!n.dataset.command;)n=n.parentElement;n&&(xr(t,"reject"),N.insert(t.model,n.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),t.dirty=!0,t.focus())})),r.innerHTML=window.MathfieldElement.createHTML(e),r}function fm(){document.getElementById("mathlive-suggestion-popover")&&(Vi("mathlive-suggestion-popover"),We("suggestion-popover"),We("core"))}function Wh(){let t=String(new Error().stack).replace(/^Error.*\n/,"").split(` +`);if(t.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let e=t[1],r=e.match(/http.*\.ts[\?:]/);return r&&(e=t[2]),r=e.match(/(https?:.*):[0-9]+:[0-9]+/),r||(r=e.match(/at (.*(\.ts))[\?:]/),r||(r=e.match(/at (.*(\.mjs|\.js))[\?:]/))),r?r[1]:(console.error(t),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${e}").`),"")}var zn=null,gm,ym,ml=((ym=(gm=globalThis==null?void 0:globalThis.document)==null?void 0:gm.currentScript)==null?void 0:ym.src)||Wh();async function Ma(t){if(/^(?:[a-z+]+:)?\/\//i.test(t))return new URL(t).href;if(zn===null)try{let e=await fetch(ml,{method:"HEAD"});e.status===200&&(zn=e.url)}catch(e){console.error(`Invalid URL "${t}" (relative to "${ml}")`)}return new URL(t,zn!=null?zn:ml).href}function Uh(t,e,r={}){return new FontFace(t,`url(${e}.woff2) format('woff2')`,r)}var De="not-loaded";async function bm(){return De="not-loaded",Wr()}async function Wr(){var e;if(De!=="not-loaded")return;if(De="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){De="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){let r=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],i=Array.from(document.fonts).map(a=>a.family);if(r.every(a=>i.includes(a))){De="ready";return}if(!window.MathfieldElement.fontsDirectory){De="not-loaded";return}let n=await Ma(window.MathfieldElement.fontsDirectory);if(!n){document.body.classList.add("ML__fonts-did-not-load"),De="error";return}let o=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(a=>Uh(a[0].replace(/-[a-zA-Z]+$/,""),`${n}/${a[0]}`,a[1]));try{(await Promise.all(o.map(s=>{try{return s.load()}catch(l){}}))).forEach(s=>document.fonts.add(s)),De="ready";return}catch(a){console.error(`MathLive 0.97.2: The math fonts could not be loaded from "${n}"`,{cause:a}),document.body.classList.add("ML__fonts-did-not-load")}De="error"}}function jh(t){let e=0;for(let r=0;r{Bt(t)&&t.dirty&&(t.atomBoundsCache=new Map,at(t,e),t.atomBoundsCache=void 0)})))}function Jh(t,e){var o;e=e!=null?e:{};let r=new T({from:g(p({},t.context),{atomIdsSettings:{seed:e.forHighlighting?jh(y.serialize([t.model.root],{expandMacro:!1,defaultMode:t.options.defaultMode})):"random",groupNumbers:(o=e.forHighlighting)!=null?o:!1},letterShapeStyle:t.options.letterShapeStyle}),mathstyle:t.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),i=t.model.root.render(r);return ar(At(i,r),{classes:t.hasEditablePrompts?"ML__mathlive ML__prompting":"ML__mathlive",attributes:{translate:"no","aria-hidden":"true"}})}function pl(t,e){let{model:r}=t;r.root.caret=void 0,r.root.isSelected=!1,r.root.containsCaret=!0;for(let n of r.atoms)n.caret=void 0,n.isSelected=!1,n.containsCaret=!1;if(r.selectionIsCollapsed){if(t.isSelectionEditable&&t.hasFocus()){let o=r.at(r.position);o.caret=t.model.mode;let a=o.parent;for(;a;)a.containsCaret=!0,a=a.parent}}else{let n=r.getAtoms(r.selection,{includeChildren:!0});for(let o of n)o.isSelected=!0}return Jh(t,e).toMarkup()}function at(t,e){var a;if(!Bt(t))return;e!=null||(e={});let r=(a=t.element)==null?void 0:a.querySelector("[part=virtual-keyboard-toggle]");r&&(r.style.display=t.hasEditableContent?"flex":"none");let i=t.field,n=t.isSelectionEditable&&t.hasFocus(),o=i.classList.contains("ML__focused");o&&!n?i.classList.remove("ML__focused"):!o&&n&&i.classList.add("ML__focused"),i.innerHTML=window.MathfieldElement.createHTML(pl(t,e)),t.fieldContent=i.getElementsByClassName("ML__mathlive")[0],In(t,e.interactive),t.dirty=!1}function In(t,e){let r=t.field;if(!r)return;for(let s of r.querySelectorAll(".ML__selection, .ML__contains-highlight"))s.remove();!(e!=null&&e)&&De!=="error"&&De!=="ready"&&setTimeout(()=>{De==="ready"?In(t):setTimeout(()=>In(t),128)},32);let i=t.model,n=parseFloat(getComputedStyle(r).width),a=r.getBoundingClientRect().width/n;if(a=isNaN(a)?1:a,i.selectionIsCollapsed){$i(t,{deferred:!0});let s=i.at(i.position);for(;s&&!(s.containsCaret&&s.displayContainsHighlight);)s=s.parent;if(s!=null&&s.containsCaret&&s.displayContainsHighlight){let l=Zs(t,dr(t,s),a);if(l){l.left/=a,l.right/=a,l.top/=a,l.bottom/=a;let c=document.createElement("div");c.classList.add("ML__contains-highlight"),c.style.position="absolute",c.style.left=`${l.left}px`,c.style.top=`${l.top}px`,c.style.width=`${Math.ceil(l.right-l.left)}px`,c.style.height=`${Math.ceil(l.bottom-l.top-1)}px`,r.insertBefore(c,r.childNodes[0])}}return}for(let s of Gh(ua(t,{excludeAtomsWithBackground:!0}))){s.left/=a,s.right/=a,s.top/=a,s.bottom/=a;let l=document.createElement("div");l.classList.add("ML__selection"),l.style.position="absolute",l.style.left=`${s.left}px`,l.style.top=`${s.top}px`,l.style.width=`${Math.ceil(s.right-s.left)}px`,l.style.height=`${Math.ceil(s.bottom-s.top-1)}px`,r.insertBefore(l,r.childNodes[0])}}function Gh(t){let e=[];for(let r of t){let i=!1;for(let n of e)if(r.left===n.left&&r.right===n.right&&r.top===n.top&&r.bottom===n.bottom){i=!0;break}i||e.push(r)}t=e,e=[];for(let r of t){let i=0;for(let n of t)if(r.left>=n.left&&r.right<=n.right&&r.top>=n.top&&r.bottom<=n.bottom&&(i+=1,i>1))break;i===1&&e.push(r)}return e}var hl=3,st;function oe(t,e){e=p({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},e!=null?e:{}),st||(st={});for(let r of Object.keys(t))st[r],st[r]=g(p({},e),{fn:t[r]})}function fl(t){let e;if(Array.isArray(t)){if(t[0]==="performWithFeedback")return fl(t[1]);e=t[0]}else e=t;return e=e.replace(/-\w/g,r=>r[1].toUpperCase()),st[e]}function Rt(t){var e;return(e=fl(t))==null?void 0:e.target}function xm(t,e){var l;if(!e)return!1;let r,i=[],n=!1,o=!1;ee(e)?(r=e[0],i=e.slice(1)):r=e,r=r.replace(/-\w/g,c=>c[1].toUpperCase());let a=st[r],s=a==null?void 0:a.target;if(s==="model"){if(!t.isSelectionEditable&&(a!=null&&a.changeContent))return t.model.announce("plonk"),!1;/^(delete|add)/.test(r)&&(r!=="deleteBackward"&&t.flushInlineShortcutBuffer(),t.snapshot(r)),/^complete/.test(r)||qr(t),st[r].fn(t.model,...i),br(t),o=!0,n=!0}else if(s==="virtual-keyboard")o=(l=window.mathVirtualKeyboard.executeCommand(e))!=null?l:!1,n=!0;else if(st[r]){if(!t.isSelectionEditable&&(a!=null&&a.changeContent))return t.model.announce("plonk"),!1;/^(undo|redo)/.test(r)&&t.flushInlineShortcutBuffer(),o=st[r].fn(t,...i),n=!0}else throw new Error(`Unknown command "${r}"`);return s!=="virtual-keyboard"&&(!t.model.selectionIsCollapsed||a!=null&&a.changeSelection&&e!=="deleteBackward")&&(t.flushInlineShortcutBuffer(),a!=null&&a.changeContent||t.stopCoalescingUndo(),t.style={}),o&&W(t),n}function Xh(t,e){var n;if(!t)return!1;t.focus(),qi.keypressVibration&&oo()&&navigator.vibrate(hl);let r=fl(e);window.MathfieldElement.playSound((n=r==null?void 0:r.audioFeedback)!=null?n:"keypress");let i=t.executeCommand(e);return t.scrollIntoView(),i}oe({performWithFeedback:(t,e)=>Xh(t,e)});function Zh(t){return br(t,{atIndex:t.suggestionIndex+1}),!1}function Yh(t){return br(t,{atIndex:t.suggestionIndex-1}),!1}oe({complete:xr},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0});oe({nextSuggestion:Zh,previousSuggestion:Yh},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Nn="mathlive#virtual-keyboard-message";function Fn(t){var r;return t.type!=="message"?!1:((r=t.data)==null?void 0:r.type)===Nn}var Rn=class t{constructor(){this.targetOrigin=window.origin;this.originValidator="none";this._boundingRect=new DOMRect(0,0,0,0);this._isShifted=!1;window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new t),this._singleton}set alphabeticLayout(e){this.sendMessage("update-setting",{alphabeticLayout:e})}set layouts(e){this.sendMessage("update-setting",{layouts:e})}get normalizedLayouts(){return[]}set editToolbar(e){this.sendMessage("update-setting",{editToolbar:e})}set actionKeycap(e){this.sendMessage("update-setting",{actionKeycap:e})}set shiftKeycap(e){this.sendMessage("update-setting",{shiftKeycap:e})}set backspaceKeycap(e){this.sendMessage("update-setting",{backspaceKeycap:e})}set tabKeycap(e){this.sendMessage("update-setting",{tabKeycap:e})}set container(e){throw new Error("Container inside an iframe cannot be changed")}show(e){this.sendMessage("show",e)}hide(e){this.sendMessage("hide",e)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(e){e?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(e){return this.sendMessage("execute-command",{command:e}),!0}updateToolbar(e){this.sendMessage("update-toolbar",e)}update(e){this.sendMessage("update-setting",e)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(e,r,i){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].has(r)||this.listeners[e].add(r)}dispatchEvent(e){return!this.listeners[e.type]||this.listeners[e.type].size===0?!0:(this.listeners[e.type].forEach(r=>{typeof r=="function"?r(e):r==null||r.handleEvent(e)}),!e.defaultPrevented)}removeEventListener(e,r,i){this.listeners[e]&&this.listeners[e].delete(r)}handleEvent(e){if(Fn(e)){if(!Li(e.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");this.handleMessage(e.data)}}handleMessage(e){let{action:r}=e;if(r==="execute-command"){let{command:i}=e;Rt(i)==="virtual-keyboard"&&this.executeCommand(i);return}if(r==="synchronize-proxy"){this._boundingRect=e.boundingRect,this._isShifted=e.isShifted;return}if(r==="geometry-changed"){this._boundingRect=e.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(e,r={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(p({type:Nn,action:e},r),this.targetOrigin)}};var gl={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"φ",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"ς",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"ϵ",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"ρ",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"τ",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"υ",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"θ",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"ι",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"ο",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"π",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"α",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"σ",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"δ",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{label:"φ",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"γ",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"η",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"ξ",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"κ",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"λ",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"ζ",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"χ",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"ψ",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"ω",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"β",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"ν",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"μ",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"ε",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"ϑ",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"ϰ",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"ϖ",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"ϱ",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{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:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:` + .minimalist-backdrop { + display: flex; + justify-content: center; + } + .minimalist-container { + --keycap-height: 40px; + --keycap-max-width: 53px; + --keycap-small-font-size: 12px; + background: var(--keyboard-background); + padding: 20px; + border-top-left-radius: 8px; + border-top-right-radius: 8px; + border: 1px solid var(--keyboard-border); + box-shadow: 0 0 32px rgb(0 0 0 / 30%); + } + `,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}};var _a={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"}],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:"\\mathbb{N}",aside:"set of natural numbers"}],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    \u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space
    \xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space
    \u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space
    \u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Hi;function Sa(t,e){var m,h,f;let r=ke.singleton;if(!r)return;let i=Ur(t),n=(h=(m=r.getKeycap(i==null?void 0:i.id))==null?void 0:m.variants)!=null?h:"";if(typeof n=="string"&&!yl(n)||Array.isArray(n)&&n.length===0){e==null||e();return}let o={},a="";for(let x of ef(n)){let M=bl(x),b=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);o[b]=M;let[k,_]=Wi(M);a+=`
    ${k}
    `}let s=document.createElement("div");s.setAttribute("aria-hidden","true"),s.className="MLK__variant-panel",s.style.height="auto";let l=Object.keys(o).length,c=5;l===1?c=1:l===2||l===4?c=2:l===3||l===5||l===6?c=3:l>=7&&l<14&&(c=4),s.style.width=`calc(var(--variant-keycap-length) * ${c} + 12px)`,s.innerHTML=qi.createHTML(a),Te.scrim||(Te.scrim=new Te),Te.scrim.open({root:(f=r==null?void 0:r.container)==null?void 0:f.querySelector(".ML__keyboard"),child:s}),Hi=new AbortController;let{signal:u}=Hi,d=t==null?void 0:t.getBoundingClientRect();if(d){d.top-s.clientHeight<0&&(s.style.width="auto",l<=6?s.style.height="56px":l<=12?s.style.height="108px":l<=18?s.style.height="205px":s.classList.add("compact"));let x=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(d.left+d.right-s.offsetWidth)/2)),M=d.top-s.clientHeight+5;s.style.transform=`translate(${x}px, ${M}px)`,s.classList.add("is-visible"),requestAnimationFrame(()=>{s.addEventListener("pointerup",b=>{let k=Ur(b.target);!(k!=null&&k.id)||!o[k.id]||(Aa(o[k.id]),jr(),e==null||e(),b.preventDefault())},{capture:!0,passive:!1,signal:u}),s.addEventListener("pointerenter",b=>{let k=Ur(b.target);!(k!=null&&k.id)||!o[k.id]||k.classList.add("is-active")},{capture:!0,signal:u}),s.addEventListener("pointerleave",b=>{let k=Ur(b.target);!(k!=null&&k.id)||!o[k.id]||k.classList.remove("is-active")},{capture:!0,signal:u}),window.addEventListener("pointercancel",()=>{jr(),e==null||e()},{signal:u}),window.addEventListener("pointerup",()=>{jr(),e==null||e()},{signal:u})})}}function jr(){var t;Hi==null||Hi.abort(),Hi=null,(t=Te.scrim)==null||t.close()}function Qh(t){if(t==="foreground-color"){let e=[];for(let r of Object.keys(Wt))e.push({class:"swatch-button",label:'',command:["applyStyle",{color:r}]});return e}if(t==="background-color"){let e=[];for(let r of Object.keys(Ht))e.push({class:"swatch-button",label:'',command:["applyStyle",{backgroundColor:r}]});return e}}function yl(t){return _a[t]!==void 0}function ef(t){var e;return typeof t!="string"?t:(_a[t]||(_a[t]=(e=Qh(t))!=null?e:[]),_a[t])}function tf(t){return typeof t=="string"?t:Object.entries(t).map(([e,r])=>`${e}:${r} !important`).join(";")}function rf(t){return Object.keys(t).map(e=>`${e} {${tf(t[e])}}`).join("")}function Vn(t){if(!t)return"";let e=new T,r=new y({mode:"math",type:"root",body:ne(t,{context:e,args:n=>n==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),i=or(At(new w(r.render(e),{classes:"ML__base"}),e));return ar(i,{classes:"ML__mathlive"}).toMarkup()}function $n(t){var r;if(Array.isArray(t))return t.map(i=>$n(i)).flat();let e=typeof t=="string"?{markup:t}:t;return"rows"in e&&Array.isArray(e.rows)&&(e.rows=e.rows.map(i=>i.map(n=>bl(n)))),(r=e.id)!=null||(e.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[e]}function nf(){var o,a;let e=window.mathVirtualKeyboard.alphabeticLayout;if(e==="auto"){let s=fr();s&&(e=s.virtualLayout),(!e||e==="auto")&&(e=(o={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[O.locale.slice(0,2)])!=null?o:"qwerty")}let r={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},i=(a=r[e])!=null?a:r.qwerty,n=[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(let s of i){let l=[];for(let c of s)/[a-z]/.test(c)?l.push({label:c,class:"hide-shift",shift:{label:c.toUpperCase()},variants:yl(c)?c:void 0}):c==="~"?e!=="dvorak"?l.push("[backspace]"):l.push({label:"[backspace]",width:1}):c==="^"?l.push("[shift]"):c===" "&&l.push("[separator-5]");n.push(l)}return n.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:$n({rows:n})}}function xl(t){if(t==="alphabetic")return nf();if(typeof t=="string")return gl[t],`${t}`,xl(gl[t]);let e;if("rows"in t&&Array.isArray(t.rows)){"layers"in t||"markup"in t;let n=t,{rows:a}=n,s=si(n,["rows"]);e=g(p({},s),{layers:$n({rows:t.rows})})}else if("markup"in t&&typeof t.markup=="string"){let o=t,{markup:a}=o,s=si(o,["markup"]);e=g(p({},s),{layers:$n(t.markup)})}else e=p({},t),"layers"in t?e.layers=$n(t.layers):console.error('MathLive 0.97.2: provide either a "rows", "markup" or "layers" property');let r=!1,i=!1;for(let a of e.layers)if(a.rows)for(let s of a.rows.flat()){Ui(s)&&(r=!0);let l=s.command;typeof l=="string"&&["undo","redo","cut","copy","paste"].includes(l)&&(i=!0)}return(!("displayShiftedKeycaps"in t)||t.displayShiftedKeycaps===void 0)&&(e.displayShiftedKeycaps=r),(!("displayEditToolbar"in t)||t.displayEditToolbar===void 0)&&(e.displayEditToolbar=!i),e}function of(t,e){var i,n;let r='
    ';if(t.normalizedLayouts.length>1)for(let[o,a]of t.normalizedLayouts.entries()){let s=a,l=[o===e?"selected":"layer-switch"];s.tooltip&&l.push("MLK__tooltip"),s.labelClass&&l.push(...s.labelClass.split(" ")),r+=`
    ${(n=s.label)!=null?n:"untitled"}
    `}return r+="
    ",r}function vm(t,e){let r="";if(t.editToolbar==="none")return"";let n=[];e.selectionIsCollapsed?n.push("undo","redo","pasteFromClipboard"):n.push("cutToClipboard","copyToClipboard","pasteFromClipboard");let o={undo:`
    + +
    `,redo:`
    + +
    `,cutToClipboard:` +
    + +
    + `,copyToClipboard:` +
    + +
    + `,pasteFromClipboard:` +
    + +
    + `};return r+=n.map(a=>o[a]).join(""),r}function af(t){for(let e of t)sf(e)}function sf(t){let e=ke.singleton;if(!e)return;let r={};if(!t.id){if(t.hasAttribute("data-label")&&(r.label=t.dataset.label),t.hasAttribute("data-latex")&&(r.latex=t.dataset.latex),t.hasAttribute("data-key")&&(r.key=t.dataset.key),t.hasAttribute("data-insert")&&(r.insert=t.dataset.insert),t.hasAttribute("data-variants")&&(r.variants=t.dataset.variants),t.hasAttribute("data-aside")&&(r.aside=t.dataset.aside),t.className&&(r.class=t.className),!r.label&&!r.latex&&!r.key&&!r.insert&&(r.latex=t.innerText,r.label=t.innerHTML),t.hasAttribute("data-command"))try{r.command=JSON.parse(t.dataset.command)}catch(i){}t.id=e.registerKeycap(r)}if(!t.innerHTML){let[i,n]=Wi(r);t.innerHTML=window.MathfieldElement.createHTML(i)}}function lf(){Oe("virtual-keyboard"),Oe("core"),Wr()}function wm(){We("core"),We("virtual-keyboard")}var cf=` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;function km(t){t.resetKeycapRegistry(),lf();let e=document.createElement("div");e.className="ML__keyboard";let r=document.createElement("div");r.className="MLK__plate",r.innerHTML=window.MathfieldElement.createHTML(cf+t.normalizedLayouts.map((a,s)=>uf(t,a,s)).join(""));let i=document.createElement("div");i.className="MLK__backdrop",i.appendChild(r),e.appendChild(i),e.addEventListener("pointerdown",mf,{passive:!1});let n=e.querySelectorAll(".ML__edit-toolbar");if(n)for(let a of n)a.addEventListener("click",s=>{var u,d;let l=s.target,c="";for(;l&&!c;)c=(u=l==null?void 0:l.getAttribute("data-command"))!=null?u:"",l=(d=l==null?void 0:l.parentElement)!=null?d:null;c&&t.executeCommand(JSON.parse(c))});af(e.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));let o=e.querySelectorAll(".MLK__layer");o.length>0;for(let a of o)a.addEventListener("pointerdown",s=>s.preventDefault());return t.currentLayer=t.latentLayer,e}function uf(t,e,r){let i=[];if(!("layers"in e))return"";for(let n of e.layers)i.push(`
    `),(t.normalizedLayouts.length>1||e.displayEditToolbar)&&(i.push("")),i.push(df(t,n)),i.push("
    ");return i.join("")}function df(t,e){if(typeof e=="string")return e;let r="";if(typeof e.style=="string"?r+=``:typeof e.style=="object"&&(r+=``),e.backdrop&&(r+=`
    `),e.container&&(r+=`
    `),e.rows){r+="
    ";for(let i of e.rows){r+="
    ";for(let n of i)if(n){let o=t.registerKeycap(n),[a,s]=Wi(n);/(^|\s)separator/.test(s)?r+=`
    ${a}
    `}r+="
    "}r+="
    "}else e.markup&&(r+=e.markup);return e.container&&(r+="
    "),e.backdrop&&(r+="
    "),r}function Wi(t,e={shifted:!1}){var n,o,a,s,l,c,u;let r="",i=(n=t.class)!=null?n:"";if(e.shifted&&Ui(t)&&(i+=" is-active"),e.shifted&&"shift"in t)typeof t.shift=="string"?r=Vn(t.shift):typeof t.shift=="object"&&(r=t.shift.label?t.shift.label:(o=Vn(t.shift.latex||t.shift.insert||"")||t.shift.key)!=null?o:""),typeof t.shift=="object"&&(i=(s=(a=t.shift.class)!=null?a:t.class)!=null?s:"");else{if(r=t.label?t.label:(l=Vn(t.latex||t.insert||"")||t.key)!=null?l:"",t.shift){let d;typeof t.shift=="string"?d=Vn(t.shift):t.shift.label?d=t.shift.label:d=(c=Vn(t.shift.latex||t.shift.insert||"")||t.shift.key)!=null?c:"",r+=`${d}`}t.aside&&(r+=``)}return t.layer&&!/layer-switch/.test(i)&&(i+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(i)||(i+=" MLK__keycap"),!/\bw[0-9]+\b/.test(i)&&t.width&&(i+=(u={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[t.width])!=null?u:""),[r,i||"MLK__keycap"]}var Jr={"[left]":{class:"action hide-shift",label:"",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"",command:["performWithFeedback","moveToNextChar"],shift:{label:"",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:""},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"",command:["performWithFeedback","addRowAfter"]},width:1.5,label:""},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:""},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"",shift:{class:"action warning",label:"",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:""},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:""},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:""}};function bl(t){var r;if(typeof t=="string"){if(!Jr[t])return{latex:t};t={label:t}}let e;return"label"in t&&t.label&&Jr[t.label]&&(e=g(p(p({},Jr[t.label]),t),{label:Jr[t.label].label})),"key"in t&&t.key&&Jr[t.key]&&(e=g(p(p({},Jr[t.key]),t),{key:Jr[t.key].key})),e?(e.command==="insertDecimalSeparator"&&(e.label=(r=window.MathfieldElement.decimalSeparator)!=null?r:"."),t.label==="[action]"&&(e=p(p({},e),window.mathVirtualKeyboard.actionKeycap)),t.label==="[shift]"&&(e=p(p({},e),window.mathVirtualKeyboard.shiftKeycap)),t.label==="[backspace]"&&(e=p(p({},e),window.mathVirtualKeyboard.backspaceKeycap)),t.label==="[tab]"&&(e=p(p({},e),window.mathVirtualKeyboard.tabKeycap)),e):t}var qn;function mf(t){var a;if(t.button!==0)return;let e=ke.singleton;if(!e)return;let r=t.target;for(;r&&!r.getAttribute("data-layer");)r=r.parentElement;if(r){e.currentLayer=(a=r.getAttribute("data-layer"))!=null?a:"",t.preventDefault();return}let i=Ur(t.target);if(!(i!=null&&i.id))return;let n=e.getKeycap(i.id);if(!n)return;t.type;let o=new AbortController;i.classList.add("is-pressed"),i.addEventListener("pointerenter",La(o),{capture:!0,signal:o.signal}),i.addEventListener("pointerleave",La(o),{capture:!0,signal:o.signal}),i.addEventListener("pointercancel",La(o),{signal:o.signal}),i.addEventListener("pointerup",La(o),{signal:o.signal}),Ui(n)&&(i.classList.add("is-active"),e.shiftPressCount++),n.variants&&(qn&&clearTimeout(qn),qn=setTimeout(()=>{i.classList.contains("is-pressed")&&(i.classList.remove("is-pressed"),i.classList.add("is-active"),t.target&&"releasePointerCapture"in t.target&&t.target.releasePointerCapture(t.pointerId),Sa(i,()=>{o.abort(),i==null||i.classList.remove("is-active")}))},300)),t.preventDefault()}function La(t){return e=>{let r=Ur(e.target);if(!(r!=null&&r.id))return;let i=ke.singleton;if(!i)return;let n=i.getKeycap(r.id);if(n){if(e.type==="pointerenter"&&e.target===r&&e.isPrimary&&r.classList.add("is-pressed"),e.type==="pointercancel"){r.classList.remove("is-pressed"),Ui(n)&&(i.shiftPressCount--,r.classList.toggle("is-active",i.isShifted)),t.abort();return}if(e.type==="pointerleave"&&e.target===r){r.classList.remove("is-pressed"),Ui(n)&&(i.shiftPressCount--,r.classList.toggle("is-active",i.isShifted));return}if(e.type==="pointerup"){qn&&clearTimeout(qn),Ui(n)?r.classList.toggle("is-active",i.isShifted):r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),i.isShifted&&n.shift?typeof n.shift=="string"?i.executeCommand(["insert",n.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex",resetStyle:!0}]):Aa(n.shift):Aa(n),i.shiftPressCount===1&&!e.shiftKey&&(i.shiftPressCount=0)),t.abort(),e.preventDefault();return}}}}function Aa(t){var r;let e=t.command;!e&&t.insert&&(e=["insert",t.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex",resetStyle:!0}]),!e&&t.key&&(e=["typedText",t.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!e&&t.latex&&(e=["insert",t.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex",resetStyle:!0}]),e||(e=["typedText",t.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(r=ke.singleton)==null||r.executeCommand(e)}function pf(t){if(t.nodeType!==1)return!1;let e=t.classList;return e.contains("MLK__keycap")||e.contains("shift")||e.contains("action")||e.contains("fnbutton")||e.contains("bigfnbutton")}function Ur(t){if(!t)return;let e=t;for(;e&&!pf(e);)e=e.parentElement;return e!=null?e:void 0}function Ui(t){return!!t.class&&/(^|\s)shift($|\s)/.test(t.class)}var ke=class t{constructor(){this.originalContainerBottomPadding=null;this.keycapRegistry={};this._shiftPressCount=0;var e,r,i;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(r=(e=window.document)==null?void 0:e.body)!=null?r:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(n=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(i=window.top)==null||i.addEventListener("message",this)}catch(n){window.addEventListener("message",this)}document.body.addEventListener("focusin",n=>{var a;let o=n.target;if(o!=null&&o.isConnected&&((a=o.tagName)==null?void 0:a.toLowerCase())==="math-field"&&nc()){let s=o;s.mathVirtualKeyboardPolicy==="auto"&&!s.readOnly&&this.show({animate:!0})}}),document.addEventListener("focusout",n=>{n.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{var l,c,u;let a=document.activeElement,s=!1;for(;a;){if(((l=a.tagName)==null?void 0:l.toLowerCase())==="math-field"){s=!0;break}a=(u=(c=a.shadowRoot)==null?void 0:c.activeElement)!=null?u:null}s||this.hide()},300)})}get currentLayer(){var e,r,i;return(i=(r=(e=this._element)==null?void 0:e.querySelector(".MLK__layer.is-visible"))==null?void 0:r.id)!=null?i:""}set currentLayer(e){var i;if(!this._element){this.latentLayer=e;return}let r=e?this._element.querySelector(`#${e}.MLK__layer`):null;r||(r=this._element.querySelector(".MLK__layer")),r&&((i=this._element.querySelector(".MLK__layer.is-visible"))==null||i.classList.remove("is-visible"),r.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(e){var r;this._shiftPressCount=e>2||e<0?0:e,(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(e){let r="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[r]=e,r}getKeycap(e){return e?this.keycapRegistry[e]:void 0}getLayer(e){let r=this.normalizedLayouts;for(let i of r)for(let n of i.layers)if(n.id===e)return n}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(e){this._alphabeticLayout=e,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(e){this._actionKeycap=typeof e=="string"?{label:e}:e}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(e){this._shiftKeycap=typeof e=="string"?{label:e}:e}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(e){this._backspaceKeycap=typeof e=="string"?{label:e}:e}get tabKeycap(){return this._tabKeycap}set tabKeycap(e){this._tabKeycap=typeof e=="string"?{label:e}:e}get layouts(){return this._layouts}set layouts(e){this.updateNormalizedLayouts(e),this.rebuild()}updateNormalizedLayouts(e){let r=Array.isArray(e)?[...e]:[e],i=r.findIndex(n=>n==="default");i>=0&&r.splice(i,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(r),this._normalizedLayouts=r.map(n=>xl(n))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(e){this._editToolbar=e,this.rebuild()}get container(){return this._container}set container(e){this._container=e,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new t}catch(e){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(e,r,i){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].has(r)||this.listeners[e].add(r)}dispatchEvent(e){return!this.listeners[e.type]||this.listeners[e.type].size===0?!0:(this.listeners[e.type].forEach(r=>{typeof r=="function"?r(e):r==null||r.handleEvent(e)}),!e.defaultPrevented)}removeEventListener(e,r,i){this.listeners[e]&&this.listeners[e].delete(r)}get element(){return this._element}set element(e){var r;this._element!==e&&((r=this._element)==null||r.remove(),this._element=e)}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get boundingRect(){var r;if(!this._visible)return new DOMRect;let e=(r=this._element)==null?void 0:r.getElementsByClassName("MLK__plate")[0];return e?e.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var r,i;let e=this.boundingRect.height;if(this.container===document.body){(r=this._element)==null||r.style.setProperty("--_keyboard-height",`calc(${e}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);let n=e-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${n}px)`:`${n}px`}else(i=this._element)==null||i.style.setProperty("--_keyboard-height",`${e}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;let e=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=e,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;let e=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(e&&(e.backdrop||e.container)));let r=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(r)for(let i of r){let n=this.getKeycap(i.id);if(n){let[o,a]=Wi(n,{shifted:this.isShifted});i.innerHTML=window.MathfieldElement.createHTML(o),i.className=a}}}show(e){var i;if(this._visible)return;let r=this.container;if(r&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){let n=this._element.getElementsByClassName("MLK__plate")[0];if(n&&this.observer.observe(n),r===window.document.body){let o=r.style.paddingBottom;this.originalContainerBottomPadding=o;let a=n.offsetHeight-1;r.style.paddingBottom=o?`calc(${o} + ${a}px)`:`${a}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(i=this._element)==null||i.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,e!=null&&e.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var n;return(n=this._element)==null?void 0:n.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(e){var i;let r=this.container;if(r&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;let n=this._element.getElementsByClassName("MLK__plate")[0];n&&this.observer.unobserve(n),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),jr(),wm(),(i=this._element)==null||i.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(r.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var e,r;return(r=(e=this.element)==null?void 0:e.offsetHeight)!=null?r:0}buildAndAttachElement(){var e;this.element,this.element=km(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",r=>{r.shiftKey||((r.ctrlKey||r.button===2)&&Sa(r.target),r.preventDefault(),r.stopPropagation())},{capture:!0}),(e=this.container)==null||e.appendChild(this.element)}handleEvent(e){if(Fn(e)){if(!Li(e.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");e.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:e.data.action!=="update-setting"&&e.data.action!=="proxy-created"&&e.data.action!=="execute-command"&&(e.source,this.connectedMathfieldWindow=e.source),this.handleMessage(e.data,e.source)}if(this._element)switch(e.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":e.button!==2&&e.preventDefault();break;case"keydown":{e.key==="Shift"&&!e.repeat&&(this.shiftPressCount=1);break}case"keyup":{(e.key==="Shift"||!e.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(e,r){let{action:i}=e;if(i==="execute-command"){let{command:n}=e,o=Rt(n);if(window.top!==void 0&&o!=="virtual-keyboard")return;this.executeCommand(n);return}if((i==="connect"||i==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r),i!=="disconnect"&&window===window.top){if(i==="show"){typeof e.animate!="undefined"?this.show({animate:e.animate}):this.show();return}if(i==="hide"){typeof e.animate!="undefined"?this.hide({animate:e.animate}):this.hide();return}if(i==="update-setting"){e.alphabeticLayout&&(this.alphabeticLayout=e.alphabeticLayout),e.layouts&&(this.layouts=e.layouts),e.editToolbar&&(this.editToolbar=e.editToolbar);return}if(i==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r);return}}}sendMessage(e,r,i){if(i||(i=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||i===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:p({type:Nn,action:e},r)}));return}if(i)i.postMessage(p({type:Nn,action:e},r),{targetOrigin:this.targetOrigin});else if(r.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:r.command})),e==="execute-command"&&Array.isArray(r.command)&&r.command[0]==="insert"){let n=r.command[1].split("");for(let o of n)this.dispatchEvent(new KeyboardEvent("keydown",{key:o,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:o,bubbles:!0}))}}stateWillChange(e){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:e},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(e){let r=this._element;if(!r)return;r.classList.toggle("is-math-mode",e.mode==="math"),r.classList.toggle("is-text-mode",e.mode==="text"),r.classList.toggle("can-undo",e.canUndo),r.classList.toggle("can-redo",e.canRedo),r.classList.toggle("can-copy",!e.selectionIsCollapsed),r.classList.toggle("can-copy",!e.selectionIsCollapsed),r.classList.toggle("can-paste",!0);let i=r.querySelectorAll(".ML__edit-toolbar");if(i)for(let n of i)n.innerHTML=vm(this,e)}update(e){this._style=e.style,this.updateToolbar(e)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(e){let r,i=[],n=Rt(e);return ee(e)?(r=e[0],r==="performWithFeedback"&&(e=e.slice(1),n=Rt(e)),i=e.slice(1)):r=e,r=r.replace(/-\w/g,o=>o[1].toUpperCase()),n==="virtual-keyboard"?st[r].fn(void 0,...i):(this.sendMessage("execute-command",{command:e}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};if(pe()&&!("mathVirtualKeyboard"in window))if(window===window.top){let t=ke.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>t})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>Rn.singleton,configurable:!0});function ji(t){let e={};for(let r of Object.keys(t))switch(r){case"scriptDepth":let i=t.scriptDepth;if(ee(i))e.scriptDepth=[i[0],i[1]];else if(typeof i=="number")e.scriptDepth=[i,i];else if(typeof i=="string"){let[o,a]=i.split(",").map(s=>parseInt(s.trim()));e.scriptDepth=[o,a]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let n=t.mathVirtualKeyboardPolicy.toLowerCase();if(n==="sandboxed"){if(window!==window.top){let o=ke.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>o})}n="manual"}e.mathVirtualKeyboardPolicy=n;break;case"letterShapeStyle":t.letterShapeStyle==="auto"?O.locale.startsWith("fr")?e.letterShapeStyle="french":e.letterShapeStyle="tex":e.letterShapeStyle=t.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(t.defaultMode)?e.defaultMode=t.defaultMode:(console.error('MathLive 0.97.2: valid values for defaultMode are "text", "math" or "inline-math"'),e.defaultMode="math");break;case"macros":e.macros=mo(t.macros);break;default:ee(t[r])?e[r]=[...t[r]]:typeof t[r]=="object"&&!(t[r]instanceof Element)&&r!=="computeEngine"?e[r]=p({},t[r]):e[r]=t[r]}return e}function Nt(t,e){let r;typeof e=="string"?r=[e]:e===void 0?r=Object.keys(t):r=e;let i={};for(let n of r)t[n]===null?i[n]=null:ee(t[n])?i[n]=[...t[n]]:typeof t[n]=="object"&&!(t[n]instanceof Element)&&n!=="computeEngine"?i[n]=p({},t[n]):i[n]=t[n];return typeof e=="string"?i[e]:i}function Ji(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Mr,backgroundColorMap:li,letterShapeStyle:O.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,mathModeSpace:"",placeholderSymbol:"\u25A2",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:x0,inlineShortcuts:la,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:b0,value:""}}function vl(t){return t.defaultMode==="inline-math"?"math":t.defaultMode}function Lt(t){return typeof t=="number"&&!Number.isNaN(t)}function Gr(t){return Array.isArray(t)&&t.length===2}function Gi(t){return t!=null&&typeof t=="object"&&"ranges"in t&&Array.isArray(t.ranges)}var Mm="",Ea="";function Ca(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function U(t,e){return!t||!e.generateID?"":` extid="${t}"`}function hf(t,e,r){var d,m,h,f,x,M,b,k,_,A,E;let i=!1;e=e!=null?e:t.atoms.length;let n="",o="",a=t.atoms[t.index],s=(m=(d=a.style)==null?void 0:d.variant)!=null?m:"",l=(f=(h=a.style)==null?void 0:h.variantStyle)!=null?f:"",c="";if(s||l){let D=ao(a.value,(x=a.style)==null?void 0:x.variant,(M=a.style)==null?void 0:M.variantStyle);if(D!==a.value)return t.index+=1,n=`${D}`,vr(n,t,r)||(t.mathML+=n,t.lastType="mi"),!0;c=(b={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[l+s])!=null?b:"",c=` mathvariant="${c}"`}let u={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(u[a.command]){t.index+=1;let D=`${u[a.command]}`;return(t.lastType==="mi"||t.lastType==="mn"||t.lastType==="mtext"||t.lastType==="fence")&&(D=Ea+D),vr(D,t,r)||(t.mathML+=D,t.lastType="mi"),!0}if(a.command==="\\operatorname")o=Xi(a.body),t.index+=1;else if(s||l)for(;t.index0){i=!0,n=`${o}`;let D=t.lastType;n.endsWith(">f")||n.endsWith(">g")?(n+=Mm,t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(n)?"mo":"mi",vr(n,t,r)||((D==="mi"||D==="mn"||D==="mtext"||D==="fence")&&(n=Ea+n),t.mathML+=n)}return i}function ff(t){return t.index${t}${a}${o}`:o?s=`${t}${o}`:a&&(s=`${t}${a}`),e.mathML+=s,e.lastType="",!0}function yf(t,e,r){e=e!=null?e:t.atoms.length;let i=t.index,n="";for(;t.index0?(t.mathML+=`${n}`,t.lastType="mtext",!0):!1}function bf(t,e,r){e=e!=null?e:t.atoms.length;let i=t.index,n="",o=gf(t);for(o>=0&&o"+n+"",o<0&&ff(t)&&(o=t.index,t.index+=1),vr(n,t,r)||(t.mathML+=n,t.lastType="mn"),!0)}function xf(t,e,r){let i=!1;e=e!=null?e:t.atoms.length;let n="",o="";if(t.index",n+=Xr(t.atoms[l],r),n+=R(t.atoms,r,l+1,c),n+=Xr(t.atoms[c],r),n+="",t.index=c+1,(t.lastType==="mi"||t.lastType==="mn"||t.lastType==="mfrac"||t.lastType==="fence")&&(t.mathML+=Ea),vr(n,t,r)&&(i=!0,t.lastType="",n=""),o="fence")}return n.length>0&&(i=!0,t.mathML+=n,t.lastType=o),i}function vf(t,e,r){let i=!1;e=e!=null?e:t.atoms.length;let n="",o="",a=t.atoms[t.index];if(!a)return!1;let s={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(s[a.command]){t.index+=1;let l=`${s[a.command]}`;return vr(l,t,r)||(t.mathML+=l,t.lastType="mo"),!0}if(t.index"+l,n+=R(a.subscript,r),n+=R(a.superscript,r),n+=""):a.superscript?(n+=""+l,n+=R(a.superscript,r),n+=""):a.subscript&&(n+=""+l,n+=R(a.subscript,r),n+=""),o="mo"}else{let l=t.atoms[t.index],c=l.value==="\\operatorname",u=c?'"+Xi(l.value)+"":Xr(l,r);n+=u,!c&&!/^(.*)<\/mo>$/.test(u)?(n+=Mm,o="applyfunction"):o=c?"mi":"mo"}(t.lastType==="mi"||t.lastType==="mn")&&!/^(.*)<\/mo>$/.test(n)&&(n=Ea+n),t.index+=1}return n.length>0&&(i=!0,vr(n,t,r)||(t.mathML+=n,t.lastType=o)),i}function R(t,e,r,i){e!=null||(e={});let n={atoms:[],index:r!=null?r:0,mathML:"",lastType:""};if(typeof t=="number"||typeof t=="boolean")n.mathML=t.toString();else if(typeof t=="string")n.mathML=t;else if(t instanceof y)n.mathML=wl(t,e);else if(Array.isArray(t)){n.atoms=t;let o=0;for(i=i||(t?t.length:0);n.index0&&n.atoms[n.index].type==="genfrac"&&(a=""+a),n.atoms[n.index].type==="genfrac"?n.lastType="mfrac":n.lastType="",n.index+=1,vr(a,n,e)?o+=1:a.length>0&&(n.mathML+=a,o+=1)}o>1&&(n.mathML=""+n.mathML+"")}return n.mathML}function Xr(t,e){let r="",i=Xi(t.value);return i&&(r=""+i+""),r}function Xi(t){if(!t)return"";if(typeof t=="string")return Ca(t);if(!Array.isArray(t)&&typeof t.body=="string")return Ca(t.body);let e="";for(let r of t)typeof r.value=="string"&&(e+=r.value);return Ca(e)}function wl(t,e){var x,M,b,k,_,A,E,D,K,P,se,_e,ut,$t,qt,ge,rn,nn,on,ie,me,Se;if(t.mode==="text")return`${t.value}`;let r={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5},n="",o="",a,s,l,c,u,d,{command:m}=t;if(t.command==="\\error")return`${R(t.body,e)}`;let h={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},f={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(t.type){case"first":break;case"group":case"root":n=R(t.body,e);break;case"array":if((t.leftDelim&&t.leftDelim!=="."||t.rightDelim&&t.rightDelim!==".")&&(n+="",t.leftDelim&&t.leftDelim!=="."&&(n+=""+(h[t.leftDelim]||t.leftDelim)+"")),n+="",a=0;a"+R(t.array[s][a],e)+"";n+=""}n+="",(t.leftDelim&&t.leftDelim!=="."||t.rightDelim&&t.rightDelim!==".")&&(t.rightDelim&&t.rightDelim!=="."&&(n+=""+(h[t.leftDelim]||t.rightDelim)+""),n+="");break;case"genfrac":(t.leftDelim||t.rightDelim)&&(n+=""),t.leftDelim&&t.leftDelim!=="."&&(n+=""+(h[t.leftDelim]||t.leftDelim)+""),t.hasBarLine?(n+="",n+=R(t.above,e)||" ",n+=R(t.below,e)||" ",n+=""):(n+="",n+=""+R(t.above,e)+"",n+=""+R(t.below,e)+"",n+=""),t.rightDelim&&t.rightDelim!=="."&&(n+=""+(h[t.rightDelim]||t.rightDelim)+""),(t.leftDelim||t.rightDelim)&&(n+="");break;case"surd":t.hasEmptyBranch("above")?(n+="",n+=R(t.body,e),n+=""):(n+="",n+=R(t.body,e),n+=R(t.above,e),n+="");break;case"leftright":let Xe=t,Re=Xe.leftDelim;n="",Re&&Re!=="."&&(n+=`${(x=h[Re])!=null?x:Re}`),t.body&&(n+=R(t.body,e));let dt=Xe.matchingRightDelim();dt&&dt!=="."&&(n+=`${(M=h[dt])!=null?M:dt}`),n+="";break;case"sizeddelim":case"delim":n+=`${h[t.value]||t.value}`;break;case"accent":n+='",n+=R(t.body,e),n+=""+(f[m]||t.accent)+"",n+="";break;case"line":case"overlap":break;case"overunder":u=t.above,c=t.below,(t.svgAbove||u)&&(t.svgBelow||c)?d=t.body:u&&u.length>0?(d=t.body,(k=(b=t.body)==null?void 0:b[0])!=null&&k.below?(c=t.body[0].below,d=t.body[0].body):((A=(_=t.body)==null?void 0:_[0])==null?void 0:A.type)==="first"&&((D=(E=t.body)==null?void 0:E[1])!=null&&D.below)&&(c=t.body[1].below,d=t.body[1].body)):c&&c.length>0&&(d=t.body,(P=(K=t.body)==null?void 0:K[0])!=null&&P.above?(u=t.body[0].above,d=t.body[0].body):((_e=(se=t.body)==null?void 0:se[0])==null?void 0:_e.type)==="first"&&(($t=(ut=t.body)==null?void 0:ut[1])!=null&&$t.above)&&(u=t.body[1].overscript,d=t.body[1].body)),(t.svgAbove||u)&&(t.svgBelow||c)?(n+=``,n+=(qt=r[t.svgBody])!=null?qt:R(d,e),n+=(ge=r[t.svgBelow])!=null?ge:R(c,e),n+=(rn=r[t.svgAbove])!=null?rn:R(u,e),n+=""):t.svgAbove||u?(n+=``+((nn=r[t.svgBody])!=null?nn:R(d,e)),n+=(on=r[t.svgAbove])!=null?on:R(u,e),n+=""):(t.svgBelow||c)&&(n+=``+((ie=r[t.svgBody])!=null?ie:R(d,e)),n+=(me=r[t.svgBelow])!=null?me:R(c,e),n+="");break;case"placeholder":n+="?";break;case"mord":{n=typeof t.value=="string"?t.value:m,m==="\\char"?n="&#x"+("000000"+t.args[0].number.toString(16)).slice(-4)+";":n.length>0&&n.startsWith("\\")&&(typeof t.value=="string"&&t.value.charCodeAt(0)>255?n="&#x"+("000000"+t.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof t.value=="string"?n=t.value.charAt(0):(console.error("Did not expect this"),n=""));let Ae=/\d/.test(n)?"mn":"mi";n=`<${Ae}${U(t.id,e)}>${Ca(n)}`;break}case"mbin":case"mrel":case"minner":n=Xr(t,e);break;case"mpunct":n='"+m+"";break;case"mop":case"operator":case"extensible-symbol":t.body!=="\u200B"&&(n="",n+=m==="\\operatorname"?t.body:m||t.body,n+="");break;case"box":n='"+R(t.body,e)+"";break;case"spacing":n+='';break;case"enclose":n=''+R(t.body,e)+"";break;case"prompt":n=''+R(t.body,e)+"";break;case"space":n+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":n+=Xr(t,e);break;case"mclose":n+=Xr(t,e);break;case"macro":{let Ae=t.command+Xi(t.macroArgs);Ae&&(n+=`${Ae}`)}break;case"latexgroup":n+=R(t.body,e);break;case"latex":n+=""+t.value+"";break;case"tooltip":n+=R(t.body,e);break;case"text":n+=`${t.value}`;break;default:if(t.command==="\\displaystyle")return`${R(t.body,e)}`;if(t.command==="\\textstyle")return`${R(t.body,e)}`;console.info("Unexpected element in conversion to MathML:",t)}return n}var Hn={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Wn={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function wf(t){let e="";for(let r of t){let i=e[e.length-1];i!==void 0&&/\d/.test(i)&&/^\d/.test(r)&&(e+=" "),e+=r}return e}function Q(t){var n,o,a,s,l,c,u,d,m,h,f,x,M;if(!t)return"";if(ee(t)){if(t.length===0)return"";if(t[0].mode==="latex")return t.map(Q).join("");if(t[0].mode==="text"){let _=0,A="";for(;((n=t[_])==null?void 0:n.mode)==="text";)A+=t[_].body?Q(t[_].body):t[_].value,_++;return`"${A}" ${Q(t.slice(_))}`}let b=0,k=[];for(;t[b]&&t[b].mode==="math";){let _="";for(;t[b]&&t[b].type==="mord"&&/\d/.test(t[b].value);)_+=t[b++].value;_?k.push(_):k.push(Q(t[b++]))}return k.push(Q(t.slice(b))),wf(k)}if(t.mode==="text")return`"${t.value}"`;let e="",{command:r}=t,i;if(r==="\\placeholder")return`(${Q(t.body)})`;switch(t.type){case"accent":let b={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[r];e=`${b!=null?b:""} ${Q(t.body)} `;break;case"first":return"";case"latexgroup":return t.body.map(K=>K.value).join("");case"group":case"root":e=(o=Hn[r])!=null?o:Q(t.body);break;case"genfrac":{let K=t;(K.leftDelim||K.rightDelim)&&(e=K.leftDelim==="."||!K.leftDelim?"{:":K.leftDelim),K.hasBarLine?(e+="(",e+=Q(K.above),e+=")/(",e+=Q(K.below),e+=")"):(e+="("+Q(K.above)+"),",e+="("+Q(K.below)+")"),(K.leftDelim||K.rightDelim)&&(e+=K.rightDelim==="."||!K.rightDelim?"{:":K.rightDelim)}break;case"surd":e+=t.hasEmptyBranch("above")?"sqrt("+Q(t.body)+")":"root("+Q(t.above)+")("+Q(t.body)+")";break;case"latex":e=t.value;break;case"leftright":{let K=t,P=K.leftDelim;e+=P==="."||!P?"{:":P,e+=Q(K.body);let se=K.matchingRightDelim();e+=se==="."||!se?":}":se}break;case"sizeddelim":case"delim":e=t.value;break;case"overlap":break;case"overunder":break;case"mord":e=(s=(a=Hn[r])!=null?a:r)!=null?s:typeof t.value=="string"?t.value:"",e.startsWith("\\")&&(e+=" "),i=r?r.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,i?e=String.fromCodePoint(Number.parseInt("0x"+i[1])):e.length>0&&e.startsWith("\\")&&(e=typeof t.value=="string"?t.value.charAt(0):t.command),e=kf(e,t.style);break;case"mbin":case"mrel":case"minner":e=(c=(l=Hn[r])!=null?l:Wn[r])!=null?c:t.value;break;case"mopen":case"mclose":e=t.value;break;case"mpunct":e=(u=Wn[r])!=null?u:r;break;case"mop":case"operator":case"extensible-symbol":t.value!=="\u200B"&&(Wn[r]?e=Wn[r]:e=r==="\\operatorname"?Q(t.body):(d=t.value)!=null?d:r,e+=" ");break;case"array":let k=t.array,_=t.environmentName,A=(m={bmatrix:["[","]"],"bmatrix*":["[","]"]}[_])!=null?m:["(",")"],E=[];for(let K of k){let P=[];for(let se of K)P.push(A[0]+Q(se)+A[1]);E.push(P.join(","))}let D=(h={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[_])!=null?h:["(",")"];e=D[0]+E.join(",")+D[1];break;case"box":break;case"spacing":e=(f=Hn[r])!=null?f:" ";break;case"enclose":e="("+Q(t.body)+")";break;case"space":e=" ";break;case"subsup":e="";break;case"macro":e=(M=(x=Hn[r])!=null?x:Wn[r])!=null?M:Q(t.body);break}if(!t.hasEmptyBranch("subscript")){e+="_";let b=Q(t.subscript);e+=b.length!==1?`(${b})`:b}if(!t.hasEmptyBranch("superscript")){e+="^";let b=Q(t.superscript);e+=b.length!==1?`(${b})`:b}return e}function kf(t,e){if(!e)return t;let r=t;return e.variant==="double-struck"&&(r=`bbb "${r}"`),e.variant==="script"&&(r=`cc "${r}"`),e.variant==="fraktur"&&(r=`fr "${r}"`),e.variant==="sans-serif"&&(r=`sf "${r}"`),e.variant==="monospace"&&(r=`tt "${r}"`),e.variantStyle==="bold"&&(r=`bb "${r}"`),e.color?`color({${e.color}})(${r})`:r}var Zi={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":' 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 ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"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 ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'open paren',"\\rparen":'close paren',"\\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 ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},kl={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Mf(t){let e="";return t.startsWith("\\")&&(e=" "+t.replace("\\","")+" "),e}function Un(t){let e=0;if(ee(t))for(let r of t)r.type!=="first"&&(e+=1);return e===1}function _f(t){if(ee(t)){for(let e of t)if(e.type!=="first"&&e.id)return e.id.toString()}return""}function _m(t){let e="";if(ee(t))for(let r of t)r.type!=="first"&&typeof r.value=="string"&&(e+=r.value);return e}function Sf(t){return t?t.map(e=>e.value).join(""):""}function z(t,e){var o,a,s,l,c;function r(u){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(u)?` ${u}`:/[A-Z]/.test(u)?`capital ${u.toLowerCase()}`:u:/[a-z]/.test(u)?" '"+u.toUpperCase()+"'":/[A-Z]/.test(u)?" 'capital "+u.toUpperCase()+"'":u}function i(u){return""+u+""}if(!e)return"";let n="";if(ee(e)){let u=!1,d=!1;for(let m=0;m'),n+=e.value;else{e.id&&t==="math"&&(n+='');let u="",d="",m="",h=!1,{command:f}=e;switch(f){case"\\vec":return"vector "+z(t,e.body);case"\\acute":return z(t,e.body)+" acute";case"\\grave":return z(t,e.body)+" grave";case"\\dot":return"dot over"+z(t,e.body);case"\\ddot":return"double dot over"+z(t,e.body);case"\\mathring":return"ring over"+z(t,e.body);case"\\tilde":case"\\widetilde":return"tilde over"+z(t,e.body);case"\\bar":return z(t,e.body)+" bar";case"\\breve":return z(t,e.body)+" breve";case"\\check":case"\\widecheck":return"check over "+z(t,e.body);case"\\hat":case"\\widehat":return"hat over"+z(t,e.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+z(t,e.body);case"\\underarc":case"\\underparen":return"arc under "+z(t,e.body)}switch(e.type){case"prompt":let x=e.body.length>1?'start input . '+z(t,e.body)+'. end input':"blank";n+=' '+x+'. '+((a=e.correctness)!=null?a:"")+' . ';break;case"array":let M=e.array,b=e.environmentName;if(Object.keys(kl).includes(b)){n+=` begin ${kl[b]} `;for(let A=0;A0&&(n+=","),n+=` row ${A+1} `;for(let E=0;E0&&(n+=","),n+=` column ${E+1}: `,n+=z("math",M[A][E])}n+=` end ${kl[b]} `}break;case"group":f==="\\ne"?n+=" not equal ":(f==="\\not"&&(n+=" not "),n+=z("math",e.body));break;case"root":n+=z("math",e.body);break;case"genfrac":if(u=z("math",e.above),d=z("math",e.below),Un(e.above)&&Un(e.below)){let E={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[_m(e.above)+"/"+_m(e.below)];E?n=E:n+=u+" over "+d}else n+=' the fraction '+u+' over '+d+'. End fraction.';break;case"surd":if(m=z("math",e.body),e.hasEmptyBranch("above"))n+=Un(e.body)?" the square root of "+m+" , ":' the square root of '+m+'. End square root';else{let A=z("math",e.above);A=A.trim();let E=A.replace(//g,"");E==="3"?n+=' the cube root of '+m+'. End cube root':E==="n"?n+=' the nth root of '+m+'. End root':n+=' the root with index: '+A+', of '+m+'. End root'}break;case"leftright":{let A=e;n+=(s=A.leftDelim?Zi[A.leftDelim]:void 0)!=null?s:A.leftDelim,n+=z("math",e.body),n+=(l=A.rightDelim?Zi[A.rightDelim]:void 0)!=null?l:A.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":let k=f.replace(/^\\/g,""),_=di()[k];_&&(_!=null&&_.expand?n+=z("math",e.body):n+=`${k} `);break;case"placeholder":n+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(f==="\\mathbin"||f==="\\mathrel"||f==="\\mathopen"||f==="\\mathclose"||f==="\\mathpunct"||f==="\\mathord"||f==="\\mathinner"){n=z(t,e.body);break}let A=e.isDigit()?e.asDigit():e.value,E=e.command;if((e.type==="delim"||e.type==="sizeddelim")&&(E=e.value,A=E),t==="text")n+=A;else{if(e.type==="mbin"&&(n+=''),A){let D=Zi[A]||(E?Zi[E.trim()]:"");if(D)n+=" "+D;else{let K=E?Mf(E.trim()):"";n+=K||r(A)}}else n+=z("math",e.body);e.type==="mbin"&&(n+='')}break}case"mop":case"operator":case"extensible-symbol":if(e.value!=="\u200B"){let A=e.command;if(A==="\\sum")if(!e.hasEmptyBranch("superscript")&&!e.hasEmptyBranch("subscript")){let E=z("math",e.superscript);E=E.trim();let D=z("math",e.subscript);D=D.trim(),n+=' the summation from '+D+' to '+E+' of ',h=!0}else if(e.hasEmptyBranch("subscript"))n+=" the summation of";else{let E=z("math",e.subscript);E=E.trim(),n+=' the summation from '+E+' of ',h=!0}else if(A==="\\prod")if(!e.hasEmptyBranch("superscript")&&!e.hasEmptyBranch("subscript")){let E=z("math",e.superscript);E=E.trim();let D=z("math",e.subscript);D=D.trim(),n+=' the product from '+D+' to '+E+' of ',h=!0}else if(e.hasEmptyBranch("subscript"))n+=" the product of ";else{let E=z("math",e.subscript);E=E.trim(),n+=' the product from '+E+' of ',h=!0}else if(A==="\\int")if(!e.hasEmptyBranch("superscript")&&!e.hasEmptyBranch("subscript")){let E=z("math",e.superscript);E=E.trim();let D=z("math",e.subscript);D=D.trim(),n+=' the integral from '+i(D)+' to '+i(E)+' of ',h=!0}else n+=' the integral of ';else if(typeof e.value=="string"){let E=(c=Zi[e.value])!=null?c:e.command?Zi[e.command]:void 0;n+=E||" "+e.value}else e.command&&(e.command==="\\mathop"?n+=z("math",e.body):e.command==="\\operatorname"?n+=Sf(e.body):n+=e.command.startsWith("\\")?" "+e.command.slice(1):" "+e.command)}break;case"enclose":m=z("math",e.body),n+=" crossed out "+m+". End crossed out.";break;case"space":case"spacing":break}if(!h&&!e.hasEmptyBranch("superscript")){let x=z(t,e.superscript);x=x.trim();let M=x.replace(/<[^>]*>/g,"");if(Un(e.superscript)){if(t==="math"){let b=_f(e.superscript);b&&(n+='')}M==="\u2032"?n+=" prime ":M==="2"?n+=" squared ":M==="3"?n+=" cubed ":Number.isNaN(Number.parseInt(M))?n+=" to the "+x+"; ":n+=' to the '+M+" power; "}else Number.isNaN(Number.parseInt(M))?n+=" raised to the "+x+"; ":n+=' raised to the '+M+" power; "}if(!h&&!e.hasEmptyBranch("subscript")){let x=z("math",e.subscript);x=x.trim(),n+=Un(e.subscript)?" sub "+x:" subscript "+x+". End subscript. "}}return n}function Ft(t){var r,i;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){let n=R(t);if(n){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(r=window.MathfieldElement.textToSpeechRulesOptions)!=null?r:{},window.MathfieldElement.textToSpeechRulesOptions.markup=window.MathfieldElement.textToSpeechMarkup,window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions.markup="ssml_step"),window.MathfieldElement.textToSpeechRulesOptions.rate=window.MathfieldElement.speechEngineRate);let o=(i=window.SRE)!=null?i:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&o.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let a="";try{a=o.toSpeech(n)}catch(s){console.error("MathLive 0.97.2: `SRE.toSpeech()` runtime error",s)}return a}return""}let e=z("math",t);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let n="";window.MathfieldElement.speechEngineRate&&(n=''),e=''+n+"

    "+e+"

    "+(n?"
    ":"")+""}else window.MathfieldElement.textToSpeechMarkup==="mac"&&mt()==="macos"?e=e.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):e=e.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return e}function Zr(t,e){return t+Ft(e)}oe({speak:(t,e,r)=>Af(t,e,r)},{target:"mathfield"});function Af(t,e,r){var l,c;r=r!=null?r:{withHighlighting:!1};let{model:i}=t;function n(u){let d=null;switch(u){case"all":d=i.root;break;case"selection":d=i.getAtoms(i.selection);break;case"left":{d=i.getAtoms(i.offsetOf(i.at(i.position).leftSibling),i.position);break}case"right":{d=i.getAtoms(i.position,i.offsetOf(i.at(i.position).rightSibling));break}case"group":d=i.getAtoms(i.getSiblingsRange(i.position));break;case"parent":{let{parent:m}=i.at(i.position);m!=null&&m.parent?d=m:d=i.root;break}default:d=i.root}return d}function o(u){let d="";switch(u){case"all":break;case"selection":d="no selection";break;case"left":d="at start";break;case"right":d="at end";break;case"group":break;case"parent":d="no parent";break;default:""+u;break}return d}let a=n(e);if(a===null)return(c=(l=window.MathfieldElement).speakHook)==null||c.call(l,o(e)),!1;(r.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");let s=Ft(a);return pe()&&r.withHighlighting?(lt().readAloudMathfield=t,at(t,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(t.field,s)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(s),!1}function Sm(t){var e,r;if(pe())if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){let i=new SpeechSynthesisUtterance(t);window.speechSynthesis.speak(i)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.97.2: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{let i=new window.AWS.Polly({apiVersion:"2016-06-10"}),n={OutputFormat:"mp3",VoiceId:(e=window.MathfieldElement.speechEngineVoice)!=null?e:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna")?"neural":"standard",Text:t,TextType:"ssml"};i.synthesizeSpeech(n,(o,a)=>{if(o)console.trace(`MathLive 0.97.2: \`polly.synthesizeSpeech()\` error: ${o}`);else if(a!=null&&a.AudioStream){let s=new Uint8Array(a.AudioStream),l=new Blob([s.buffer],{type:"audio/mpeg"}),c=URL.createObjectURL(l);new Audio(c).play().catch(d=>console.log(d))}})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.97.2: The Google speech engine is not supported yet. Please come again.")}function Am(t){var r;let e;if(t.parent.type==="prompt")t.parentBranch==="body"&&(e="prompt");else if(t.parentBranch==="body")e=t.type&&(r={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[t.type])!=null?r:"parent";else if(t.parent.type==="genfrac"){if(t.parentBranch==="above")return"numerator";if(t.parentBranch==="below")return"denominator"}else t.parent.type==="surd"?t.parentBranch==="above"&&(e="index"):t.parentBranch==="superscript"?e="superscript":t.parentBranch==="subscript"&&(e="subscript");return e!=null?e:"parent"}function Lm(t,e,r,i){let n="";if(e==="plonk")window.MathfieldElement.playSound("plonk"),t.flushInlineShortcutBuffer();else if(e==="delete")n=Zr("deleted: ",i);else if(e==="focus"||e.includes("move"))n=Lf(t.model,r)+(t.model.selectionIsCollapsed?"":"selected: ")+Cf(t.model);else if(e==="replacement")n=Zr("",t.model.at(t.model.position));else if(e==="line"){let o=Zr("",t.model.root);t.keyboardDelegate.setAriaLabel(o)}else n=i?Zr(e+" ",i):e;if(n){let o=t.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";t.ariaLiveText.textContent=n+o}}function Lf(t,e){if(Number.isNaN(e))return"";let r=t.at(e);if(!r||r.treeDepth<=t.at(t.position).treeDepth)return"";let i="",n=r.parent,o=t.at(t.position).parent;for(;n!==t.root&&n!==o;)i+=`out of ${Am(n)};`,n=n.parent;return i}function Cf(t){if(!t.selectionIsCollapsed)return Zr("",t.getAtoms(t.selection));let e="",r=t.at(t.position),i=Am(r);return r.isFirstSibling&&(e=(i?"start of "+i:"unknown")+": "),r.isLastSibling?r.isFirstSibling||(e+=i?"end of "+i:"unknown"):e+=Zr("",r),e}function je(t){return{value:t.model.getValue(),selectionIsCollapsed:t.model.selectionIsCollapsed,canUndo:t.canUndo(),canRedo:t.canRedo(),style:t.selectionStyle,mode:t.model.mode}}var jn=class{constructor(e,r,i){this.mathfield=e,this.mode=r,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=i}dispose(){this.mathfield=void 0}getState(){let e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,r){var o;let i=this.silenceNotifications;this.silenceNotifications=(o=r==null?void 0:r.silenceNotifications)!=null?o:!0;let n={};if((r==null?void 0:r.type)==="undo"&&(n={inputType:"historyUndo"}),(r==null?void 0:r.type)==="redo"&&(n={inputType:"historyRedo"}),this.contentWillChange(n)){let a=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=nt(e.content),this.selection=e.selection,this.silenceNotifications=a,this.contentDidChange(n)}this.silenceNotifications=i}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var l,c,u;let i=this.normalizeSelection(e,r);if(i===void 0)throw new TypeError("Invalid selection");if(i.ranges.length===1&&i.ranges[0][0]===i.ranges[0][1]){let d=i.ranges[0][0];return!this.mathfield.dirty&&!((l=this.at(d))!=null&&l.parentPrompt)&&this.mathfield.hasEditablePrompts?(c=this.at(d-1))!=null&&c.parentPrompt?(this._anchor=this.normalizeOffset(d-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor),!0):(u=this.at(d+1))!=null&&u.parentPrompt?(this._anchor=this.normalizeOffset(d+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor),!0):(this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]},!1):(this._anchor=d,this._position=d,this._selection=i,!1)}let n=Y(i);i.direction==="backward"?[this._position,this._anchor]=n:[this._anchor,this._position]=n;let o=this.at(n[0]+1),a=this.at(n[1]),s=y.commonAncestor(o,a);return(s==null?void 0:s.type)==="array"&&o.parent===s&&a.parent===s?this._selection={ranges:[n],direction:i.direction}:this._selection={ranges:[n],direction:i.direction},this._position>=0&&this._position<=this.lastOffset,!1})}setPositionHandlingPlaceholder(e){var i;let r=this.at(e);(r==null?void 0:r.type)==="placeholder"?this.setSelection(e-1,e):((i=r==null?void 0:r.rightSibling)==null?void 0:i.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,r instanceof Z&&r.isSuggestion&&(r.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){let r=this.at(e),{parent:i}=r;if(!i)return[0,this.lastOffset];let n=r.parent.branch(r.parentBranch);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getBranchRange(e,r){let i=this.at(e).branch(r);return[this.offsetOf(i[0]),this.offsetOf(i[i.length-1])]}getAtoms(e,r,i){let n=i!=null?i:{};if(Gi(e)){if(n=r!=null?r:{},e.ranges.length>1)return e.ranges.reduce((u,d)=>[...u,...this.getAtoms(d,n)],[]);e=e.ranges[0]}let o,a;if(Lt(e)){if(o=e,!Lt(r))return[];a=r}else[o,a]=e,n=r!=null?r:{};if(!Number.isFinite(o))return[];n.includeChildren===void 0&&(n.includeChildren=!1),o<0&&(o=this.lastOffset-o+1),a<0&&(a=this.lastOffset-a+1);let s=Math.min(o,a)+1,l=Math.max(o,a);if(!n.includeChildren&&s===1&&l===this.lastOffset)return[this.root];let c=[];for(let u=s;u<=l;u++){let d=this.atoms[u];Cm(this,d,s,l)&&c.push(d)}return n.includeChildren||(c=c.filter(u=>{let d=!1,{parent:m}=u;for(;m&&!d;)d=Cm(this,m,s,l),m=m.parent;return!d})),c}getAllAtoms(e=0){let r=[],i=this.lastOffset;for(let n=e;n<=i;n++)r.push(this.atoms[n]);for(let n=0;n=0;a--)if(n=this.atoms[a],e(n))return n;for(let a=o;a>r;a--)if(n=this.atoms[a],e(n))return n}extractAtoms(e){let r=this.getAtoms(e);if(r.length===1&&!r[0].parent)if(r[0].type==="root")r=[...r[0].body],r.shift();else return r=this.root.cells.flat(),this.root=new y({type:"root",body:[]}),r;for(let i of r)i.parent.removeChild(i);return r}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,r){let i=r!=null?r:"latex";if(i.startsWith("latex"))return y.serialize([e],{expandMacro:i==="latex-expanded",skipStyles:i==="latex-unstyled",defaultMode:this.mathfield.options.defaultMode});if(i==="math-ml")return R(e);if(i==="spoken")return Ft(e);if(i==="spoken-text"){let n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";let o=Ft(e);return window.MathfieldElement.textToSpeechMarkup=n,o}if(i==="spoken-ssml"||i==="spoken-ssml-with-highlighting"){let n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";let o=Ft(e);return window.MathfieldElement.textToSpeechMarkup=n,o}return i==="ascii-math"?Q(e):(console.error(`MathLive 0.97.2: Unexpected format "${i}`),"")}getValue(e,r,i){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let n,o;if(Lt(e)&&Lt(r)?(n=[this.normalizeRange([e,r])],o=i):Gr(e)?(n=[this.normalizeRange(e)],o=r):Gi(e)?(n=e.ranges,o=r):(n=[this.normalizeRange([0,-1])],o=e),o!=null||(o="latex"),o==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available. +Load the library, for example with: +import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';let a=this.getValue({ranges:n},"latex-unstyled");try{let s=window.MathfieldElement.computeEngine.parse(a);return JSON.stringify(s.json)}catch(s){return JSON.stringify(["Error",`'${s.toString()}'`])}}if(o.startsWith("latex")){let a={expandMacro:o==="latex-expanded",skipStyles:o==="latex-unstyled",defaultMode:this.mathfield.options.defaultMode};return B(n.map(s=>y.serialize(this.getAtoms(s),a)))}return n.map(a=>this.getAtoms(a).map(s=>this.atomToString(s,o)).join("")).join("")}extendSelectionTo(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{let i=this.normalizeRange([e,r]),[n,o]=i,{parent:a}=this.at(o);if(a&&(a.type==="genfrac"||a.type==="subsup"))for(;a!==this.root&&Ml(this,a,[n,o]);)o=this.offsetOf(a),a=a.parent;for(a=this.at(n).parent;a!==this.root&&Ml(this,a,[n,o]);)n=this.offsetOf(a.leftSibling),a=a.parent;if(a=this.at(o).parent,(a==null?void 0:a.type)==="genfrac")for(;a!==this.root&&Ml(this,a,[n,o]);)o=this.offsetOf(a),o>=0,a=a.parent;this._position=this.normalizeOffset(r),this._selection={ranges:[[n,o]],direction:"none"}})}announce(e,r,i=[]){var o,a;((a=(o=this.mathfield.host)==null?void 0:o.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:r,atoms:i},cancelable:!0,bubbles:!0,composed:!0})))!=null?a:!0)&&Lm(this.mathfield,e,r,i)}deferNotifications(e,r){let i=this._selection,n=this._anchor,o=this._position,a=this.silenceNotifications;this.silenceNotifications=!0;let s=this.root.changeCounter;r();let l=this.root.changeCounter!==s,c=n!==this._anchor||o!==this._position||g0(this._selection,i)==="different";return this.silenceNotifications=a,e.content&&l&&this.contentDidChange({inputType:e.type}),e.selection&&c&&this.selectionDidChange(),l||c}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[r,i]=e;return r=this.normalizeOffset(r),i=this.normalizeOffset(i),rthis.normalizeRange(o)),direction:(n=e.direction)!=null?n:"none"});return i}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var r;let e=this.at(this.position);if(e){for(;e&&((r=e.parent)==null?void 0:r.type)!=="array";)e=e.parent;if(!(!(e!=null&&e.parent)||e.parent.type!=="array"))return e.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;let r=this.silenceNotifications;this.silenceNotifications=!0;let i=this.mathfield.onContentWillChange(e);return this.silenceNotifications=r,i}contentDidChange(e){var i;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;let r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",g(p({},e),{data:e.data?e.data:(i=e.inputType)!=null?i:"",bubbles:!0,composed:!0}))),this.silenceNotifications=r}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this.mathfield)),this.silenceNotifications))return;let e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function Cm(t,e,r,i){let n=t.offsetOf(e);if(ni)return!1;if(!e.hasChildren)return!0;let o=t.offsetOf(e.firstChild);if(o>=r&&o<=i){let a=t.offsetOf(e.lastChild);if(a>=r&&a<=i)return!0}return!1}function Ml(t,e,r){if(!(e!=null&&e.hasChildren))return!1;let[i,n]=r,o=t.offsetOf(e.firstChild),a=t.offsetOf(e.lastChild);return o>=i&&o<=n&&a>=o&&a<=n}ss(["math","displaymath"],Ie);ss("center",Ie);pt("array","{columns:colspec}",(t,e,r,i)=>new I(t,_l(e),r,{columns:i[0],mathstyleName:"textstyle"}));pt(["equation","equation*","subequations"],"",(t,e,r)=>new I(t,_l(e),r,{columns:[{align:"c"}]}));pt(["multline","multline*"],"",Ie);pt(["align","align*","aligned","eqnarray"],"",Ie);pt("split","",Ie);pt(["gather","gathered"],"",Ie);pt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Ie);pt(["smallmatrix","smallmatrix*"],"[columns:colspec]",Ie);pt(["cases","dcases","rcases"],"",Ie);function Ef(t){for(let e of t)for(let r of e)if(r.length>0)return!1;return!0}function _l(t,e=1){return Ef(t)?Array(e).fill([[new y({type:"first"}),new xe]]):t.map(r=>r.length===0?[[new y({type:"first"})]]:r.map(i=>i.length===0?[new y({type:"first"})]:(i[0].type!=="first"&&i.unshift(new y({type:"first"})),i)))}function Ie(t,e=[[[]]],r=[],i=[]){switch(e=_l(e,["split","align","align*","aligned","eqnarray"].includes(t)?2:1),t){case"math":return new I(t,e,r,{mathstyleName:"textstyle"});case"displaymath":return new I(t,e,r,{mathstyleName:"textstyle"});case"center":return new I(t,e,r,{columns:[{align:"c"}]});case"multline":case"multline*":return new I(t,e,r,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new I(t,e,r,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new I(t,e,r,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Yr(i[0])});case"bmatrix":case"bmatrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Yr(i[0])});case"Bmatrix":case"Bmatrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Yr(i[0])});case"vmatrix":case"vmatrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Yr(i[0])});case"Vmatrix":case"Vmatrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Yr(i[0])});case"matrix":case"matrix*":return new I(t,e,r,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Yr(i==null?void 0:i[0])});case"smallmatrix":case"smallmatrix*":return new I(t,e,r,{mathstyleName:"scriptstyle",columns:Yr(i==null?void 0:i[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new I(t,e,r,{mathstyleName:t==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new I(t,e,r,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new I(t,e,r,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let n=0;for(let s of e)n=Math.max(n,s.length);let o=[{gap:0},{align:"r"},{gap:.25},{align:"l"}],a=2;for(;a1){i.removeRow(n[0]);let a=i.getCell(Math.max(0,n[0]-1),n[1]);o=t.offsetOf(a[a.length-1])}break;case"column":if(i.colCount>i.minColumns){i.removeColumn(n[1]);let a=i.getCell(n[0],Math.max(0,n[1]-1));o=t.offsetOf(a[a.length-1])}break}o&&t.setPositionHandlingPlaceholder(o)}}function Pf(t){return t.contentWillChange({inputType:"deleteContent"})?(Em(t,"row"),t.contentDidChange({inputType:"deleteContent"}),!0):!1}function Of(t){return t.contentWillChange({inputType:"deleteContent"})?(Em(t,"column"),t.contentDidChange({inputType:"deleteContent"}),!0):!1}oe({addRowAfter:Sl,addColumnAfter:Al,addRowBefore:Kf,addColumnBefore:Bf,removeRow:Pf,removeColumn:Of,setEnvironment:Ll},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Da(){return[new xe]}function Jn(t,e,r,i){var o,a,s,l,c,u;let n=r.parent;if(n&&r instanceof q){let d=!i&&e==="forward"||i==="body"&&e==="backward",m=d?t.offsetOf(r.firstChild):t.offsetOf(r.lastChild);return d?r.rightDelim!=="?"&&r.rightDelim!=="."?(r.leftDelim=".",r.isDirty=!0):(n.addChildrenAfter(r.removeBranch("body"),r),n.removeChild(r),m--):r.leftDelim!=="?"&&r.leftDelim!=="."?(r.rightDelim=".",r.isDirty=!0):(n.addChildrenAfter(r.removeBranch("body"),r),n.removeChild(r),m--),t.position=m,!0}if(n&&r.type==="surd"){if(e==="forward"&&!i||e==="backward"&&i==="body"){let d=r.leftSibling;r.hasChildren&&n.addChildrenAfter(r.removeBranch("body"),r),n.removeChild(r),t.position=t.offsetOf(d)}else e==="forward"&&i==="body"?t.position=t.offsetOf(r):!i&&e==="backward"?r.hasChildren?t.position=t.offsetOf(r.lastChild):(t.position=Math.max(0,t.offsetOf(r)-1),n.removeChild(r)):i==="above"&&(r.hasEmptyBranch("above")&&r.removeBranch("above"),e==="backward"?t.position=t.offsetOf(r.leftSibling):t.position=t.offsetOf(r.body[0]));return!0}if(n&&(r.type==="box"||r.type==="enclose")){let d=i&&e==="backward"||!i&&e==="forward"?r.leftSibling:r.lastChild;return n.addChildrenAfter(r.removeBranch("body"),r),n.removeChild(r),t.position=t.offsetOf(d),!0}if(r.type==="genfrac"||r.type==="overunder"){if(!i)return r.type==="overunder"&&r.hasEmptyBranch("body")||r.type==="genfrac"&&r.hasEmptyBranch("below")&&r.hasEmptyBranch("above")?!1:(t.position=t.offsetOf(e==="forward"?r.firstChild:r.lastChild),!0);let d=qi.fractionNavigationOrder==="numerator-denominator"?"above":"below",m=d==="above"?"below":"above";if(n&&(e==="forward"&&i===d||e==="backward"&&i===m)){let h=r.removeBranch(d),f=r.removeBranch(m);return n.addChildrenAfter([...h,...f],r),n.removeChild(r),t.position=t.offsetOf(h.length>0?h[h.length-1]:f[0]),!0}return e==="backward"?t.position=t.offsetOf(r.leftSibling):t.position=t.offsetOf(r),!0}if(r.isExtensibleSymbol||r.type==="subsup"){if(!i&&e==="forward")return!1;if(!i){if(r.subscript||r.superscript){let d=e==="forward"?(s=(o=r.superscript)==null?void 0:o[0])!=null?s:(a=r.subscript)==null?void 0:a[0]:(u=(l=r.subscript)==null?void 0:l[0].lastSibling)!=null?u:(c=r.superscript)==null?void 0:c[0].lastSibling;return d&&(t.position=t.offsetOf(d)),!0}return!1}if(!r.hasChildren&&r.type==="subsup"){let d=e==="forward"?t.offsetOf(r):Math.max(0,t.offsetOf(r)-1);return r.parent.removeChild(r),t.position=d,!0}if(i==="superscript")if(e==="backward"){let d=t.offsetOf(r.firstChild)-1;d>=0,t.position=d}else r.subscript?t.position=t.offsetOf(r.subscript[0]):t.position=t.offsetOf(r);else i==="subscript"&&(e==="backward"&&r.superscript?t.position=t.offsetOf(r.superscript[0].lastSibling):e==="backward"?t.position=t.offsetOf(r.firstChild)-1:t.position=t.offsetOf(r));if(i&&r.hasEmptyBranch(i)&&(r.removeBranch(i),r.type==="subsup"&&!r.subscript&&!r.superscript)){let d=e==="forward"?t.offsetOf(r):Math.max(0,t.offsetOf(r)-1);r.parent.removeChild(r),t.position=d}return!0}if((n==null?void 0:n.type)==="genfrac"&&!i&&r.type!=="first"){let d=t.offsetOf(r.leftSibling);return n.removeChild(r),n.hasEmptyBranch("above")&&n.hasEmptyBranch("below")?(d=t.offsetOf(n.leftSibling),n.parent.removeChild(n),t.announce("delete",void 0,[n]),t.position=d,!0):(t.announce("delete",void 0,[r]),t.position=d,!0)}if(e==="backward"&&((n==null?void 0:n.command)==="\\ln"||(n==null?void 0:n.command)==="\\log")&&r.parentBranch!=="body"){let d=t.offsetOf(n.leftSibling);return n.parent.removeChild(n),t.announce("delete",void 0,[n]),t.position=d,!0}return!1}function Tm(t){return!t.mathfield.isSelectionEditable||!t.contentWillChange({inputType:"deleteContentBackward"})?!1:t.selectionIsCollapsed?t.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let e=t.at(t.position);if(!(e&&Jn(t,"backward",e))){if(e!=null&&e.isFirstSibling){if(Jn(t,"backward",e.parent,e.parentBranch))return;e=null}if(!e){t.announce("plonk");return}t.position=t.offsetOf(e.leftSibling),e.parent.removeChild(e),t.announce("delete",void 0,[e])}}):Je(t,Y(t.selection),"deleteContentBackward")}function Dm(t){return!t.mathfield.isSelectionEditable||!t.contentWillChange({inputType:"deleteContentForward"})?!1:t.selectionIsCollapsed?t.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var i,n;let e=t.at(t.position).rightSibling;if(e&&Jn(t,"forward",e))return;if(e){if(t.at(t.position).isLastSibling&&Jn(t,"forward",e.parent,e.parentBranch))return}else{if(e=t.at(t.position),e.isLastSibling&&Jn(t,"forward",e.parent,e.parentBranch))return;e=void 0}if(t.position===t.lastOffset||!e){t.announce("plonk");return}e.parent.removeChild(e);let r=(i=t.at(t.position))==null?void 0:i.rightSibling;for(;(r==null?void 0:r.type)==="subsup";)r.parent.removeChild(r),r=(n=t.at(t.position))==null?void 0:n.rightSibling;t.announce("delete",void 0,[e])}):Je(t,Y(t.selection),"deleteContentForward")}function Je(t,e,r){let i=t.getAtoms(e);if(i.length>0&&i[0].parent){let n=i[0].parent.firstChild;n.type==="first"&&(n=n.rightSibling);let o=i[i.length-1].parent.lastChild,a=i[0];a.type==="first"&&(a=a.rightSibling);let s=i[i.length-1];if(a===n&&s===o){let l=i[0].parent;l.parent&&l.type!=="prompt"&&(e=[t.offsetOf(l.leftSibling),t.offsetOf(l)])}if(i.length===1&&i[0].type==="placeholder"&&i[0].parent.type==="genfrac"){let l=i[0].parent,c=i[0].parentBranch==="below"?"above":"below",u=t.offsetOf(l.leftSibling);return t.deferNotifications({content:!0,selection:!0,type:r},()=>{var m,h;let d=l.removeBranch(c);if(d.length===1&&d[0].type==="placeholder")(h=l.parent)==null||h.removeChild(l),t.position=Math.max(0,u);else{let f=l.parent.addChildrenAfter(d,l);(m=l.parent)==null||m.removeChild(l),t.position=t.offsetOf(f)}})}}return t.deferNotifications({content:!0,selection:!0,type:r},()=>t.deleteAtoms(e))}function Km(t,e){let r=t.at(t.position);if(r.type==="composition")r.value=e;else{let{caret:i}=r;r.caret=void 0;let n=new Di(e,{mode:r.mode});n.caret=i,r.parent.addChildAfter(n,r),t.position+=1}}function Bm(t){let e=t.at(t.position);e.type==="composition"&&(e.parent.removeChild(e),t.position-=1)}function Pm(t,e){let r=t.at(e),i;if(r){i=r.mode;let n=r.parent;for(;!i&&n;)n&&(i=n.mode),n=n.parent}return i}function Ct(t,e){!t||!e||(ee(t)?t.forEach(r=>Ct(r,e)):typeof t=="object"&&!t.style.color&&!t.style.backgroundColor&&!t.style.fontFamily&&!t.style.fontShape&&!t.style.fontSeries&&!t.style.fontSize&&!t.style.variant&&!t.style.variantStyle&&(t.applyStyle(e),Ct(t.body,e),Ct(t.above,e),Ct(t.below,e),Ct(t.subscript,e),Ct(t.superscript,e)))}function Gn(t,e,r,i){function n(a,s){for(let l of o)if(l.style[a]!==s)return!1;return!0}if(e=t.normalizeRange(e),e[0]===e[1])return!1;let o=t.getAtoms(e,{includeChildren:!0});i.operation==="toggle"&&(r.color&&n("color",r.color)&&(r.color="none",delete r.verbatimColor),r.backgroundColor&&n("backgroundColor",r.backgroundColor)&&(r.backgroundColor="none",delete r.verbatimBackgroundColor),r.fontFamily&&n("fontFamily",r.fontFamily)&&(r.fontFamily="none"),r.fontSeries&&n("fontSeries",r.fontSeries)&&(r.fontSeries="auto"),r.fontShape&&n("fontShape",r.fontShape)&&(r.fontShape="auto"),r.fontSize&&n("fontSize",r.fontSize)&&(r.fontSize=Mi),r.variant&&n("variant",r.variant)&&(r.variant="normal"),r.variantStyle&&n("variantStyle",r.variantStyle)&&(r.variantStyle=""));for(let a of o)a.applyStyle(r);return!0}var Pa=class Pa{constructor(e){this.recording=!1;this.model=e,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(e){e&&this.index>=0&&(this.stack[this.index].selection=e),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(e){return this.recording?(e&&e===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>Pa.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=e!=null?e:"",!0):!1}};Pa.maximumDepth=1e3;var Ba=Pa;function El(t){let e=t.position,r=t.at(e).parent;return r!=null&&r.parent?(t.position=t.offsetOf(r),t.mathfield.stopCoalescingUndo(),t.announce("move",e),!0):(t.announce("plonk"),!1)}function zf(t){let e=0,r=t.at(t.position),i=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(e+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(i=!1):i=!0,r=r.parent;return i?e:0}function If(t){let e=0,r=t.at(t.position),i=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(e+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(i=!0):i=!1,r=r.parent;return i?e:0}function Om(t){var r;if(t.collapseSelection(),zf(t)>=t.mathfield.options.scriptDepth[1])return t.announce("plonk"),!1;let e=t.at(t.position);return e.subsupPlacement===void 0&&(((r=e.rightSibling)==null?void 0:r.type)!=="subsup"&&e.parent.addChildAfter(new Ot({style:e.computedStyle}),e),e=e.rightSibling),e.createBranch("superscript"),t.setSelection(t.getSiblingsRange(t.offsetOf(e.superscript[0]))),!0}function zm(t){var r;if(t.collapseSelection(),If(t)>=t.mathfield.options.scriptDepth[0])return t.announce("plonk"),!1;let e=t.at(t.position);return e.subsupPlacement===void 0&&(((r=t.at(t.position+1))==null?void 0:r.type)!=="subsup"&&e.parent.addChildAfter(new Ot({style:t.at(t.position).computedStyle}),e),e=t.at(t.position+1)),e.createBranch("subscript"),t.setSelection(t.getSiblingsRange(t.offsetOf(e.subscript[0]))),!0}function Rf(){function t(l){let c=[],u=[];return[...l.querySelectorAll(`input, select, textarea, a[href], button, + [tabindex], audio[controls], video[controls], + [contenteditable]:not([contenteditable="false"]), details>summary`)].filter(e).forEach((m,h)=>{let f=i(m);f===0?c.push(m):u.push({documentOrder:h,tabIndex:f,node:m})}),u.sort((m,h)=>m.tabIndex===h.tabIndex?m.documentOrder-h.documentOrder:m.tabIndex-h.tabIndex).map(m=>m.node).concat(c)}function e(l){return!(!r(l)||n(l)||i(l)<0)}function r(l){return!(l.disabled||l.type==="hidden"&&l.tagName.toUpperCase()==="INPUT"||s(l))}function i(l){var u;let c=Number.parseInt((u=l.getAttribute("tabindex"))!=null?u:"NaN",10);return Number.isNaN(c)?l.contentEditable==="true"||(l.nodeName==="AUDIO"||l.nodeName==="VIDEO")&&l.getAttribute("tabindex")===null?0:l.tabIndex:c}function n(l){return l.tagName.toUpperCase()==="INPUT"&&l.type==="radio"&&!a(l)}function o(l,c){for(let u of l)if(u.checked&&u.form===c)return u;return null}function a(l){var m;if(!l.name)return!0;let u=((m=l.form)!=null?m:l.ownerDocument).querySelectorAll('input[type="radio"][name="'+l.name+'"]'),d=o(u,l.form);return!d||d===l}function s(l){if(!pe()||l===document.activeElement||l.contains(document.activeElement))return!1;if(getComputedStyle(l).visibility==="hidden")return!0;let c=l.getBoundingClientRect();if(c.width===0||c.height===0)return!0;for(;l;){if(getComputedStyle(l).display==="none")return!0;l=l.parentElement}return!1}return pe()?t(document.body):[]}function Me(t,e,r="forward"){let i=t.position;if(Array.isArray(e)){let n=t.offsetOf(e[0]),o=t.offsetOf(e[e.length-1]);return r==="forward"?t.setSelection(n,o):t.setSelection(o,n),t.announce("move",i),t.mathfield.stopCoalescingUndo(),!0}return r==="forward"?Me(t,[e.leftSibling,e]):Me(t,[e,e.leftSibling])}function ct(t,e){let r=t.position;if(typeof e=="number"&&(e=t.at(e)),e.type==="prompt")t.setSelection(t.offsetOf(e.firstChild),t.offsetOf(e.lastChild));else{let i=t.offsetOf(e);e.type==="placeholder"?t.setSelection(i-1,i):t.position=i}return t.announce("move",r),t.mathfield.stopCoalescingUndo(),!0}function Oa(t,e,r=!0){var s,l;let i=e==="forward"?1:-1;t.at(t.anchor).type==="placeholder"&&Ge(t,e);let n,o=t.at(t.anchor).parentPrompt;o?e==="forward"?n=t.offsetOf(o)+1:n=t.offsetOf(o.leftSibling):n=Math.max(t.position+i,0);let a=Cl(t,n,e);if(!a||e==="forward"&&t.offsetOf(a)n){if(!r||!((l=(s=t.mathfield.host)==null?void 0:s.dispatchEvent(new CustomEvent("move-out",{detail:{direction:e},cancelable:!0,bubbles:!0,composed:!0})))==null||l))return t.announce("plonk"),!1;let u=Rf();if(!document.activeElement||u.length<=1)return t.announce("plonk"),!1;let d=u.indexOf(document.activeElement)+i;return d<0&&(d=u.length-1),d>=u.length&&(d=0),u[d].focus(),t.mathfield.stopCoalescingUndo(),!0}return ct(t,a),!0}function Cl(t,e=0,r="forward"){return t.findAtom(i=>i.type==="placeholder"||i.type==="prompt"||!t.mathfield.readOnly&&i.treeDepth>2&&i.isFirstSibling&&i.isLastSibling,e,r)}oe({moveToOpposite:t=>{let e={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},r=t.at(t.position),{parent:i}=r;if(!i)return t.announce("plonk"),!1;let n=r.parentBranch,o;if(typeof n=="string"&&(o=e[n]),!o){let s=r.subsupPlacement?zm(t):Om(t);return t.mathfield.stopCoalescingUndo(),s}i.branch(o)||i.createBranch(o);let a=t.setSelection(t.getBranchRange(t.offsetOf(i),o));return t.mathfield.stopCoalescingUndo(),a},moveBeforeParent:t=>{let{parent:e}=t.at(t.position);return e?(t.position=t.offsetOf(e),t.mathfield.stopCoalescingUndo(),!0):(t.announce("plonk"),!1)},moveAfterParent:t=>El(t),moveToNextChar:t=>Ge(t,"forward"),moveToPreviousChar:t=>Ge(t,"backward"),moveUp:t=>Ge(t,"upward"),moveDown:t=>Ge(t,"downward"),moveToNextWord:t=>wr(t,"forward"),moveToPreviousWord:t=>wr(t,"backward"),moveToGroupStart:t=>{let e=t.offsetOf(t.at(t.position).firstSibling);return e===t.position?(t.announce("plonk"),!1):(t.position=e,t.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:t=>{let e=t.offsetOf(t.at(t.position).lastSibling);return e===t.position?(t.announce("plonk"),!1):(t.position=e,t.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:t=>{var a,s,l,c;if(t.position===t.lastOffset&&t.anchor===t.lastOffset)return Oa(t,"forward");let e=t.at(t.position);if(e.mode==="text"){if(t.selectionIsCollapsed){let u=e;for(;u&&u.mode==="text";)u=u.leftSibling;let d=e;for(;((a=d.rightSibling)==null?void 0:a.mode)==="text";)d=d.rightSibling;if(u&&d)return Me(t,[u,d])}if(e.rightSibling.mode==="text"){let u=e;for(;u&&u.mode==="text";)u=u.rightSibling;return u?(ct(t,(s=u.leftSibling)!=null?s:u),t.mathfield.switchMode("math"),!0):ct(t,t.lastOffset)}}let i=Cl(t,t.position+1,"forward");if(i)return ct(t,i);let n=Im(t,e,u=>u.type==="leftright"||u.type==="text","forward");if(n){if(n.mode==="text"){let u=n;for(;u&&u.mode==="text";)u=u.rightSibling;return Me(t,[(l=n.leftSibling)!=null?l:n,(c=u.leftSibling)!=null?c:u])}return Me(t,n)}let o=e.parent;if(o){if(o.type==="leftright"||o.type==="surd")return Me(t,o);if(e.parentBranch==="superscript"&&o.subscript)return Me(t,o.subscript);if(e.parentBranch==="above"&&o.below)return Me(t,o.below);if(e.parentBranch==="superscript"||e.parentBranch==="subscript")return ct(t,o);if(e.parentBranch==="above"||e.parentBranch==="below")return Me(t,o)}return ct(t,t.lastOffset)},moveToPreviousGroup:t=>{var n;if(t.position===0&&t.anchor===0)return Oa(t,"backward");let e=t.at(t.position),r=e.mode;if(r==="text"){if(t.selectionIsCollapsed){let o=e;for(;o&&o.mode==="text";)o=o.leftSibling;let a=e;for(;((n=a.rightSibling)==null?void 0:n.mode)==="text";)a=a.rightSibling;if(o&&a)return Me(t,[o,a])}for(;e&&e.mode==="text";)e=e.leftSibling;return e?ct(t,e):ct(t,0)}let i=Cl(t,t.position-1,"backward");if(i)return ct(t,i);if(r==="math"){let o=Im(t,e,s=>s.type==="leftright"||s.type==="text","backward");if(o){if(o.mode==="text"){let s=o;for(;s&&s.mode==="text";)s=s.leftSibling;return Me(t,[o,s])}return Me(t,o)}let a=e.parent;if(a){if(a.type==="leftright"||a.type==="surd")return Me(t,a);if(e.parentBranch==="subscript"&&a.superscript)return Me(t,a.superscript);if(e.parentBranch==="below"&&a.above)return Me(t,a.above);if(e.parentBranch==="superscript"||e.parentBranch==="subscript")return ct(t,a);if(e.parentBranch==="above"||e.parentBranch==="below")return Me(t,a)}return ct(t,0)}return!1},moveToMathfieldStart:t=>t.selectionIsCollapsed&&t.position===0?(t.announce("plonk"),!1):(t.position=0,t.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:t=>t.selectionIsCollapsed&&t.position===t.lastOffset?(t.announce("plonk"),!1):(t.position=t.lastOffset,t.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:t=>Om(t),moveToSubscript:t=>zm(t)},{target:"model",changeSelection:!0});oe({moveToNextPlaceholder:t=>Oa(t,"forward"),moveToPreviousPlaceholder:t=>Oa(t,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function Im(t,e,r,i){if(i==="forward"){let o=e.rightSibling;for(;o&&!r(o);)o=o.rightSibling;return o}let n=e.leftSibling;for(;n&&!r(n);)n=n.leftSibling;return n}function za(t,e,r){typeof e=="function"&&(r=e,e=1/0),e===void 0&&(e=1/0);let i=t.position,n=!1,o="";for(;!n;){let a=t.at(i);n=e===0||a===void 0||a.type==="first"||a.mode!=="math"||!(a.type&&/mord|mpunct|operator/.test(a.type)||a.type==="mop"&&/[a-zA-Z ]+/.test(a.value))||!a.hasEmptyBranch("superscript")||!a.hasEmptyBranch("subscript")||typeof r=="function"&&!r(a),n||(a.mode="text",a.command=a.value,a.verbatimLatex=void 0,o+=a.value),i-=1,e-=1}t.contentDidChange({data:o,inputType:"insertText"})}function ti(t,e,r){typeof e=="function"&&(r=e,e=1/0),e===void 0&&(e=1/0);let i=t.position,n=!1,o=[];for(;!n;){let a=t.at(i);n=e===0||!a||a.type==="first"||a.isFirstSibling||a.mode!=="text"||a.value===" "||typeof r=="function"&&!r(a),n||(o.push(y.serialize([a],{defaultMode:"math"})),a.mode="math"),i-=1,e-=1}Ia(t),t.contentDidChange({data:B(o),inputType:"insertText"})}function Ia(t){var r;let e=t.position-1;for(;e>=0&&((r=t.at(e))==null?void 0:r.mode)==="math";)e-=1;if(!(e<0)&&t.at(e).mode==="text"&&t.at(e).value===" "&&t.at(e-1).mode==="math"){t.at(e-1).parent.removeChild(t.at(e-1));let i=t.silenceNotifications;t.silenceNotifications=!0,t.position-=1,t.silenceNotifications=i,t.contentDidChange({inputType:"deleteContent"})}}function Nf(t){let e="",r=t.position,i=!1;for(;!i;){let n=t.at(r);i=!(n&&(n.mode==="text"||n.mode==="math"&&n.type&&/mord|mpunct/.test(n.type))),i||(e=n.value+e),r-=1}return e}function Rm(t,e,r){let{model:i}=t;if(i.mode==="latex"||!i.at(i.position).isLastSibling||!r||!gr(r))return!1;let n=yr(r);if(!i.selectionIsCollapsed)return!!(t.model.mode==="text"&&/[/_^]/.test(n));let o=Nf(i)+n;if(t.model.mode==="text"){if(e==="Esc"||/[/\\]/.test(n))return!0;if(/[\^_]/.test(n))return/(^|\s)[a-zA-Z][^_]$/.test(o)&&ti(i,1),!0;let a={")":"(","}":"{","]":"["}[n],{parent:s}=i.at(i.position);if(a&&s instanceof q&&s.leftDelim===a)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(o))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(n))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(o))return ti(i,1),!1;if(/\D\.[^\d\s]$/.test(o)){ti(i,1);let l=i.at(i.position);return l.value="\u22C5",l.style.variant="normal",l.command="\\cdot",l.verbatimLatex=void 0,i.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(o)||/\.\d$/.test(o)||/\([\d+\-.]$/.test(o))return ti(i,1),!0;if(/\([a-z][,;]$/.test(o))return ti(i,2),!0;if(/[\d+\-=><*|]$/.test(n))return Ia(i),!0}else{if(e==="[Space]")return za(i,void 0,a=>/[a-z][:,;.]$/.test(a.value)),!0;if(/[a-zA-Z]{3,}$/.test(o)&&!/(dxd|abc|xyz|uvw)$/.test(o))return za(i,void 0,a=>/[a-zA-Z]/.test(a.value)),!0;if(/(^|\W)(if)$/i.test(o))return za(i,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(o)&&!/(αβγ)$/.test(o))return za(i,void 0,a=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(a.value)),!0;if(n==="?"||n==="."&&!/[\d-+]\.$/.test(o))return!0}return!1}function Nm(t,e){if(!t.isSelectionEditable||!t.keystrokeCaptionVisible)return;let r=Vm(),i=t.element.getBoundingClientRect();r.style.left=`${i.left}px`,r.style.top=`${i.top-64}px`,r.innerHTML=window.MathfieldElement.createHTML(""+(Ni(e)||e)+""+r.innerHTML),r.style.visibility="visible",setTimeout(()=>{r.childNodes.length>0&&r.childNodes[r.childNodes.length-1].remove(),r.childNodes.length===0&&(r.style.visibility="hidden")},3e3)}function Fm(t){if(t.keystrokeCaptionVisible=!t.keystrokeCaptionVisible,t.keystrokeCaptionVisible){let e=Vm();e.innerHTML=""}else{let e=Hr("mathlive-keystroke-caption-panel");e.style.visibility="hidden"}return!1}function Vm(){let t=document.getElementById("mathlive-keystroke-caption-panel");return t||(Oe("keystroke-caption"),Oe("core"),Hr("mathlive-keystroke-caption-panel"))}function $m(){document.getElementById("mathlive-keystroke-caption-panel")&&(Vi("mathlive-keystroke-caption-panel"),We("core"),We("keystroke-caption"))}function Kl(t,e){var u,d,m,h;let{model:r}=t,i=wa(e);if(e.isTrusted){om(e);let f=fr();t.keyboardLayout!==f.id&&(t.keyboardLayout=f.id,t._keybindings=void 0)}if(clearTimeout(t.inlineShortcutBufferFlushTimer),t.inlineShortcutBufferFlushTimer=0,Nm(t,i),e.isTrusted&&e.defaultPrevented)return t.flushInlineShortcutBuffer(),!1;let n,o="",a,s=t.inlineShortcutBuffer;if(t.isSelectionEditable){if(r.mode==="math")if(i==="[Backspace]")s.pop();else if(!gr(e))t.flushInlineShortcutBuffer();else{let f=yr(e),x=[...(d=(u=s[s.length-1])==null?void 0:u.keystrokes)!=null?d:[],f];s.push({state:r.getState(),keystrokes:x,leftSiblings:Ff(t)});let M=0,b="";for(;!n&&M(N.insert(r,n,{format:"latex",style:f}),Ia(t.model),n.endsWith(" ")&&(r.mode="text",N.insert(r," ",{style:f,mode:"text"})),t.snapshot(),r.selectionIsCollapsed||t.flushInlineShortcutBuffer(),!0)),t.dirty=!0,r.announce("replacement")}return t.scrollIntoView(),e.preventDefault&&e.preventDefault(),!1}function Xn(t,e,r){let{model:i}=t;if(!t.isSelectionEditable){i.announce("plonk");return}r!=null||(r={}),r.focus&&t.focus(),r.feedback&&window.MathfieldElement.playSound("keypress"),typeof r.mode=="string"&&(t.switchMode(r.mode),t.snapshot());let n=ia(e),o=window.mathVirtualKeyboard;if(o!=null&&o.isShifted&&(n=typeof n=="string"?n.toUpperCase():n.map(l=>l.toUpperCase())),r.simulateKeystroke){let l=!0;for(let c of n)Kl(t,new KeyboardEvent("keypress",{key:c}))&&(l=!1);if(l)return}let a=i.at(i.position),s=p(p({},a.computedStyle),t.style);if(i.selectionIsCollapsed||(i.deleteAtoms(Y(i.selection)),t.snapshot("delete")),i.mode==="latex")i.deferNotifications({content:!0,selection:!0,data:e,type:"insertText"},()=>{qr(t);for(let l of n)N.insert(i,l);t.snapshot("insert-latex"),br(t)});else if(i.mode==="text"){for(let l of n)N.insert(i,l,{style:s});t.snapshot("insert-text")}else if(i.mode==="math")for(let l of n)Vf(t,l,s,a);t.dirty=!0,t.scrollIntoView()}function Ff(t){let e=t.model,r=[],i=e.at(Math.min(e.position,e.anchor));for(;i.type!=="first";)r.push(i),i=i.leftSibling;return r}function Vf(t,e,r,i){let n=t.model,o={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[e];if(e===" "&&t.options.mathModeSpace&&(o=["insert",t.options.mathModeSpace]),o){t.executeCommand(o);return}if(/\d/.test(e)&&t.options.smartSuperscript&&i.parentBranch==="superscript"&&i.parent.type!=="mop"&&i.parent.type!=="operator"&&i.parent.type!=="extensible-symbol"&&i.hasNoSiblings){$f(n),N.insert(n,e,{style:r}),t.snapshot(),El(n),t.snapshot();return}if(t.adoptStyle!=="none"){let a=t.adoptStyle==="left"?i:i.parent?i.rightSibling:null;(a==null?void 0:a.type)==="mord"&&/[a-zA-Z0-9]/.test(a.value)&&/[a-zA-Z0-9]/.test(e)&&(r=p({},r),a.style.variant&&(r.variant=a.style.variant),a.style.variantStyle&&(r.variantStyle=a.style.variantStyle))}N.insert(n,e,{style:r}),t.snapshot(`insert-${n.at(n.position).type}`)}function $f(t){t.selectionIsCollapsed||(t.deleteAtoms(Y(t.selection)),t.mathfield.snapshot("delete"))}function Dl(t,e,r){if(!e||t.mode!=="math")return!1;let i=t.at(t.position),{parent:n}=i,o={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[e];if(!o)return!1;let a=Ei[o],s=Ci[o];if(!t.selectionIsCollapsed){t.mathfield.snapshot();let[l,c]=Y(t.selection),u=t.extractAtoms([l,c]),d=n.addChildrenAfter([new q("left...right",u,{leftDelim:o,rightDelim:s})],t.at(l));return t.setSelection(t.offsetOf(d.firstChild),t.offsetOf(d.lastChild)),t.mathfield.snapshot("insert-fence"),t.contentDidChange({data:o,inputType:"insertText"}),!0}if(o==="|"){let l=n instanceof q?n.leftDelim+n.rightDelim:"";if(l==="\\lbrace\\rbrace"||l==="\\{\\}"||l==="\\lbrace?")return t.mathfield.snapshot(),N.insert(t,"\\,\\middle\\vert\\,",{format:"latex",style:r}),t.mathfield.snapshot("insert-fence"),t.contentDidChange({data:o,inputType:"insertText"}),!0}if(s){if(n instanceof q&&n.firstChild===i&&(n.leftDelim==="?"||n.leftDelim==="."))return n.leftDelim=o,n.isDirty=!0,t.mathfield.snapshot(),t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0;if(!(n instanceof q)){let d=i;for(;d&&!(d.type==="mclose"&&d.value===s);)d=d.rightSibling;if(d){t.mathfield.snapshot();let m=t.extractAtoms([t.offsetOf(i),t.offsetOf(d)]);return m.pop(),n.addChildrenAfter([new q("left...right",m,{leftDelim:o,rightDelim:s})],i),t.position=t.offsetOf(n.firstChild)+1,t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0}}let l=t.offsetOf(i.lastSibling),c;for(c=t.position;c<=l;c++){let d=t.at(c);if(d instanceof q&&(d.leftDelim==="?"||d.leftDelim===".")&&qm(o,d.rightDelim))break}let u=t.at(c);if(c<=l&&u instanceof q){u.leftDelim=o,t.mathfield.snapshot();let d=t.extractAtoms([t.position,c-1]);return d=d.filter(m=>m.type!=="first"),u.addChildren(d,u.parentBranch),t.position+=1,t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0}if(n instanceof q&&(n.leftDelim==="?"||n.leftDelim===".")&&qm(o,n.rightDelim)){n.isDirty=!0,n.leftDelim=o,t.mathfield.snapshot();let d=t.extractAtoms([t.offsetOf(i.firstSibling),t.position]);for(let m of d)n.parent.addChildBefore(m,n);return t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0}if(!(n instanceof q&&n.leftDelim==="|")){if(t.mathfield.snapshot(),N.insert(t,`\\left${o}\\right?`,{format:"latex",style:r}),i.lastSibling.type!=="first"){let d=t.offsetOf(i.lastSibling),m=t.extractAtoms([t.position,d]);t.at(t.position).body=m,t.position-=1}return t.mathfield.snapshot("insert-fence"),!0}}if(a){let l=i;for(;l;){if(l.type==="mopen"&&l.value===a){t.mathfield.snapshot();let h=l.leftSibling,f=t.extractAtoms([t.offsetOf(l.leftSibling),t.offsetOf(i)]);f.shift();let x=new q("left...right",f,{leftDelim:a,rightDelim:o});return n.addChildrenAfter([x],h),t.position=t.offsetOf(x),t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0}l=l.leftSibling}if(n instanceof q&&i.isLastSibling&&Tl(n.leftDelim,o))return t.mathfield.snapshot(),n.isDirty=!0,n.rightDelim=o,t.position+=1,t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0;let c=t.offsetOf(i.firstSibling),u;for(u=t.position;u>=c;u--){let h=t.at(u);if(h instanceof q&&(h.rightDelim==="?"||h.rightDelim===".")&&Tl(h.leftDelim,o))break}let d=t.at(u);if(u>=c&&d instanceof q)return t.mathfield.snapshot(),d.rightDelim=o,d.addChildren(t.extractAtoms([u,t.position]),d.parentBranch),t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0;if(n instanceof q&&(n.rightDelim==="?"||n.rightDelim===".")&&Tl(n.leftDelim,o))return t.mathfield.snapshot(),n.isDirty=!0,n.rightDelim=o,n.parent.addChildren(t.extractAtoms([t.position,t.offsetOf(i.lastSibling)]),n.parentBranch),t.position=t.offsetOf(n),t.contentDidChange({data:o,inputType:"insertText"}),t.mathfield.snapshot("insert-fence"),!0;let m=n.parent;return m instanceof q&&(m.rightDelim==="?"||m.rightDelim===".")&&t.at(t.position).isLastSibling?(t.position=t.offsetOf(m),Dl(t,o,r)):!1}return!1}function Tl(t,e){return t?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(t)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(e):Ci[t]===e:!0}function qm(t,e){return e?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(e)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(t):Ei[e]===t:!0}var Hm={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};v(Object.keys(Hm),"{body:auto}",{createAtom:t=>new hr(g(p({},t),{body:L(t.args[0]),accentChar:Hm[t.command.slice(1)]}))});v(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:t=>{let e=as(L(t.args[0]));return new hr(g(p({},t),{body:L(t.args[0]),svgAccent:t.command.slice(1)+(e.length>5?"4":["1","1","2","2","3","3"][e.length])}))}});v(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:t=>new hr(g(p({},t),{body:L(t.args[0]),svgAccent:"overarc"}))});v(["underarc","underparen"],"{body:auto}",{createAtom:t=>new fe(g(p({},t),{body:L(t.args[0]),svgBelow:"underarc"}))});v("utilde","{body:auto}",{createAtom:t=>{let e=L(t.args[0]),r=as(e),i="widetilde"+(r.length>5?"4":["1","1","2","2","3","3"][r.length]);return new fe(g(p({},t),{body:e,svgBelow:i,boxType:Kr(e)}))}});v("^","{:string}",{createAtom:t=>{var e;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:t.args[0]&&(e={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[t.args[0]])!=null?e:"^"}))}});v("`","{:string}",{createAtom:t=>{var e;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:t.args[0]&&(e={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[t.args[0]])!=null?e:"`"}))}});v("'","{:string}",{createAtom:t=>{var e;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:t.args[0]&&(e={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[t.args[0]])!=null?e:"'"}))}});v('"',"{:string}",{createAtom:t=>{var e,r;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:(e=t.args)!=null&&e[0]?(r={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[t.args[0]])!=null?r:'"'+t.args[0]:'"'}))}});v(".","{:string}",{createAtom:t=>{var e,r;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:(e=t.args)!=null&&e[0]?(r={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[t.args[0]])!=null?r:"."+t.args[0]:"."}))}});v("=","{:string}",{createAtom:t=>{var e,r;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:(e=t.args)!=null&&e[0]?(r={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[t.args[0]])!=null?r:"="+t.args[0]:"="}))}});v("~","{:string}",{createAtom:t=>{var e;return new y(g(p({type:"mord"},t),{isFunction:!1,limits:"adjacent",value:t.args[0]&&(e={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[t.args[0]])!=null?e:"\xB4"}))}});v("c","{:string}",{createAtom:t=>{var e;return new y(g(p({},t),{type:"mord",isFunction:!1,limits:"adjacent",value:t.args[0]&&(e={c:"\xE7",C:"\xC7"}[t.args[0]])!=null?e:""}))}});v("enclose","{notation:string}[style:string]{body:auto}",{createAtom:t=>{var n,o;let e=t.args,r={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(n=t.style)!=null?n:{}};if(e[1]){let a=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(let s of a){let l=s.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(l)r.strokeWidth=l[1],r.strokeStyle=l[2],r.strokeColor=l[3];else{let c=s.match(/\s*([a-z]*)\s*=\s*"(.*)"/);c&&(c[1]==="mathbackground"?r.backgroundcolor=c[2]:c[1]==="mathcolor"?r.strokeColor=c[2]:c[1]==="padding"?r.padding=c[2]:c[1]==="shadow"&&(r.shadow=c[2]))}}r.strokeStyle==="dashed"?r.svgStrokeStyle="5,5":r.strokeStyle==="dotted"&&(r.svgStrokeStyle="1,5")}r.borderStyle=`${r.strokeWidth} ${r.strokeStyle} ${r.strokeColor}`;let i={};return((o=e[0])!=null?o:"").split(/[, ]/).filter(a=>a.length>0).forEach(a=>{i[a.toLowerCase()]=!0}),new zt(t.command,L(e[2]),i,r)}});v("cancel","{body:auto}",{createAtom:t=>{var e;return new zt(t.command,L(t.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(e=t.style)!=null?e:{}})}});v("bcancel","{body:auto}",{createAtom:t=>{var e;return new zt(t.command,L(t.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(e=t.style)!=null?e:{}})}});v("xcancel","{body:auto}",{createAtom:t=>{var e;return new zt(t.command,L(t.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(e=t.style)!=null?e:{}})}});v(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:t=>{var e;return new fe(g(p({},t),{body:L((e=t.args)==null?void 0:e[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:t.command.slice(1)}))}});v("overbrace","{:auto}",{createAtom:t=>new fe(g(p({},t),{body:L(t.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:t.command.slice(1)}))});v(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:t=>new fe(g(p({},t),{body:L(t.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:t.command.slice(1)}))});v(["underbrace"],"{:auto}",{createAtom:t=>new fe(g(p({},t),{body:L(t.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:t.command.slice(1)}))});v(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:t=>{var e,r,i,n,o;return new fe(g(p({},t),{svgBody:t.command.slice(1),above:((r=L((e=t.args)==null?void 0:e[1]))==null?void 0:r.length)===0?void 0:L((i=t.args)==null?void 0:i[1]),below:(o=L((n=t.args)==null?void 0:n[0]))!=null?o:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(t,e)=>t.command+(t.hasEmptyBranch("below")?"":`[${t.belowToLatex(e)}]`)+`{${t.aboveToLatex(e)}}${t.supsubToLatex(e)}`});v(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:t=>new ot(t.command.slice(1),g(p({},t),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))});v(["liminf","limsup"],"",{ifMode:"math",createAtom:t=>new ot({"\\liminf":"lim inf","\\limsup":"lim sup"}[t.command],g(p({},t),{limits:"over-under",variant:"main"}))});v(["lim","mod"],"",{ifMode:"math",createAtom:t=>new ot(t.command.slice(1),g(p({},t),{limits:"over-under",variant:"main"}))});v(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:t=>new ot(t.command.slice(1),g(p({},t),{limits:"over-under",isFunction:!0,variant:"main"}))});v(["ang"],"{:math}",{ifMode:"math",createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),serialize:(t,e)=>`\\ang{${t.bodyToLatex(e)}}`,render:(t,e)=>{let r=t.createBox(e),i=r.caret;r.caret=void 0;let n=new w("\xB0",{style:g(p({},t.style),{variant:"normal",variantStyle:"up"})});return new w([r,n],{type:"inner",isSelected:t.isSelected,caret:i})}});v("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:t=>new Ri(g(p({},t),{body:L(t.args[1]),index:t.args[0]?L(t.args[0]):void 0}))});v(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:t=>{let e=p({},t),r=t.command,i=t.args;switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":e.hasBarLine=!0;break;case"\\atopfrac":e.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":e.hasBarLine=!1,e.leftDelim="(",e.rightDelim=")";break;case"\\cfrac":e.hasBarLine=!0,e.continuousFraction=!0;break;default:}switch(r){case"\\dfrac":case"\\dbinom":e.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":e.mathstyleName="textstyle";break;default:}return new Mt(i[0]?L(i[0]):[new xe],i[1]?L(i[1]):[new xe],e)},serialize:(t,e)=>{let r=t.aboveToLatex(e),i=t.belowToLatex(e);return/^[0-9]$/.test(r)&&/^[0-9]$/.test(i)?`${t.command}${r}${i}`:F(t.command,r,i)}});v(["brace","brack"],"",{infix:!0,createAtom:t=>new Mt(L(t.args[0]),L(t.args[1]),g(p({},t),{hasBarLine:!1,leftDelim:t.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:t.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(t,e)=>B([t.aboveToLatex(e),t.command,t.belowToLatex(e)])});v(["over","atop","choose"],"",{infix:!0,createAtom:t=>{let e,r,i=t.args;return t.command==="\\choose"&&(e="(",r=")"),new Mt(L(i[0]),L(i[1]),g(p({},t),{hasBarLine:t.command==="\\over",leftDelim:e,rightDelim:r}))},serialize:(t,e)=>B([t.aboveToLatex(e),t.command,t.belowToLatex(e)])});v(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:t=>{var r,i;let e=t.args;return new Mt(L(e[0]),L(e[1]),g(p({},t),{leftDelim:(r=e[2])!=null?r:".",rightDelim:(i=e[3])!=null?i:".",hasBarLine:!1}))},serialize:(t,e)=>`${t.aboveToLatex(e)} ${t.command}${t.leftDelim}${t.rightDelim}${t.belowToLatex(e)}`});v("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:t=>new Mt(L(t.args[0]),L(t.args[1]),g(p({},t),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))});v(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:t=>new Rr({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[t.command.slice(1)],g(p({},t),{limits:"auto",variant:"main"}))});v("smallint","",{ifMode:"math",createAtom:t=>new ot("\u222B",g(p({},t),{limits:"adjacent",variant:"main"}))});var Wm={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};v(Object.keys(Wm),"",{ifMode:"math",createAtom:t=>{let e=t.command,r=Wm[e.slice(1)];return new Rr(r,g(p({},t),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[r]}))}});v(["Re","Im"],"",{ifMode:"math",createAtom:t=>new ot({"\\Re":"\u211C","\\Im":"\u2111"}[t.command],g(p({},t),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))});v("middle","{:delim}",{ifMode:"math",createAtom:t=>{var e;return new zi(g(p({},t),{delim:(e=t.args[0])!=null?e:"|",size:1}))}});v("the","{:value}",{createAtom:t=>new y(g(p({},t),{captureSelection:!0,verbatimLatex:null})),render:(t,e)=>{var o;let r=new T({parent:e},t.style),i="";t.isSelected&&(i+=" ML__selected");let n=r.evaluate(t.args[0]);return new w(((o=ce(n))!=null?o:"").split("").map(a=>new w(a,{type:"ord",classes:i,mode:t.mode,isSelected:t.isSelected,style:p({variant:"main"},t.style)})),{type:"lift",style:t.style,caret:t.caret,isSelected:t.isSelected,classes:i}).wrap(r)},serialize:t=>{var e;return`\\the${(e=ce(t.args[0]))!=null?e:"\\relax"}`}});v("mathtip","{:auto}{:math}",{createAtom:t=>new Nr(g(p({},t),{body:L(t.args[0]),tooltip:L(t.args[1]),content:"math"})),serialize:(t,e)=>e.skipStyles?t.bodyToLatex(e):`\\texttip{${t.bodyToLatex(e)}}{${y.serialize([t.tooltip],g(p({},e),{defaultMode:"math"}))}}`});v("texttip","{:auto}{:text}",{createAtom:t=>new Nr(g(p({},t),{body:L(t.args[0]),tooltip:L(t.args[1]),content:"text"})),serialize:(t,e)=>e.skipStyles?t.bodyToLatex(e):`\\texttip{${t.bodyToLatex(e)}}{${y.serialize([t.tooltip],g(p({},e),{defaultMode:"text"}))}}`});v("error","{:math}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),serialize:(t,e)=>`\\error{${t.bodyToLatex(e)}}`,render:(t,e)=>t.createBox(e,{classes:"ML__error"})});v("ensuremath","{:math}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),serialize:(t,e)=>`${t.command}{${t.bodyToLatex(g(p({},e),{defaultMode:"math"}))}}`});v("color","{:value}",{applyStyle:(t,e,r)=>{var i,n;return{verbatimColor:(i=ce(e[0]))!=null?i:void 0,color:r.toColor((n=e[0])!=null?n:{string:"red"})}}});v("textcolor","{:value}{content:auto*}",{applyStyle:(t,e,r)=>{var i,n;return{verbatimColor:(i=ce(e[0]))!=null?i:void 0,color:r.toColor((n=e[0])!=null?n:{string:"red"})}}});v("boxed","{content:math}",{createAtom:t=>new Ue(g(p({},t),{body:L(t.args[0]),framecolor:{string:"black"}}))});v("colorbox","{:value}{:text*}",{applyStyle:(t,e,r)=>{var i,n;return{verbatimBackgroundColor:(i=ce(e[0]))!=null?i:void 0,backgroundColor:r.toBackgroundColor((n=e[0])!=null?n:{string:"yellow"})}}});v("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:t=>{var e,r;return new Ue(g(p({},t),{body:L(t.args[2]),framecolor:(e=t.args[0])!=null?e:{string:"blue"},backgroundcolor:(r=t.args[1])!=null?r:{string:"yellow"}}))},serialize:(t,e)=>{var r,i;return e.skipStyles?t.bodyToLatex(g(p({},e),{defaultMode:"text"})):F(t.command,(r=ce(t.framecolor))!=null?r:"",(i=ce(t.backgroundcolor))!=null?i:"",t.bodyToLatex(g(p({},e),{defaultMode:"text"})))}});v("bbox","[:bbox]{body:auto}",{createAtom:t=>{var i;let e=t.args[0],r=L(t.args[1]);return e?new Ue(g(p({},t),{body:r,padding:e.padding,border:e.border,backgroundcolor:(i=e.backgroundcolor)!=null?i:void 0})):new Ue(g(p({},t),{body:r}))},serialize:(t,e)=>{var i,n;if(e.skipStyles)return t.bodyToLatex(e);let r=t.command;if(Number.isFinite(t.padding)||t.border!==void 0||t.backgroundcolor!==void 0){let o=[];t.padding&&o.push((i=ce(t.padding))!=null?i:""),t.border&&o.push(`border: ${t.border}`),t.backgroundcolor&&o.push((n=ce(t.backgroundcolor))!=null?n:""),r+=`[${o.join(",")}]`}return F(r,t.bodyToLatex(e))}});v(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),render:(t,e)=>{let r=new T({parent:e,mathstyle:t.command.slice(1)},t.style),i=y.createBox(r,t.body,{type:"lift"});return t.caret&&(i.caret=t.caret),t.bind(e,i)},serialize:(t,e)=>e.skipStyles?t.bodyToLatex(e):`{${B([t.command,t.bodyToLatex(e)])}}`});v(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:t=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[t]})});v("fontseries","{:string}",{ifMode:"text",applyStyle:(t,e)=>{var r;return{fontSeries:(r=e[0])!=null?r:"auto"}}});v("fontshape","{:string}",{ifMode:"text",applyStyle:(t,e)=>{var r;return{fontShape:(r=e[0])!=null?r:"auto"}}});v("fontfamily","{:string}",{ifMode:"text",applyStyle:(t,e)=>{var r;return{fontFamily:(r=e[0])!=null?r:"roman"}}});v("selectfont","",{ifMode:"text",applyStyle:()=>({})});v("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})});v(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),serialize:(t,e)=>`${t.command}{${t.bodyToLatex(e)}}`,render:(t,e)=>t.createBox(e,{classes:"ML__boldsymbol"})});v("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})});v("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})});v("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})});v("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})});v("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})});v("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})});v("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})});v("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})});v("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})});v("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})});v("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})});v("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})});v("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})});v("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})});v("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})});v("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})});v("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})});v("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})});v("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})});v("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})});v("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})});v("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})});v("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})});v("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})});v("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})});v("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})});v("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})});v(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})});v(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})});v("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})});v("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})});v("mbox","{:text}",{ifMode:"math",createAtom:t=>new y(g(p({},t),{type:"mord",body:L(t.args[0]),mode:"math"})),serialize:(t,e)=>F("\\mbox",t.bodyToLatex(g(p({},e),{defaultMode:"text"})))});v("text","{:text}",{ifMode:"math",applyMode:"text"});v(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[1])})),serialize:(t,e)=>!t.args[0]||e.skipStyles?t.bodyToLatex(e):`${t.command}{${t.args[0]}}{${t.bodyToLatex(e)}}`,render:(t,e)=>{var r;return t.createBox(e,{classes:(r=t.args[0])!=null?r:""})}});v(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[1])})),serialize:(t,e)=>{var r;return!((r=t.args)!=null&&r[0])||e.skipStyles?t.bodyToLatex(e):`${t.command}{${t.args[0]}}{${t.bodyToLatex(e)}}`},render:(t,e)=>{var i;let r=t.createBox(e);return r.cssId=(i=t.args[0])!=null?i:"",r}});v("htmlData","{data:string}{content:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[1])})),serialize:(t,e)=>{var r;return!((r=t.args)!=null&&r[0])||e.skipStyles?t.bodyToLatex(e):`\\htmlData{${t.args[0]}}{${t.bodyToLatex(e)}}`},render:(t,e)=>{var i;let r=t.createBox(e);return r.htmlData=(i=t.args[0])!=null?i:"",r}});v(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[1])})),serialize:(t,e)=>{var r;return!((r=t.args)!=null&&r[0])||e.skipStyles?t.bodyToLatex(e):`${t.command}{${t.args[0]}}{${t.bodyToLatex(e)}}`},render:(t,e)=>{var i;let r=t.createBox(e);return r.htmlStyle=(i=t.args[0])!=null?i:"",r}});v("em","{:rest}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),serialize:(t,e)=>e.skipStyles?t.bodyToLatex(e):`{\\em ${t.bodyToLatex(e)}}`,render:(t,e)=>t.createBox(e,{classes:"ML__emph",boxType:"lift"})});v("emph","{:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[1])})),serialize:(t,e)=>e.skipStyles?t.bodyToLatex(e):`\\emph{${t.bodyToLatex(e)}}`,render:(t,e)=>t.createBox(e,{classes:"ML__emph",boxType:"lift"})});var Um={"\\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}};v(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:t=>{var e;return new Ii(g(p({},t),{delim:(e=t.args[0])!=null?e:".",size:Um[t.command].size,delimType:Um[t.command].mclass}))}});v(["hspace","hspace*"],"{width:value}",{createAtom:t=>{var e;return new St(g(p({},t),{width:(e=t.args[0])!=null?e:{dimension:0}}))}});v(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:t=>{var e;return new St(g(p({},t),{width:(e=t.args[0])!=null?e:{dimension:0}}))}});v("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:t=>new y(t),render:(t,e)=>{let r=0,i=e.mathstyle.id;(i===An||i===sr)&&(r=1),(i===Br||i===Pe)&&(r=2),(i===lr||i===be)&&(r=3);let n=L(t.args[r]);return y.createBox(e,n)},serialize:(t,e)=>`\\mathchoice{${y.serialize(t.args[0],e)}}{${y.serialize(t.args[1],e)}}{${y.serialize(t.args[2],e)}}{${y.serialize(t.args[3],e)}}`});v("mathop","{:auto}",{createAtom:t=>new y(g(p({},t),{type:"mop",body:L(t.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(t,e)=>{var i;let r=y.createBox(e,t.body);if(t.superscript||t.subscript){let n=(i=t.subsupPlacement)!=null?i:"auto";r=n==="over-under"||n==="auto"&&e.isDisplayStyle?t.attachLimits(e,{base:r}):t.attachSupsub(e,{base:r})}return new w(t.bind(e,r),{type:"op",isSelected:t.isSelected,classes:"op-group"})},serialize:(t,e)=>{let r=[F(t.command,t.bodyToLatex(e))];return t.explicitSubsupPlacement&&(t.subsupPlacement==="over-under"&&r.push("\\limits"),t.subsupPlacement==="adjacent"&&r.push("\\nolimits"),t.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(t.supsubToLatex(e)),B(r)}});v(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:t=>new y(g(p({},t),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t.command],body:L(t.args[0]),captureSelection:!0}))});v(["operatorname","operatorname*"],"{operator:math}",{createAtom:t=>{let e=L(t.args[0]).map(r=>{var i;return r.type!=="first"&&(r.type="mord",r.value=(i={"\u2217":"*","\u2212":"-"}[r.value])!=null?i:r.value,r.isFunction=!1,!r.style.variant&&!r.style.variantStyle&&(r.style.variant="main",r.style.variantStyle="up")),r});return new y(g(p({},t),{type:"mop",body:e,isFunction:!0,limits:t.command==="\\operatorname"?"adjacent":"over-under"}))},render:(t,e)=>{var i;let r=y.createBox(e,t.body);if(t.superscript||t.subscript){let n=(i=t.subsupPlacement)!=null?i:"auto";r=n==="over-under"||n==="auto"&&e.isDisplayStyle?t.attachLimits(e,{base:r}):t.attachSupsub(e,{base:r})}return t.caret&&(r.caret=t.caret),new w(t.bind(e,r),{type:"op",isSelected:t.isSelected,classes:"op-group"})},serialize:(t,e)=>{let r=[F(t.command,t.bodyToLatex(e))];return t.explicitSubsupPlacement&&(t.subsupPlacement==="over-under"&&r.push("\\limits"),t.subsupPlacement==="adjacent"&&r.push("\\nolimits"),t.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(t.supsubToLatex(e)),B(r)}});v(["char","unicode"],"{charcode:value}",{createAtom:t=>new y(g(p({},t),{type:t.mode==="text"?"text":"mord"})),serialize:t=>{var e;return`${t.command}${ce((e=t.args[0])!=null?e:{number:10067,base:"hexadecimal"})}`},render:(t,e)=>{let r=e.evaluate(t.args[0]);return(!r||!("number"in r))&&(r={number:10067,base:"hexadecimal"}),t.value=String.fromCodePoint(r.number),t.createBox(e)}});v("rule","[raise:value]{width:value}{thickness:value}",{createAtom:t=>new y(t),render:(t,e)=>{var s,l,c;let r=new T({parent:e,mathstyle:"textstyle"},t.style),i=r.toEm((s=t.args[0])!=null?s:{dimension:0}),n=r.toEm((l=t.args[1])!=null?l:{dimension:10}),o=r.toEm((c=t.args[2])!=null?c:{dimension:10}),a=new w(null,{classes:"rule",type:"ord"});return a.width=n,a.height=o+i,a.depth=-i,a.setStyle("border-right-width",n,"em"),a.setStyle("border-top-width",o,"em"),a.setStyle("border-color",t.style.color),a.setStyle("vertical-align",i,"em"),t.isSelected&&a.setStyle("opacity","50%"),t.bind(r,a),t.caret&&(a.caret=t.caret),a.wrap(e)},serialize:t=>`\\rule${t.args[0]?`[${ce(t.args[0])}]`:""}{${ce(t.args[1])}}{${ce(t.args[2])}}`});v(["overline","underline"],"{:auto}",{createAtom:t=>new y(g(p({},t),{body:L(t.args[0])})),render:(t,e)=>{let r=t.command.substring(1),i=new T({parent:e,mathstyle:"cramp"},t.style),n=y.createBox(i,t.body);if(!n)return null;let o=i.metrics.defaultRuleThickness/i.scalingFactor,a=new w(null,{classes:r+"-line"});a.height=o,a.maxFontSize=o*1.125*i.scalingFactor;let s;return r==="overline"?s=new H({shift:0,children:[{box:n},3*o,{box:a},o]}):s=new H({top:n.height,children:[o,{box:a},3*o,{box:n}]}),t.caret&&(s.caret=t.caret),new w(s,{classes:r,type:"ignore"})}});v("overset","{:auto}{base:auto}",{createAtom:t=>{let e=L(t.args[1]);return new fe(g(p({},t),{above:L(t.args[0]),body:e,skipBoundary:!1,boxType:Kr(e)}))},serialize:(t,e)=>F(t.command,t.aboveToLatex(e),t.bodyToLatex(e))});v("underset","{:auto}{base:auto}",{createAtom:t=>{let e=L(t.args[1]);return new fe(g(p({},t),{below:L(t.args[0]),body:e,skipBoundary:!1,boxType:Kr(e)}))},serialize:(t,e)=>F(t.command,t.belowToLatex(e),t.bodyToLatex(e))});v("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:t=>{let e=L(t.args[2]);return new fe(g(p({},t),{above:L(t.args[0]),below:L(t.args[1]),body:e,skipBoundary:!1,boxType:Kr(e)}))},serialize:(t,e)=>F(t.command,t.belowToLatex(e),t.bodyToLatex(e))});v(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:t=>new fe(g(p({},t),{body:L(t.args[2]),above:L(t.args[1]),below:L(t.args[0]),skipBoundary:!1,boxType:t.command==="\\stackrel"?"rel":"bin"})),serialize:(t,e)=>F(t.command,t.aboveToLatex(e),t.bodyToLatex(e))});v("smash","[:string]{:auto}",{createAtom:t=>{var e,r,i,n;return new It(g(p({},t),{body:L(t.args[1]),smashHeight:(r=(e=t.args[0])==null?void 0:e.includes("t"))!=null?r:!0,smashDepth:(n=(i=t.args[0])==null?void 0:i.includes("b"))!=null?n:!0}))}});v(["vphantom"],"{:auto}",{createAtom:t=>new It(g(p({},t),{body:L(t.args[0]),isInvisible:!0,smashWidth:!0}))});v(["hphantom"],"{:auto}",{createAtom:t=>new It(g(p({},t),{body:L(t.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))});v(["phantom"],"{:auto}",{createAtom:t=>new It(g(p({},t),{body:L(t.args[0]),isInvisible:!0}))});v("not","{:math}",{createAtom:t=>{let e=L(t.args[0]);return e.length===0?new y(g(p({},t),{type:"mrel",value:"\uE020"})):new y(g(p({},t),{body:[new it(g(p({},t),{body:"\uE020",align:"right"})),...e],captureSelection:!0}))},serialize:(t,e)=>{let r=t.args[0],i=r&&typeof r=="object"&&"group"in r;return t.value!=="\uE020"?i?`\\not{${y.serialize(r.group,e)}}`:`\\not${y.serialize(r,e)}`:i?"\\not{}":"\\not"},render:(t,e)=>{if(t.value)return t.createBox(e);let i=t.args[0]&&typeof t.args[0]=="object"&&"group"in t.args[0]?"ord":Kr(L(t.args[0])),n=y.createBox(e,t.body,{type:i});return t.caret&&(n.caret=t.caret),t.bind(e,n)}});v(["ne","neq"],"",{createAtom:t=>new y(g(p({},t),{type:"mrel",body:[new it(g(p({},t),{body:"\uE020",align:"right",boxType:"rel"})),new y(g(p({},t),{value:"="}))],captureSelection:!0})),serialize:t=>t.command});v("rlap","{:auto}",{createAtom:t=>new it(g(p({},t),{body:L(t.args[0]),align:"right"}))});v("llap","{:auto}",{createAtom:t=>new it(g(p({},t),{body:L(t.args[0]),align:"left"}))});v("mathrlap","{:math}",{createAtom:t=>new it(g(p({},t),{body:L(t.args[0]),align:"left"}))});v("mathllap","{:math}",{createAtom:t=>new it(g(p({},t),{body:L(t.args[0]),align:"left"}))});v("raisebox","{:value}{:text}",{createAtom:t=>{var e;return new Ue(g(p({},t),{body:L(t.args[1]),padding:{dimension:0},offset:(e=t.args[0])!=null?e:{dimension:0}}))},serialize:(t,e)=>{var r;return F("\\raisebox",(r=ce(t.offset))!=null?r:"0pt",t.bodyToLatex(e))}});v("raise","{:value}{:auto}",{createAtom:t=>{var e;return new Ue(g(p({},t),{body:L(t.args[1]),padding:{dimension:0},offset:(e=t.args[0])!=null?e:{dimension:0}}))},serialize:(t,e)=>{var r;return F("\\raise",(r=ce(t.offset))!=null?r:"0pt",t.bodyToLatex(e))}});v("lower","{:value}{:auto}",{createAtom:t=>{var e;return new Ue(g(p({},t),{body:L(t.args[1]),padding:{dimension:0},offset:(e=tt(t.args[0],-1))!=null?e:{dimension:0}}))},serialize:(t,e)=>{var r,i;return F("\\lower",(i=ce(tt((r=t.offset)!=null?r:{dimension:0},-1)))!=null?i:"0pt",t.bodyToLatex(e))}});ue("0123456789/@.?!");os(65,90);os(97,122);ue([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]);ue([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]);ue([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]);ue([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel");ue([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]);ue([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]);ue([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams");ue([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin");ue([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams");ue([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]);ue([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel");ue([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams");ue([["\\wp",8472],["\\aleph",8501]]);ue([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams");ue([["\\ ",160],["~",160]],"space");v(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:t=>new St(t)});v("space","",{createAtom:t=>new St(t)});ue([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct");ue([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner");ue([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);oe({undo:t=>(t.undo(),!0),redo:t=>(t.redo(),!0),scrollIntoView:t=>(t.scrollIntoView(),!0),scrollToStart:t=>(t.field.scroll(0,0),!0),scrollToEnd:t=>{let e=t.field.getBoundingClientRect();return t.field.scroll(e.left-window.scrollX,0),!0},toggleKeystrokeCaption:Fm,toggleContextMenu:t=>{let e=t.toggleContextMenu();return e||t.model.announce("plonk"),e},plonk:t=>(t.model.announce("plonk"),!0),switchMode:(t,e,r,i)=>(t.switchMode(e,r,i),!0),insert:(t,e,r)=>t.insert(e,r),typedText:(t,e,r)=>(Xn(t,e,r),!0),insertDecimalSeparator:t=>{let e=t.model;return e.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&e.at(Math.max(e.position,e.anchor)).isDigit()?(t.insert("{,}",{format:"latex"}),t.snapshot("insert-mord"),!0):(t.insert("."),!0)},commit:t=>{var e;return t.model.contentWillChange({inputType:"insertLineBreak"})&&((e=t.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),t.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(t,e,r)=>{let i=t.getPrompts(),n="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o=0;for(;i.includes(n)&&o<100;){if(o===99)return console.error("could not find a unique ID after 100 tries"),!1;n="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o++}return t.insert(`\\placeholder[${e!=null?e:n}]{}`,r),!0}});oe({copyToClipboard:t=>(t.focus(),t.model.selectionIsCollapsed&&t.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):t.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"});oe({cutToClipboard:t=>(t.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):t.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:t=>(t.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(e=>{e&&t.model.contentWillChange({inputType:"insertFromPaste",data:e})?(t.stopCoalescingUndo(),t.stopRecording(),t.insert(e,{mode:t.model.mode})&&(br(t),t.startRecording(),t.snapshot("paste"),t.model.contentDidChange({inputType:"insertFromPaste"}),W(t))):t.model.announce("plonk"),t.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function qf(t,e){t.flushInlineShortcutBuffer(),t.stopCoalescingUndo();let r=Bl(t,e),{model:i}=t;return i.selectionIsCollapsed?(t.style.fontSeries&&r.fontSeries===t.style.fontSeries&&(r.fontSeries="auto"),r.fontShape&&r.fontShape===t.style.fontShape&&(r.fontShape="auto"),r.color&&r.color===t.style.color&&(r.color="none"),r.backgroundColor&&r.backgroundColor===t.style.backgroundColor&&(r.backgroundColor="none"),r.fontSize&&r.fontSize===t.style.fontSize&&(r.fontSize="auto"),t.style=p(p({},t.style),r)):t.model.deferNotifications({content:!0,type:"insertText"},()=>{i.selection.ranges.forEach(n=>Gn(i,n,r,{operation:"toggle"})),t.snapshot("style-change")}),!0}oe({applyStyle:qf},{target:"mathfield",canUndo:!0,changeContent:!0});function Bl(t,e){var n,o,a,s,l,c;let r={};typeof e.color=="string"&&(r.verbatimColor=e.color,r.color=(n=t.colorMap(e.color))!=null?n:"none"),typeof e.backgroundColor=="string"&&(r.verbatimBackgroundColor=e.backgroundColor,r.backgroundColor=(o=t.backgroundColorMap(e.backgroundColor))!=null?o:"none"),typeof e.fontFamily=="string"&&(r.fontFamily=e.fontFamily),typeof e.series=="string"&&(r.fontSeries=e.series),typeof e.fontSeries=="string"&&(r.fontSeries=e.fontSeries.toLowerCase()),r.fontSeries&&(r.fontSeries=(a={bold:"b",medium:"m",normal:"m"}[r.fontSeries])!=null?a:r.fontSeries),typeof e.shape=="string"&&(r.fontShape=e.shape),typeof e.fontShape=="string"&&(r.fontShape=e.fontShape.toLowerCase()),r.fontShape&&(r.fontShape=(s={italic:"it",up:"n",upright:"n",normal:"n"}[r.fontShape])!=null?s:r.fontShape),e.variant&&(r.variant=e.variant.toLowerCase()),e.variantStyle&&(r.variantStyle=e.variantStyle.toLowerCase());let i=(l=e.size)!=null?l:e.fontSize;return typeof i=="number"?r.fontSize=Math.max(1,Math.min(10,i)):typeof i=="string"&&(r.fontSize=(c={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[i.toLowerCase()])!=null?c:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[i]),r}function Ra(t){let[e,r]=Y(t.selection);if(e=jm(t,e,"backward"),r=jm(t,r,"forward"),e===r){let i=t.at(e);if(i.type==="leftright")return t.setSelection(t.offsetOf(i.firstChild)-1,r);if(i.type==="first"&&(i.parent.type==="leftright"||i.parent.type==="surd"))return t.setSelection(e-1,t.offsetOf(i.parent.lastChild)+1);t.setSelection(e-1,r)}else t.setSelection(e,r);return!0}function jm(t,e,r){var o,a,s;let i=t.at(e);if(!i)return e;let n=r==="forward"?1:-1;if(i.mode==="text"){for(;i&&!(i.mode!=="text"||!_r.test(i.value));)e+=n,i=t.at(e);return r==="backward"?e-1:e}if(i.mode==="latex"){if(/[a-zA-Z\*]/.test(i.value))if(r==="backward")for(;i&&i.mode==="latex"&&i.value!=="\\"&&/[a-zA-Z]/.test(i.value);)e+=n,i=t.at(e);else for(;i&&i.mode==="latex"&&/[a-zA-Z\*]/.test(i.value);)e+=n,i=t.at(e);else if(i.value==="{"){if(r==="forward"){for(;i&&i.mode==="latex"&&i.value!=="}";)e+=n,i=t.at(e);return e}return e-1}else if(i.value==="}"){if(r==="backward"){for(;i&&i.mode==="latex"&&i.value!=="{";)e+=n,i=t.at(e);return e-1}return e}return e-1}if(i.mode==="math"){if(i.isDigit()){for(;(o=t.at(e+n))!=null&&o.isDigit();)e+=n;return r==="backward"?e-1:e}if(i.style.variant||i.style.variantStyle){let l=(a=t.at(e))==null?void 0:a.style;for(;l&&l.variant===i.style.variant&&l.variantStyle===i.style.variantStyle;)l=(s=t.at(e+n))==null?void 0:s.style,e+=n;return r==="backward"?e-1:e}return e}return e}oe({selectGroup:t=>{let e=Ra(t);return e||t.announce("plonk"),e},selectAll:t=>t.setSelection(0,t.lastOffset),extendSelectionForward:t=>Ge(t,"forward",{extend:!0}),extendSelectionBackward:t=>Ge(t,"backward",{extend:!0}),extendToNextWord:t=>wr(t,"forward",{extend:!0}),extendToPreviousWord:t=>wr(t,"backward",{extend:!0}),extendSelectionUpward:t=>Ge(t,"upward",{extend:!0}),extendSelectionDownward:t=>Ge(t,"downward",{extend:!0}),extendToNextBoundary:t=>wr(t,"forward",{extend:!0}),extendToPreviousBoundary:t=>wr(t,"backward",{extend:!0}),extendToGroupStart:t=>{let e=t.setSelection(t.anchor,t.offsetOf(t.at(t.position).firstSibling));return e||t.announce("plonk"),e},extendToGroupEnd:t=>{let e=t.setSelection(t.anchor,t.offsetOf(t.at(t.position).lastSibling));return e||t.announce("plonk"),e},extendToMathFieldStart:t=>{let e=t.setSelection(t.anchor,0);return e||t.announce("plonk"),e},extendToMathFieldEnd:t=>{let e=t.setSelection(t.anchor,t.lastOffset);return e||t.announce("plonk"),e}},{target:"model",changeSelection:!0});var ri=null,Zn=0,ii,Yn;function Pl(t){return t!==null&&globalThis.PointerEvent!==void 0&&t instanceof PointerEvent}function Na(t){ii==null||ii.abort(),ii=void 0,typeof Yn=="number"&&(t.field.releasePointerCapture(Yn),Yn=void 0)}function Ol(t,e){var b;t.atomBoundsCache=new Map;let r=t,i,n=!1,o=!1,a="none";if(e.buttons>1)return;let s=!1,l=!1,c=e.clientX,u=e.clientY,d=Date.now(),m=r.field,h=setInterval(()=>{s?m.scroll({top:0,left:m.scrollLeft-16}):l&&m.scroll({top:0,left:m.scrollLeft+16})},32);function f(){Na(t),n=!1,clearInterval(h),t.element.classList.remove("tracking"),e&&e.preventDefault()}function x(k){if(!r.hasFocus()){f();return}let _=k.clientX,A=k.clientY,E=Pl(k)&&k.pointerType==="touch"?20:5;if(Date.now()D.right,s=_=0&&P>=0&&(r.model.extendSelectionTo(K,P),W(t)),o&&Ra(r.model)}ri&&Math.abs(ri.x-c)<5&&Math.abs(ri.y-u)<5&&Date.now()=M.left&&c<=M.right&&u>=M.top&&u<=M.bottom){if(t.flushInlineShortcutBuffer(),t.adoptStyle="left",i=ni(t,c,u,{bias:0}),i>=0){if(t.element.classList.add("tracking"),e.shiftKey){let k=t.model.selectionIsCollapsed;t.model.extendSelectionTo(t.model.anchor,i),ul(t.model)||k?a="all":a="selection"}else t.model.at(i).type==="placeholder"?(t.model.setSelection(i-1,i),a="selection"):((b=t.model.at(i).rightSibling)==null?void 0:b.type)==="placeholder"?(t.model.setSelection(i,i+1),a="selection"):(t.model.position=i,ul(t.model)?a="all":a="selection");if(t.style={},e.detail===3||Zn>2)f(),(e.detail===3||Zn===3)&&(t.model.selection={ranges:[[0,t.model.lastOffset]]},a="all");else if(!n){n=!0,ii||(ii=new AbortController);let k={signal:ii.signal};"PointerEvent"in window?(m.addEventListener("pointermove",x,k),m.addEventListener("pointerup",f,k),m.addEventListener("pointercancel",f,k),Pl(e)&&(Yn=e.pointerId,m.setPointerCapture(Yn))):(window.addEventListener("blur",f,k),window.addEventListener("mousemove",x,k),window.addEventListener("mouseup",f,k)),(e.detail===2||Zn===2)&&(o=!0,Ra(t.model),a="all")}}t.hasFocus()||(a="none",t.focus({preventScroll:!0}))}else ri=null;t.stopCoalescingUndo(),a!=="none"&&(t.model.selectionIsCollapsed&&(a="all"),W(t)),e.preventDefault()}function Hf(t,e,r){if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return 0;let i=t-(r.left+r.right)/2,n=e-(r.top+r.bottom)/2;return i*i+n*n}function Jm(t,e,r,i,n){if(!r.id)return[1/0,null];if(e.has(r.id))return e.get(r.id);let o=dr(t,r);if(!o)return[1/0,null];let a=[1/0,null];if(r.hasChildren&&!r.captureSelection&&i>=o.left&&i<=o.right)for(let s of r.children){let l=Jm(t,e,s,i,n);l[0]<=a[0]&&(a=l)}return a[1]||(a=[Hf(i,n,o),r]),e.set(r.id,a),a}function Wf(t,e,r){let[,i]=Jm(t,new Map,t.model.root,e,r);return i}function ni(t,e,r,i){var c,u;let n=(c=t.fieldContent)==null?void 0:c.getBoundingClientRect();if(!n)return 0;if(e>n.right||r>n.bottom+8)return t.model.lastOffset;if(e0?(u.push(d),d=[x]):d.push(x);d.length>0&&u.push(d);let m=Number(c.parentBranch[0]),h=Number(c.parentBranch[1]),f=c.parent.maxColumns;for(;c.parent.colCount-h=f&&(h=0,c.parent.addRowAfter(m),m++),c.parent.setCell(m,h,u[x])}else c.parent.addChildrenAfter(s.filter(u=>u.type!=="first"),c);return l.position=l.offsetOf(s[s.length-1]),l.contentDidChange({inputType:"insertFromPaste"}),W(e),!0}}catch(a){}if(o=typeof r!="string"?r.getData("application/json"):"",o&&window.MathfieldElement.computeEngine)try{let a=JSON.parse(o);if(typeof a=="object"&&"latex"in a&&a.latex&&(i=a.latex),!i){let s=window.MathfieldElement.computeEngine.box(a);s&&!s.has("Error")&&(i=s.latex)}i||(n="latex")}catch(a){}if(!i&&typeof r!="string"&&(i=r.getData("application/x-latex"),i&&(n="latex")),i||(i=typeof r=="string"?r:r.getData("text/plain")),i){let a;return[a,i]=ca(i),n==="auto"&&a&&(n="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,i,{format:n})&&(e.startRecording(),e.snapshot("paste"),W(e)),e.startRecording(),!0}return!1}insert(e,r,i){var M,b;let n=typeof r=="string"?r:(b=(M=window.MathfieldElement.computeEngine)==null?void 0:M.box(r).latex)!=null?b:"";if(!i.silenceNotifications&&!e.contentWillChange({data:n,inputType:"insertText"}))return!1;i.insertionMode||(i.insertionMode="replaceSelection"),i.selectionMode||(i.selectionMode="placeholder"),i.format||(i.format="auto");let{silenceNotifications:o}=e;i.silenceNotifications&&(e.silenceNotifications=!0);let a=e.silenceNotifications;e.silenceNotifications=!0;let s={};if(s[0]=i.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),s["?"]="\\placeholder{}",s["@"]=s["?"],i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Y(e.selection)):i.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):i.insertionMode==="insertBefore"?e.collapseSelection("backward"):i.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]),s[0])s["@"]=s[0];else if(typeof r=="string"&&/(^|[^\\])#@/.test(r)){let k=Jf(e);k>=0&&(s["@"]=e.getValue(k,e.position,"latex"),e.deleteAtoms([k,e.position]))}s[0]||(s[0]=s["?"]);let l=!1,c=k=>(l=!0,s[k]),[u,d]=Uf(e,r,c,i);if(!d)return!1;let{parent:m}=e.at(e.position);if(u!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&m instanceof q&&m.leftDelim==="("&&m.hasEmptyBranch("body")&&d.length===1&&d[0].type==="genfrac"){let k=m.parent,_=m.parentBranch;k.removeChild(m),k.setChildren(d,_)}let h=m.hasEmptyBranch("body"),f=e.at(e.position);f.parent.addChildrenAfter(d,f),u==="latex"&&typeof r=="string"&&(m==null?void 0:m.type)==="root"&&h&&!l&&(m.verbatimLatex=r),e.silenceNotifications=a;let x=d[d.length-1];if(i.selectionMode==="placeholder"){let k=d.flatMap(_=>[_,..._.children]).find(_=>_.type==="placeholder");if(k){let _=e.offsetOf(k);e.setSelection(_-1,_),e.announce("move")}else x&&(e.position=e.offsetOf(x))}else i.selectionMode==="before"||(i.selectionMode==="after"?x&&(e.position=e.offsetOf(x)):i.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(x)));return e.contentDidChange({data:n,inputType:"insertText"}),e.silenceNotifications=o,!0}};function Uf(t,e,r,i){var a;let n,o=[];if(typeof e!="string"||i.format==="math-json"){let s=window.MathfieldElement.computeEngine;if(!s)return["math-json",[]];[n,e]=["latex",s.box(e).latex],o=ne(e,{context:t.mathfield.context})}else typeof e=="string"&&i.format==="ascii-math"?([n,e]=Or(e,{format:"ascii-math",inlineShortcuts:t.mathfield.options.inlineShortcuts}),o=ne(e,{context:t.mathfield.context}),n!=="latex"&&t.mathfield.options.removeExtraneousParentheses&&Fa(o)):(i.format==="auto"||(a=i.format)!=null&&a.startsWith("latex"))&&(i.format==="auto"&&([n,e]=Or(e,{format:"auto",inlineShortcuts:t.mathfield.options.inlineShortcuts})),i.format==="latex"&&([,e]=ca(e)),o=ne(e,{context:t.mathfield.context,args:r}),i.format!=="latex"&&t.mathfield.options.removeExtraneousParentheses&&Fa(o));return Ct(o,i.style),[n!=null?n:"latex",o]}function jf(t){if(!t||(t[0].type,t.length>1))return null;let e=t[0];return e instanceof q&&e.leftDelim==="("&&e.rightDelim===")"?e.removeBranch("body"):null}function Fa(t){if(t){for(let e=0;t[e];e++){let r=t[e];if(r instanceof q&&r.leftDelim==="("){let i=0,n=0,o=0;for(let a=0;r.body[a];a++)r.body[a].type==="genfrac"&&(i++,n=a),o++;o===0&&i===1&&(t[e]=r.body[n])}}for(let e of t){for(let r of e.branches)if(!e.hasEmptyBranch(r)){Fa(e.branch(r));let i=jf(e.branch(r));i&&e.setChildren(i,r)}if(e instanceof I)for(let r of e.cells)Fa(r)}}}function Jf(t){let e=t.at(t.position);if(e.mode==="text"){for(;!e.isFirstSibling&&e.mode==="text";)e=e.leftSibling;return t.offsetOf(e)}let r=e,i=!1;if(e.type==="mclose"){let n=Ei[e.value];for(;!e.isFirstSibling&&!(e.type==="mopen"&&e.value===n);)e=e.leftSibling;e.isFirstSibling||(e=e.leftSibling),i=!0}else e.type==="leftright"&&(e=e.leftSibling,i=!0);if(i)for(;!e.isFirstSibling&&(e.isFunction||Gm(e));)e=e.leftSibling;else{let n=[];for(;!e.isFirstSibling&&(Gm(e)||n.length>0);)e.type==="mclose"&&n.unshift(e.value),e.type==="mopen"&&n.length>0&&e.value===Ei[n[0]]&&n.shift(),e=e.leftSibling}return r===e?-1:t.offsetOf(e)}function Gm(t){return t.isDigit()?!0:t.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(t.type)?!(t.isExtensibleSymbol||t.isFunction):!1}new zl;var Il=class extends N{constructor(){super("text")}onPaste(e,r){if(!r)return!1;let i=typeof r=="string"?r:r.getData("text/plain");return i&&e.model.contentWillChange({inputType:"insertFromPaste",data:i})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,i)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),W(e)),e.startRecording(),!0):!1}insert(e,r,i={}){if(!e.contentWillChange({data:r,inputType:"insertText"}))return!1;i.insertionMode||(i.insertionMode="replaceSelection"),i.selectionMode||(i.selectionMode="placeholder"),i.format||(i.format="auto");let{silenceNotifications:n}=e;i.silenceNotifications&&(e.silenceNotifications=!0);let o=e.silenceNotifications;e.silenceNotifications=!0,i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Y(e.selection)):i.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):i.insertionMode==="insertBefore"?e.collapseSelection("backward"):i.insertionMode==="insertAfter"&&e.collapseSelection("forward");let a=Gf(r,e.mathfield.context);if(Ct(a,i.style),!a)return!1;let s=e.at(e.position),l=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=o,i.selectionMode==="before"||(i.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(l)):l&&(e.position=e.offsetOf(l))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=n,!0}};function Gf(t,e){return t=t.replace(/\\/g,"\\textbackslash "),t=t.replace(/#/g,"\\#"),t=t.replace(/\$/g,"\\$"),t=t.replace(/%/g,"\\%"),t=t.replace(/&/g,"\\&"),t=t.replace(/_/g,"\\_"),t=t.replace(/{/g,"\\textbraceleft "),t=t.replace(/}/g,"\\textbraceright "),t=t.replace(/\^/g,"\\textasciicircum "),t=t.replace(/~/g,"\\textasciitilde "),t=t.replace(/£/g,"\\textsterling "),ne(t,{context:e,parseMode:"text"})}new Il;var J=4,Ke=20,ae=2*(Ke+J),Va=(t,e)=>` + + + + + `,Xm=(t,e)=>` + + + + + `,$a=(t,e,r)=>` + + + + + + `,Xf=` + + + + + ${$a(2*(J+ae),2*J+3*ae,0)} + + + ${$a(2*(J+ae),2*J+ae,180)} + + + ${$a(2*J+3*ae,2*(J+ae),-90)} + + + ${$a(2*J+ae,2*(J+ae),90)} + + + + + ${Va(2*J+ae,J)} + + + ${Xm(2*J+2*ae,J)} + + + ${Va(2*J+3*ae,J)} + + + ${Va(J,2*J+ae)} + + + ${Xm(J,2*J+2*ae)} + + + ${Va(J,2*J+3*ae)} + +`,Zf=t=>` + + + + + `,Yf=t=>` + + + + + + + `,Zm=t=>` + + + + + + + +`,Qf=t=>` + + + + + + + +`,eg=t=>` + + + + + + + +`,tg=t=>` + + + + + + + + + +`,rg=t=>` + + + + + + + +`,ig=t=>` + + + + + + + +`,Rl={matrix:Zf,pmatrix:Yf,bmatrix:Qf,Bmatrix:Zm,vmatrix:eg,Vmatrix:tg},Nl={cases:rg,rcases:ig,Bmatrix:Zm};function ng(t){var m,x;let e=(m=t.model.parentEnvironment)==null?void 0:m.array;if(!e)return;let r=0;e.forEach(M=>{(!r||M.length>r)&&(r=M.length)});let i=document.getElementById("mathlive-environment-popover");i||(i=Hr("mathlive-environment-popover"),Oe("environment-popover"),Oe("core"),i.setAttribute("aria-hidden","true"));let n,o=i.querySelector(".MLEP__environment-controls");o?n=o:(n=document.createElement("div"),i.innerHTML="",i.appendChild(n)),n.className="MLEP__environment-controls",n.style.display="flex",n.style.width="100%",n.style.height="100%",n.style.boxSizing="border-box",n.innerHTML=Xf;let a=[],s="",l=t.model.parentEnvironment.environmentName;if(ma(l)){let M=og(l);s=Rl[M]("active");let h=Rl,{[M]:b}=h,k=si(h,[Qa(M)]);a=Object.values(k).map(_=>_("inactive"))}else if(N0(l)){let M=ag(l);s=Nl[M]("active");let f=Nl,{[M]:b}=f,k=si(f,[Qa(M)]);a=Object.values(k).map(_=>_("inactive"))}else F0(l)&&(s=Rl.matrix("active"),a=Object.values(Nl).map(M=>M("inactive")));let c=document.createElement("div");c.className="MLEP__environment-delimiter-controls",c.style.display="flex",c.style.flexDirection="column",c.innerHTML=` +
    + ${s} + ${a.join("")} +
    `,s&&n.appendChild(c),n.querySelectorAll("[data-command]").forEach(M=>{let b=M.dataset.command,k=b;try{k=JSON.parse(b)}catch(_){}M.addEventListener("mousedown",_=>_.preventDefault()),k&&M.addEventListener("click",()=>t.executeCommand(k))});let d=(x=t.field)==null?void 0:x.getBoundingClientRect();d&&(i.style.top=`${window.scrollY+(d.top-i.clientHeight-15)}px`,i.style.left=`${d.left+20}px`,i.classList.add("is-visible"))}function qa(){let t=document.getElementById("mathlive-environment-popover");t==null||t.classList.remove("is-visible")}function Ym(){document.getElementById("mathlive-environment-popover")&&(Vi("mathlive-environment-popover"),We("environment-popover"),We("core"))}function Qn(t){if(!t.hasFocus())return;let e=!1;if(t.model.mode==="math"){let r=t.model.parentEnvironment;if(r!=null&&r.array&&R0(r.environmentName)){let i=t.options.environmentPopoverPolicy;e=i==="auto"||i==="on"}}e?ng(t):qa()}function og(t){return t.replace("*","")}function ag(t){return t==="dcases"?"cases":t}function Fl(t){return t.dir&&t.dir!=="auto"?t.dir:t.parentElement?Fl(t.parentElement):"ltr"}function Vl(t,e,r,i){return r==="middle"?t-e/2:r==="start"&&i==="ltr"||r==="end"&&i==="rtl"||r==="top"||r==="left"?Math.max(0,t-e):t}function sg(t,e,r,i){return r==="middle"?t-e/2:r==="start"&&i==="ltr"||r==="end"&&i==="rtl"||r==="top"||r==="left"?t:t-e}function $l(t,e){var d,m,h;let r=(d=Fl(t))!=null?d:"ltr";t.style.position="absolute",t.style.left="auto",t.style.top="auto",t.style.right="auto",t.style.bottom="auto",t.style.height="auto",t.style.width="auto";let i=t.getBoundingClientRect(),n=getComputedStyle(t),o=Number.isFinite(e.maxHeight)?Math.min(e.maxHeight,window.innerHeight):window.innerHeight,a=Math.min(o,(m=e.height)!=null?m:i.height-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)),s=Vl(e.location.y,a,e.verticalPos,r);s+a>window.innerHeight-8&&(e.alternateLocation?(s=Vl(e.alternateLocation.y,a,e.verticalPos,r),s+a>window.innerHeight-8&&(s=void 0)):s=void 0),Number.isFinite(s)||(s=Math.max(8,window.innerHeight-8-a),8+a>window.innerHeight-8&&(t.style.bottom="8px")),a=Math.min(s+a,window.innerHeight-8)-s;let l=Number.isFinite(e.maxWidth)?Math.min(e.maxWidth,window.innerWidth):window.innerWidth,c=Math.min(l,(h=e.width)!=null?h:i.width),u=Vl(e.location.x,c,e.horizontalPos,r);u+c>window.innerWidth-8&&(e.alternateLocation?(u=sg(e.alternateLocation.x,c,e.verticalPos,r),u+c>window.innerWidth-8&&(u=void 0)):u=void 0),Number.isFinite(u)||(u=Math.max(8,window.innerWidth-8-c),8+c>window.innerWidth-8&&(t.style.right="8px")),c=Math.min(u+c,window.innerWidth-8)-u,t.style.left=`${Math.ceil(u).toString()}px`,t.style.top=`${Math.ceil(s).toString()}px`,t.style.height=`${Math.ceil(a).toString()}px`,t.style.width=`${Math.ceil(c).toString()}px`}function Qm(t,e){return Math.hypot(e.x-t.x,e.y-t.y)}var ep={};function ql(t){let e=ep[t];if(!e){let r;switch(t){case"checkmark":r=``;break;case"chevron-right":r='';break}if(r){let i=document.createElement("template");i.innerHTML=r,ep[t]=i,e=i}}if(e){if("content"in e)return e.content.cloneNode(!0);let r=document.createElement("svg");return r.innerHTML=e.innerHTML,r}}var tp=80,eo=class{constructor(e,r,i){this._element=null;var n,o,a,s;this.parentMenu=r,this._visible=(n=Hl(e,e.visible,i))!=null?n:!0,this._enabled=(o=Hl(e,e.enabled,i))!=null?o:!0,this.checked=(a=Hl(e,e.checked,i))!=null?a:!1,this._class=e.class,this._keyboardShortcut=e.keyboardShortcut,this.id=e.id,this._label=Wl(e,e.label,i),this.ariaLabel=Wl(e,e.ariaLabel,i),this.ariaDetails=Wl(e,e.ariaDetails,i),typeof e.onMenuSelect=="function"&&(this.onMenuSelect=e.onMenuSelect),this.data=e.data,Array.isArray(e.submenu)?(this._type="submenu",this.submenu=new Yi(e.submenu,{parentMenu:r,containerClass:e.containerClass}),this.submenu.updateMenu(i)):e.type===void 0&&e.checked!==void 0?this._type="checkbox":this._type=(s=e.type)!=null?s:"command"}get type(){return this._type}get label(){var e,r;return(r=(e=this._label)!=null?e:this.ariaLabel)!=null?r:""}get visible(){return this._visible}set visible(e){this._visible=e,this.element&&(this.element.hidden=!e)}get enabled(){return this._enabled}get items(){if(this.type==="submenu"&&this.submenu)return this.submenu.items}render(){if(!this.visible)return null;if(this.type==="divider"){let i=document.createElement("li");return this._class&&(i.className=this._class),i.setAttribute("part","menu-divider"),i.setAttribute("role","divider"),i}if(this.type!=="command"&&this.type!=="submenu"&&this.type!=="radio"&&this.type!=="checkbox")return null;let e=document.createElement("li");this._class&&(e.className=this._class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.type==="radio"?e.setAttribute("role","menuitemradio"):this.type==="checkbox"?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.checked&&(e.setAttribute("aria-checked","true"),e.append(ql("checkmark"))),this.submenu&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false")),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel),this.ariaDetails&&e.setAttribute("aria-details",this.ariaDetails),this.enabled?(e.addEventListener("pointerenter",this),e.addEventListener("pointerleave",this),e.addEventListener("pointerup",this)):e.setAttribute("aria-disabled","true");let r=document.createElement("span");if(r.innerHTML=this.label,r.className=this.parentMenu.hasCheckbox||this.parentMenu.hasRadio?"label indent":"label",this.enabled&&r.addEventListener("click",i=>{this.select(we(i))}),e.append(r),this._keyboardShortcut){let i=document.createElement("kbd");i.innerHTML=Ni(this._keyboardShortcut),e.append(i)}return this.submenu&&e.append(ql("chevron-right")),e}get active(){var e,r;return(r=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?r:!1}set active(e){this.element&&(e?this.element.classList.add("active"):this.element.classList.remove("active"))}get element(){return this._element?this._element:(this._element=this.render(),this._element)}dispatchSelect(e){var n;e!=null||(e={alt:!1,control:!1,shift:!1,meta:!1});let r=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:e,id:this.id,label:this.label,data:this.data,element:(n=this.element)!=null?n:void 0}});this.parentMenu.dispatchEvent(r)&&typeof this.onMenuSelect=="function"&&this.onMenuSelect({modifiers:e,label:this.label,id:this.id,data:this.data,element:this.element})}handleEvent(e){var r;if(e.type==="pointerenter"){let i=e;this.parentMenu.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((r=this.parentMenu.activeMenuItem)!=null&&r.movingTowardSubmenu(i))?this.parentMenu.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.submenu&&this.openSubmenu(we(i))}):(this.parentMenu.activeMenuItem=this,this.submenu&&this.openSubmenu(we(i),{withDelay:!0}))}else e.type==="pointerleave"?this.parentMenu.rootMenu.activeMenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null):e.type==="pointerup"&&(this.parentMenu.rootMenu.state!=="modal"&&this.select(we(e)),e.stopPropagation(),e.preventDefault())}select(e){if(this.parentMenu.rootMenu.cancelDelayedOperation(),this.submenu){this.openSubmenu(e);return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.parentMenu.rootMenu.hide(),this.dispatchSelect(e)},tp)},tp)}openSubmenu(e,r){var n;if(!this.submenu||!this.element)return;if((n=r==null?void 0:r.withDelay)!=null&&n){this.parentMenu.rootMenu.scheduleOperation(()=>{this.openSubmenu(e)});return}let i=this.element.getBoundingClientRect();this.submenu.show({container:this.parentMenu.rootMenu.element.parentNode,location:{x:i.right,y:i.top-4},alternateLocation:{x:i.left,y:i.top-4},modifiers:e})}movingTowardSubmenu(e){if(!this.element)return!1;let r=this.parentMenu.rootMenu.lastMoveEvent;if(!r)return!1;let i=e.timeStamp-r.timeStamp;if(i>500)return!1;let n=e.clientX-r.clientX;if(lg(n,r.clientY-e.clientY,i)<=.2)return!1;let a="right";if(this.submenu.element){let s=this.submenu.element.getBoundingClientRect(),l=this.element.getBoundingClientRect();s.left0:n<0}};function lg(t,e,r){return Math.hypot(t,e)/r}function Hl(t,e,r){if(typeof e=="boolean")return e;if(r!=null||(r={alt:!1,control:!1,shift:!1,meta:!1}),typeof e=="function")return e({modifiers:r,id:t.id,data:t.data})}function Wl(t,e,r){if(typeof e=="string")return e;if(r!=null||(r={alt:!1,control:!1,shift:!1,meta:!1}),typeof e=="function")return e({modifiers:r,id:t.id,data:t.data})}var Yi=class t{constructor(e,r){this.hasCheckbox=!1;this.hasRadio=!1;this._element=null;this._menuItems=[];this._activeMenuItem=null;var i;this.parentMenu=(i=r==null?void 0:r.parentMenu)!=null?i:null,this._menuItemsDescriptions=[...e],this.isSubmenuOpen=!1,this._containerClass=r==null?void 0:r.containerClass}handleEvent(e){if(e.type==="wheel"&&this._element){let r=e;this._element.scrollBy(0,r.deltaY),e.stopPropagation()}}get rootMenu(){return this.parentMenu.rootMenu}dispatchEvent(e){return this.rootMenu.dispatchEvent(e)}updateMenu(e){var s;let r=this._element,i=-1,n=0,o=0,a;r&&(i=this.activeMenuItem?this._menuItems.indexOf(this.activeMenuItem):-1,a=r.parentNode,n=Number.parseInt(r.style.left),o=Number.parseInt(r.style.top),a==null||a.removeChild(r),this._element=null),this._menuItems=this._menuItemsDescriptions.map(l=>new eo(l,this,e));for(let l of this._menuItems)l.items&&l.items.reduce((c,u)=>u.visible?c+1:c,0)===0&&(l.visible=!1);this.hasCheckbox=this._menuItems.some(l=>l.type==="checkbox"),this.hasRadio=this._menuItems.some(l=>l.type==="radio"),r&&(a==null||a.appendChild(this.element),$l(this.element,{location:{x:n,y:o},verticalPos:"bottom",horizontalPos:"right"}),this.activeMenuItem=i>=0?this._menuItems[i]:null,(s=this.activeMenuItem)!=null&&s.submenu&&this.activeMenuItem.openSubmenu(e))}get menuItems(){return this._menuItemsDescriptions}set menuItems(e){this._menuItemsDescriptions=e,this.updateMenu(),this._menuItems.filter(r=>r.visible).length===0&&this.hide()}get items(){return this._menuItems}get firstMenuItem(){let e=0,r=!1,i=this._menuItems;for(;!r&&e<=i.length-1;){let n=i[e];r=n.type!=="divider"&&n.visible&&n.enabled,e+=1}return r?i[e-1]:null}get lastMenuItem(){let e=this._menuItems,r=e.length-1,i=!1;for(;!i&&r>=0;){let n=e[r];i=n.type!=="divider"&&n.visible&&n.enabled,r-=1}return i?e[r+1]:null}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(e){var r,i,n,o,a;if((r=this.parentMenu)==null||r.rootMenu.cancelDelayedOperation(),e!==this._activeMenuItem){if(this.activeMenuItem){let s=this.activeMenuItem;s.active=!1,(i=s.submenu)==null||i.hide()}if(!((n=e==null?void 0:e.visible)==null||n)){this._activeMenuItem=null;return}this._activeMenuItem=e,e&&(e.active=!0)}e?(o=e.element)==null||o.focus():(a=this._element)==null||a.focus()}nextMenuItem(e){if(!this._activeMenuItem&&e>0)return this.firstMenuItem;if(!this._activeMenuItem&&e<0)return this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;let r=this._menuItems.indexOf(this.firstMenuItem),i=this._menuItems.indexOf(this.lastMenuItem),n=!1,o=this._menuItems.indexOf(this._activeMenuItem)+e;for(;!n&&o>=r&&o<=i;){let a=this._menuItems[o];n=a.type!=="divider"&&a.visible&&a.enabled,o+=e}return n?this._menuItems[o-e]:e>0?this.lastMenuItem:this.firstMenuItem}static get collator(){return t._collator||(t._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),t._collator}findMenuItem(e){var a;let r=this._menuItems.filter(s=>s.type!=="divider"&&s.visible&&s.enabled);if(r.length===0)return null;let i=Math.max(...r.map(s=>s.label.length))-e.length;if(i<0)return null;let n=null,o=0;for(;ot.collator.compare(e,s.label.substring(o,e.length))===0))!=null?a:null,o++;return n}makeElement(){var i;let e=document.createElement("menu");e.setAttribute("role","menu"),e.setAttribute("tabindex","-1"),e.setAttribute("aria-orientation","vertical"),e.setAttribute("part","ui-menu-container"),this._containerClass&&e.classList.add(this._containerClass),e.classList.add("ui-menu-container"),e.addEventListener("focus",this),e.addEventListener("wheel",this,{passive:!0});let r=!0;for(let n of this._menuItems)n.type==="divider"?(r&&(n.visible=!1),r=!0):n.visible&&(r=!1);for(let{element:n,visible:o}of this._menuItems)n&&o&&e.append(n);return(i=e.querySelector("li:first-of-type"))==null||i.setAttribute("tabindex","0"),e}get element(){return this._element||(this._element=this.makeElement()),this._element}show(e){return this.updateMenu(e==null?void 0:e.modifiers),this._menuItems.filter(r=>r.visible).length===0?!1:(e.container.appendChild(this.element),e.location&&$l(this.element,{location:e.location,alternateLocation:e.alternateLocation,verticalPos:"bottom",horizontalPos:"right"}),this.element.focus(),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var e,r;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),(r=(e=this._element)==null?void 0:e.parentNode)==null||r.removeChild(this._element),this._element=null}set openSubmenu(e){var i,n,o,a;let r=e!==null;(i=this.activeMenuItem)!=null&&i.submenu&&((n=this.activeMenuItem.element)==null||n.setAttribute("aria-expanded",r.toString())),(a=(o=this.activeMenuItem)==null?void 0:o.element)==null||a.classList.toggle("is-submenu-open",r),this.isSubmenuOpen=r}appendMenuItem(e,r){this.insertMenuItem(-1,e,r)}insertMenuItem(e,r,i){e<0&&(e=Math.max(0,this._menuItems.length-1));let n=new eo(r,this,i);this._menuItems.splice(e+1,0,n)}};var Ha=class extends Yi{constructor(r,i){var n;super(r);this.typingBufferResetTimer=0;this.hysteresisTimer=0;this._host=(n=i==null?void 0:i.host)!=null?n:null,this.isDynamic=r.some(rp),this.currentKeyboardModifiers=i==null?void 0:i.keyboardModifiers,this.typingBuffer="",this.state="closed",this._scrim=new Te({onClose:()=>this.hide()})}get activeMenu(){let r=this;for(;r.isSubmenuOpen;)r=r.activeMenuItem.submenu;return r}handleKeyupEvent(r){if(this.isDynamic){let i=we(r);sl(this.currentKeyboardModifiers,i)||(this.updateMenu(i),this.currentKeyboardModifiers=i)}r.stopImmediatePropagation()}handleKeydownEvent(r){if(r.key==="Tab"){this.rootMenu.hide();return}if(this.isDynamic){let a=we(r);sl(this.currentKeyboardModifiers,a)||(this.updateMenu(a),this.currentKeyboardModifiers=a)}let i=!0,n=this.activeMenu,o=n.activeMenuItem;switch(r.key){case" ":case"Space":case"Return":case"Enter":o==null||o.select(we(r));break;case"ArrowRight":o!=null&&o.submenu?(o.select(we(r)),this.activeMenu.activeMenuItem=this.activeMenu.firstMenuItem):o||(n.activeMenuItem=n.firstMenuItem);break;case"ArrowLeft":if(n===this.rootMenu)o||(n.activeMenuItem=n.firstMenuItem);else{n.hide();let a=n.parentMenu.activeMenuItem;if(a){let{element:s}=a;s==null||s.focus(),s==null||s.classList.remove("is-submenu-open")}}break;case"ArrowDown":n.activeMenuItem=n.nextMenuItem(1);break;case"ArrowUp":n.activeMenuItem=n.nextMenuItem(-1);break;case"Home":case"PageUp":n.activeMenuItem=n.firstMenuItem;break;case"End":case"PageDown":n.activeMenuItem=n.lastMenuItem;break;case"Escape":this.rootMenu.hide();break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);let a=n.findMenuItem(this.typingBuffer);a&&(n.activeMenuItem=a),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(gr(r)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=r.key;let a=n.findMenuItem(this.typingBuffer);a&&(n.activeMenuItem=a),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else i=!1}i&&(r.preventDefault(),r.stopPropagation())}handleEvent(r){if(r.type==="keydown")this.handleKeydownEvent(r);else if(r.type==="keyup")this.handleKeyupEvent(r);else if(r.type==="pointermove")this.lastMoveEvent=r;else if(r.type==="pointerup"&&r.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.hide();else if(r.type==="contextmenu"){r.preventDefault(),r.stopPropagation();return}super.handleEvent(r)}dispatchEvent(r){return this._host?this._host.dispatchEvent(r):!0}get scrim(){return this._scrim.element}connectScrim(r){let{scrim:i}=this;i.addEventListener("pointerup",this),i.addEventListener("contextmenu",this),i.addEventListener("keydown",this),i.addEventListener("keyup",this),i.addEventListener("pointermove",this),this._scrim.open({root:r})}disconnectScrim(){let{scrim:r}=this;r.removeEventListener("pointerup",this),r.removeEventListener("contextmenu",this),r.removeEventListener("keydown",this),r.removeEventListener("keyup",this),r.removeEventListener("pointermove",this),this._scrim.close()}get rootMenu(){return this}show(r){return this._onDismiss=r==null?void 0:r.onDismiss,this.connectScrim(r==null?void 0:r.container),super.show(g(p({},r),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!=="closed"&&(this.activeMenuItem=null,super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0)}scheduleOperation(r){this.cancelDelayedOperation();let i=this.submenuHysteresis;if(i<=0){r();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,r()},i)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}get submenuHysteresis(){return 120}};function rp(t){let e=typeof t.enabled=="function"||typeof t.visible=="function"||typeof t.checked=="function"||typeof t.label=="function"||typeof t.ariaDetails=="function"||typeof t.ariaLabel=="function";return t.type==="submenu"&&t.submenu?e||t.submenu.some(rp):e}var Qi=class Qi{constructor(e,r){this.timer=0;let i=Pn(e);if(i){this.startPoint=i,this.lastPoint=i,this.timer=setTimeout(()=>{this.dispose(),Qm(this.lastPoint,this.startPoint){r.state==="closed"&&(i==null||i(),r.show({container:e,location:o,modifiers:a}))}),!0}return!1}function re(t,e){var a,s;e!=null||(e={}),e.mathstyle=(a=e.mathstyle)!=null?a:"displaystyle";let r=new T({from:g(p({},Ln()),{renderPlaceholder:()=>new w(160,{maxFontSize:1}),letterShapeStyle:(s=e==null?void 0:e.letterShapeStyle)!=null?s:"tex"}),mathstyle:e.mathstyle}),n=new y({mode:"math",type:"root",body:ne(t,{context:r,parseMode:"math",mathstyle:e.mathstyle})}).render(r);return n?(or(At(n,r)),ar(n,{classes:"ML__mathlive"}).toMarkup()):""}function cg(t){return ya(t,{context:Ln()})}function Jl(t,e={}){return R(ne(t,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),e)}function Gl(t){let e=ne(t,{parseMode:"math",mathstyle:"displaystyle"});return Ft(e)}var to;function Xl(t){var e,r;if(!to){let i=(e=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:e.ComputeEngine;i?to=new i:console.error(`MathLive 0.97.2: The CortexJS Compute Engine library is not available. + + Load the library, for example with: + + import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(r=to==null?void 0:to.box(t).latex)!=null?r:""}function ug(t,e="math"){return Q(new y({type:"root",body:ne(t,{parseMode:e})}))}function dg(t){return Or(t,{format:"ascii-math"})[1]}function j(t){let e=Yl(t),r="";for(let i of e){if(typeof i.value!="string")return"";r+=i.value}return r}function Yl(t){let r=t.model.selection.ranges;return r.length!==1?[]:t.model.getAtoms(r[0])}function Zl(t,e){let r=Yl(t);if(r.length!==1)return!1;let i=xa[e];return i?!!i.test(r[0].value):!1}function np(t,e){return j(t).length>0}function mg(t){return[{label:()=>re(`\\mathbb{${j(t)}}`),visible:()=>Zl(t,"double-struck"),onMenuSelect:()=>t.applyStyle({variant:"double-struck"},{operation:"toggle"})},{label:()=>re(`\\mathfrak{${j(t)}}`),visible:()=>Zl(t,"fraktur"),onMenuSelect:()=>t.applyStyle({variant:"fraktur"},{operation:"toggle"})},{label:()=>re(`\\mathcal{${j(t)}}`),visible:()=>Zl(t,"calligraphic"),onMenuSelect:()=>t.applyStyle({variant:"calligraphic"},{operation:"toggle"})},{label:()=>re(`\\mathrm{${j(t)}}`),visible:()=>np(t,"up"),onMenuSelect:()=>t.applyStyle({variantStyle:"up"},{operation:"toggle"})},{label:()=>re(`\\mathbf{${j(t)}}`),visible:()=>np(t,"bold"),onMenuSelect:()=>t.applyStyle({variantStyle:"bold"},{operation:"toggle"})}]}function pg(t){return[{label:()=>re(`\\vec{${j(t)}}`),visible:()=>j(t).length===1,onMenuSelect:()=>t.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>re(`\\overrightarrow{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>re(`\\overleftarrow{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>re(`\\dot{${j(t)}}`),visible:()=>j(t).length===1,onMenuSelect:()=>t.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>re(`\\ddot{${j(t)}}`),visible:()=>j(t).length===1,onMenuSelect:()=>t.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>re(`\\bar{${j(t)}}`),visible:()=>j(t).length===1,onMenuSelect:()=>t.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>re(`\\overline{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>re(`\\overgroup{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>re(`\\overbrace{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>re(`\\underline{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>re(`\\undergroup{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>re(`\\underbrace{${j(t)}}`),visible:()=>j(t).length>0,onMenuSelect:()=>t.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function hg(t){return[{label:()=>re(`\\boxed{${t.getValue(t.model.selection)}}}`),onMenuSelect:()=>t.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>re(`\\bbox[5px, border: 2px solid red]{${t.getValue(t.model.selection)}}`),onMenuSelect:()=>t.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>re(`\\bbox[5px, border: 2px dashed black]{${t.getValue(t.model.selection)}}`),onMenuSelect:()=>t.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function fg(t){let e=[];for(let r of Object.keys(Ht))e.push({class:"menu-swatch",label:``,onMenuSelect:()=>{t.model.selectionIsCollapsed?t.style.backgroundColor===r?t.style.backgroundColor=void 0:t.style.backgroundColor=r:t.applyStyle({backgroundColor:r},{operation:"toggle"})}});return e}function gg(t){let e=[];for(let r of Object.keys(Wt))e.push({class:"menu-swatch",label:``,onMenuSelect:()=>{t.model.selectionIsCollapsed?t.style.color===r?t.style.color=void 0:t.style.color=r:t.applyStyle({color:r},{operation:"toggle"})}});return e}function yg(t){let e=[];for(let r=1;r<=5;r++)for(let i=1;i<=5;i++)e.push({label:"\u2610",onMenuSelect:()=>{t.insert(`\\begin{pmatrix}${Array(i).fill(Array(r).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return e}function op(t){return[{label:"Return to Math Mode",id:"return-to-math-mode",onMenuSelect:()=>t.executeCommand(["switchMode","math"]),visible:()=>t.isSelectionEditable&&t.model.mode==="text"},{type:"divider"},{label:he("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>t.executeCommand("addRowBefore"),visible:()=>oi(t)},{label:he("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>t.executeCommand("addRowAfter"),visible:()=>oi(t)},{label:he("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>t.executeCommand("addColumnBefore"),visible:()=>oi(t),enabled:()=>{let e=t.model.parentEnvironment;if(!e)return!1;let[r,i]=bg(t);return rt.executeCommand("addColumnAfter"),visible:()=>oi(t)},{label:he("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>t.executeCommand("removeRow"),visible:()=>oi(t)},{label:he("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>t.executeCommand("removeColumn"),visible:()=>oi(t)},{label:"Insert Matrix",id:"insert-matrix",containerClass:"menu-container-insert-matrix",visible:()=>t.isSelectionEditable,submenu:yg(t)},{label:"Borders",containerClass:"menu-container-border",visible:()=>oi(t)&&t.isSelectionEditable,type:"group",submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>ro(t,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>ro(t,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>ro(t,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>ro(t,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>ro(t,"Bmatrix")}]},{type:"divider"},{label:"Insert Text",id:"insert-text",onMenuSelect:()=>t.executeCommand(["switchMode","text"]),visible:()=>t.model.mode==="math"},{type:"divider"},{label:"Variant",id:"variant",containerClass:"menu-container-variant",visible:()=>t.isSelectionEditable,submenu:mg(t)},{label:"Accent",id:"accent",containerClass:"menu-container-variant",visible:()=>t.isSelectionEditable,submenu:pg(t)},{label:"Decoration",id:"decoration",containerClass:"menu-container-variant",visible:()=>t.isSelectionEditable&&Yl(t).length>0,submenu:hg(t)},{label:"Color",id:"color",containerClass:"menu-container-swatches",visible:()=>t.isSelectionEditable,submenu:gg(t)},{label:"Background Color",id:"background-color",containerClass:"menu-container-swatches",visible:()=>t.isSelectionEditable,submenu:fg(t)},{type:"divider"},{label:"Evaluate",id:"ce-evaluate",visible:()=>window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{let e=xg(t);if(!e){t.model.announce("plonk");return}t.model.selectionIsCollapsed?(t.model.position=t.model.lastOffset,t.insert(`=${e}`,{insertionMode:"insertAfter",selectionMode:"item"})):t.insert(e,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:"Simplify",id:"ce-simplify",visible:()=>window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var e,r;if(t.model.selectionIsCollapsed){let i=(e=t.expression)==null?void 0:e.simplify();if(t.model.position=t.model.lastOffset,!i){t.model.announce("plonk");return}t.insert(`=${i.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{let i=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(t.getValue(t.model.selection)).simplify();if(!i){t.model.announce("plonk");return}t.insert(i.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:"Solve",id:"ce-solve",visible:()=>{var e;return window.MathfieldElement.computeEngine!==null&&((e=t.expression)==null?void 0:e.unknowns.length)===1},onMenuSelect:()=>{var n;let e=t.expression,r=e==null?void 0:e.unknowns[0],i=(n=e.solve(r))==null?void 0:n.map(o=>{var a;return(a=o.simplify().latex)!=null?a:""});if(!i){t.model.announce("plonk");return}t.insert(`${r}=${i.length===1?i[0]:"\\left\\lbrace"+(i==null?void 0:i.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:"Cut",onMenuSelect:()=>t.executeCommand("cutToClipboard"),visible:()=>!t.options.readOnly&&t.isSelectionEditable,keyboardShortcut:"meta+X"},{label:"Copy",id:"copy",submenu:[{label:"Copy LaTeX",id:"copy-latex",onMenuSelect:()=>N.copyToClipboard(t,"latex"),keyboardShortcut:"meta+C"},{label:"Copy ASCII Math",id:"copy-ascii-math",onMenuSelect:()=>N.copyToClipboard(t,"ascii-math")},{label:"Copy MathML",id:"copy-math-ml",onMenuSelect:()=>N.copyToClipboard(t,"math-ml")}]},{label:"Paste",id:"paste",onMenuSelect:()=>t.executeCommand("pasteFromClipboard"),visible:()=>!t.options.readOnly,keyboardShortcut:"meta+V"},{label:"Select All",id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>t.executeCommand("selectAll")}]}function oi(t){var e;return!!((e=t.model.parentEnvironment)!=null&&e.array)}function bg(t){var r;let e=(r=t.model.parentEnvironment)==null?void 0:r.array;return e?[e.length,e.reduce((i,n)=>Math.max(i,n.length),0)]:[0,0]}function ro(t,e){qr(t),t.flushInlineShortcutBuffer(),Ll(t.model,e),W(t)}function xg(t){var i,n;let e;if(t.model.selectionIsCollapsed?e=(i=window.MathfieldElement.computeEngine)==null?void 0:i.parse(t.getValue(),{canonical:!1}):e=(n=window.MathfieldElement.computeEngine)==null?void 0:n.parse(t.getValue(t.model.selection),{canonical:!1}),!e)return"";let r=e.evaluate();return r.isSame(e)&&(r=e.N()),r.latex}var vg=``,wg=``,Wa=class{constructor(e,r){this.focusBlurInProgress=!1;var l,c,u;this.options=p(g(p({},Ji()),{macros:di(),registers:sa()}),ji(r)),this.eventController=new AbortController,r.eventSink&&(this.host=r.eventSink),this.element=e,e.mathfield=this,O.root=e,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.style={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let i=(c=(l=r.value)!=null?l:this.element.textContent)!=null?c:"";i=i.trim();let n=vl(this.options),o=new y({type:"root",mode:n,body:ne(i,{context:this.context})});this.model=new jn(this,n,o),this.undoManager=new Ba(this.model);let a=[];if(a.push(""),a.push('"),a.push(""),a.push(""),a.push(""),this.element.innerHTML=window.MathfieldElement.createHTML(a.join("")),!this.element.children){console.error("%cMathLive 0.97.2: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",d=>d.stopImmediatePropagation(),{capture:!1,signal:this.eventController.signal}),this.field.addEventListener("wheel",this,{passive:!1,signal:this.eventController.signal}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:this.eventController.signal}):this.field.addEventListener("mousedown",this,{signal:this.eventController.signal}),(u=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||u.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(je(this)))},{signal:this.eventController.signal}),this._menu=new Ha(op(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:this.eventController.signal});let s=this.element.querySelector("[part=menu-toggle]");s==null||s.addEventListener("pointerdown",d=>{if(d.currentTarget!==s||this._menu.state!=="closed")return;this.element.classList.add("tracking");let m=s.getBoundingClientRect();this._menu.show({container:s,location:{x:m.left,y:m.bottom},modifiers:we(d),onDismiss:()=>this.element.classList.remove("tracking")}),d.preventDefault(),d.stopPropagation()},{signal:this.eventController.signal}),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=lm(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:this.eventController.signal}),document.addEventListener("scroll",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this),Fr&&!O.locale.startsWith(Fr.locale)&&am(O.locale),De!=="ready"&&document.fonts.ready.then(()=>In(this)),e.querySelector("[part=container").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this)),Qn(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,qa())}get colorMap(){return e=>{var r,i,n;return(n=(i=(r=this.options).colorMap)==null?void 0:i.call(r,e))!=null?n:Mr(e)}}get backgroundColorMap(){return e=>{var r,i,n,o,a,s;return(s=(a=(i=(r=this.options).backgroundColorMap)==null?void 0:i.call(r,e))!=null?a:(o=(n=this.options).colorMap)==null?void 0:o.call(n,e))!=null?s:li(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,r;return(r=(e=this.host)==null?void 0:e.disabled)!=null?r:!1}get contentEditable(){var e;return((e=this.host)==null?void 0:e.getAttribute("contenteditable"))!=="false"}get userSelect(){if(!this.host)return"";let e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;let e=this.model.at(this.model.anchor),r=this.model.at(this.model.position),i=y.commonAncestor(e,r);return!!((i==null?void 0:i.type)==="prompt"||i!=null&&i.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed){let i=this.model.at(this.model.selection.ranges[0][0]),n=this.adoptStyle==="right"?i.rightSibling:i;if(!n)return{};if(n.type==="group"){let o=n.branch("body");return!o||o.length<2?{}:this.adoptStyle==="right"?o[1].style:o[o.length-1].style}return n.style}let e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};let r=p({},e[0].style);return e.forEach(i=>{for(let[n,o]of Object.entries(i.style))(!r[n]||r[n]!==o)&&(r[n]=void 0)}),r}get keybindings(){var i,n;if(this._keybindings)return this._keybindings;let[e,r]=mm(this.options.keybindings,(i=fr())!=null?i:sm());return((n=fr())==null?void 0:n.score)>0&&(this._keybindings=e,r.length>0&&console.error("MathLive 0.97.2: Invalid keybindings for current keyboard layout",r)),e}get menu(){return this._menu}setOptions(e){var n;this.options=p(p({},this.options),ji(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let r=this.options.defaultMode;r==="inline-math"&&(r="math"),((n=this.model.root.firstChild)==null?void 0:n.mode)!==r&&(this.model.root.firstChild.mode=r),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");let i=y.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==i)&&N.insert(this.model,i,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&W(this)}getOptions(e){return Nt(this.options,e)}getOption(e){return Nt(this.options,e)}handleEvent(e){var r;if(Bt(this)){if(Fn(e)){if(!Li(e.origin,(r=this.options.originValidator)!=null?r:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");let{action:i}=e.data;if(i==="execute-command"){let n=e.data.command;if(Rt(n)==="virtual-keyboard")return;this.executeCommand(n)}else i==="update-state"||(i==="focus"?this.focus({preventScroll:!0}):i==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":Ol(this,e);break;case"pointerdown":Ol(this,e),this._menu.menuItems.length>0&&jl(e,this.element.querySelector("[part=container"),this._menu,()=>Na(this));break;case"contextmenu":this._menu.menuItems.length>0&&jl(e,this.element.querySelector("[part=container"),this._menu,()=>Na(this));break;case"virtual-keyboard-toggle":this.hasFocus()&&Qn(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Bt(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Bt(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}}dispose(){if(!Bt(this))return;this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();let e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.fieldContent=void 0,this.ariaLiveText=void 0,$m(),fm(),Ym()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return Rt(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(je(this))),!1):xm(this,e)}get errors(){return ya(this.model.getValue(),{context:this.context})}getValue(e,r,i){return this.model.getValue(e,r,i)}setValue(e,r){var i;r=r!=null?r:{mode:"math"},r.insertionMode===void 0&&(r.insertionMode="replaceAll"),(r.format===void 0||r.format==="auto")&&(r.format="latex"),(r.mode===void 0||r.mode==="auto")&&(r.mode=(i=Pm(this.model,this.model.position))!=null?i:"math"),N.insert(this.model,e,r)&&(W(this),this.undoManager.snapshot("set-value"))}get expression(){let e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.97.2: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var i;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){let n=window.mathVirtualKeyboard.boundingRect,o=this.host.getBoundingClientRect();o.bottom>n.top&&((i=window.document.scrollingElement)==null||i.scrollBy(0,o.bottom-n.top+8))}}this.dirty&&at(this,{interactive:!0});let e=this.field.getBoundingClientRect(),r=null;if(this.model.selectionIsCollapsed)r=Ai(this.field);else{let n=ua(this);if(n.length>0){let o=-1/0,a=-1/0;for(let s of n)s.right>o&&(o=s.right),s.topn.bottom&&(a=o-n.bottom+this.host.scrollTop+r.height),this.host.scroll({top:a,left:0})}if(r){let n=r.x-window.scrollX,o=this.field.scrollLeft;ne.right&&(o=n-e.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:o})}}insert(e,r){if(typeof e!="string"||e.length===0&&((r==null?void 0:r.insertionMode)==="insertBefore"||(r==null?void 0:r.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed)return!1;if(this.flushInlineShortcutBuffer(),r=r!=null?r:{mode:"math"},r.focus&&this.focus(),r.feedback&&(window.MathfieldElement.keypressVibration&&oo()&&navigator.vibrate(hl),window.MathfieldElement.playSound("keypress")),e==="\\\\")Sl(this.model);else if(e==="&")Al(this.model);else{let i=this.style;this.model.selectionIsCollapsed?N.insert(this.model,e,p({style:this.model.at(this.model.position).computedStyle},r)):N.insert(this.model,e,r),r.resetStyle&&(this.style=i)}return this.snapshot(`insert-${this.model.at(this.model.position).type}`),W(this),r.scrollIntoView&&this.scrollIntoView(),!0}switchMode(e,r="",i=""){var a;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled||!((a=this.host)!=null&&a.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0}))))return;let n=this.model.mode,{model:o}=this;o.deferNotifications({content:!!i||!!r,selection:!0,type:"insertText"},()=>{let s=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),r&&e!=="latex"){let l=ne(r,{context:this.context,parseMode:e});o.collapseSelection("forward");let c=o.at(o.position);o.position=o.offsetOf(c.parent.addChildrenAfter(l,c)),s=!0}if(this.model.mode=e,e==="latex"){let l=o.selectionIsCollapsed;xr(this,"accept");let c,u=o.at(o.position);if(l)c="\\";else{let m=Y(o.selection);c=this.model.getValue(m,"latex");let h=this.model.extractAtoms(m);h.length===1&&h[0].type==="placeholder"&&(c=r,l=!0),u=o.at(m[0])}let d=new _t(c);u.parent.addChildAfter(d,u),l?o.position=o.offsetOf(d.lastChild):o.setSelection(o.offsetOf(d.firstChild),o.offsetOf(d.lastChild))}else $r(o).forEach(l=>{l.isError=!1});if(i){let l=ne(i,{context:this.context,parseMode:n});o.collapseSelection("forward");let c=o.at(o.position);o.position=o.offsetOf(c.parent.addChildrenAfter(l,c)),s=!0}return W(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),s}),this.model.mode=e,window.mathVirtualKeyboard.update(je(this))}hasFocus(){return!this.blurred}focus(e){this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.model.announce("line")),e!=null&&e.preventScroll||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]}}applyStyle(e,r={}){var a,s;let i={operation:"set",silenceNotifications:!1};Gr(r)?i.range=r:(r.operation==="toggle"&&(i.operation="toggle"),i.range=r.range,i.silenceNotifications=(a=r.silenceNotifications)!=null?a:!1);let n=Bl(this,e),o=(s=i.operation)!=null?s:"set";this.model.deferNotifications({content:!i.silenceNotifications,type:"insertText"},()=>{if(i.range===void 0)for(let l of this.model.selection.ranges)Gn(this.model,l,n,{operation:o});else Gn(this.model,i.range,n,{operation:o})}),W(this)}toggleContextMenu(){var e;return this._menu.menuItems.length===0?!1:this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({container:this.element.querySelector("[part=container"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var r;return(r=this.element)==null?void 0:r.focus()}}),!0)}getCaretPoint(){let e=Ai(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,r){let i=ni(this,e,r,{bias:0});if(i<0)return!1;let n=this.model.position;return this.model.position=i,this.model.announce("move",n),W(this),!0}getPrompt(e){let r=this.model.findAtom(i=>i.type==="prompt"&&i.placeholderId===e);return r}getPromptValue(e,r){let i=this.getPrompt(e);if(!i)return"";let n=this.model.offsetOf(i.firstChild),o=this.model.offsetOf(i.lastChild);return this.model.getValue(n,o,r)}getPrompts(e){return this.model.getAllAtoms().filter(r=>r.type!=="prompt"?!1:e?!(e.id&&r.placeholderId!==e.id||e.locked&&r.locked!==e.locked||e.correctness==="undefined"&&r.correctness||e.correctness&&r.correctness!==e.correctness):!0).map(r=>r.placeholderId)}setPromptValue(e,r,i){if(r!==void 0){let n=this.getPrompt(e);if(!n){console.error(`MathLive 0.97.2: unknown prompt ${e}`);return}let o=this.model.getBranchRange(this.model.offsetOf(n),"body");this.model.setSelection(o),this.insert(r,g(p({},i),{insertionMode:"replaceSelection"}))}i!=null&&i.silenceNotifications&&(this.valueOnFocus=this.getValue()),W(this)}setPromptState(e,r,i){let n=this.getPrompt(e);if(!n){console.error(`MathLive 0.97.2: unknown prompt ${e}`);return}r==="undefined"?n.correctness=void 0:typeof r=="string"&&(n.correctness=r),typeof i=="boolean"&&(n.locked=i,n.captureSelection=i),W(this)}stripPromptContent(e){let r=this.model.getAllAtoms().filter(n=>n.type!=="prompt"?!1:e?!(e.id&&n.placeholderId!==e.id||e.locked&&n.locked!==e.locked||e.correctness==="undefined"&&n.correctness||e.correctness&&n.correctness!==e.correctness):!0),i={};return r.forEach(n=>{let o=n.placeholderId;i[o]=this.getPromptValue(o),this.setPromptValue(o,"")}),i}getPromptState(e){let r=this.getPrompt(e);return r?[r.correctness,r.locked]:(console.error(`MathLive 0.97.2: unknown prompt ${e}`),[void 0,!0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var r;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var r,i;let e=this.model;this.keyboardDelegate.setValue(e.getValue(this.model.selection,"latex-expanded"));{let n=e.at(e.position),o=(r=n.mode)!=null?r:vl(this.options);this.model.mode!==o&&(this.model.mode==="latex"?(xr(this,"accept",{mode:o}),e.position=e.offsetOf(n)):this.switchMode(o))}(i=this.host)==null||i.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(je(this)),Qn(this)}onContentWillChange(e){var r,i,n;return(n=(i=this.host)==null?void 0:i.dispatchEvent(new InputEvent("beforeinput",g(p({},e),{data:e.data?e.data:(r=e.inputType)!=null?r:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?n:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),at(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var i,n,o;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",xr(this,"accept"),this.model.getValue()!==this.valueOnFocus&&((i=this.host)==null||i.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(n=this.host)==null||n.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(o=this.host)==null||o.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),W(this),this.focusBlurInProgress=!1,qa();let e=new AbortController,r=e.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Bt(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0})},{once:!0,signal:r}),setTimeout(()=>e.abort(),100)}onInput(e){Xn(this,e)}onKeystroke(e){return Kl(this,e)}onCompositionStart(e){this.model.deleteAtoms(Y(this.model.selection));let r=Ai(this.field);r&&requestAnimationFrame(()=>{at(this),this.keyboardDelegate.moveTo(r.x,r.y-r.height)})}onCompositionUpdate(e){Km(this.model,e),W(this)}onCompositionEnd(e){Bm(this.model),Xn(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),N.onCopy(this,e),Je(this.model,Y(this.model.selection),"deleteByCut"),this.snapshot("cut"),W(this))}onCopy(e){N.onCopy(this,e)}onPaste(e){let r=this.isSelectionEditable;return r&&(r=N.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),r||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),r}onGeometryChange(){this._menu.hide(),$i(this),Qn(this)}onWheel(e){let r=5*e.deltaX;if(!Number.isFinite(r)||r===0)return;let i=this.field;r<0&&i.scrollLeft===0||r>0&&i.offsetWidth+i.scrollLeft>=i.scrollWidth||(i.scrollBy({top:0,left:r}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let r=e;for(;!r.id&&r.hasChildren;)r=e.children[0];return this.fieldContent.querySelector(`[data-atom-id="${r.id}"]`)}get context(){var e,r;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(r=this.options.placeholderSymbol)!=null?r:"\u25A2",colorMap:i=>this.colorMap(i),backgroundColorMap:i=>this.backgroundColorMap(i),getMacro:i=>po(i,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function Ja(t,e,r){if(t.at(e).mode!=="text")return e;let i=r==="backward"?-1:1,n;if(_r.test(t.at(e).value)){let o=e,a;do a=t.at(o).mode==="text"&&_r.test(t.at(o).value),o+=i;while(t.at(o)&&a);n=t.at(o)?o-2*i:o-i}else if(/\s/.test(t.at(e).value)){let o=e;for(;t.at(o)&&t.at(o).mode==="text"&&/\s/.test(t.at(o).value);)o+=i;if(!t.at(o))n=o-i;else{let a=!0;do a=t.at(o).mode==="text"&&!/\s/.test(t.at(o).value),o+=i;while(t.at(o)&&a);n=t.at(o)?o-2*i:o-i}}else{let o=e;for(;t.at(o)&&t.at(o).mode==="text"&&!/\s/.test(t.at(o).value);)o+=i;n=t.at(o)?o:o-i;let a=!0;for(;t.at(o)&&a;)a=t.at(o).mode==="text"&&/\s/.test(t.at(o).value),a&&(n=o),o+=i;n=t.at(o)?o-2*i:o-i}return n-(i>0?0:1)}function wr(t,e,r){var a,s,l,c,u,d,m;let i=t.position;(a=r==null?void 0:r.extend)!=null&&a||t.collapseSelection(e);let n=t.at(t.position);if(e==="forward"&&(n.type==="subsup"?(n=n.rightSibling,n||(n=t.at(t.position+1))):n=t.at(t.position+1)),!n)return t.announce("plonk"),!1;let o=t.offsetOf(n);if(n instanceof He)o=Ja(t,o,e);else if(n instanceof Z)if(n.isSuggestion)for(;n&&n instanceof Z;)n.isSuggestion=!1,o=t.offsetOf(n),n=n.rightSibling;else if(e==="forward"){if(n=n.rightSibling,!n||!(n instanceof Z))return t.announce("plonk"),!1;for(;n&&n instanceof Z&&/[a-zA-Z\*]/.test(n.value);)o=t.offsetOf(n),n=n.rightSibling}else{if(n=n.leftSibling,!n||!(n instanceof Z))return t.announce("plonk"),!1;for(;n&&n instanceof Z&&/[a-zA-Z\*]/.test(n.value);)o=t.offsetOf(n),n=n.leftSibling}else if(e==="forward"&&n.type==="mopen"){let h=0;do n.type==="mopen"?h+=1:n.type==="mclose"&&(h-=1),n=n.rightSibling;while(!n.isLastSibling&&h!==0);o=t.offsetOf(n.leftSibling)}else if(e==="backward"&&n.type==="mclose"){let h=0;do n.type==="mopen"?h+=1:n.type==="mclose"&&(h-=1),n=n.leftSibling;while(!n.isFirstSibling&&h!==0);o=t.offsetOf(n)}else if(e==="backward")if(n.type==="first")for(;o>0&&n.type==="first";)o-=1,n=t.at(o);else{let h=n.type;n.type==="subsup"&&(o=t.offsetOf(t.at(o).leftSibling)),o-=1;let f=(s=t.at(o))==null?void 0:s.type;for(;o>=0&&f===h;)((l=t.at(o))==null?void 0:l.type)==="subsup"?o=t.offsetOf(t.at(o).leftSibling):o-=1,f=t.at(o).type}else{let{type:h}=n,f=(c=t.at(o))==null?void 0:c.type,{lastOffset:x}=t;for(;o<=x&&(f===h||f==="subsup");){for(;((u=t.at(o).rightSibling)==null?void 0:u.type)==="subsup";)o=t.offsetOf(t.at(o).rightSibling);o+=1,f=(d=t.at(o))==null?void 0:d.type}o-=1}if((m=r==null?void 0:r.extend)!=null&&m){if(!t.setSelection(t.anchor,o))return t.announce("plonk"),!1}else{if(o===t.position)return t.announce("plonk"),!1;t.position=o}return t.announce("move",i),t.mathfield.stopCoalescingUndo(),!0}function Ge(t,e,r){var o,a;if(r=r!=null?r:{extend:!1},t.mathfield.adoptStyle=e==="backward"?"right":"left",e!=="forward"){let[s,l]=ka(t);s!==void 0&&l!==void 0&&t.deleteAtoms([s,l])}if(e==="upward")return Mg(t,r);if(e==="downward")return _g(t,r);if(r.extend){let s=Ua(t,t.position,e);s<0&&(s=0),s>t.lastOffset&&(s=t.lastOffset);let l=t.setSelection(t.anchor,s);return t.mathfield.stopCoalescingUndo(),l}if(t.selectionIsPlaceholder){t.collapseSelection(e);let s=Ge(t,e);return t.mathfield.stopCoalescingUndo(),s}let i=t.position,n=i;if(t.collapseSelection(e)?(i=t.position,ap(t,i)||(i=Ua(t,i,e))):i=Ua(t,i,e),i<0||i>t.lastOffset){let s=!0;return t.silenceNotifications||(s=(a=(o=t.mathfield.host)==null?void 0:o.dispatchEvent(new CustomEvent("move-out",{detail:{direction:e},cancelable:!0,bubbles:!0,composed:!0})))!=null?a:!0),s&&t.announce("plonk"),s}return t.setPositionHandlingPlaceholder(i),t.mathfield.stopCoalescingUndo(),t.announce("move",n),!0}function Ua(t,e,r){return e=e+(r==="forward"?1:-1),e<0||e>t.lastOffset||ap(t,e)?e:Ua(t,e,r)}function ap(t,e){var n;let r=t.at(e),i=r.parent;for(;i&&!i.inCaptureSelection;)i=i.parent;return!(i!=null&&i.inCaptureSelection||(n=r.parent)!=null&&n.skipBoundary&&(!r.isFirstSibling&&r.isLastSibling||r.type==="first")||t.mathfield.hasEditablePrompts&&!r.parentPrompt)}function kg(t,e,r){let i=1/0,n=0;for(;nc.type==="prompt"&&!c.captureSelection):r,s=Ys(t.mathfield.getHTMLElement(e)).right,l=t.offsetOf(kg(t.mathfield,a,s))-(o?1:0);if(i){let[c,u]=t.selection.ranges[0],d;l<(n==="up"?c:u)?d={ranges:[[l,u]],direction:"backward"}:d={ranges:[[c,l]],direction:"forward"},t.setSelection(d)}else t.setPositionHandlingPlaceholder(l);t.announce(`move ${n}`)}function Mg(t,e){var a,s;let r=(a=e==null?void 0:e.extend)!=null?a:!1;r||t.collapseSelection("backward");let i=()=>{var c,u;let l=!0;return t.silenceNotifications||(l=(u=(c=t.mathfield.host)==null?void 0:c.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0),t.announce(l?"plonk":"line"),l},n=t.at(t.position),o=n;for(;o&&o.parentBranch!=="below"&&!(Array.isArray(o.parentBranch)&&o.parent instanceof I);)o=o.parent;if(Array.isArray(o==null?void 0:o.parentBranch)&&o.parent instanceof I){let l=o.parent;if(o.parentBranch[0]<1)return i();let c=o.parentBranch[0]-1,u=l.array[c][o.parentBranch[1]];if(!u.some(m=>m.type==="prompt"&&!m.captureSelection)&&t.mathfield.hasEditablePrompts)return i();ja(t,n,u,r,"up")}else if(o){let l=(s=o.parent.branch("above"))!=null?s:o.parent.createBranch("above");if(!l.some(u=>u.type==="prompt"&&u.placeholderId)&&t.mathfield.hasEditablePrompts)return i();ja(t,n,l,r,"up")}else return i();return t.mathfield.stopCoalescingUndo(),!0}function _g(t,e){var a,s;let r=(a=e==null?void 0:e.extend)!=null?a:!1;r||t.collapseSelection("forward");let i=()=>{var c,u;let l=!0;return t.silenceNotifications||(l=(u=(c=t.mathfield.host)==null?void 0:c.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0),t.announce(l?"plonk":"line"),l},n=t.at(t.position),o=n;for(;o&&o.parentBranch!=="above"&&!(Array.isArray(o.parentBranch)&&o.parent instanceof I);)o=o.parent;if(Array.isArray(o==null?void 0:o.parentBranch)&&o.parent instanceof I){let l=o.parent;if(o.parentBranch[0]+1>l.array.length-1)return i();let c=o.parentBranch[0]+1,u=l.array[c][o.parentBranch[1]];if(!u.some(m=>m.type==="prompt"&&!m.captureSelection)&&t.mathfield.hasEditablePrompts)return i();ja(t,n,u,r,"down")}else if(o){let l=(s=o.parent.branch("below"))!=null?s:o.parent.createBranch("below");if(!l.some(u=>u.type==="prompt")&&t.mathfield.hasEditablePrompts)return i();ja(t,n,l,r,"down")}else return i();return!0}oe({deleteAll:t=>t.contentWillChange({inputType:"deleteContent"})&&Je(t,[0,-1],"deleteContent"),deleteForward:t=>Dm(t),deleteBackward:t=>Tm(t),deleteNextWord:t=>t.contentWillChange({inputType:"deleteWordForward"})&&Je(t,[t.anchor,Ja(t,t.position,"forward")],"deleteWordForward"),deletePreviousWord:t=>t.contentWillChange({inputType:"deleteWordBackward"})&&Je(t,[t.anchor,Ja(t,t.position,"backward")],"deleteWordBackward"),deleteToGroupStart:t=>t.contentWillChange({inputType:"deleteSoftLineBackward"})&&Je(t,[t.anchor,t.offsetOf(t.at(t.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:t=>t.contentWillChange({inputType:"deleteSoftLineForward"})&&Je(t,[t.anchor,t.offsetOf(t.at(t.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:t=>t.contentWillChange({inputType:"deleteHardLineBackward"})&&Je(t,[t.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:t=>t.contentWillChange({inputType:"deleteHardLineForward"})&&Je(t,[t.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});function sp(t){if(t&&(t.classList.remove("ML__highlight"),t.children))for(let e of t.children)sp(e)}function Ql(t,e){var r;t&&(!e||((r=t.dataset)==null?void 0:r.atomId)===e?(t.classList.add("ML__highlight"),t.children&&t.children.length>0&&[...t.children].forEach(i=>{i instanceof HTMLElement&&Ql(i)})):(t.classList.remove("ML__highlight"),t.children&&t.children.length>0&&[...t.children].forEach(i=>{i instanceof HTMLElement&&Ql(i,e)})))}function lp(t,e){var n;if(!pe())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.97.2: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(e);return}if(!window.AWS){console.error("MathLive 0.97.2: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}let r=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"json",VoiceId:(n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna",Engine:"standard",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};lt().readAloudElement=t,r.synthesizeSpeech(i,(o,a)=>{if(o){console.trace(`MathLive 0.97.2: \`polly.synthesizeSpeech()\` error: ${o}`);return}if(!(a!=null&&a.AudioStream))return;let s=new TextDecoder("utf-8").decode(new Uint8Array(a.AudioStream));lt().readAloudMarks=s.split(` +`).map(l=>l?JSON.parse(l):{}),lt().readAloudTokens=[];for(let l of lt().readAloudMarks)l.value&<().readAloudTokens.push(l.value);lt().readAloudCurrentMark="",i.OutputFormat="mp3",i.SpeechMarkTypes=[],r.synthesizeSpeech(i,(l,c)=>{if(l){console.trace(`MathLive 0.97.2: \`polly.synthesizeSpeech("${e}") error:${l}`);return}if(!(c!=null&&c.AudioStream))return;let u=new Uint8Array(c.AudioStream),d=new Blob([u.buffer],{type:"audio/mpeg"}),m=URL.createObjectURL(d),h=lt();h.readAloudAudio?h.readAloudAudio.pause():(h.readAloudAudio=new Audio,h.readAloudAudio.addEventListener("ended",()=>{let f=h.readAloudMathfield;h.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),f?(at(f),h.readAloudElement=null,h.readAloudMathfield=null,h.readAloudTokens=[],h.readAloudMarks=[],h.readAloudCurrentMark=""):sp(h.readAloudElement)}),h.readAloudAudio.addEventListener("timeupdate",()=>{let f="",x=h.readAloudAudio.currentTime*1e3+100;for(let M of h.readAloudMarks)M.time0){console.group("%cMathLive 0.97.2: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathFieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(let s of a)console.warn(s);console.groupEnd()}}en()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0});let o=``;this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot?(this.shadowRoot.adoptedStyleSheets=[zr("core"),zr("mathfield"),zr("mathfield-element"),zr("ui"),zr("menu")],this.shadowRoot.innerHTML=o):this.shadowRoot.innerHTML=""+o,r&&this._setOptions(r)}static get formAssociated(){return en()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(r){r!==this._fontsDirectory&&(this._fontsDirectory=r,bm())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(r){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(r){this._soundsDirectory=r,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(r){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(r){var i,n,o;this.audioBuffers={},r===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof r=="string"?this._keypressSound={spacebar:r,return:r,delete:r,default:r}:typeof r=="object"&&"default"in r&&(this._keypressSound={spacebar:(i=r.spacebar)!=null?i:r.default,return:(n=r.return)!=null?n:r.default,delete:(o=r.delete)!=null?o:r.default,default:r.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(r){this.audioBuffers={},this._plonkSound=r}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(r){this._speechEngine=r}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(r){this._speechEngineRate=r}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(r){this._speechEngineVoice=r}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(r){this._textToSpeechMarkup=r}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(r){this._textToSpeechRules=r}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(r){this._textToSpeechRulesOptions=r}static get locale(){return O.locale}static set locale(r){r==="auto"&&(r=navigator.language.slice(0,5)),O.locale=r}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(r){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return O.strings}static set strings(r){O.merge(r)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(r){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(r){this._decimalSeparator=r,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(r){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var r,i;if(this._computeEngine===void 0){let n=(r=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.ComputeEngine;if(!n)return null;this._computeEngine=new n,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(i=this._computeEngine)!=null?i:null}static set computeEngine(r){this._computeEngine=r}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(r){throw new Error("Use MathfieldElement.computeEngine instead")}static async loadSound(r){delete this.audioBuffers[r];let i="";switch(r){case"keypress":i=this._keypressSound.default;break;case"return":i=this._keypressSound.return;break;case"spacebar":i=this._keypressSound.spacebar;break;case"delete":i=this._keypressSound.delete;break;case"plonk":i=this.plonkSound;break}if(typeof i!="string")return;i=i.trim();let n=this.soundsDirectory;if(!(n==null||n==="null"||i==="none"||i==="null"))try{let a=await(await fetch(await Ma(`${n}/${i}`))).arrayBuffer(),s=await this.audioContext.decodeAudioData(a);this.audioBuffers[r]=s}catch(o){}}static async playSound(r){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&await this.audioContext.resume(),this.audioBuffers[r]||await this.loadSound(r),!this.audioBuffers[r])return;let i=this.audioContext.createBufferSource();i.buffer=this.audioBuffers[r];let n=this.audioContext.createGain();n.gain.value=Sg,i.connect(n).connect(this.audioContext.destination),i.start()}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",r=>{var i;r.target===this&&!((i=this._mathfield)!=null&&i.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:r.altKey,button:r.button,buttons:r.buttons,clientX:r.clientX,clientY:r.clientY,ctrlKey:r.ctrlKey,metaKey:r.metaKey,movementX:r.movementX,movementY:r.movementY,relatedTarget:r.relatedTarget,screenX:r.screenX,screenY:r.screenY,shiftKey:r.shiftKey}))},{once:!0})}getPromptValue(r,i){var n,o;return(o=(n=this._mathfield)==null?void 0:n.getPromptValue(r,i))!=null?o:""}getPrompts(r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.getPrompts(r))!=null?n:[]}get form(){var r;return(r=this._internals)==null?void 0:r.form}get name(){var r;return(r=this.getAttribute("name"))!=null?r:""}get type(){return this.localName}get mode(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.model.mode)!=null?i:this.defaultMode==="text"?"text":"math"}set mode(r){this._mathfield&&(this._mathfield.model.mode=r)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.97.2: The CortexJS Compute Engine library is not available. + + Load the library, for example with: + + import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(r){var n,o;if(!this._mathfield)return;let i=(o=(n=te.computeEngine)==null?void 0:n.box(r).latex)!=null?o:null;i!==null&&this._mathfield.setValue(i),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.97.2: The CortexJS Compute Engine library is not available. + + Load the library, for example with: + + import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.errors)!=null?i:[]}_getOptions(r){return this._mathfield?Nt(this._mathfield.options,r):V.has(this)?p({},Nt(p(p({},Ji()),ji(V.get(this).options)),r)):null}getOptions(r){return console.warn("%cMathLive 0.97.2: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Nt(this._mathfield.options,r):V.has(this)?Nt(p(p({},Ji()),ji(V.get(this).options)),r):null}reflectAttributes(){let r=Ji(),i=this._getOptions();Object.keys(te.optionsAttributes).forEach(n=>{let o=Vt(n);te.optionsAttributes[n]==="on/off"?r[o]!==i[o]?this.setAttribute(n,i[o]?"on":"off"):this.removeAttribute(n):r[o]!==i[o]&&(te.optionsAttributes[n]==="boolean"?i[o]?this.setAttribute(n,""):this.removeAttribute(n):(typeof i[o]=="string"||typeof i[o]=="number")&&this.setAttribute(n,i[o].toString()))})}getOption(r){return console.warn("%cMathLive 0.97.2: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([r])[r]}_getOption(r){return this._getOptions([r])[r]}_setOptions(r){if(this._mathfield)this._mathfield.setOptions(r);else if(V.has(this)){let i=p(p({},V.get(this).options),r);V.set(this,g(p({},V.get(this)),{selection:{ranges:i.readOnly?[[0,0]]:[[0,-1]]},options:i}))}else V.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:r});this.reflectAttributes()}setOptions(r){console.group("%cMathLive 0.97.2: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(let i of Object.keys(r))kr[i]&&console.warn(`\`mf.setOptions({${i}:...})\` -> ${kr[i]}`);console.groupEnd(),this._setOptions(r)}executeCommand(r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.executeCommand(r))!=null?n:!1}getValue(r,i,n){var o,a;if(this._mathfield)return this._mathfield.model.getValue(r,i,n);if(V.has(this)){let s,l,c;if(Gi(r)?([s,l]=r.ranges[0],c=i):Gr(r)?([s,l]=r,c=i):Lt(r)&&Lt(i)?(s=r,l=i,c=n):(s=0,l=-1,c=r),(c===void 0||c==="latex")&&s===0&&l===-1)return(a=(o=V.get(this).value)!=null?o:this.textContent)!=null?a:""}return""}setValue(r,i){if(this._mathfield&&r!==void 0){i!=null||(i={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(r,i);return}if(V.has(this)){let o=V.get(this).options;V.set(this,{value:r,selection:{ranges:o.readOnly?[[0,0]]:[[0,-1]],direction:"forward"},options:o});return}let n=Ga(this);V.set(this,{value:r,selection:{ranges:n.readOnly?[[0,0]]:[[0,-1]],direction:"forward"},options:n})}hasFocus(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.hasFocus())!=null?i:!1}focus(){var r;(r=this._mathfield)==null||r.focus()}blur(){var r;(r=this._mathfield)==null||r.blur()}select(){var r;(r=this._mathfield)==null||r.select()}insert(r,i){var n,o;return(o=(n=this._mathfield)==null?void 0:n.insert(r,i))!=null?o:!1}applyStyle(r,i){var n;return(n=this._mathfield)==null?void 0:n.applyStyle(r,i)}get caretPoint(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.getCaretPoint())!=null?i:null}set caretPoint(r){var i;r&&((i=this._mathfield)==null||i.setCaretPoint(r.x,r.y))}setCaretPoint(r,i){var n,o;return(o=(n=this._mathfield)==null?void 0:n.setCaretPoint(r,i))!=null?o:!1}offsetFromPoint(r,i,n){return this._mathfield?ni(this._mathfield,r,i,n):-1}hitboxFromOffset(r){if(!this._mathfield)return null;let i=this._mathfield.model.at(r);if(!i)return null;let n=dr(this._mathfield,i);return n?new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top):null}resetUndo(){var r;(r=this._mathfield)==null||r.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(r){var i,n,o,a;Te.scrim&&Te.scrim.state!=="closed"||((n=(i=this._mathfield)==null?void 0:i.menu)==null?void 0:n.state)==="closed"&&(r.type==="pointerdown"&&this.onPointerDown(),r.type==="focus"&&((o=this._mathfield)==null||o.focus()),r.type==="blur"&&((a=this._mathfield)==null||a.blur()))}connectedCallback(){var n,o,a;this.shadowRoot.host.addEventListener("pointerdown",this,!0),this.shadowRoot.host.addEventListener("focus",this,!0),this.shadowRoot.host.addEventListener("blur",this,!0),en()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),this.hasAttribute("contenteditable")||this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");let r=this.shadowRoot.querySelector("slot:not([name])");try{this._style=r.assignedElements().filter(s=>s.tagName.toLowerCase()==="style").map(s=>s.textContent).join("")}catch(s){console.error(s)}if(this._style){let s=document.createElement("style");s.textContent=this._style,this.shadowRoot.appendChild(s)}let i="";if(this.hasAttribute("value")?i=(n=this.getAttribute("value"))!=null?n:"":i=(o=r==null?void 0:r.assignedNodes().map(s=>s.nodeType===3?s.textContent:"").join("").trim())!=null?o:"",this._mathfield=new Wa(this.shadowRoot.querySelector(":host > span"),g(p({},V.has(this)?V.get(this).options:Ga(this)),{eventSink:this,value:i})),!V.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(let s of Object.keys(te.optionsAttributes))this.upgradeProperty(Vt(s))}if(!((a=this._mathfield)!=null&&a.model)){this._mathfield=null;return}V.has(this)&&this._mathfield.model.deferNotifications({content:!1,selection:!1},()=>{let s=V.get(this).value;s!==void 0&&this._mathfield.setValue(s),this._mathfield.model.selection=V.get(this).selection,V.delete(this)}),window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Wr()}disconnectedCallback(){if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));let r=Nt(this._mathfield.options,Object.keys(te.optionsAttributes).map(i=>Vt(i)));V.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,options:r}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(r){if(this.hasOwnProperty(r)){let i=this[r];delete this[r],(r==="readonly"||r==="read-only")&&(r="readOnly"),this[r]=i}}attributeChangedCallback(r,i,n){if(i===n)return;let o=n!==null;switch(r){case"contenteditable":W(this._mathfield);break;case"disabled":this.disabled=o;break;case"read-only":case"readonly":this.readOnly=o;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(r){let i=!!r;i?(this.setAttribute("readonly",""),en()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(en()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:i})}get disabled(){return this.hasAttribute("disabled")}set disabled(r){var n;let i=!!r;i?this.setAttribute("disabled",""):this.removeAttribute("disabled"),en()?this._internals.ariaDisabled=i?"true":"false":this.setAttribute("aria-disabled",i?"true":"false"),i&&((n=this._mathfield)!=null&&n.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(r){this.setValue(r)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(r){this._setOptions({defaultMode:r})}get macros(){return this._getOption("macros")}set macros(r){this._setOptions({macros:r})}get registers(){let r=this;return new Proxy({},{get:(i,n)=>{if(typeof n=="string")return r._getOption("registers")[n]},set(i,n,o){return typeof n!="string"?!1:(r._setOptions({registers:g(p({},r._getOption("registers")),{[n]:o})}),!0)}})}set registers(r){this._setOptions({registers:r})}get colorMap(){return this._getOption("colorMap")}set colorMap(r){this._setOptions({colorMap:r})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(r){this._setOptions({backgroundColorMap:r})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(r){this._setOptions({letterShapeStyle:r})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(r){this._setOptions({minFontScale:r})}get smartMode(){return this._getOption("smartMode")}set smartMode(r){this._setOptions({smartMode:r})}get smartFence(){return this._getOption("smartFence")}set smartFence(r){this._setOptions({smartFence:r})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(r){this._setOptions({smartSuperscript:r})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(r){this._setOptions({scriptDepth:r})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(r){this._setOptions({removeExtraneousParentheses:r})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(r){this._setOptions({mathModeSpace:r})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(r){this._setOptions({placeholderSymbol:r})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(r){this._setOptions({popoverPolicy:r})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(r){this._setOptions({environmentPopoverPolicy:r})}get menuItems(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.menu.menuItems)!=null?i:[]}set menuItems(r){var i,n;if((i=this._mathfield)!=null&&i.menu){let o=(n=this._mathfield.element)==null?void 0:n.querySelector("[part=menu-toggle]");o&&(o.style.display=r.length===0?"none":""),this._mathfield.menu.menuItems=r}}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(r){this._setOptions({mathVirtualKeyboardPolicy:r})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(r){this._setOptions({inlineShortcuts:r})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(r){this._setOptions({inlineShortcutTimeout:r})}get keybindings(){return this._getOption("keybindings")}set keybindings(r){this._setOptions({keybindings:r})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(r){this._setOptions({onInlineShortcut:r})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(r){this._setOptions({onScrollIntoView:r})}get onExport(){return this._getOption("onExport")}set onExport(r){this._setOptions({onExport:r})}get readOnly(){return this._getOption("readOnly")}set readOnly(r){this._setOptions({readOnly:r})}get isSelectionEditable(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.isSelectionEditable)!=null?i:!1}setPromptState(r,i,n){var o;(o=this._mathfield)==null||o.setPromptState(r,i,n)}getPromptState(r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.getPromptState(r))!=null?n:[void 0,!0]}setPromptContent(r,i,n){var o;(o=this._mathfield)==null||o.setPromptValue(r,i,n)}stripPromptContent(r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.stripPromptContent(r))!=null?n:{}}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(r){this._setOptions({virtualKeyboardTargetOrigin:r})}get selection(){return this._mathfield?this._mathfield.model.selection:V.has(this)?V.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(r){if(typeof r=="number"&&(r={ranges:[[r,r]]}),this._mathfield){this._mathfield.model.selection=r;return}if(V.has(this)){V.set(this,g(p({},V.get(this)),{selection:r}));return}V.set(this,{value:void 0,selection:r,options:Ga(this)})}get selectionIsCollapsed(){let r=this.selection;return r.ranges.length===1&&r.ranges[0][0]===r.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:V.has(this)?V.get(this).selection.ranges[0][0]:0}set position(r){if(this._mathfield&&(this._mathfield.model.position=r),V.has(this)){V.set(this,g(p({},V.get(this)),{selection:{ranges:[[r,r]]}}));return}V.set(this,{value:void 0,selection:{ranges:[[r,r]]},options:Ga(this)})}getOffsetDepth(r){var i;return this._mathfield?((i=this._mathfield.model.at(r))==null?void 0:i.treeDepth)-2:0}get lastOffset(){var r,i;return(i=(r=this._mathfield)==null?void 0:r.model.lastOffset)!=null?i:-1}};te.version="0.97.2",te._fontsDirectory="./fonts",te._soundsDirectory="./sounds",te.keypressVibration=!0,te._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},te._plonkSound="plonk.wav",te.audioBuffers={},te.createHTML=r=>r,te._speechEngineRate="100%",te._speechEngineVoice="Joanna",te._textToSpeechMarkup="",te._textToSpeechRules="mathlive",te._textToSpeechRulesOptions={},te.speakHook=Sm,te.readAloudHook=lp,te._decimalSeparator=".",te.fractionNavigationOrder="numerator-denominator";var ai=te;function Vt(t){return t.replace(/[^a-zA-Z\d]+(.)/g,(e,r)=>r.toUpperCase())}function Ga(t){let e={readOnly:!1},r=ai.optionsAttributes;return Object.keys(r).forEach(i=>{if(t.hasAttribute(i)){let n=t.getAttribute(i);r[i]==="boolean"?e[Vt(i)]=!0:r[i]==="on/off"?n==="on"?e[Vt(i)]=!0:n==="off"?e[Vt(i)]=!1:e[Vt(i)]=void 0:r[i]==="number"?e[Vt(i)]=Number.parseFloat(n!=null?n:"0"):e[Vt(i)]=n}}),e}function en(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var qi=ai,cp,up,dp,mp;if(pe()&&!((cp=window.customElements)!=null&&cp.get("math-field"))){(dp=window[up=Symbol.for("io.cortexjs.mathlive")])!=null||(window[up]={});let t=window[Symbol.for("io.cortexjs.mathlive")];t.version="0.97.2",window.MathfieldElement=ai,(mp=window.customElements)==null||mp.define("math-field",ai)}function Ag(t,e,r){let i=r,n=0,o=t.length;for(;i0&&o.push({type:"text",data:s.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(u=s.indexOf(e,c),u===-1){d=!0;break}c!==u&&o.push({type:"text",data:s.slice(c,u)}),c=u}else{if(u=Ag(r,s,c+e.length),u===-1){d=!0;break}let m=s.slice(c+e.length,u);n==="ascii-math"&&([,m]=Or(m,{format:"ascii-math"})),o.push({type:"math",data:m,rawData:s.slice(c,u+r.length),mathstyle:i}),c=u+r.length}l=!l}c{i=Xa(i,n,o,"textstyle")}),e!=null&&e.display&&e.display.forEach(([n,o])=>{i=Xa(i,n,o,"displaystyle")}),r!=null&&r.inline&&r.inline.forEach(([n,o])=>{i=Xa(i,n,o,"textstyle","ascii-math")}),r!=null&&r.display&&r.display.forEach(([n,o])=>{i=Xa(i,n,o,"displaystyle","ascii-math")}),i}function Lg(t,e){let r=document.createElement("span");r.setAttribute("translate","no");try{let i=""+e.renderToMathML(t)+"";r.innerHTML=window.MathfieldElement.createHTML(i)}catch(i){console.error(`MathLive 0.97.2: Could not convert "${t}"' to MathML with ${i}`),r.textContent=t}return r.className="ML__sr-only",r}function Cg(t,e,r,i){try{let n=e.renderToMarkup(t,{mathstyle:r,format:"html"}),o=document.createElement("span");return o.dataset.latex=t,o.style.display=r==="displaystyle"?"flex":"inline-flex",o.setAttribute("aria-hidden","true"),o.setAttribute("translate","no"),o.innerHTML=window.MathfieldElement.createHTML(n),o}catch(n){if(console.error("Could not parse'"+t+"' with ",n),i)return document.createTextNode(t)}return null}function tn(t,e,r,i){var a;let n=Cg(t,r,e||"textstyle",i),o=(a=r.renderAccessibleContent)!=null?a:"";if(n&&/\b(mathml|speakable-text)\b/i.test(o)){let s=document.createElement("span");if(/\bmathml\b/i.test(o)&&r.renderToMathML&&s.append(Lg(t,r)),/\bspeakable-text\b/i.test(o)&&r.renderToSpeakableText){let l=document.createElement("span");l.setAttribute("translate","no");let c=r.renderToSpeakableText(t);l.innerHTML=window.MathfieldElement.createHTML(c),l.className="ML__sr-only",s.append(l)}return s.append(n),s}return n}function Eg(t,e){var i,n,o;let r=null;if((i=e.TeX)!=null&&i.processEnvironments&&/^\s*\\begin/.test(t)){r=document.createDocumentFragment();let a=tn(t,"",e,!0);a&&r.appendChild(a)}else{if(!t.trim())return null;let a=pp(t,(n=e.TeX)==null?void 0:n.delimiters,(o=e.asciiMath)==null?void 0:o.delimiters);if(a.length===1&&a[0].type==="text")return null;r=document.createDocumentFragment();for(let s of a)if(s.type==="text")r.appendChild(document.createTextNode(s.data));else{let l=tn(s.data,s.mathstyle==="textstyle"?"textstyle":"displaystyle",e,!0);l&&r.appendChild(l)}}return r}function hp(t,e){var r,i,n,o,a,s,l,c,u,d,m,h,f,x,M,b;if(t.childNodes.length===1&&t.childNodes[0].nodeType===3){let k=(r=t.childNodes[0].textContent)!=null?r:"";if((i=e.TeX)!=null&&i.processEnvironments&&/^\s*\\begin/.test(k)){t.textContent="";let A=tn(k,"",e,!0);A&&t.append(A);return}let _=pp(k,(n=e.TeX)==null?void 0:n.delimiters,(o=e.asciiMath)==null?void 0:o.delimiters);if(_.length===1&&_[0].type==="math"){t.textContent="";let A=tn(_[0].data,_[0].mathstyle==="textstyle"?"textstyle":"displaystyle",e,!0);A&&t.append(A);return}if(_.length===1&&_[0].type==="text")return}for(let k=t.childNodes.length-1;k>=0;k--){let _=t.childNodes[k];if(_.nodeType===3){let A=Eg((a=_.textContent)!=null?a:"",e);A&&(k+=A.childNodes.length-1,_.replaceWith(A))}else if(_.nodeType===1){let A=_,E=_.nodeName.toLowerCase();if(E==="script"){let D=_,K;if((s=e.processScriptTypePattern)!=null&&s.test(D.type))K=(l=D.textContent)!=null?l:"";else if((c=e.processMathJSONScriptTypePattern)!=null&&c.test(D.type))try{K=(d=e.serializeToLatex)==null?void 0:d.call(e,JSON.parse((u=D.textContent)!=null?u:""))}catch(P){console.error(P)}if(K){let P="textstyle";for(let _e of D.type.split(";")){let[ut,$t]=_e.toLowerCase().split("=");ut.trim()==="mode"&&(P=$t.trim()==="display"?"displaystyle":"textstyle")}let se=tn(K,P,e,!0);se&&D.parentNode.replaceChild(se,D)}}else if(((h=(m=e.processClassPattern)==null?void 0:m.test(A.className))!=null?h:!1)||!((x=(f=e.skipTags)==null?void 0:f.includes(E))!=null&&x||(b=(M=e.ignoreClassPattern)==null?void 0:M.test(A.className))!=null&&b))if(t.childNodes.length===1&&t.childNodes[0].nodeType===3){let K=t.textContent;t.textContent="";let P=tn(K!=null?K:"","displaystyle",e,!0);P&&t.append(P)}else hp(A,e)}}}var Tg={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function ec(t,e){var r,i,n,o;try{let a=p(p({},Tg),e);a.ignoreClassPattern=new RegExp((r=a.ignoreClass)!=null?r:""),a.processClassPattern=new RegExp((i=a.processClass)!=null?i:""),a.processScriptTypePattern=new RegExp((n=a.processScriptType)!=null?n:""),a.processMathJSONScriptTypePattern=new RegExp((o=a.processMathJSONScriptType)!=null?o:""),Wr(),Oe("core"),hp(t,a)}catch(a){a instanceof Error?console.error("renderMathInElement(): "+a.message):console.error("renderMathInElement(): Could not render math for element",t)}}function Dg(t,e){let r=ke.singleton;return r?(r.show(),jr(),r.currentLayer=e,r.render(),r.focus(),!0):!1}function Kg(){let t=window.mathVirtualKeyboard;return t.visible?t.hide({animate:!0}):t.show({animate:!0}),!1}oe({switchKeyboardLayer:Dg,toggleVirtualKeyboard:Kg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function lt(){var t,e;return(e=globalThis[t=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[t]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Bg(){return console.warn("%cMathLive 0.97.2: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Pg(t){fp(document.body,t)}function Og(t){if(typeof t=="string"){let e=document.getElementById(t);if(e===null)throw new Error(`The element with ID "${t}" could not be found.`);return e}return typeof t=="string"?null:t}function fp(t,e){var n,o,a,s;let r=Og(t);if(!r)return;let i=e!=null?e:{};(n=i.renderToMarkup)!=null||(i.renderToMarkup=re),(o=i.renderToMathML)!=null||(i.renderToMathML=Jl),(a=i.renderToSpeakableText)!=null||(i.renderToSpeakableText=Gl),(s=i.serializeToLatex)!=null||(i.serializeToLatex=Xl),ec(r,i)}var zg={mathlive:"0.97.2"};return Mp(Ig);})(); +Object.assign(exports, MathLive); Object.defineProperty(exports, '__esModule', { value: true });})); diff --git a/public/_assets/mathlive/sounds/keypress-delete.wav b/public/_assets/mathlive/sounds/keypress-delete.wav new file mode 100644 index 0000000000..e4a4af7282 Binary files /dev/null and b/public/_assets/mathlive/sounds/keypress-delete.wav differ diff --git a/public/_assets/mathlive/sounds/keypress-return.wav b/public/_assets/mathlive/sounds/keypress-return.wav new file mode 100644 index 0000000000..8b666ce041 Binary files /dev/null and b/public/_assets/mathlive/sounds/keypress-return.wav differ diff --git a/public/_assets/mathlive/sounds/keypress-spacebar.wav b/public/_assets/mathlive/sounds/keypress-spacebar.wav new file mode 100644 index 0000000000..84743a0512 Binary files /dev/null and b/public/_assets/mathlive/sounds/keypress-spacebar.wav differ diff --git a/public/_assets/mathlive/sounds/keypress-standard.wav b/public/_assets/mathlive/sounds/keypress-standard.wav new file mode 100644 index 0000000000..42dcef5a08 Binary files /dev/null and b/public/_assets/mathlive/sounds/keypress-standard.wav differ diff --git a/public/_assets/mathlive/sounds/plonk.wav b/public/_assets/mathlive/sounds/plonk.wav new file mode 100644 index 0000000000..ea05fc87cb Binary files /dev/null and b/public/_assets/mathlive/sounds/plonk.wav differ diff --git a/src/components/equations-app/equations-app.tsx b/src/components/equations-app/equations-app.tsx new file mode 100644 index 0000000000..2edad62f73 --- /dev/null +++ b/src/components/equations-app/equations-app.tsx @@ -0,0 +1,1038 @@ +/* eslint-disable @next/next/no-img-element */ +import { ComputeEngine } from '@cortex-js/compute-engine' +import { faSquare } from '@fortawesome/free-regular-svg-icons' +import { + faCircleCheck, + faPlay, + faRotateLeft, +} from '@fortawesome/free-solid-svg-icons' +import * as confetti from 'canvas-confetti' // why is this throwing warnings? sigh .. +import { Expression } from 'mathlive' +import { useEffect, useRef, useState } from 'react' +import { v4 } from 'uuid' + +import { MathField } from './math-field' +import { MathField2 } from './math-field-2' +import { FaIcon } from '../fa-icon' + +type Mode = 'done' | 'input' | 'choose' +type InputState = + | 'error' + | 'ok' + | 'empty' + | 'var-mismatch' + | 'left-mismatch' + | 'right-mismatch' + +export function EquationsApp() { + const ce = new ComputeEngine() + + const [sessionId] = useState(v4()) + + function safeParse(latex: string) { + return ce.parse(latex.replaceAll('{,}', '.')) + } + try { + window.MathfieldElement.decimalSeparator = ',' + } catch (e) { + // + } + const [description, setDescription] = useState( + 'Löse die Gleichung und bestimme die Lösungsmenge.' + ) + const [edit, setEdit] = useState(false) + + const [mode, setMode] = useState('choose') + const [inputState, setInputState] = useState('empty') + + const [list, setList] = useState(['4x + 3 = 11']) + const [actions, setActions] = useState([]) + + const [solution, setSolution] = useState('') + + const lastScrollPosition = useRef(-1) + + const scrollDiv = useRef(null) + + const variableSymbol = Array.from( + extractSymbols(safeParse(list[list.length - 1]).json).values() + )[0] + + const [refLeft, setRefLeft] = useState('') + const [refRight, setRefRight] = useState('') + + const currentLatex = useRef('') + + let options: Action[] = [] + + if (mode === 'choose') { + //console.log('regen choices', JSON.stringify(list)) + const json = safeParse(list[list.length - 1]).json + try { + options = findActions( + json, + variableSymbol, + list[list.length - 1].replaceAll('{,}', '.') + ) + //console.log(options) + } catch (e) { + // eslint-disable-next-line no-console + console.log(e) + } + } + const rejectReason = useRef('') + + const solved = useRef>(new Set()) + + const [showOverview, setShowOverview] = useState(true) + + useEffect(() => { + if (showOverview && lastScrollPosition.current > 0) { + window.document.documentElement.scrollTop = lastScrollPosition.current + } + }, [showOverview]) + + useEffect(() => { + submit({ event: 'visit', latex: '', sessionId }) + const handlePopstate = () => { + setShowOverview(true) + } + + window.addEventListener('popstate', handlePopstate) + + return () => { + window.removeEventListener('popstate', handlePopstate) + } + }, []) + + if (showOverview) { + return ( +
    +
    +
    +

    + + Serlo Gleichungs-App +

    +
    +
    +
    +
    +
    +
    + Diese App befindet sich aktuell im Beta-Test. +
    + + Wir freuen uns über dein Feedback + + . +
    +

    Serlo 26258 - Aufgaben zu linearen Gleichungen

    + {renderExample('x+1=4')} + {renderExample('2x=8')} + {renderExample('4x=3x+5')} + {renderExample('0x=7')} + {renderExample('4x+4=3x+3')} + {renderExample('5x-2=x+6')} + {renderExample('3x=x+5')} + {renderExample('2x=4')} + {renderExample('7x-9=2x+5')} + {renderExample('\\frac{1}{12}x - 5 = 3')} + {renderExample('-8x + 5 = -5')} + {renderExample('x + 4 = 9x - (5 - x)')} + {renderExample('\\frac{1}{24} x = 0')} + {renderExample('3(a-4)=1-\\frac15(2-a)' /*, 'HN Multiplikation?'*/)} + {renderExample('3(4x-3)=4(3x-4)')} + {renderExample('3(4x+4)=4(3-4x)')} +

    Studyflix - einfache Gleichungen

    + {renderExample('5=2+3')} + {renderExample('6=2+3')} + {renderExample('x+4=6')} + {renderExample('x-2=8')} + {renderExample('5y+3=18')} + {renderExample('4(x+1)+3=7x-5')} + {renderExample('3x-1=8')} + {renderExample('2x-1=4x+3')} + {renderExample('3x+5=14')} + {renderExample('\\frac{x+5}{8}=2-2x')} + {renderExample('x+5=8')} + {renderExample('x-x=0')} + {renderExample('x=x+1')} +

    Lernkompass - S-Blatt01-lineare-Gleichungen

    + {renderExample('3x=21')} + {renderExample('-6x=48')} + {renderExample('12x=-60')} + {renderExample('7x=63')} + {renderExample('-8x=-56')} + {renderExample('10x=36')} + {renderExample('x+3=-12')} + {renderExample('x-7=25')} + {renderExample('x+4=16')} + {renderExample('5-x=17')} + {renderExample('13=3+x')} + {renderExample('12-x=27')} + + {renderExample('21-2x=6x+5')} + {renderExample('15-5x=2x-20')} + {renderExample('9x+14=2+5x')} + {renderExample('3x+7=11+19x')} + {renderExample('41-3x=9+5x')} + {renderExample('17x-21=6x+45')} + {renderExample('x-3=5x-11')} + {renderExample('-44-12x=-5x+12')} + + {renderExample('\\frac13 x = 9')} + {renderExample('\\frac25 x = 10')} + {renderExample('-2x = \\frac27')} + {renderExample('5x=- \\frac{10}{35}')} + {renderExample('-2{,}5x + 5{,}75 = 7{,}5x+1{,}75')} + {renderExample('8{,}3-1{,}2x=4{,}7+1{,}8x')} + {renderExample('\\frac23 x + \\frac12 = \\frac32 x + \\frac56')} + {renderExample('\\frac34x-\\frac25 = \\frac13+\\frac45 x')} + + {renderExample('15+11x=2(3+x)')} + {renderExample('3(x+6)=4(2+x)')} + {renderExample('5(2-3x)+x=2(-6+4x)')} + {renderExample('6(4x+8)-12=-3(3-2x)')} + {renderExample('10-(7x-5)=2-2(x+6)')} + {renderExample('12-(-3x+6)=18-(9+3x)')} + {renderExample('2-7(2x+5)-3(2x-4)=19')} + +
    + {' '} + +
    + +
    +
    +
    + ) + } + + function renderExample(latex: string, warning?: string) { + const isSolved = solved.current.has(latex) + return ( +
    +
    + + {isSolved && ( + + )} +
    +
    + {warning} + {isSolved ? ( + + ) : ( + + )} +
    +
    + ) + } + + const output = `\\begin{align}${list + .map((line, i) => { + const parts = line.split('=') + return `${parts[0]} &= ${parts[1]} && ${ + actions.length > i + ? actions[i].type === 'simplify' + ? ' \\Leftrightarrow' + : ` \\vert ${actions[i].displayLatex}` + : mode === 'done' + ? ' ' + : ' \\boxed{\\textcolor{orange}{?}}' + }` + }) + .join('\\\\\n')}\\end{align}` + + return ( +
    +
    +
    +

    + + Serlo Gleichungs-App +

    +
    +
    + {edit ? ( + <> + + + + ) : ( + mode !== 'done' && ( + + ) + )} +
    +
    +
    +
    + {edit ? ( + <> +

    + +

    +
    + { + try { + const input = safeParse(latex) + + if (!input.isValid) { + setInputState('error') + setMode('input') + } else { + const { json } = input + const result = validateInput(json) + if (result === true) { + setInputState('ok') + setMode('done') + setList([latex]) + return + } + rejectReason.current = result + } + setMode('input') + setInputState('error') + } catch (e) { + setMode('input') + setInputState('error') + } + }} + /> +
    + {inputState === 'error' &&
    {rejectReason.current}
    } + + ) : ( + <> +

    {description}

    + +
    + +
    + {mode === 'choose' && ( +
    +

    + Klicke auf eine der Optionen: +

    +
    + {options.map((op, i) => { + if (op.type === 'simplify') { + return ( + + ) + } + if (op.type === 'equiv-add' || op.type === 'equiv-raw') { + return ( + + ) + } + if (op.type === 'solution') { + return ( + + ) + } + })} +
    +
    + )} + + {mode === 'input' && ( +
    +
    +
    +
    + {actions[actions.length - 1].type === 'simplify' + ? 'Terme in Gleichung vereinfachen:' + : 'Forme auf beiden Seiten um:'} +
    + +
    +
    + { + setTimeout(() => { + try { + if (!latex) { + setInputState('empty') + return + } + const parsed = safeParse(latex) + + if (!parsed.isValid) { + setInputState('error') + return + } + + const symbols = extractSymbols(parsed.json) + + // console.log(symbols) + + // console.log(symbols, variableSymbol) + if ( + (!symbols.has(variableSymbol) && + symbols.size > 0) || + // (variableSymbol && symbols.size == 0) || + symbols.size > 1 + ) { + setInputState('var-mismatch') + return + } + + const parts = latex.split('=') + + if (parts.length < 2) { + setInputState('error') + return + } + + for (let i = -4; i <= 4; i++) { + if (variableSymbol) { + ce.assign(variableSymbol, i) + } + + const termL = `( ${refLeft} ) - ( ${parts[0]} )` + const valueL = safeParse(termL).N() + .value as number + + const termR = `( ${refRight} ) - ( ${parts[1]} )` + const valueR = safeParse(termR).N() + .value as number + + // console.log(termL, valueL, '\n', termR, valueR) + + if (Math.abs(valueL) > 0.00001) { + setInputState('left-mismatch') + return + } + if (Math.abs(valueR) > 0.00001) { + setInputState('right-mismatch') + return + } + //if (symbols.size == 0) break + } + + currentLatex.current = latex + setInputState('ok') + } catch (e) { + // eslint-disable-next-line no-console + console.log(e) + setMode('input') + setInputState('error') + } + }, 0) + }} + onEnter={() => { + if (inputState === 'ok') { + setList((list) => [...list, currentLatex.current]) + setMode('choose') + window.mathVirtualKeyboard.hide() + } + }} + /> +
    +
    + {inputState === 'empty' && ( + + Erwarte Eingabe der Form{' '} + +  =  + + + )} + {inputState === 'error' && ( + Fehler bei der Eingabe + )} + {inputState === 'var-mismatch' && ( + Variablen passen nicht + )} + {inputState === 'left-mismatch' && ( + + Term auf der linken Seite der Gleichung ist nicht + passend + + )} + {inputState === 'right-mismatch' && ( + + Term auf der rechten Seite der Gleichung ist nicht + passend + + )} + {inputState === 'ok' && ( +
    + Super! + +
    + )} +
    +
    +
    + )} + {mode === 'done' && ( + <> +
    +
    + +
    +
    + {' '} + Stark! +
    +
    +
    + +
    + + )} + + )} +
    +
    +
    + ) + + function extractSymbols(json: Expression): Set { + const output = new Set() + + function runInner(json: Expression) { + if (Array.isArray(json)) { + json.slice(1).map(runInner) + } + if (typeof json === 'string' && json !== 'Half') { + output.add(json) + } + } + + runInner(json) + return output + } + + function combineRef(latex: string, op: Action): string { + if (op.type === 'equiv-raw') { + return `( ${latex} ) ${op.latex}` + } + if (op.type === 'equiv-add') { + return `( ${latex} ) + ( ${op.latex} )` + } + return latex + } + + function validateInput(json: Expression): true | string { + // console.log('MathJSON:', json) + if (Array.isArray(json) && json.length === 3 && json[0] === 'Equal') { + const symbols = extractSymbols(json) + if (symbols.size <= 1) { + return true + } + } + return 'Eingabe keine Gleichung' + } +} + +interface Action { + type: 'simplify' | 'equiv-add' | 'solution' | 'equiv-raw' + displayLatex?: string + latex: string +} + +function findActions( + input: Expression, + variableSymbol: string, + sourceLatex: string +): Action[] { + const ce = new ComputeEngine() + const output: Action[] = [] + + // console.log('actions', input) + + function negateAndShowOp(t: any) { + if (typeof t === 'number' && t === 0) return + // komplexere Terme ausschließen? + const rawLatex = ce + .box(['Negate', t]) + .latex.replaceAll('\\frac{-', '-\\frac{') + output.push({ + type: 'equiv-add', + displayLatex: rawLatex.startsWith('-') ? rawLatex : `+ ${rawLatex}`, + latex: rawLatex, + }) + } + + function forInput(t: Expression) { + if (Array.isArray(t)) { + if (t[0] === 'Add') { + t.slice(1).forEach(negateAndShowOp) + } + if (t[0] === 'Subtract') { + negateAndShowOp(t[1]) + negateAndShowOp(['Negate', t[2]]) + } + if (t[0] === 'Multiply') { + t.slice(1).forEach((t) => { + if (typeof t === 'number' && t !== 0) { + if (t > 0) { + output.push({ + type: 'equiv-raw', + displayLatex: `: ${t}`, + latex: `\\div ${t}`, + }) + } else { + output.push({ + type: 'equiv-raw', + displayLatex: `: ( ${t} )`, + latex: `\\div ${t}`, + }) + } + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + if (isRational(t)) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (t[1] > 0) { + output.push({ + type: 'equiv-raw', + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + displayLatex: `: ${ce.box(t).latex}`, + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + latex: `\\div ${ce.box(t).latex}`, + }) + } else { + output.push({ + type: 'equiv-raw', + displayLatex: `: (${ce + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + .box(t) + .latex.replaceAll('\\frac{-', '-\\frac{')})`, + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + latex: `\\div ${ce.box(t).latex}`, + }) + } + } + }) + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + if (typeof t[1] === 'number' || isRational(t[1])) { + if (t[2] === variableSymbol && t[1] !== 0) { + negateAndShowOp(t) + } + } + } + if (t[0] === 'Divide') { + if (typeof t[2] === 'number') { + const latex = `\\cdot ${t[2] > 0 ? t[2] : `(${t[2]})`}` + output.push({ + type: 'equiv-raw', + displayLatex: latex, + latex, + }) + } + } + if (t[0] === 'Negate' && t.length === 2 && t[1] === variableSymbol) { + output.push({ + type: 'equiv-raw', + displayLatex: `\\cdot (-1)`, + latex: `\\cdot (-1)`, + }) + } + } + if (typeof t === 'number') { + negateAndShowOp(t) + } + if (t === variableSymbol) { + negateAndShowOp(t) + } + } + + if (Array.isArray(input)) { + if (input[0] === 'Equal' && input.length === 3) { + if (isDone(input) || isDoneRational(input)) { + const parts = sourceLatex.trim().split('=') + const result = parts[0] === variableSymbol ? parts[1] : parts[0] + const resultJSON = ce.parse(result, { canonical: false }).json + let outputValue = '' + if (typeof resultJSON === 'number' || resultJSON === 'Half') { + outputValue = result + } + if (Array.isArray(resultJSON) && isDivide(resultJSON)) { + const z = resultJSON[1] as number + const n = resultJSON[2] as number + if (Math.abs(gcd(z, n)) === 1) { + outputValue = result + } + } + if ( + Array.isArray(resultJSON) && + resultJSON.length === 2 && + resultJSON[0] === 'Negate' && + isDivide(resultJSON[1]) + ) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const z = (resultJSON as any)[1][1] as number + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const n = (resultJSON as any)[1][2] as number + if (Math.abs(gcd(z, n)) === 1) { + outputValue = result + } + } + if (outputValue) { + output.push({ + type: 'solution', + displayLatex: `\\mathbb{L} = \\left\\{ ${outputValue} \\right\\}`, + latex: '', + }) + } + } + /*if (isDoneRational(input)) { + console.log('source', sourceLatex) + const value = isRational(input[1]) ? input[1] : input[2] + output.push({ + type: 'solution', + displayLatex: `\\mathbb{L} = \\left\\{ ${ + ce.box(value).latex + } \\right\\}`, + latex: '', + }) + }*/ + if (typeof input[1] === 'number' && typeof input[2] === 'number') { + if (input[1] === input[2]) { + output.push({ + type: 'solution', + displayLatex: `\\mathbb{L} = \\mathbb{Q}`, + latex: '', + }) + } else { + output.push({ + type: 'solution', + displayLatex: `\\mathbb{L} = \\{ \\}`, + latex: '', + }) + } + } + if (output.length === 0) { + output.push({ type: 'simplify', latex: '' }) + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + forInput(input[1]) + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + forInput(input[2]) + } + const existingOps = new Set() + return output + .map((op) => { + if (op.displayLatex) { + op.displayLatex = op.displayLatex.replaceAll('.', '{,}') + const key = op.displayLatex + '²²' + op.type + if (existingOps.has(key)) return null + existingOps.add(key) + } + return op + }) + .filter((x) => x !== null) as Action[] + } + } + throw new Error('invalid input') + + function isDone(json: Expression) { + // console.log('is done?', json) + if ( + Array.isArray(json) && + json.length === 3 && + json[0] === 'Equal' && + ((json[1] === variableSymbol && typeof json[2] === 'number') || + (json[2] === variableSymbol && typeof json[1] === 'number')) + ) { + return true + } + return false + } + + function isDoneRational(json: Expression) { + // console.log('is done?', json) + if ( + Array.isArray(json) && + json.length === 3 && + json[0] === 'Equal' && + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + ((json[1] === variableSymbol && isRational(json[2])) || + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + (json[2] === variableSymbol && isRational(json[1]))) + ) { + return true + } + return false + } + + function isRational(json: Expression) { + if (json === 'Half') return true + if (Array.isArray(json)) { + if ( + json[0] === 'Rational' && + json.length === 3 && + typeof json[1] === 'number' && + typeof json[2] === 'number' + ) { + return true + } + } + return false + } + function isDivide(json: Expression) { + if (Array.isArray(json)) { + if ( + json[0] === 'Divide' && + json.length === 3 && + typeof json[1] === 'number' && + typeof json[2] === 'number' + ) { + return true + } + } + return false + } +} + +function gcd(a: number, b: number): number { + return b === 0 ? a : gcd(b, a % b) +} + +interface EquationsAppstatsData { + event: string + latex: string + sessionId: string +} + +function submit(data: EquationsAppstatsData) { + void (async () => { + await fetch('/api/frontend/equations-app-stats', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ ...data }), + }) + })() +} diff --git a/src/components/equations-app/math-field-2.tsx b/src/components/equations-app/math-field-2.tsx new file mode 100644 index 0000000000..7514587802 --- /dev/null +++ b/src/components/equations-app/math-field-2.tsx @@ -0,0 +1,84 @@ +import MathfieldElement from 'mathlive/dist/types/mathfield-element' +import { useState, useEffect, createRef, useRef } from 'react' + +interface MathFieldProps { + value?: string + readonly?: boolean + onChange?: (latex: string) => void + onEnter?: () => void +} + +export function MathField2(props: MathFieldProps) { + const [value, setValue] = useState(props.value ?? '') + + // Customize the mathfield when it is mounted + const mf = createRef() + + const onEnter = useRef(props.onEnter) + onEnter.current = props.onEnter + useEffect(() => { + if (mf.current) { + mf.current.menuItems = [] + if (props.readonly) { + mf.current.readOnly = true + } else { + // only run on mount + // Read more about customizing the mathfield: https://cortexjs.io/mathlive/guides/customizing/ + // mf.current.smartFence = false + mf.current.inlineShortcuts = { + ...mf.current.inlineShortcuts, + '*': '\\cdot', + } + mf.current.scriptDepth = 1 + + mf.current.addEventListener('focusin', () => { + window.mathVirtualKeyboard.show() + }) + mf.current.addEventListener('focusout', () => { + window.mathVirtualKeyboard.hide() + }) + + const beforeInputHandler = (ev: InputEvent) => { + if (ev.inputType === 'insertLineBreak') { + if (onEnter.current) { + onEnter.current() + } + } + } + + const mfc = mf.current + + mfc.addEventListener('beforeinput', beforeInputHandler) + + mf.current.keybindings = [ + ...mf.current.keybindings, + { key: ':', command: ['insert', '\\div'] }, + { key: '[NumpadDivide]', command: ['insert', '\\div'] }, + ] + //mf.current.focus() + + return () => { + mfc.removeEventListener('beforeinput', beforeInputHandler) + } + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + return ( + { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const v = (evt.target as MathfieldElement).value + setValue(v) + if (props.onChange) { + props.onChange(v) + } + }} + > + {value} + + ) +} diff --git a/src/components/equations-app/math-field.tsx b/src/components/equations-app/math-field.tsx new file mode 100644 index 0000000000..9878d40058 --- /dev/null +++ b/src/components/equations-app/math-field.tsx @@ -0,0 +1,128 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +import { faSpinner } from '@fortawesome/free-solid-svg-icons' +import MathfieldElement from 'mathlive/dist/types/mathfield-element' +import { useState, useEffect, createRef } from 'react' + +import { FaIcon } from '../fa-icon' + +interface MathFieldProps { + value?: string + readonly?: boolean + onChange?: (latex: string) => void + onEnter?: () => void + lazy?: boolean +} + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace JSX { + interface IntrinsicElements { + 'math-field': React.DetailedHTMLProps< + React.HTMLAttributes, + MathfieldElement + > + } + } +} + +export function MathField(props: MathFieldProps) { + const [value, setValue] = useState(props.value ?? '') + + const [wait, setWait] = useState(!!props.lazy) + + // Customize the mathfield when it is mounted + const mf = createRef() + + useEffect(() => { + if (wait) { + setTimeout(() => { + setWait(false) + }, 100) + return + } + if (mf.current) { + mf.current.menuItems = [] + if (props.readonly) { + mf.current.readOnly = true + if (mf.current.registers) { + // @ts-expect-error readonly? + mf.current.registers.arraystretch = 1.5 + } + } else { + // only run on mount + // Read more about customizing the mathfield: https://cortexjs.io/mathlive/guides/customizing/ + mf.current.smartFence = false + mf.current.inlineShortcuts = { '*': '\\cdot' } + mf.current.macros = {} + mf.current.scriptDepth = 0 + mf.current.mathVirtualKeyboardPolicy = 'manual' + mf.current.addEventListener('focusin', () => { + window.mathVirtualKeyboard.show() + }) + mf.current.addEventListener('focusout', () => { + window.mathVirtualKeyboard.hide() + }) + mf.current.keybindings = [ + ...mf.current.keybindings, + { key: ':', command: ['insert', '\\div'] }, + { key: '[NumpadDivide]', command: ['insert', '\\div'] }, + { key: '/', command: ['insert', '\\div'] }, + ] + //window.MathfieldElement.decimalSeparator = ',' + mf.current.focus() + window.mathVirtualKeyboard.layouts = { + displayEditToolbar: false, + rows: [ + [], + [ + '+', + '-', + '\\cdot', + '\\div', + '(', + ')', + '[left]', + '[right]', + { + label: '[backspace]', + width: 1.5, + }, + ], + ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'], + [], + ], + } + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [mf.current, wait]) + + if (wait) { + return ( +
    + +
    + ) + } + + return ( + { + if (ev.key === 'Enter' && props.onEnter) { + props.onEnter() + } + }} + onInput={(evt) => { + const v = (evt.target as MathfieldElement).value + setValue(v) + if (props.onChange) { + props.onChange(v) + } + }} + > + {value} + + ) +} diff --git a/src/pages/api/frontend/equations-app-stats.ts b/src/pages/api/frontend/equations-app-stats.ts new file mode 100644 index 0000000000..fe95a91b22 --- /dev/null +++ b/src/pages/api/frontend/equations-app-stats.ts @@ -0,0 +1,37 @@ +import type { NextApiRequest, NextApiResponse } from 'next' + +import { prisma } from '@/helper/prisma' + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + if (req.method !== 'POST') { + res.status(405).send({ message: 'Only POST requests allowed' }) + return + } + + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { event, latex, sessionId } = req.body + + if ( + typeof event === 'string' && + typeof latex === 'string' && + typeof sessionId === 'string' && + event.length < 255 && + latex.length < 255 && + sessionId.length < 64 + ) { + await prisma.equationsAppStats.create({ + data: { event, latex, sessionId }, + }) + res.send('ok') + return + } + } catch (e) { + // eslint-disable-next-line no-console + // console.log(e) + } + res.send('bad') +} diff --git a/src/pages/gleichungs-app.tsx b/src/pages/gleichungs-app.tsx new file mode 100644 index 0000000000..be563fd17c --- /dev/null +++ b/src/pages/gleichungs-app.tsx @@ -0,0 +1,44 @@ +/* eslint-disable @next/next/no-before-interactive-script-outside-document */ +import { NextPage } from 'next' +import Script from 'next/script' + +import { EquationsApp } from '@/components/equations-app/equations-app' +import { FrontendClientBase } from '@/components/frontend-client-base' +import { HeadTags } from '@/components/head-tags' + +const ContentPage: NextPage = () => { + return ( + + + + + + + ) +} + +export default ContentPage diff --git a/yarn.lock b/yarn.lock index 9b279dd9f6..586c677466 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1571,6 +1571,16 @@ __metadata: languageName: node linkType: hard +"@cortex-js/compute-engine@npm:0.22.0, @cortex-js/compute-engine@npm:^0.22.0": + version: 0.22.0 + resolution: "@cortex-js/compute-engine@npm:0.22.0" + dependencies: + complex.js: ^2.1.1 + decimal.js: ^10.4.3 + checksum: 1ccc95b86b03697394f1fb3427d5e6a9d8b8706749a1c930956d8c0a89c4913e80c39d2731c2625c457ccfdb00e1c898b4d2e860112c1b01f283f39722e28ea6 + languageName: node + linkType: hard + "@emotion/cache@npm:^10.0.27": version: 10.0.29 resolution: "@emotion/cache@npm:10.0.29" @@ -3938,6 +3948,7 @@ __metadata: resolution: "@serlo/frontend@workspace:." dependencies: "@babel/core": ^7.23.0 + "@cortex-js/compute-engine": ^0.22.0 "@fortawesome/fontawesome-svg-core": 6.4.2 "@fortawesome/free-brands-svg-icons": 6.4.2 "@fortawesome/free-regular-svg-icons": 6.4.2 @@ -3963,6 +3974,7 @@ __metadata: "@tailwindcss/typography": ^0.5.10 "@tippyjs/react": ^4.2.6 "@types/algebra.js": ^0.2.2 + "@types/canvas-confetti": ^1.6.4 "@types/escape-html": ^1.0.2 "@types/iframe-resizer": ^3.5.10 "@types/jest": ^29.5.5 @@ -3989,6 +4001,7 @@ __metadata: array-move: ^4.0.0 autoprefixer: ^10.4.16 babel-jest: ^29.7.0 + canvas-confetti: ^1.9.2 clsx: ^2.0.0 cross-env: ^7.0.3 dotenv: ^16.3.1 @@ -4013,6 +4026,7 @@ __metadata: js-cookie: ^3.0.5 json-diff: ^1.0.6 katex: ^0.16.9 + mathlive: ^0.97.4 micromark: ^4.0.0 msw: ^0.47.4 next: ^13.5.4 @@ -4344,6 +4358,13 @@ __metadata: languageName: node linkType: hard +"@types/canvas-confetti@npm:^1.6.4": + version: 1.6.4 + resolution: "@types/canvas-confetti@npm:1.6.4" + checksum: 0452e1f381e5d59471578be1b83f2908f0906ba0fddfe16f941a07e070f4ad91ceaf1a68bd84d84bb5e81214c95ef00137677d9d61d81119051425ca5ce307ba + languageName: node + linkType: hard + "@types/codemirror@npm:^0.0.90": version: 0.0.90 resolution: "@types/codemirror@npm:0.0.90" @@ -5928,6 +5949,13 @@ __metadata: languageName: node linkType: hard +"canvas-confetti@npm:^1.9.2": + version: 1.9.2 + resolution: "canvas-confetti@npm:1.9.2" + checksum: e85fc0bbcd6ce7879997ccf18ba5a9747589ecf6916a06bdb3d229551e8c45c74fd5b9f8d455763db4a9e868c4c3e13b4630c26451823c9f7d1d390f0f0ab192 + languageName: node + linkType: hard + "capital-case@npm:^1.0.4": version: 1.0.4 resolution: "capital-case@npm:1.0.4" @@ -6328,6 +6356,13 @@ __metadata: languageName: node linkType: hard +"complex.js@npm:^2.1.1": + version: 2.1.1 + resolution: "complex.js@npm:2.1.1" + checksum: a0802cc3f0eb7703088edfc3fe209ae7be5ce93c0e710a0f288be2e29ee31b3530a8c0d3330d7c2a668410dfe4293a4038554d66c7f1f1165997941bdc1092aa + languageName: node + linkType: hard + "compute-scroll-into-view@npm:^1.0.17": version: 1.0.17 resolution: "compute-scroll-into-view@npm:1.0.17" @@ -6689,6 +6724,13 @@ __metadata: languageName: node linkType: hard +"decimal.js@npm:^10.4.3": + version: 10.4.3 + resolution: "decimal.js@npm:10.4.3" + checksum: 796404dcfa9d1dbfdc48870229d57f788b48c21c603c3f6554a1c17c10195fc1024de338b0cf9e1efe0c7c167eeb18f04548979bcc5fdfabebb7cc0ae3287bae + languageName: node + linkType: hard + "decode-named-character-reference@npm:^1.0.0": version: 1.0.2 resolution: "decode-named-character-reference@npm:1.0.2" @@ -10557,6 +10599,15 @@ __metadata: languageName: node linkType: hard +"mathlive@npm:^0.97.4": + version: 0.97.4 + resolution: "mathlive@npm:0.97.4" + dependencies: + "@cortex-js/compute-engine": 0.22.0 + checksum: 268a4e4102e3e22d65e0c9dca050291333b03febe98d0ed0851bd3a7e8f0df56aba2ae454738e2846019ae415ff0116976956927b1d7f83f9df1408a10ffc52d + languageName: node + linkType: hard + "mdn-data@npm:2.0.28": version: 2.0.28 resolution: "mdn-data@npm:2.0.28"