HEX
Server: Apache
System: Linux vps.mmtprep.com 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: mmtprep (1001)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/mathlive.min-Fi-xmH1a.js
var Dh=Object.defineProperty,Bh=Object.defineProperties,Ah=Object.getOwnPropertyDescriptors,co=Object.getOwnPropertySymbols,v0=Object.prototype.hasOwnProperty,x0=Object.prototype.propertyIsEnumerable,ql=(e,t,i)=>t in e?Dh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,f=(e,t)=>{for(var i in t||(t={}))v0.call(t,i)&&ql(e,i,t[i]);if(co)for(var i of co(t))x0.call(t,i)&&ql(e,i,t[i]);return e},b=(e,t)=>Bh(e,Ah(t)),Rl=e=>typeof e=="symbol"?e:e+"",ho=(e,t)=>{var i={};for(var r in e)v0.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&co)for(var r of co(e))t.indexOf(r)<0&&x0.call(e,r)&&(i[r]=e[r]);return i};function _e(e){return Array.isArray(e)}var Lh={en:{"keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","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.borders":"Borders","menu.insert matrix":"Insert Matrix","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","menu.mode":"Mode","menu.mode-math":"Math","menu.mode-text":"Text","menu.mode-latex":"LaTeX","tooltip.blackboard":"Blackboard","tooltip.bold":"Bold","tooltip.italic":"Italic","tooltip.fraktur":"Fraktur","tooltip.script":"Script","tooltip.caligraphic":"Caligraphic","tooltip.typewriter":"Typewriter","tooltip.roman-upright":"Roman Upright","tooltip.row-by-col":"%@ × %@","menu.font-style":"Font Style","menu.accent":"Accent","menu.decoration":"Decoration","menu.color":"Color","menu.background-color":"Background","menu.evaluate":"Evaluate","menu.simplify":"Simplify","menu.solve":"Solve","menu.solve-for":"Solve for %@","menu.cut":"Cut","menu.copy":"Copy","menu.copy-as-latex":"Copy as LaTeX","menu.copy-as-ascii-math":"Copy as ASCII Math","menu.copy-as-mathml":"Copy as MathML","menu.paste":"Paste","menu.select-all":"Select All","color.red":"Red","color.orange":"Orange","color.yellow":"Yellow","color.lime":"Lime","color.green":"Green","color.teal":"Teal","color.cyan":"Cyan","color.blue":"Blue","color.indigo":"Indigo","color.purple":"Purple","color.magenta":"Magenta","color.black":"Black","color.dark-grey":"Dark Grey","color.grey":"Grey","color.light-grey":"Light Grey","color.white":"White"},ar:{"keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.alphabetic":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.cut to clipboard":"قص إلى الحافظة","tooltip.paste from clipboard":"لصق من الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء","menu.insert matrix":"أدخل المصفوفة","menu.borders":"محددات المصفوفة","menu.array.add row above":"أضف صفًا بعد ذلك","menu.array.add row below":"أضف الصف قبل","menu.array.add column after":"أضف العمود بعد ذلك","menu.array.add column before":"أضف العمود قبل","menu.array.delete row":"احذف صف","menu.array.delete rows":"حذف الصفوف المحددة","menu.array.delete column":"حذف العمود","menu.array.delete columns":"حذف الأعمدة المحددة","menu.mode":"وضع","menu.mode-math":"رياضيات","menu.mode-text":"نص","menu.mode-latex":"لاتكس","tooltip.blackboard":"سبورة","tooltip.bold":"عريض","tooltip.italic":"مائل","tooltip.fraktur":"فراكتور","tooltip.script":"سكريبت","tooltip.caligraphic":"كاليجرافيك","tooltip.typewriter":"آلة كاتبة","tooltip.roman-upright":"روماني مستقيم","tooltip.row-by-col":"%@ × %@","menu.font-style":"نمط الخط","menu.accent":"تشكيل","menu.decoration":"زخرفة","menu.color":"لون","menu.background-color":"الخلفية","menu.evaluate":"تقييم","menu.simplify":"تبسيط","menu.solve":"حل","menu.solve-for":"حل لـ %@","menu.cut":"قص","menu.copy":"نسخ","menu.copy-as-latex":"نسخ كـ LaTeX","menu.copy-as-ascii-math":"نسخ كـ ASCII Math","menu.copy-as-mathml":"نسخ كـ MathML","menu.paste":"لصق","menu.select-all":"تحديد الكل","color.red":"أحمر","color.orange":"برتقالي","color.yellow":"أصفر","color.lime":"ليموني","color.green":"أخضر","color.teal":"سماوي","color.cyan":"سماوي فاتح","color.blue":"أزرق","color.indigo":"نيلي","color.purple":"بنفسجي","color.magenta":"أرجواني","color.black":"أسود","color.dark-grey":"رمادي غامق","color.grey":"رمادي","color.light-grey":"رمادي فاتح","color.white":"أبيض"},de:{"keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.alphabetic":"Römische 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ügen","menu.borders":"Matrixtrennzeichen","menu.array.add row above":"Zeile hinzufügen nach","menu.array.add row below":"Zeile hinzufügen vor","menu.array.add column after":"Spalte hinzufügen nach","menu.array.add column before":"Spalte hinzufügen vor","menu.array.delete row":"Zeile löschen","menu.array.delete rows":"Ausgewählte Zeilen löschen","menu.array.delete column":"Spalte löschen","menu.array.delete columns":"Ausgewählte Spalten löschen","menu.mode":"Modus","menu.mode-math":"Mathematik","menu.mode-text":"Text","menu.mode-latex":"LaTeX","tooltip.blackboard":"Tafel","tooltip.bold":"Fett","tooltip.italic":"Kursiv","tooltip.fraktur":"Fraktur","tooltip.script":"Skript","tooltip.caligraphic":"Kalligraphie","tooltip.typewriter":"Schreibmaschine","tooltip.roman-upright":"Römisch aufrecht","tooltip.row-by-col":"%@ × %@","menu.font-style":"Schriftstil","menu.accent":"Akzent","menu.decoration":"Dekoration","menu.color":"Farbe","menu.background-color":"Hintergrund","menu.evaluate":"Auswerten","menu.simplify":"Vereinfachen","menu.solve":"Lösen","menu.solve-for":"Lösen für %@","menu.cut":"Ausschneiden","menu.copy":"Kopieren","menu.copy-as-latex":"Als LaTeX kopieren","menu.copy-as-ascii-math":"Als ASCII Math kopieren","menu.copy-as-mathml":"Als MathML kopieren","menu.paste":"Einfügen","menu.select-all":"Alles auswählen","color.red":"Rot","color.orange":"Orange","color.yellow":"Gelb","color.lime":"Limette","color.green":"Grün","color.teal":"Blaugrün","color.cyan":"Cyan","color.blue":"Blau","color.indigo":"Indigo","color.purple":"Lila","color.magenta":"Magenta","color.black":"Schwarz","color.dark-grey":"Dunkelgrau","color.grey":"Grau","color.light-grey":"Hellgrau","color.white":"Weiß"},el:{"keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.alphabetic":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω","menu.insert matrix":"Εισαγωγή μήτρα","menu.borders":"Οριοθέτες μήτρα","menu.array.add row above":"Προσθήκη σειράς μετά","menu.array.add row below":"Προσθήκη σειράς πριν","menu.array.add column after":"Προσθήκη στήλης μετά","menu.array.add column before":"Προσθήκη στήλης πριν","menu.array.delete row":"Διαγραφή σειράς","menu.array.delete rows":"Διαγραφή επιλεγμένων σειρών","menu.array.delete column":"Διαγραφή στήλης","menu.array.delete columns":"Διαγραφή επιλεγμένων στηλών","menu.mode":"Λειτουργία","menu.mode-math":"Μαθηματικά","menu.mode-text":"Κείμενο","menu.mode-latex":"LaTeX","tooltip.blackboard":"Πίνακας","tooltip.bold":"Έντονη","tooltip.italic":"Πλάγια","tooltip.fraktur":"Φράκτουρ","tooltip.script":"Σενάριο","tooltip.caligraphic":"Καλλιγραφική","tooltip.typewriter":"Μηχανή γραφής","tooltip.roman-upright":"Ρωμαϊκό Κατακόρυφο","tooltip.row-by-col":"%@ × %@","menu.font-style":"Στυλ γραμματοσειράς","menu.accent":"Τόνος","menu.decoration":"Διακόσμηση","menu.color":"Χρώμα","menu.background-color":"Χρώμα φόντου","menu.evaluate":"Αξιολόγηση","menu.simplify":"Απλοποίηση","menu.solve":"Λύση","menu.solve-for":"Λύση για %@","menu.cut":"Αποκοπή","menu.copy":"Αντιγραφή","menu.copy-as-latex":"Αντιγραφή ως LaTeX","menu.copy-as-ascii-math":"Αντιγραφή ως ASCII Math","menu.copy-as-mathml":"Αντιγραφή ως MathML","menu.paste":"Επικόλληση","menu.select-all":"Επιλογή όλων","color.red":"Κόκκινο","color.orange":"Πορτοκαλί","color.yellow":"Κίτρινο","color.lime":"Λαχανί","color.green":"Πράσινο","color.teal":"Κυανό","color.cyan":"Γαλάζιο","color.blue":"Μπλε","color.indigo":"Ινδικό","color.purple":"Μωβ","color.magenta":"Ματζέντα","color.black":"Μαύρο","color.dark-grey":"Σκούρο Γκρι","color.grey":"Γκρι","color.light-grey":"Ανοιχτό Γκρι","color.white":"Λευκό"},es:{"keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.numeric":"Numérico","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ñadir Matriz","menu.borders":"Delimitadores de Matriz","menu.array.add row above":"Añadir Línea Antes","menu.array.add row below":"Añadir Línea Despues","menu.array.add column after":"Añadir Columna Despues","menu.array.add column before":"Añadir Columna Antes","menu.array.delete row":"Borrar Línea","menu.array.delete rows":"Borrar Líneas Seleccionadas","menu.array.delete column":"Borrar Columna","menu.array.delete columns":"Borrar Columnas Seleccionadas","menu.mode":"Modo","menu.mode-math":"Matemáticas","menu.mode-text":"Texto","menu.mode-latex":"LaTeX","tooltip.blackboard":"Pizarra","tooltip.bold":"Negrita","tooltip.italic":"Cursiva","tooltip.fraktur":"Fraktur","tooltip.script":"Script","tooltip.caligraphic":"Caligráfico","tooltip.typewriter":"Máquina de escribir","tooltip.roman-upright":"Romano Vertical","tooltip.row-by-col":"%@ × %@","menu.font-style":"Estilo de fuente","menu.accent":"Acento","menu.decoration":"Decoración","menu.color":"Color","menu.background-color":"Fondo","menu.evaluate":"Evaluar","menu.simplify":"Simplificar","menu.solve":"Resolver","menu.solve-for":"Resolver para %@","menu.cut":"Cortar","menu.copy":"Copiar","menu.copy-as-latex":"Copiar como LaTeX","menu.copy-as-ascii-math":"Copiar como ASCII Math","menu.copy-as-mathml":"Copiar como MathML","menu.paste":"Pegar","menu.select-all":"Seleccionar todo","color.red":"Rojo","color.orange":"Naranja","color.yellow":"Amarillo","color.lime":"Lima","color.green":"Verde","color.teal":"Verde azulado","color.cyan":"Cian","color.blue":"Azul","color.indigo":"Índigo","color.purple":"Morado","color.magenta":"Magenta","color.black":"Negro","color.dark-grey":"Gris oscuro","color.grey":"Gris","color.light-grey":"Gris claro","color.white":"Blanco"},fr:{"keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.alphabetic":"Lettres romaines","tooltip.menu":"Menu","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler","menu.insert matrix":"Insérer une Matrice","menu.borders":"Bords","menu.array.add row above":"Ajouter une Ligne Avant","menu.array.add row below":"Ajouter une Ligne Après","menu.array.add column before":"Ajouter une Colonne Avant","menu.array.add column after":"Ajouter une Colonne Après","menu.array.delete row":"Enlever une Ligne","menu.array.delete rows":"Enlever les Lignes Sélectionées","menu.array.delete column":"Enlever une Colone","menu.array.delete columns":"Enlever les Colonnes Sélectionées","menu.mode":"Mode","menu.mode-math":"Math","menu.mode-text":"Text","menu.mode-latex":"LaTeX","tooltip.blackboard":"Tableau noir","tooltip.bold":"Gras","tooltip.italic":"Italique","tooltip.fraktur":"Fraktur","tooltip.script":"Script","tooltip.caligraphic":"Calligraphique","tooltip.typewriter":"Machine à écrire","tooltip.roman-upright":"Romain droit","tooltip.row-by-col":"%@ × %@","menu.font-style":"Style de police","menu.accent":"Accent","menu.decoration":"Décoration","menu.color":"Couleur","menu.background-color":"Arrière-plan","menu.evaluate":"Évaluer","menu.simplify":"Simplifier","menu.solve":"Résoudre","menu.solve-for":"Résoudre pour %@","menu.cut":"Couper","menu.copy":"Copier","menu.copy-as-latex":"Copier en LaTeX","menu.copy-as-ascii-math":"Copier en ASCII Math","menu.copy-as-mathml":"Copier en MathML","menu.paste":"Coller","menu.select-all":"Sélectionner tout","color.red":"Rouge","color.orange":"Orange","color.yellow":"Jaune","color.lime":"Citron vert","color.green":"Vert","color.teal":"Turquoise","color.cyan":"Cyan","color.blue":"Bleu","color.indigo":"Indigo","color.purple":"Violet","color.magenta":"Magenta","color.black":"Noir","color.dark-grey":"Gris foncé","color.grey":"Gris","color.light-grey":"Gris clair","color.white":"Blanc"},he:{"keyboard.tooltip.symbols":"סמלים","keyboard.tooltip.greek":"אותיות יווניות","keyboard.tooltip.numeric":"מספרי","keyboard.tooltip.alphabetic":"מכתבים רומיים","tooltip.copy to clipboard":"העתק ללוח","tooltip.redo":"לַעֲשׂוֹת שׁוּב","tooltip.toggle virtual keyboard":"החלף את המקלדת הווירטואלית","tooltip.undo":"לבטל","menu.insert matrix":"הכנס מטריקס","menu.borders":"מפרידי מטריקס","menu.array.add row above":"הוסף שורה אחרי","menu.array.add row below":"הוסף שורה לפני","menu.array.add column after":"הוסף עמודה אחרי","menu.array.add column before":"הוסף עמודה לפני","menu.array.delete row":"מחק שורה","menu.array.delete rows":"מחק שורות שנבחרו","menu.array.delete column":"מחק עמודה","menu.array.delete columns":"מחק עמודות שנבחרו","menu.mode":"מצב","menu.mode-math":"מתמטיקה","menu.mode-text":"טקסט","menu.mode-latex":"LaTeX","tooltip.blackboard":"לוח שחור","tooltip.bold":"מודגש","tooltip.italic":"נטוי","tooltip.fraktur":"פרקטור","tooltip.script":"כתב","tooltip.caligraphic":"קליגרפי","tooltip.typewriter":"מכונת כתיבה","tooltip.roman-upright":"רומי ישר","tooltip.row-by-col":"%@ × %@","menu.font-style":"סגנון גופן","menu.accent":"צליל","menu.decoration":"קישוט","menu.color":"צבע","menu.background-color":"רקע","menu.evaluate":"חשב","menu.simplify":"פשט","menu.solve":"פתור","menu.solve-for":"פתור עבור %@","menu.cut":"גזור","menu.copy":"העתק","menu.copy-as-latex":"העתק כ־LaTeX","menu.copy-as-ascii-math":"העתק כ־ASCII Math","menu.copy-as-mathml":"העתק כ־MathML","menu.paste":"הדבק","menu.select-all":"בחר הכל","color.red":"אדום","color.orange":"כתום","color.yellow":"צהוב","color.lime":"ירוק ליים","color.green":"ירוק","color.teal":"טיל","color.cyan":"ציאן","color.blue":"כחול","color.indigo":"אינדיגו","color.purple":"סגול","color.magenta":"מגנטה","color.black":"שחור","color.dark-grey":"אפור כהה","color.grey":"אפור","color.light-grey":"אפור בהיר","color.white":"לבן"},it:{"keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","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.borders":"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","menu.mode":"Modalità","menu.mode-math":"Matematica","menu.mode-text":"Testo","menu.mode-latex":"LaTeX","tooltip.blackboard":"Lavagna","tooltip.bold":"Grassetto","tooltip.italic":"Corsivo","tooltip.fraktur":"Fraktur","tooltip.script":"Script","tooltip.caligraphic":"Caligrafico","tooltip.typewriter":"Macchina da scrivere","tooltip.roman-upright":"Romano dritto","tooltip.row-by-col":"%@ × %@","menu.font-style":"Stile del carattere","menu.accent":"Accento","menu.decoration":"Decorazione","menu.color":"Colore","menu.background-color":"Sfondo","menu.evaluate":"Valuta","menu.simplify":"Semplifica","menu.solve":"Risolvi","menu.solve-for":"Risolvi per %@","menu.cut":"Taglia","menu.copy":"Copia","menu.copy-as-latex":"Copia come LaTeX","menu.copy-as-ascii-math":"Copia come ASCII Math","menu.copy-as-mathml":"Copia come MathML","menu.paste":"Incolla","menu.select-all":"Seleziona tutto","color.red":"Rosso","color.orange":"Arancione","color.yellow":"Giallo","color.lime":"Lime","color.green":"Verde","color.teal":"Verde acqua","color.cyan":"Ciano","color.blue":"Blu","color.indigo":"Indaco","color.purple":"Viola","color.magenta":"Magenta","color.black":"Nero","color.dark-grey":"Grigio scuro","color.grey":"Grigio","color.light-grey":"Grigio chiaro","color.white":"Bianco"},ja:{"keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.numeric":"数値","keyboard.tooltip.alphabetic":"ローマ字","tooltip.menu":"メニュー","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す","menu.insert matrix":"マトリックスを挿入","menu.borders":"行列区切り文字","menu.array.add row above":"後に行を追加","menu.array.add row below":"前に行を追加","menu.array.add column after":"後に列を追加","menu.array.add column before":"前に列を追加","menu.array.delete row":"行を削除","menu.array.delete rows":"選択した行を削除する","menu.array.delete column":"列を削除","menu.array.delete columns":"選択した列を削除する","menu.mode":"モード","menu.mode-math":"数式","menu.mode-text":"テキスト","menu.mode-latex":"LaTeX","tooltip.blackboard":"黒板","tooltip.bold":"太字","tooltip.italic":"イタリック","tooltip.fraktur":"フラクトゥール","tooltip.script":"スクリプト","tooltip.caligraphic":"カリグラフィック","tooltip.typewriter":"タイプライター","tooltip.roman-upright":"ローマ直立","tooltip.row-by-col":"%@ × %@","menu.font-style":"フォントスタイル","menu.accent":"アクセント","menu.decoration":"装飾","menu.color":"色","menu.background-color":"背景","menu.evaluate":"評価","menu.simplify":"簡略化","menu.solve":"解く","menu.solve-for":"%@ を解く","menu.cut":"切り取り","menu.copy":"コピー","menu.copy-as-latex":"LaTeXとしてコピー","menu.copy-as-ascii-math":"ASCII Mathとしてコピー","menu.copy-as-mathml":"MathMLとしてコピー","menu.paste":"貼り付け","menu.select-all":"すべて選択","color.red":"赤","color.orange":"オレンジ","color.yellow":"黄色","color.lime":"ライム","color.green":"緑","color.teal":"ティール","color.cyan":"シアン","color.blue":"青","color.indigo":"インディゴ","color.purple":"紫","color.magenta":"マゼンタ","color.black":"黒","color.dark-grey":"濃いグレー","color.grey":"グレー","color.light-grey":"薄いグレー","color.white":"白"},ko:{"keyboard.tooltip.symbols":"기호","keyboard.tooltip.greek":"그리스 문자","keyboard.tooltip.numeric":"숫자","keyboard.tooltip.alphabetic":"로마 문자","tooltip.copy to clipboard":"클립 보드에 복사","tooltip.redo":"다시 하다","tooltip.toggle virtual keyboard":"가상 키보드 전환","tooltip.undo":"실행 취소","menu.insert matrix":"매트릭스 삽입","menu.borders":"행렬 구분 기호","menu.array.add row above":"뒤에 행 추가","menu.array.add row below":"앞에 행 추가","menu.array.add column after":"뒤에 열 추가","menu.array.add column before":"앞에 열 추가","menu.array.delete row":"행 삭제","menu.array.delete rows":"선택한 행 삭제","menu.array.delete column":"열 삭제","menu.array.delete columns":"선택한 열 삭제","menu.mode":"モード","menu.mode-math":"数式","menu.mode-text":"テキスト","menu.mode-latex":"LaTeX","tooltip.blackboard":"칠판","tooltip.bold":"굵게","tooltip.italic":"이탤릭","tooltip.fraktur":"프랙투어","tooltip.script":"스크립트","tooltip.caligraphic":"캘리그래픽","tooltip.typewriter":"타자기","tooltip.roman-upright":"로마 직립","tooltip.row-by-col":"%@ × %@","menu.font-style":"글꼴 스타일","menu.accent":"악센트","menu.decoration":"장식","menu.color":"색상","menu.background-color":"배경","menu.evaluate":"평가","menu.simplify":"간소화","menu.solve":"해결","menu.solve-for":"%@에 대해 해결","menu.cut":"잘라내기","menu.copy":"복사","menu.copy-as-latex":"LaTeX로 복사","menu.copy-as-ascii-math":"ASCII Math로 복사","menu.copy-as-mathml":"MathML로 복사","menu.paste":"붙여넣기","menu.select-all":"모두 선택","color.red":"빨강","color.orange":"주황","color.yellow":"노랑","color.lime":"라임","color.green":"초록","color.teal":"청록","color.cyan":"청색","color.blue":"파랑","color.indigo":"남색","color.purple":"보라","color.magenta":"자홍","color.black":"검정","color.dark-grey":"진한 회색","color.grey":"회색","color.light-grey":"연한 회색","color.white":"흰색"},pl:{"keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.alphabetic":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij","menu.insert matrix":"Wstaw macierz","menu.borders":"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ę po","menu.array.add column before":"Dodaj kolumnę przed","menu.array.delete row":"Usuń wiersz","menu.array.delete rows":"Usuń wybrane wiersze","menu.array.delete column":"Usuń kolumnę","menu.array.delete columns":"Usuń wybrane kolumny","menu.mode":"Tryb","menu.mode-math":"Formuła","menu.mode-text":"Tekst","menu.mode-latex":"LaTeX","tooltip.blackboard":"Tablica","tooltip.bold":"Pogrubienie","tooltip.italic":"Kursywa","tooltip.fraktur":"Fraktura","tooltip.script":"Skrypt","tooltip.caligraphic":"Kaligraficzny","tooltip.typewriter":"Maszynowy","tooltip.roman-upright":"Rzymski prosto","tooltip.row-by-col":"%@ × %@","menu.font-style":"Styl czcionki","menu.accent":"Akcent","menu.decoration":"Dekoracja","menu.color":"Kolor","menu.background-color":"Tło","menu.evaluate":"Oblicz","menu.simplify":"Uprość","menu.solve":"Rozwiąż","menu.solve-for":"Rozwiąż dla %@","menu.cut":"Wytnij","menu.copy":"Kopiuj","menu.copy-as-latex":"Kopiuj jako LaTeX","menu.copy-as-ascii-math":"Kopiuj jako ASCII Math","menu.copy-as-mathml":"Kopiuj jako MathML","menu.paste":"Wklej","menu.select-all":"Zaznacz wszystko","color.red":"Czerwony","color.orange":"Pomarańczowy","color.yellow":"Żółty","color.lime":"Limetkowy","color.green":"Zielony","color.teal":"Turkusowy","color.cyan":"Cyjan","color.blue":"Niebieski","color.indigo":"Indygo","color.purple":"Fioletowy","color.magenta":"Magenta","color.black":"Czarny","color.dark-grey":"Ciemnoszary","color.grey":"Szary","color.light-grey":"Jasnoszary","color.white":"Biały"},pt:{"keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras gregas","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.alphabetic":"Letras romanas","tooltip.copy to clipboard":"Copiar para área de transferência","tooltip.redo":"Refazer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Desfazer","menu.insert matrix":"Inserir Matriz","menu.borders":"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","menu.mode":"Modo","menu.mode-math":"Fórmula","menu.mode-text":"Texto","menu.mode-latex":"LaTeX","tooltip.blackboard":"Quadro Negro","tooltip.bold":"Negrito","tooltip.italic":"Itálico","tooltip.fraktur":"Fraktur","tooltip.script":"Script","tooltip.caligraphic":"Caligráfico","tooltip.typewriter":"Máquina de Escrever","tooltip.roman-upright":"Romano Vertical","tooltip.row-by-col":"%@ × %@","menu.font-style":"Estilo da Fonte","menu.accent":"Acento","menu.decoration":"Decoração","menu.color":"Cor","menu.background-color":"Cor de Fundo","menu.evaluate":"Avaliar","menu.simplify":"Simplificar","menu.solve":"Resolver","menu.solve-for":"Resolver para %@","menu.cut":"Recortar","menu.copy":"Copiar","menu.copy-as-latex":"Copiar como LaTeX","menu.copy-as-ascii-math":"Copiar como ASCII Math","menu.copy-as-mathml":"Copiar como MathML","menu.paste":"Colar","menu.select-all":"Selecionar Tudo","color.red":"Vermelho","color.orange":"Laranja","color.yellow":"Amarelo","color.lime":"Verde Lima","color.green":"Verde","color.teal":"Verde-azulado","color.cyan":"Ciano","color.blue":"Azul","color.indigo":"Índigo","color.purple":"Roxo","color.magenta":"Magenta","color.black":"Preto","color.dark-grey":"Cinza Escuro","color.grey":"Cinza","color.light-grey":"Cinza Claro","color.white":"Branco"},uk:{"keyboard.tooltip.symbols":"Символи","keyboard.tooltip.greek":"Грецькі літери","keyboard.tooltip.numeric":"Числовий","keyboard.tooltip.alphabetic":"Римські літери","tooltip.copy to clipboard":"Копіювати в буфер обміну","tooltip.redo":"Повторити","tooltip.toggle virtual keyboard":"Переключити віртуальну клавіатуру","tooltip.undo":"Скасувати","menu.insert matrix":"Вставити матрицю","menu.borders":"Матричні роздільники","menu.array.add row above":"Додати рядок після","menu.array.add row below":"Додати рядок до","menu.array.add column after":"Додати стовпець після","menu.array.add column before":"Додати стовпець перед","menu.array.delete row":"Видалити рядок","menu.array.delete rows":"Видалити вибрані рядки","menu.array.delete column":"Видалити стовпець","menu.array.delete columns":"Видалити вибрані стовпці","menu.mode":"Режим","menu.mode-math":"Математика","menu.mode-text":"Текст","menu.mode-latex":"LaTeX","tooltip.blackboard":"Чорна дошка","tooltip.bold":"Жирний","tooltip.italic":"Курсив","tooltip.fraktur":"Фрактурний","tooltip.script":"Скрипт","tooltip.caligraphic":"Каліграфічний","tooltip.typewriter":"Машинка для письма","tooltip.roman-upright":"Римський прямий","tooltip.row-by-col":"%@ × %@","menu.font-style":"Стиль шрифту","menu.accent":"Акцент","menu.decoration":"Декорація","menu.color":"Колір","menu.background-color":"Фон","menu.evaluate":"Обчислити","menu.simplify":"Спростити","menu.solve":"Вирішити","menu.solve-for":"Вирішити для %@","menu.cut":"Вирізати","menu.copy":"Копіювати","menu.copy-as-latex":"Копіювати як LaTeX","menu.copy-as-ascii-math":"Копіювати як ASCII Math","menu.copy-as-mathml":"Копіювати як MathML","menu.paste":"Вставити","menu.select-all":"Вибрати все","color.red":"Червоний","color.orange":"Помаранчевий","color.yellow":"Жовтий","color.lime":"Лайм","color.green":"Зелений","color.teal":"Бірюзовий","color.cyan":"Синьо-зелений","color.blue":"Синій","color.indigo":"Індиго","color.purple":"Фіолетовий","color.magenta":"Пурпурний","color.black":"Чорний","color.dark-grey":"Темно-сірий","color.grey":"Сірий","color.light-grey":"Світло-сірий","color.white":"Білий"},zh_cn:{"keyboard.tooltip.symbols":"符号","keyboard.tooltip.greek":"希腊字母","keyboard.tooltip.numeric":"数字","keyboard.tooltip.alphabetic":"罗马字母","tooltip.copy to clipboard":"复制到剪贴板","tooltip.redo":"重做","tooltip.toggle virtual keyboard":"切换虚拟键盘","tooltip.undo":"撤消","menu.insert matrix":"插入矩阵","menu.borders":"矩阵分隔符","menu.array.add row above":"在后面添加行","menu.array.add row below":"在前面添加行","menu.array.add column after":"在后面添加列r","menu.array.add column before":"在前面添加列","menu.array.delete row":"删除行","menu.array.delete rows":"删除选定行","menu.array.delete column":"删除列","menu.array.delete columns":"删除选定的列","menu.mode":"模式","menu.mode-math":"数学","menu.mode-text":"文本","menu.mode-latex":"LaTeX","tooltip.blackboard":"黑板","tooltip.bold":"粗体","tooltip.italic":"斜体","tooltip.fraktur":"Fraktur","tooltip.script":"脚本","tooltip.caligraphic":"草书","tooltip.typewriter":"打字机","tooltip.roman-upright":"罗马直立","tooltip.row-by-col":"%@ × %@","menu.font-style":"字体样式","menu.accent":"重音","menu.decoration":"装饰","menu.color":"颜色","menu.background-color":"背景","menu.evaluate":"计算","menu.simplify":"简化","menu.solve":"求解","menu.solve-for":"求解 %@","menu.cut":"剪切","menu.copy":"复制","menu.copy-as-latex":"复制为 LaTeX","menu.copy-as-ascii-math":"复制为 ASCII Math","menu.copy-as-mathml":"复制为 MathML","menu.paste":"粘贴","menu.select-all":"全选","color.red":"红色","color.orange":"橙色","color.yellow":"黄色","color.lime":"绿黄色","color.green":"绿色","color.teal":"青色","color.cyan":"蓝绿色","color.blue":"蓝色","color.indigo":"靛蓝色","color.purple":"紫色","color.magenta":"洋红色","color.black":"黑色","color.dark-grey":"深灰色","color.grey":"灰色","color.light-grey":"浅灰色","color.white":"白色"},zh_tw:{"keyboard.tooltip.symbols":"符號","keyboard.tooltip.greek":"希臘字母","keyboard.tooltip.numeric":"數字","keyboard.tooltip.alphabetic":"羅馬字母","tooltip.copy to clipboard":"複製到剪貼板","tooltip.redo":"重做","tooltip.toggle virtual keyboard":"切換虛擬鍵盤","tooltip.undo":"撤消","menu.insert matrix":"插入矩陣","menu.borders":"矩陣分隔符","menu.array.add row above":"在後面添加行","menu.array.add row below":"在前面添加行","menu.array.add column after":"在後面添加列","menu.array.add column before":"在前面添加列","menu.array.delete row":"刪除行","menu.array.delete rows":"刪除選定行","menu.array.delete column":"刪除列","menu.array.delete columns":"刪除選定的列","menu.mode":"模式","menu.mode-math":"數學","menu.mode-text":"文本","menu.mode-latex":"LaTeX","tooltip.blackboard":"黑板","tooltip.bold":"粗體","tooltip.italic":"斜體","tooltip.fraktur":"Fraktur","tooltip.script":"腳本","tooltip.caligraphic":"草書","tooltip.typewriter":"打字機","tooltip.roman-upright":"羅馬直立","tooltip.row-by-col":"%@ × %@","menu.font-style":"字體樣式","menu.accent":"重音","menu.decoration":"裝飾","menu.color":"顏色","menu.background-color":"背景","menu.evaluate":"計算","menu.simplify":"簡化","menu.solve":"求解","menu.solve-for":"求解 %@","menu.cut":"剪下","menu.copy":"複製","menu.copy-as-latex":"複製為 LaTeX","menu.copy-as-ascii-math":"複製為 ASCII Math","menu.copy-as-mathml":"複製為 MathML","menu.paste":"貼上","menu.select-all":"全選","color.red":"紅色","color.orange":"橙色","color.yellow":"黃色","color.lime":"綠黃色","color.green":"綠色","color.teal":"青色","color.cyan":"藍綠色","color.blue":"藍色","color.indigo":"靛藍色","color.purple":"紫色","color.magenta":"洋紅色","color.black":"黑色","color.dark-grey":"深灰色","color.grey":"灰色","color.light-grey":"淺灰色","color.white":"白色"}};function Pe(){return"window"in globalThis&&"document"in globalThis}function Eh(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function w0(){return typeof navigator.vibrate=="function"}function rr(){var e,t;if(!Pe())return"other";let i=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(i)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(i)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Kh(){if(!Pe())return!0;if(/firefox/i.test(navigator.userAgent)){let e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){let e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function Vl(){return HTMLElement.prototype.hasOwnProperty("popover")}var z={strings:Lh,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return z._locale||(z._locale=Pe()?navigator.language.slice(0,5):"en-US"),z._locale},set locale(e){z._locale=e,z._numberFormatter=void 0,z.dirty=!0},get numberFormatter(){return z._numberFormatter||(z._numberFormatter=new Intl.NumberFormat(z.locale)),z._numberFormatter},merge(e,t){if(typeof e=="string"&&t)z.strings[e]=f(f({},z.strings[e]),t),z.dirty=!0;else for(let i of Object.keys(e))z.merge(i,e[i])},get dirty(){return z._dirty},set dirty(e){z._dirty||z._dirty===e||(z._dirty=!0,setTimeout(()=>{z._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return z._subscribers.push(e),z._subscribers.length-1},unsubscribe(e){e<0||e>=z._subscribers.length||(z._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(let i of t){let r=i.getAttribute("data-l10n-tooltip");if(r){let a=F(r);a&&i.setAttribute("data-tooltip",a)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(let i of t){let r=i.getAttribute("data-l10n-arial-label");if(r){let a=F(r);a&&i.setAttribute("aria-label",a)}}}};function F(e,...t){if(e===void 0)return;let i="",r=z.locale;z.strings[r]&&(i=z.strings[r][e]);let a=r.slice(0,2);if(!i&&z.strings[a]&&(i=z.strings[a][e]),i||(i=z.strings.en[e]),!i)return;let o=/(%@|%([0-9]+)\$@)/g,n=o.exec(i),l=0;for(;n;){if(t[l++]){let s=n[2]?parseInt(n[2],10)-1:l-1,u=t[s];typeof u=="number"&&(u=z.numberFormatter.format(u)),i=i.replace(n[1],u)}n=o.exec(i)}return i=i.replace(/%%/g,"%"),i}var Fh={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},Th={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},mi={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"},fi={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"},_0={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"},zh={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 To(e){var t,i,r,a,o,n;let l=e.split("!"),s,u,c,d=255,h=255,p=255,m=-1,y=l.length>0&&l[0].startsWith("-");y&&(l[0]=l[0].slice(1));for(let M=0;M<l.length;M++){s=d,u=h,c=p;let g=(t=l[M].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],_=g==null?void 0:g.toLowerCase(),D=g&&(n=(o=(a=(r=(i=fi[_])!=null?i:fi[_0[g]])!=null?r:Th[g])!=null?a:zh[g])!=null?o:Fh[g])!=null?n:l[M].trim(),w=D.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(w!=null&&w[1]&&w[2]&&w[3])d=Math.max(0,Math.min(255,Number.parseInt(w[1],16))),h=Math.max(0,Math.min(255,Number.parseInt(w[2],16))),p=Math.max(0,Math.min(255,Number.parseInt(w[3],16)));else if(w=D.match(/^#([\da-f]{3})$/i),w!=null&&w[1]){let L=Number.parseInt(w[1][0],16),K=Number.parseInt(w[1][1],16),E=Number.parseInt(w[1][2],16);d=Math.max(0,Math.min(255,L*16+L)),h=Math.max(0,Math.min(255,K*16+K)),p=Math.max(0,Math.min(255,E*16+E))}else if(w=D.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),w!=null&&w[1]&&w[2]&&w[3])d=Math.max(0,Math.min(255,Number.parseInt(w[1]))),h=Math.max(0,Math.min(255,Number.parseInt(w[2]))),p=Math.max(0,Math.min(255,Number.parseInt(w[3])));else return;m>=0&&(d=(1-m)*d+m*s,h=(1-m)*h+m*u,p=(1-m)*p+m*c,m=-1),M+1<l.length&&(m=Math.max(0,Math.min(100,Number.parseInt(l[++M])))/100)}return m>=0&&(d=m*d+(1-m)*s,h=m*h+(1-m)*u,p=m*p+(1-m)*c),y&&(d=255-d,h=255-h,p=255-p),"#"+("00"+Math.round(d).toString(16)).slice(-2)+("00"+Math.round(h).toString(16)).slice(-2)+("00"+Math.round(p).toString(16)).slice(-2)}function kl(e){var t,i;return e=e.trim(),(i=(t=mi[e.toLowerCase()])!=null?t:mi[_0[e]])!=null?i:To(e)}function $h(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function Go(e,t,i){return i<0&&(i+=6),i>=6&&(i-=6),i<1?(t-e)*i+e:i<3?t:i<4?(t-e)*(4-i)+e:e}function Ph(e){let[t,i,r]=[e.h,e.s,e.l];t=(t+360)%360/60,r=Math.max(0,Math.min(r,1)),i=Math.max(0,Math.min(i,1));let a=r<=.5?r*(i+1):r+i-r*i,o=r*2-a;return{r:Math.round(255*Go(o,a,t+2)),g:Math.round(255*Go(o,a,t)),b:Math.round(255*Go(o,a,t-2))}}function Zo(e){return e<0?0:e>255?255:Math.round(e)}function Oh(e){let{r:t,g:i,b:r}=e,a=((1<<24)+(Zo(t)<<16)+(Zo(i)<<8)+Zo(r)).toString(16).slice(1);return a[0]===a[1]&&a[2]===a[3]&&a[4]===a[5]&&a[6]===a[7]&&(a=a[0]+a[2]+a[4]),"#"+a}function Ih(e){let{r:t,g:i,b:r}=e;t=t/255,i=i/255,r=r/255;let a=Math.min(t,i,r),o=Math.max(t,i,r),n=o-a,l,s;o===a?l=0:t===o?l=(i-r)/n:i===o?l=2+(r-t)/n:r===o&&(l=4+(t-i)/n),l=Math.min(l*60,360),l<0&&(l+=360);let u=(a+o)/2;return o===a?s=0:u<=.5?s=n/(o+a):s=n/(2-o-a),{h:l,s,l:u}}function Nh(e){let t=$h(e);if(!t)return e;let{h:i,s:r,l:a}=Ih(t);return r+=.1,a-=.1,Oh(Ph({h:i,s:r,l:a}))}var k0={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},Xn={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},M0=[{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 S0(e,t,i){if(!/[A-Za-z\d]/.test(e)||(i==="up"&&(i=void 0),!t&&!i))return e;let r=e.codePointAt(0);if(r===void 0)return e;for(let a of M0)if((!t||a.variant===t)&&(!i||a.style===i)&&r>=a.offset&&r<a.offset+a.len){let o=a.start+r-a.offset;return String.fromCodePoint(Xn[o]||o)}return e}function qh(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(let i in Xn)if(Xn[i]===e){e=(t=i.codePointAt(0))!=null?t:0;break}for(let i of M0)if(e>=i.start&&e<i.start+i.len)return{char:String.fromCodePoint(e-i.start+i.offset),variant:i.variant,style:i.style};return{char:String.fromCodePoint(e)}}function Rh(e){var t;let i="";for(let r of e){if("{}<>[]$&#^_%:'˜".includes(r)){i+=r;continue}let a=(t=r.codePointAt(0))!=null?t:0,o=k0[a];if(o)o.startsWith("\\")?i+=o+" ":i+=o;else{let{char:n,variant:l,style:s}=qh(a);switch(o=n,l){case"double-struck":o=`\\mathbb{${o}}`;break;case"fraktur":o=`\\mathfrak{${o}}`;break;case"script":o=`\\mathscr{${o}}`;break;case"sans-serif":o=`\\mathsf{${o}}`;break;case"monospace":o=`\\mathtt{${o}}`;break;case"calligraphic":o=`\\mathcal{${o}}`;break}switch(s){case"bold":o=`\\mathbf{${o}}`;break;case"italic":o=`\\mathit{${o}}`;break;case"bolditalic":o=`\\mathbfit{${o}}`;break}i+=o}}return i}function B(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var Ir={},po=f({},k0),Wi={},Ml={},Vh={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},Hh={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},jh={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},Wh={iff:{primitive:!0,captureSelection:!0,def:"\\;⟺\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`∌}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:jh},"amsmath.sty":{package:Hh,primitive:!0},"texvc.sty":{package:Vh,primitive:!1}},Oi={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"–":8211,"—":8212,"‘":8216,"’":8217,"“":8220,"”":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},Uh=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,Gn,Nr;Kh()?(Gn=new RegExp("\\p{Letter}","u"),Nr=new RegExp("[0-9\\p{Letter}]","u")):(Gn=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,Nr=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function Zn(e,t,i="mord",r){t!==void 0&&(Ir[e]={definitionType:"symbol",type:i,variant:r,codepoint:t},po[t]||(po[t]=e))}function ue(e,t,i){if(typeof e=="string"){for(let r=0;r<e.length;r++){let a=e.charAt(r);Zn(a,a.codePointAt(0))}return}for(let[r,a,o,n]of e)Zn(r,a,o??t,n??i)}function C0(e,t){for(let i=e;i<=t;i++)Zn(String.fromCodePoint(i),i)}function Jh(e){var t;return(t=Ml[e])!=null?t:null}function Xh(e,t){var i,r;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];let a=[];for(let n in Wi)n.startsWith(t)&&!Wi[n].infix&&a.push({match:n,frequency:(i=Wi[n].frequency)!=null?i:0});for(let n in Ir)n.startsWith(t)&&a.push({match:n,frequency:(r=Ir[n].frequency)!=null?r:0});let o=t.substring(1);for(let n of Object.keys(e.options.macros))n.startsWith(o)&&a.push({match:"\\"+n,frequency:0});return a.sort((n,l)=>{var s,u;return n.frequency===l.frequency?n.match.length===l.match.length?n.match<l.match?-1:1:n.match.length-l.match.length:((s=l.frequency)!=null?s:0)-((u=n.frequency)!=null?u:0)}),a.map(n=>n.match)}function Hl(e){let t="auto",i=e.match(/:([^=]+)/);return i&&(t=i[1].trim()),t}function mo(e){if(!e)return[];let t=[],i=e.split("]");if(i[0].startsWith("[")){t.push({isOptional:!0,type:Hl(i[0].slice(1))});for(let r=1;r<=i.length;r++)t.push(...mo(i[r]))}else if(i=e.split("}"),i[0].startsWith("{")){t.push({isOptional:!1,type:Hl(i[0].slice(1))});for(let r=1;r<=i.length;r++)t.push(...mo(i[r]))}return t}function D0(e){if(!e)return"";let t="",i=!0;for(let r of e)typeof r.value=="string"?t+=r.value:i=!1;return i?t:""}function B0(e,t){typeof e=="string"&&(e=[e]);let i={tabular:!1,params:[],createAtom:t};for(let r of e)Ml[r]=i}function xt(e,t,i){typeof e=="string"&&(e=[e]);let r={tabular:!0,params:mo(t),createAtom:i};for(let a of e)Ml[a]=r}function x(e,t,i){var r,a;i||(i={});let o={definitionType:"function",params:mo(t),ifMode:i.ifMode,isFunction:(r=i.isFunction)!=null?r:!1,applyMode:i.applyMode,infix:(a=i.infix)!=null?a:!1,parse:i.parse,createAtom:i.createAtom,applyStyle:i.applyStyle,serialize:i.serialize,render:i.render};if(typeof e=="string")Wi["\\"+e]=o;else for(let n of e)Wi["\\"+n]=o}var Qr;function Sl(e){return Qr||(Qr=Yn(Wh)),e?Yn(f(f({},Qr),e)):Qr}function jl(e,t){var i,r,a,o;if(typeof e=="string"){let n=0,l=e;return/(^|[^\\])#1/.test(l)&&(n=1),/(^|[^\\])#2/.test(l)&&(n=2),/(^|[^\\])#3/.test(l)&&(n=3),/(^|[^\\])#4/.test(l)&&(n=4),/(^|[^\\])#5/.test(l)&&(n=5),/(^|[^\\])#6/.test(l)&&(n=6),/(^|[^\\])#7/.test(l)&&(n=7),/(^|[^\\])#8/.test(l)&&(n=8),/(^|[^\\])#9/.test(l)&&(n=9),{expand:(i=t==null?void 0:t.expand)!=null?i:!0,captureSelection:(r=t==null?void 0:t.captureSelection)!=null?r:!0,args:n,def:l}}return f({expand:(a=t==null?void 0:t.expand)!=null?a:!0,captureSelection:(o=t==null?void 0:t.captureSelection)!=null?o:!0,args:0},e)}function Yn(e){if(!e)return{};let t={};for(let i of Object.keys(e)){let r=e[i];if(r==null)delete t[i];else if(typeof r=="object"&&"package"in r)for(let a of Object.keys(r.package))t[a]=jl(r.package[a],{expand:!r.primitive,captureSelection:r.captureSelection});else t[i]=jl(r)}return t}function he(e,t="math"){if(!e||e.length===0)return null;let i=null;if(e.startsWith("\\")){if(i=Wi[e],i)return!i.ifMode||i.ifMode===t?i:null;t==="math"?i=Ir[e]:Oi[e]&&(i={definitionType:"symbol",type:"mord",codepoint:Oi[e]})}else if(t==="math"){if(i=Ir[e],!i&&e.length===1){let r=L0("math",e.codePointAt(0));return r.startsWith("\\")?b(f({},he(r,"math")),{command:r}):null}}else Oi[e]?i={definitionType:"symbol",type:"mord",codepoint:Oi[e]}:t==="text"&&(i={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return i??null}function A0(e,t){if(!e.startsWith("\\"))return null;let i=e.slice(1);return t[i]}function L0(e,t){return t===void 0?"":e==="math"&&po[t]?po[t]:e==="text"&&Object.keys(Oi).find(r=>Oi[r]===t)||String.fromCodePoint(t)}var Ee=[0,.68889,0,0,.72222],Ht=[0,.68889,0,0,.66667],Yo=[0,.68889,0,0,.77778],ea=[0,.68889,0,0,.61111],Wl=[.16667,.68889,0,0,.77778],or=[0,.68889,0,0,.55556],q=[0,0,0,0,.25],Ul=[0,.825,0,0,2.33334],Jl=[0,.9,0,0,2.33334],ta=[0,.68889,0,0,.54028],Qo=[-.03598,.46402,0,0,.5],me=[-.13313,.36687,0,0,1],ia=[.01354,.52239,0,0,1],Xl=[.01354,.52239,0,0,1.11111],Gl=[0,.54986,0,0,1],ra=[0,.69224,0,0,.5],en=[0,.43056,0,0,1],_t=[.08198,.58198,0,0,.77778],aa=[.19444,.69224,0,0,.41667],oa=[.1808,.675,0,0,1],Zl=[.19444,.69224,0,0,.83334],Yl=[.13667,.63667,0,0,1],Ql=[-.064,.437,0,0,1.334],kt=[.08167,.58167,0,0,.77778],nr=[0,.69224,0,0,.72222],tn=[0,.69224,0,0,.66667],na=[-.13313,.36687,0,0,.77778],es=[.06062,.54986,0,0,.77778],la=[0,.69224,0,0,.77778],wi=[.25583,.75583,0,0,.77778],Ge=[.25142,.75726,0,0,.77778],_i=[.20576,.70576,0,0,.77778],Ne=[.30274,.79383,0,0,.77778],lr=[.22958,.72958,0,0,.77778],ts=[.1808,.675,0,0,.77778],Ze=[.13667,.63667,0,0,.77778],ke=[.13597,.63597,0,0,.77778],Mt=[.03517,.54986,0,0,.77778],ki=[0,.675,0,0,.77778],is=[.19444,.69224,0,0,.61111],rs=[0,.54986,0,0,.76042],as=[0,.54986,0,0,.66667],St=[.0391,.5391,0,0,.77778],os=[.03517,.54986,0,0,1.33334],ns=[.38569,.88569,0,0,.77778],sa=[.23222,.74111,0,0,.77778],ls=[.19444,.69224,0,0,.77778],ss=[0,.37788,0,0,.5],ua=[0,.54986,0,0,.72222],us=[0,.69224,0,0,.83334],cs=[.11111,.69224,0,0,.66667],Mi=[.26167,.75726,0,0,.77778],ds=[.48256,.98256,0,0,.77778],hs=[.28481,.79383,0,0,.77778],ps=[.08167,.58167,0,0,.22222],ms=[.08167,.58167,0,0,.38889],fs=[0,.43056,.04028,0,.66667],gs=[.41951,.91951,0,0,.77778],ys=[.24982,.74947,0,0,.38865],bs=[.08319,.58283,0,0,.75623],vs=[0,.10803,0,0,.27764],rn=[0,.47534,0,0,.50181],sr=[.18906,.47534,0,0,.50181],xs=[0,.69141,0,0,.50181],ws=[.24982,.74947,0,0,.27764],an=[0,.69141,0,0,.21471],ca=[.25,.75,0,0,.44722],Ke=[0,.64444,0,0,.575],Si=[.08556,.58556,0,0,.89444],da=[0,.69444,0,0,.89444],ha=[0,.68611,0,0,.9],on=[0,.68611,0,0,.86944],Ct=[.25,.75,0,0,.575],pa=[.25,.75,0,0,.31944],jt=[0,.69444,0,0,.63889],Ci=[0,.69444,0,0,.31944],_s=[0,.44444,0,0,.63889],ks=[0,.44444,0,0,.51111],Dt=[0,.69444,0,0,.575],qe=[.13333,.63333,0,0,.89444],Ms=[0,.44444,0,0,.31944],Ss=[0,.69444,0,0,.86944],Cs=[0,.68611,0,0,.69166],ma=[0,.68611,0,0,.83055],nn=[0,.68611,0,0,.89444],ln=[0,.69444,0,0,.60278],Ds=[.19444,.69444,0,0,.51111],Bs=[0,.69444,0,0,.83055],Ye=[-.10889,.39111,0,0,1.14999],As=[.19444,.69444,0,0,.575],ur=[.19444,.69444,0,0,1.14999],Ls=[.19444,.69444,0,0,.70277],Es=[.05556,.75,0,0,.575],sn=[0,.68611,0,0,.95833],Ks=[.08556,.58556,0,0,.76666],un=[-.02639,.47361,0,0,.575],Fs=[0,.44444,0,0,.89444],Wt=[0,.55556,0,0,.76666],Ts=[-.10889,.39111,0,0,.89444],cn=[.00222,.50222,0,0,.89444],Bt=[.19667,.69667,0,0,.89444],zs=[.08556,.58556,0,0,1.14999],dn=[0,.69444,0,0,.70277],fa=[-.02778,.47222,0,0,.575],ga=[.25,.75,0,0,.51111],$s=[-.13889,.36111,0,0,1.14999],Ps=[.19444,.69444,0,0,1.02222],ya=[.12963,.69444,0,0,.89444],Os=[.19444,.69444,0,0,.44722],At=[0,.64444,.13167,0,.59111],Is=[.19444,.64444,.13167,0,.59111],hn=[0,.68611,.17208,0,.8961],Ns=[.19444,.44444,.105,0,.53222],qs=[0,.44444,.085,0,.82666],Rs=[0,.69444,.06709,0,.59111],ba=[0,.69444,.12945,0,.35555],Vs=[0,.69444,0,0,.94888],pn=[0,.69444,.11472,0,.59111],Hs=[0,.68611,.10778,0,.88555],js=[0,.69444,.07939,0,.62055],va=[0,.69444,.12417,0,.30667],Lt=[0,.64444,.13556,0,.51111],Ws=[.19444,.64444,.13556,0,.51111],xa=[0,.68333,.16389,0,.74333],Us=[.19444,.43056,.08847,0,.46],Js=[0,.43056,.07514,0,.71555],Xs=[0,.69444,.06646,0,.51111],Gs=[0,.69444,0,0,.83129],Zs=[0,.69444,.1225,0,.51111],Ys=[0,.68333,.09403,0,.76666],Qs=[0,.68333,.11111,0,.76666],eu=[0,.69444,.06961,0,.51444],ut=[0,.69444,0,0,.27778],Di=[.25,.75,0,0,.38889],Fe=[0,.64444,0,0,.5],Ut=[0,.69444,0,0,.77778],Jt=[0,.68333,0,0,.75],cr=[0,.68333,0,0,.77778],tu=[0,.68333,0,0,.68056],dr=[0,.68333,0,0,.72222],ct=[.25,.75,0,0,.5],wa=[.25,.75,0,0,.27778],oe=[0,.69444,0,0,.5],Bi=[0,.69444,0,0,.55556],mn=[0,.43056,0,0,.44445],hr=[0,.43056,0,0,.5],iu=[.19444,.43056,0,0,.55556],ru=[0,.43056,0,0,.55556],Te=[.08333,.58333,0,0,.77778],au=[0,.43056,0,0,.27778],ou=[0,.66786,0,0,.27778],nu=[0,.69444,0,0,.75],lu=[0,.66786,0,0,.5],su=[0,.68333,0,0,.625],fn=[.19444,.69444,0,0,.44445],pr=[0,.69444,0,0,.72222],uu=[.19444,.69444,0,0,.5],mr=[.19444,.69444,0,0,1],cu=[.011,.511,0,0,1.126],gn=[.19444,.69444,0,0,.61111],yn=[.05556,.75,0,0,.5],du=[0,.68333,0,0,.83334],hu=[.0391,.5391,0,0,.66667],bn=[-.05555,.44445,0,0,.5],pu=[0,.43056,0,0,.77778],Xt=[0,.55556,0,0,.66667],_a=[-.03625,.46375,0,0,.77778],mu=[-.01688,.48312,0,0,.77778],fu=[.0391,.5391,0,0,1],Et=[0,.69444,0,0,.61111],ka=[-.03472,.46528,0,0,.5],Ma=[.25,.75,0,0,.44445],gu=[-.14236,.35764,0,0,1],Sa=[.244,.744,0,0,.412],yu=[.19444,.69444,0,0,.88889],Ca=[.12963,.69444,0,0,.77778],bu=[.19444,.69444,0,0,.38889],vu=[.011,.511,0,0,1.638],xu=[.19444,.69444,0,0,0],Da=[0,.44444,0,0,.575],fr=[.19444,.44444,0,0,.575],wu=[0,.68611,0,0,.75555],_u=[0,.69444,0,0,.66759],ku=[0,.68611,0,0,.80555],Mu=[0,.68611,.08229,0,.98229],Su=[0,.68611,0,0,.76666],Cu=[0,.44444,0,0,.58472],Du=[.19444,.44444,0,0,.6118],gr=[.19444,.43056,0,0,.5],Bu=[0,.68333,.02778,.08334,.76278],Au=[0,.68333,.08125,.05556,.83125],Lu=[0,.43056,0,.05556,.48472],Eu=[.19444,.43056,0,.08334,.51702],Ku=[.25,.75,0,0,.42778],de=[0,.69444,0,0,.55],dt=[0,.69444,0,0,.73334],Kt=[0,.69444,0,0,.79445],Fu=[0,.69444,0,0,.51945],vn=[0,.69444,0,0,.70278],Tu=[0,.69444,0,0,.76389],zu=[.25,.75,0,0,.34306],xn=[0,.69444,0,0,.56111],$u=[0,.69444,0,0,.25556],Pu=[.19444,.45833,0,0,.56111],Ou=[0,.45833,0,0,.56111],Ba=[0,.69444,0,0,.30556],Iu=[0,.69444,0,0,.58056],Nu=[0,.69444,0,0,.67223],wn=[0,.69444,0,0,.85556],_n=[0,.69444,0,0,.55834],Qe=[0,.65556,.11156,0,.5],kn=[0,.69444,.08094,0,.70834],Mn=[.17014,0,0,0,.44445],qu=[0,.69444,.0799,0,.5],Ru=[0,.69444,0,0,.73752],Vu=[0,.69444,.09205,0,.5],Hu=[0,.69444,.09031,0,.77778],Sn=[0,.69444,.07816,0,.27778],ju=[0,.69444,.00316,0,.5],Wu=[.19444,.69444,0,0,.83334],Uu=[.05556,.75,0,0,.83334],Ju=[0,.75,0,0,.5],Xu=[.125,.08333,0,0,.27778],Gu=[0,.08333,0,0,.27778],et=[0,.65556,0,0,.5],Cn=[0,.69444,0,0,.47222],ht=[0,.69444,0,0,.66667],Zu=[0,.69444,0,0,.59722],Dn=[0,.69444,0,0,.54167],Bn=[0,.69444,0,0,.70834],Yu=[.25,.75,0,0,.28889],An=[0,.69444,0,0,.51667],Qu=[0,.44444,0,0,.44445],ec=[.19444,.44444,0,0,.51667],tc=[0,.44444,0,0,.38333],ic=[0,.44444,0,0,.51667],rc=[0,.69444,0,0,.83334],ac=[.35001,.85,0,0,.45834],oc=[.35001,.85,0,0,.57778],nc=[.35001,.85,0,0,.41667],lc=[.35001,.85,0,0,.58334],Aa=[0,.72222,0,0,.55556],sc=[1e-5,.6,0,0,.66667],uc=[1e-5,.6,0,0,.77778],cc=[.25001,.75,0,0,.94445],dc=[.306,.805,.19445,0,.47222],hc=[.30612,.805,.19445,0,.47222],Ai=[.25001,.75,0,0,.83334],Li=[.35001,.85,0,0,.47222],Ln=[.25001,.75,0,0,1.11111],pc=[.65002,1.15,0,0,.59722],mc=[.65002,1.15,0,0,.81111],fc=[.65002,1.15,0,0,.47222],gc=[.65002,1.15,0,0,.66667],La=[0,.75,0,0,1],yc=[.55001,1.05,0,0,1.27778],bc=[.862,1.36,.44445,0,.55556],vc=[.86225,1.36,.44445,0,.55556],Ei=[.55001,1.05,0,0,1.11111],Ea=[.65002,1.15,0,0,.52778],xc=[.65002,1.15,0,0,.61111],En=[.55001,1.05,0,0,1.51112],wc=[.95003,1.45,0,0,.73611],_c=[.95003,1.45,0,0,1.04445],kc=[.95003,1.45,0,0,.52778],Ka=[.95003,1.45,0,0,.75],Fa=[0,.75,0,0,1.44445],Ta=[.95003,1.45,0,0,.58334],Mc=[1.25003,1.75,0,0,.79167],Sc=[1.25003,1.75,0,0,1.27778],Cc=[1.25003,1.75,0,0,.58334],za=[1.25003,1.75,0,0,.80556],$a=[0,.825,0,0,1.8889],Pa=[1.25003,1.75,0,0,.63889],Oa=[.64502,1.155,0,0,.875],Dc=[1e-5,.6,0,0,.875],Kn=[-99e-5,.601,0,0,.66667],Ia=[.64502,1.155,0,0,.66667],Bc=[1e-5,.9,0,0,.88889],Ac=[.65002,1.15,0,0,.88889],Lc=[.90001,0,0,0,.88889],Ec=[-.00499,.605,0,0,1.05556],Na=[0,.12,0,0,.45],A=[0,.61111,0,0,.525],Re=[.08333,.69444,0,0,.525],Kc=[-.08056,.53055,0,0,.525],Fc=[-.05556,.55556,0,0,.525],ve=[0,.43056,0,0,.525],yr=[.22222,.43056,0,0,.525],Tc=[0,0,0,0,.525],Gh={"AMS-Regular":{32:q,65:Ee,66:Ht,67:Ee,68:Ee,69:Ht,70:ea,71:Yo,72:Yo,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Yo,76:Ht,77:[0,.68889,0,0,.94445],78:Ee,79:Wl,80:ea,81:Wl,82:Ee,83:or,84:Ht,85:Ee,86:Ee,87:[0,.68889,0,0,1],88:Ee,89:Ee,90:Ht,107:or,160:q,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:or,295:ta,710:Ul,732:Jl,770:Ul,771:Jl,989:kt,1008:fs,8245:[0,.54986,0,0,.275],8463:ta,8487:Ee,8498:or,8502:Ht,8503:[0,.68889,0,0,.44445],8504:Ht,8513:[0,.68889,0,0,.63889],8592:Qo,8594:Qo,8602:me,8603:me,8606:ia,8608:ia,8610:Xl,8611:Xl,8619:Gl,8620:Gl,8621:[-.13313,.37788,0,0,1.38889],8622:me,8624:ra,8625:ra,8630:en,8631:en,8634:_t,8635:_t,8638:aa,8639:aa,8642:aa,8643:aa,8644:oa,8646:oa,8647:oa,8648:Zl,8649:oa,8650:Zl,8651:ia,8652:ia,8653:me,8654:me,8655:me,8666:Yl,8667:Yl,8669:[-.13313,.37788,0,0,1],8672:Ql,8674:Ql,8705:[0,.825,0,0,.5],8708:or,8709:kt,8717:[0,.43056,0,0,.42917],8722:Qo,8724:[.08198,.69224,0,0,.77778],8726:kt,8733:la,8736:nr,8737:nr,8738:[.03517,.52239,0,0,.72222],8739:ps,8740:[.25142,.74111,0,0,.27778],8741:ms,8742:[.25142,.74111,0,0,.5],8756:tn,8757:tn,8764:na,8765:[-.13313,.37788,0,0,.77778],8769:na,8770:_a,8774:Ne,8776:mu,8778:kt,8782:es,8783:es,8785:_t,8786:_t,8787:_t,8790:la,8791:lr,8796:[.08198,.91667,0,0,.77778],8806:wi,8807:wi,8808:Ge,8809:Ge,8812:[.25583,.75583,0,0,.5],8814:_i,8815:_i,8816:Ne,8817:Ne,8818:lr,8819:lr,8822:ts,8823:ts,8828:Ze,8829:Ze,8830:lr,8831:lr,8832:_i,8833:_i,8840:Ne,8841:Ne,8842:ke,8843:ke,8847:Mt,8848:Mt,8858:_t,8859:_t,8861:_t,8862:ki,8863:ki,8864:ki,8865:ki,8872:[0,.69224,0,0,.61111],8873:nr,8874:[0,.69224,0,0,.88889],8876:ea,8877:ea,8878:Ee,8879:Ee,8882:Mt,8883:Mt,8884:Ze,8885:Ze,8888:[0,.54986,0,0,1.11111],8890:iu,8891:is,8892:is,8901:[0,.54986,0,0,.27778],8903:kt,8905:kt,8906:kt,8907:la,8908:la,8909:[-.03598,.46402,0,0,.77778],8910:rs,8911:rs,8912:Mt,8913:Mt,8914:as,8915:as,8916:tn,8918:St,8919:St,8920:os,8921:os,8922:ns,8923:ns,8926:Ze,8927:Ze,8928:Ne,8929:Ne,8934:sa,8935:sa,8936:sa,8937:sa,8938:_i,8939:_i,8940:Ne,8941:Ne,8994:ls,8995:ls,9416:[.15559,.69224,0,0,.90222],9484:ra,9488:ra,9492:ss,9496:ss,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:ki,9633:ki,9650:ua,9651:ua,9654:Mt,9660:ua,9661:ua,9664:Mt,9674:cs,9733:[.19444,.69224,0,0,.94445],10003:us,10016:us,10731:cs,10846:[.19444,.75583,0,0,.61111],10877:Ze,10878:Ze,10885:wi,10886:wi,10887:ke,10888:ke,10889:Mi,10890:Mi,10891:ds,10892:ds,10901:Ze,10902:Ze,10933:Ge,10934:Ge,10935:Mi,10936:Mi,10937:Mi,10938:Mi,10949:wi,10950:wi,10955:hs,10956:hs,57350:ps,57351:ms,57352:kt,57353:fs,57356:Ge,57357:Ge,57358:gs,57359:Ne,57360:Ne,57361:gs,57366:Ge,57367:Ge,57368:Ge,57369:Ge,57370:ke,57371:ke},"Caligraphic-Regular":{32:q,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:q},"Fraktur-Regular":{32:q,33:[0,.69141,0,0,.29574],34:an,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:ys,41:ys,42:[0,.62119,0,0,.27764],43:bs,44:vs,45:bs,46:vs,47:[.24982,.74947,0,0,.50181],48:rn,49:rn,50:rn,51:sr,52:sr,53:sr,54:xs,55:sr,56:xs,57:sr,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:ws,93:ws,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:q,8216:an,8217:an,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:q,33:[0,.69444,0,0,.35],34:ln,35:[.19444,.69444,0,0,.95833],36:Es,37:[.05556,.75,0,0,.95833],38:da,39:Ci,40:ca,41:ca,42:[0,.75,0,0,.575],43:qe,44:[.19444,.15556,0,0,.31944],45:tc,46:[0,.15556,0,0,.31944],47:Ct,48:Ke,49:Ke,50:Ke,51:Ke,52:Ke,53:Ke,54:Ke,55:Ke,56:Ke,57:Ke,58:Ms,59:[.19444,.44444,0,0,.31944],60:Si,61:Ts,62:Si,63:[0,.69444,0,0,.54305],64:da,65:on,66:[0,.68611,0,0,.81805],67:ma,68:[0,.68611,0,0,.88194],69:wu,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ha,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Cs,77:[0,.68611,0,0,1.09166],78:ha,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:on,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:pa,92:Ct,93:pa,94:Dt,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:jt,99:ks,100:jt,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:jt,105:Ci,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Ci,109:[0,.44444,0,0,.95833],110:_s,111:Da,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:_s,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:ks,123:Ct,124:pa,125:Ct,126:[.35,.34444,0,0,.575],160:q,163:[0,.69444,0,0,.86853],168:Dt,172:[0,.44444,0,0,.76666],176:Ss,177:qe,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:qe,216:[.04861,.73472,0,0,.89444],223:Zu,230:[0,.44444,0,0,.83055],247:qe,248:[.09722,.54167,0,0,.575],305:Ms,338:[0,.68611,0,0,1.16944],339:Fs,567:[.19444,.44444,0,0,.35139],710:Dt,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Dt,715:Dt,728:Dt,729:Ci,730:Ss,732:Dt,733:Dt,915:Cs,916:sn,920:nn,923:ku,926:Su,928:ha,931:ma,933:nn,934:ma,936:nn,937:ma,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Ci,8217:Ci,8220:ln,8221:ln,8224:Ds,8225:Ds,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:_u,8465:Bs,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Bs,8501:dn,8592:Ye,8593:As,8594:Ye,8595:As,8596:Ye,8597:Ct,8598:ur,8599:ur,8600:ur,8601:ur,8636:Ye,8637:Ye,8640:Ye,8641:Ye,8656:Ye,8657:Ls,8658:Ye,8659:Ls,8660:Ye,8661:[.25,.75,0,0,.70277],8704:jt,8706:[0,.69444,.06389,0,.62847],8707:jt,8709:Es,8711:sn,8712:Ks,8715:Ks,8722:qe,8723:qe,8725:Ct,8726:Ct,8727:fa,8728:un,8729:un,8730:[.18,.82,0,0,.95833],8733:Fs,8734:[0,.44444,0,0,1.14999],8736:nr,8739:pa,8741:Ct,8743:Wt,8744:Wt,8745:Wt,8746:Wt,8747:[.19444,.69444,.12778,0,.56875],8764:Ts,8768:[.19444,.69444,0,0,.31944],8771:cn,8776:[.02444,.52444,0,0,.89444],8781:cn,8801:cn,8804:Bt,8805:Bt,8810:zs,8811:zs,8826:Si,8827:Si,8834:Si,8835:Si,8838:Bt,8839:Bt,8846:Wt,8849:Bt,8850:Bt,8851:Wt,8852:Wt,8853:qe,8854:qe,8855:qe,8856:qe,8857:qe,8866:dn,8867:dn,8868:da,8869:da,8900:un,8901:[-.02639,.47361,0,0,.31944],8902:fa,8968:ga,8969:ga,8970:ga,8971:ga,8994:$s,8995:$s,9651:Ps,9657:fa,9661:Ps,9667:fa,9711:ur,9824:ya,9825:ya,9826:ya,9827:ya,9837:[0,.75,0,0,.44722],9838:Os,9839:Os,10216:ca,10217:ca,10815:ha,10927:Bt,10928:Bt,57376:xu},"Main-BoldItalic":{32:q,33:[0,.69444,.11417,0,.38611],34:js,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ba,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:At,49:At,50:At,51:At,52:Is,53:At,54:At,55:Is,56:At,57:At,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:pn,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:hn,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:hn,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:Rs,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:Ns,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:Ns,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:q,168:[0,.69444,.11473,0,.59111],176:Vs,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:qs,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:qs,567:[.19444,.44444,.04611,0,.385],710:Rs,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:ba,730:Vs,732:pn,733:pn,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:hn,931:[0,.68611,.11431,0,.82666],933:Hs,934:[0,.68611,.05632,0,.82666],936:Hs,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ba,8217:ba,8220:[0,.69444,.16772,0,.62055],8221:js},"Main-Italic":{32:q,33:va,34:eu,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:va,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:Lt,49:Lt,50:Lt,51:Lt,52:Ws,53:Lt,54:Lt,55:Ws,56:Lt,57:Lt,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Zs,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:xa,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:xa,79:Ys,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:xa,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:Xs,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:Us,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:Us,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:q,168:[0,.66786,.10474,0,.51111],176:Gs,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:Js,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Js,710:Xs,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:Gs,732:[0,.66786,.11585,0,.51111],733:Zs,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Ys,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:xa,931:[0,.68333,.12028,0,.71555],933:Qs,934:[0,.68333,.05986,0,.71555],936:Qs,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:va,8217:va,8220:[0,.69444,.1685,0,.51444],8221:eu,8463:ta},"Main-Regular":{32:q,33:ut,34:oe,35:Wu,36:yn,37:Uu,38:Ut,39:ut,40:Di,41:Di,42:Ju,43:Te,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:ct,48:Fe,49:Fe,50:Fe,51:Fe,52:Fe,53:Fe,54:Fe,55:Fe,56:Fe,57:Fe,58:au,59:[.19444,.43056,0,0,.27778],60:St,61:na,62:St,63:Cn,64:Ut,65:Jt,66:[0,.68333,0,0,.70834],67:dr,68:[0,.68333,0,0,.76389],69:tu,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Jt,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:cr,76:su,77:[0,.68333,0,0,.91667],78:Jt,79:cr,80:tu,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:dr,85:Jt,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Jt,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:wa,92:ct,93:wa,94:oe,95:[.31,.12056,.02778,0,.5],97:hr,98:Bi,99:mn,100:Bi,101:mn,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Bi,105:ou,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:ut,109:[0,.43056,0,0,.83334],110:ru,111:hr,112:iu,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:ru,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:mn,123:ct,124:wa,125:ct,126:[.35,.31786,0,0,.5],160:q,163:[0,.69444,0,0,.76909],167:fn,168:lu,172:[0,.43056,0,0,.66667],176:nu,177:Te,182:gn,184:Mn,198:[0,.68333,0,0,.90278],215:Te,216:[.04861,.73194,0,0,.77778],223:oe,230:[0,.43056,0,0,.72222],247:Te,248:[.09722,.52778,0,0,.5],305:au,338:[0,.68333,0,0,1.01389],339:pu,567:[.19444,.43056,0,0,.30556],710:oe,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:oe,715:oe,728:oe,729:ou,730:nu,732:lu,733:oe,915:su,916:du,920:cr,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Jt,931:dr,933:cr,934:dr,936:cr,937:dr,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:ut,8217:ut,8220:oe,8221:oe,8224:fn,8225:fn,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:ta,8465:pr,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:pr,8501:Et,8592:me,8593:uu,8594:me,8595:uu,8596:me,8597:ct,8598:mr,8599:mr,8600:mr,8601:mr,8614:[.011,.511,0,0,1],8617:cu,8618:cu,8636:me,8637:me,8640:me,8641:me,8652:[.011,.671,0,0,1],8656:me,8657:gn,8658:me,8659:gn,8660:me,8661:[.25,.75,0,0,.61111],8704:Bi,8706:[0,.69444,.05556,.08334,.5309],8707:Bi,8709:yn,8711:du,8712:hu,8715:hu,8722:Te,8723:Te,8725:ct,8726:ct,8727:ka,8728:bn,8729:bn,8730:[.2,.8,0,0,.83334],8733:pu,8734:en,8736:nr,8739:wa,8741:ct,8743:Xt,8744:Xt,8745:Xt,8746:Xt,8747:[.19444,.69444,.11111,0,.41667],8764:na,8768:[.19444,.69444,0,0,.27778],8771:_a,8773:[-.022,.589,0,0,1],8776:mu,8781:_a,8784:[-.133,.67,0,0,.778],8801:_a,8804:ke,8805:ke,8810:fu,8811:fu,8826:St,8827:St,8834:St,8835:St,8838:ke,8839:ke,8846:Xt,8849:ke,8850:ke,8851:Xt,8852:Xt,8853:Te,8854:Te,8855:Te,8856:Te,8857:Te,8866:Et,8867:Et,8868:Ut,8869:Ut,8872:[.249,.75,0,0,.867],8900:bn,8901:[-.05555,.44445,0,0,.27778],8902:ka,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:Ma,8969:Ma,8970:Ma,8971:Ma,8994:gu,8995:gu,9136:Sa,9137:Sa,9651:yu,9657:ka,9661:yu,9667:ka,9711:mr,9824:Ca,9825:Ca,9826:Ca,9827:Ca,9837:[0,.75,0,0,.38889],9838:bu,9839:bu,10216:Di,10217:Di,10222:Sa,10223:Sa,10229:[.011,.511,0,0,1.609],10230:vu,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:vu,10815:Jt,10927:ke,10928:ke,57376:xu},"Math-BoldItalic":{32:q,48:Da,49:Da,50:Da,51:fr,52:fr,53:fr,54:Ke,55:fr,56:Ke,57:fr,65:on,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:Mu,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:_u,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:Cu,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:q,915:[0,.68611,.15972,0,.65694],916:sn,920:[0,.68611,.03194,0,.86722],923:ku,926:[0,.68611,.07458,0,.84125],928:Mu,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Su,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:Cu,960:[0,.44444,.03704,0,.68241],961:Du,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:Du,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:q,48:hr,49:hr,50:hr,51:gr,52:gr,53:gr,54:Fe,55:gr,56:Fe,57:gr,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:Au,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:Bu,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:Lu,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:q,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Bu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Au,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:Lu,960:[0,.43056,.03588,0,.57003],961:Eu,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:Eu,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:q,33:[0,.69444,0,0,.36667],34:_n,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:Ba,40:Ku,41:Ku,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:de,49:de,50:de,51:de,52:de,53:de,54:de,55:de,56:de,57:de,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Fu,64:dt,65:dt,66:dt,67:vn,68:Kt,69:[0,.69444,0,0,.64167],70:Et,71:dt,72:Kt,73:[0,.69444,0,0,.33056],74:Fu,75:Tu,76:Iu,77:[0,.69444,0,0,.97778],78:Kt,79:Kt,80:vn,81:[.10556,.69444,0,0,.79445],82:vn,83:Et,84:dt,85:Tu,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:dt,89:[0,.69444,.0275,0,.73334],90:Nu,91:zu,93:zu,94:de,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:xn,99:[0,.45833,0,0,.48889],100:xn,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:xn,105:$u,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:$u,109:[0,.45833,0,0,.86667],110:Ou,111:[0,.45833,0,0,.55],112:Pu,113:Pu,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Ou,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:q,168:de,176:dt,180:de,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:de,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:de,729:Ba,730:dt,732:de,733:de,915:Iu,916:[0,.69444,0,0,.91667],920:wn,923:Nu,926:dt,928:Kt,931:Kt,933:wn,934:Kt,936:wn,937:Kt,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Ba,8217:Ba,8220:_n,8221:_n},"SansSerif-Italic":{32:q,33:[0,.69444,.05733,0,.31945],34:ju,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:Sn,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:Xu,45:[0,.44444,.01946,0,.33333],46:Gu,47:[.25,.75,.13164,0,.5],48:Qe,49:Qe,50:Qe,51:Qe,52:Qe,53:Qe,54:Qe,55:Qe,56:Qe,57:Qe,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:ht,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:kn,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Dn,77:[0,.69444,.08094,0,.875],78:kn,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:qu,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:q,168:[0,.67937,.06385,0,.5],176:Ru,184:Mn,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:qu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Vu,715:oe,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Ru,732:[0,.67659,.08826,0,.5],733:Vu,915:[0,.69444,.13372,0,.54167],916:rc,920:[0,.69444,.07555,0,.77778],923:Et,926:[0,.69444,.12816,0,.66667],928:kn,931:[0,.69444,.11983,0,.72222],933:Hu,934:[0,.69444,.04603,0,.72222],936:Hu,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Sn,8217:Sn,8220:[0,.69444,.14205,0,.5],8221:ju},"SansSerif-Regular":{32:q,33:[0,.69444,0,0,.31945],34:oe,35:Wu,36:yn,37:Uu,38:[0,.69444,0,0,.75834],39:ut,40:Di,41:Di,42:Ju,43:Te,44:Xu,45:[0,.44444,0,0,.33333],46:Gu,47:ct,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Cn,64:ht,65:ht,66:ht,67:jt,68:[0,.69444,0,0,.72223],69:Zu,70:[0,.69444,0,0,.56945],71:ht,72:Bn,73:ut,74:Cn,75:[0,.69444,0,0,.69445],76:Dn,77:[0,.69444,0,0,.875],78:Bn,79:[0,.69444,0,0,.73611],80:jt,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Bi,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:ht,89:[0,.69444,.025,0,.66667],90:Et,91:Yu,93:Yu,94:oe,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:An,99:Qu,100:An,101:Qu,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:An,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:ic,111:[0,.44444,0,0,.5],112:ec,113:ec,114:[0,.44444,.01389,0,.34167],115:tc,116:[0,.57143,0,0,.36111],117:ic,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:q,168:[0,.67937,0,0,.5],176:ht,184:Mn,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:oe,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:oe,715:oe,728:oe,729:[0,.67937,0,0,.27778],730:ht,732:[0,.67659,0,0,.5],733:oe,915:Dn,916:rc,920:Ut,923:Et,926:ht,928:Bn,931:pr,933:Ut,934:pr,936:Ut,937:pr,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:ut,8217:ut,8220:oe,8221:oe},"Script-Regular":{32:q,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:q},"Size1-Regular":{32:q,40:ac,41:ac,47:oc,91:nc,92:oc,93:nc,123:lc,125:lc,160:q,710:Aa,732:Aa,770:Aa,771:Aa,8214:[-99e-5,.601,0,0,.77778],8593:sc,8595:sc,8657:uc,8659:uc,8719:cc,8720:cc,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:hc,8748:dc,8749:dc,8750:hc,8896:Ai,8897:Ai,8898:Ai,8899:Ai,8968:Li,8969:Li,8970:Li,8971:Li,9168:Kn,10216:Li,10217:Li,10752:Ln,10753:Ln,10754:Ln,10756:Ai,10758:Ai},"Size2-Regular":{32:q,40:pc,41:pc,47:mc,91:fc,92:mc,93:fc,123:gc,125:gc,160:q,710:La,732:La,770:La,771:La,8719:yc,8720:yc,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:vc,8748:bc,8749:bc,8750:vc,8896:Ei,8897:Ei,8898:Ei,8899:Ei,8968:Ea,8969:Ea,8970:Ea,8971:Ea,10216:xc,10217:xc,10752:En,10753:En,10754:En,10756:Ei,10758:Ei},"Size3-Regular":{32:q,40:wc,41:wc,47:_c,91:kc,92:_c,93:kc,123:Ka,125:Ka,160:q,710:Fa,732:Fa,770:Fa,771:Fa,8730:[.95003,1.45,0,0,1],8968:Ta,8969:Ta,8970:Ta,8971:Ta,10216:Ka,10217:Ka},"Size4-Regular":{32:q,40:Mc,41:Mc,47:Sc,91:Cc,92:Sc,93:Cc,123:za,125:za,160:q,710:$a,732:$a,770:$a,771:$a,8730:[1.25003,1.75,0,0,1],8968:Pa,8969:Pa,8970:Pa,8971:Pa,9115:Oa,9116:Dc,9117:Oa,9118:Oa,9119:Dc,9120:Oa,9121:Ia,9122:Kn,9123:Ia,9124:Ia,9125:Kn,9126:Ia,9127:Bc,9128:Ac,9129:Lc,9130:[0,.3,0,0,.88889],9131:Bc,9132:Ac,9133:Lc,9143:[.88502,.915,0,0,1.05556],10216:za,10217:za,57344:Ec,57345:Ec,57680:Na,57681:Na,57682:Na,57683:Na},"Typewriter-Regular":{32:Tc,33:A,34:A,35:A,36:Re,37:Re,38:A,39:A,40:Re,41:Re,42:[0,.52083,0,0,.525],43:Kc,44:[.13889,.125,0,0,.525],45:Kc,46:[0,.125,0,0,.525],47:Re,48:A,49:A,50:A,51:A,52:A,53:A,54:A,55:A,56:A,57:A,58:ve,59:[.13889,.43056,0,0,.525],60:Fc,61:[-.19549,.41562,0,0,.525],62:Fc,63:A,64:A,65:A,66:A,67:A,68:A,69:A,70:A,71:A,72:A,73:A,74:A,75:A,76:A,77:A,78:A,79:A,80:A,81:[.13889,.61111,0,0,.525],82:A,83:A,84:A,85:A,86:A,87:A,88:A,89:A,90:A,91:Re,92:Re,93:Re,94:A,95:[.09514,0,0,0,.525],96:A,97:ve,98:A,99:ve,100:A,101:ve,102:A,103:yr,104:A,105:A,106:[.22222,.61111,0,0,.525],107:A,108:A,109:ve,110:ve,111:ve,112:yr,113:yr,114:ve,115:ve,116:[0,.55358,0,0,.525],117:ve,118:ve,119:ve,120:ve,121:yr,122:ve,123:Re,124:Re,125:Re,126:A,127:A,160:Tc,176:A,184:[.19445,0,0,0,.525],305:ve,567:yr,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:A,715:A,728:A,730:A,770:A,771:A,776:A,915:A,916:A,920:A,923:A,926:A,928:A,931:A,933:A,934:A,936:A,937:A,8216:A,8217:A,8242:A,9251:[.11111,.21944,0,0,.525]}},Zh=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Qi=10,He=.25,Yh=1.2,Ot=.431,zc={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[Ot,Ot,Ot],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:[He,He,He],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]},Qn=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Cl=5,$c={" ":" ","​":" ",Å:"A",Ç:"C",Ð:"D",Þ:"o",å:"a",ç:"c",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function Ii(e,t){e===void 0&&(e=77);let i=Gh[t][e];if(i)return{defaultMetrics:!1,depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};let r=String.fromCodePoint(e);if(r in $c)e=$c[r].codePointAt(0);else if(Zh.test(r))return e=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 el={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]},tl={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]},Pc={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 Qh(e){if(tl[e]){let[u,c,d]=tl[e],h=`<span class="stretchy" style="height:${d}em"><svg width="100%" height="${d}em" viewBox="0 0 ${u} ${c}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Pc[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*d/2)/100}em;min-width:0">${h}</span>`}let[t,i,r,a]=el[e],o,n,l=r/1e3;t.length===3?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],n=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(o=["slice-1-of-2","slice-2-of-2"],n=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],n=[a]);let s=t.map((u,c)=>`<span class="${o[c]}" style=height:${l}em><svg width=400em height=${l}em viewBox="0 0 400000 ${r}" preserveAspectRatio="${n[c]} slice"><path fill="currentcolor" d="${Pc[u]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${l}em;min-width:${i}em;">${s}</span>`}function ep(e){return el[e]?el[e][2]/1e3:tl[e][2]}function tp(e){let t=[];for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(r===13&&e.charCodeAt(i+1)===10&&(r=10,i++),(r===13||r===12)&&(r=10),r===0&&(r=65533),r>=55296&&r<=56319){let a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){let o=r-55296,n=a-56320;r=2**16+o*2**10+n,i++}}t.push(r)}return t}var to=8205,ip=[[to,1],[65038,2],[127995,5],[129456,4],[917536,96]],qa,Oc=[127462,127487];function Ic(e){var t;if(qa===void 0){qa={};for(let i of ip)for(let r=i[0];r<=i[0]+i[1]-1;r++)qa[r]=!0}return(t=qa[e])!=null?t:!1}function rp(e){return e>=Oc[0]&&e<=Oc[1]}function E0(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;let t=[],i=tp(e),r=0;for(;r<i.length;){let a=i[r++],o=i[r];if(o===to){let n=r-1;for(r+=2;i[r]===to;)r+=2;t.push(String.fromCodePoint(...i.slice(n,r-n+1)))}else if(Ic(o)){let n=r-1;for(;Ic(i[r]);)r+=i[r]===to?2:1;t.push(String.fromCodePoint(...i.slice(n,2*r-n-1)))}else rp(a)?(r+=1,t.push(String.fromCodePoint(...i.slice(r-2,2)))):t.push(String.fromCodePoint(a))}return t}var ap=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=E0(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){let t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";let e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();let t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){let i=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(i)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function op(e,t){var i,r,a,o;let n=[],l=e.next();if(l&&l!=="\\relax"){if(l==="\\noexpand")l=e.next(),l&&n.push(l);else if(l==="\\obeyspaces")e.obeyspaces=!0;else if(l==="\\bgroup")n.push("<{>");else if(l==="\\egroup")n.push("<}>");else if(l==="\\string"){if(l=e.next(),l)if(l.startsWith("\\"))for(let s of l)n.push(s==="\\"?"\\backslash":s);else l==="<{>"?n.push("\\{"):l==="<space>"?n.push("~"):l==="<}>"&&n.push("\\}")}else if(l==="\\csname"){for(;e.peek()==="<space>";)e.next();let s="",u=!1,c=[];do{if(c.length===0)if(/^#[\d?@]$/.test(e.peek())){let d=e.get().slice(1);c=fo((r=(i=t==null?void 0:t(d))!=null?i:t==null?void 0:t("?"))!=null?r:"\\placeholder{}",t),l=c[0]}else l=e.next(),c=l?[l]:[];u=c.length===0,!u&&l==="\\endcsname"&&(u=!0,c.shift()),u||(u=l==="<$>"||l==="<$$>"||l==="<{>"||l==="<}>"||typeof l=="string"&&l.length>1&&l.startsWith("\\")),u||(s+=c.shift())}while(!u);s&&n.push("\\"+s),n.push(...c)}else if(l!=="\\endcsname")if(l.length>1&&l.startsWith("#")){let s=l.slice(1);n.push(...fo((o=(a=t==null?void 0:t(s))!=null?a:t==null?void 0:t("?"))!=null?o:"\\placeholder{}",t))}else n.push(l)}return n}function fo(e,t=null){let i=[],r="";for(let n of e.toString().split(/\r?\n/)){r&&i.push(r),r=" ";let l=n.match(/((?:\\%)|[^%])*/);l!==null&&i.push(l[0])}let a=new ap(Rh(i.join(""))),o=[];do o.push(...op(a,t));while(!a.end());return o}function P(e){let t="",i=[];for(let r of e)r&&(t&&/^[a-zA-Z\*]/.test(r)&&i.push(t),i.push(r),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(r)&&i.push(" "),t=/\\[a-zA-Z]+\*?$/.test(r)?" ":"");return i.join("")}function G(e,...t){return e.startsWith("\\"),t.length===0?e:P([e,...t.map(i=>`{${i}}`)])}function Gt(e){return P(e.map(t=>{var i;return(i={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?i:t}))}var K0=class Br{constructor(t){Br._registry[t]=this}static createAtom(t,i,r){return Br._registry[t].createAtom(i,he(i,t),r)}static serialize(t,i){var r;if(!t||t.length===0)return"";if((r=i.skipStyles)!=null&&r){let a=[];for(let o of F0(t)){let n=Br._registry[o[0].mode];a.push(...n.serialize(o,i))}return P(a)}return P(lp(t,i))}static getFont(t,i,r){return Br._registry[t].getFont(i,r)}};K0._registry={};var Le=K0;function F0(e){let t=[],i=[],r="NONE";for(let a of e)a.type!=="first"&&(a.mode!==r?(i.length>0&&t.push(i),i=[a],r=a.mode):i.push(a));return i.length>0&&t.push(i),t}function Rt(e,t){let i=[],r=[],a;for(let o of e)if(o.type!=="first"&&o.style){let n;t==="variant"?(n=o.style.variant,o.style.variantStyle&&o.style.variantStyle!=="up"&&(n+="-"+o.style.variantStyle)):n=o.style[t],n===a?r.push(o):(r.length>0&&i.push(r),r=[o],a=n)}return r.length>0&&i.push(r),i}function Nc(e,t){var i;let{parent:r}=e[0],a=r==null?void 0:r.computedStyle.color,o=[];for(let n of F0(e)){let l=t.defaultMode;for(let s of Rt(n,"color")){let u=s[0].computedStyle,c=Le._registry[s[0].mode].serialize(s,b(f({},t),{defaultMode:l==="text"?"text":"math"}));!t.skipStyles&&u.color&&u.color!=="none"&&(!r||a!==u.color)?o.push(G("\\textcolor",(i=u.verbatimColor)!=null?i:u.color,P(c))):o.push(P(c))}}return o}function np(e,t){let{parent:i}=e[0],r=i==null?void 0:i.computedStyle.backgroundColor;return Rt(e,"backgroundColor").map(a=>{var o;if(a.length>0||a[0].type!=="box"){let n=a[0].computedStyle;if(n.backgroundColor&&n.backgroundColor!=="none"&&(!i||r!==n.backgroundColor))return G("\\colorbox",(o=n.verbatimBackgroundColor)!=null?o:n.backgroundColor,P(Nc(a,b(f({},t),{defaultMode:"text"}))))}return P(Nc(a,t))})}function lp(e,t){if(e.length===0)return[];let{parent:i}=e[0],r=i==null?void 0:i.computedStyle.fontSize,a=[];for(let o of Rt(e,"fontSize")){let n=o[0].computedStyle.fontSize,l=np(o,t);l&&(n&&n!=="auto"&&(!i||r!==n)?a.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][n],...l):a.push(...l))}return a}function il(e){return e?{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"}[e]:void 0}function jr(e){if(e.length===0)return"ord";let t=il(e[0].type),i=il(e[e.length-1].type);return t&&t===i?t:"ord"}function br(e,t){if(typeof e=="string")return e;if(typeof e=="number"){let i=Math.ceil(100*e)/100;return i===0?"0":i.toString()+(t??"")}return""}var S=class T0{constructor(t,i){var r,a,o,n,l;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:_e(t)?this.children=t.filter(u=>u!==null):t&&t instanceof T0&&(this.children=[t]),this.children)for(let u of this.children)u.parent=this;this.type=(r=i==null?void 0:i.type)!=null?r:"ignore",this.isSelected=(i==null?void 0:i.isSelected)===!0,i!=null&&i.caret&&(this.caret=i.caret),this.classes=(a=i==null?void 0:i.classes)!=null?a:"",this.isTight=(o=i==null?void 0:i.isTight)!=null?o:!1,i!=null&&i.attributes&&(this.attributes=i.attributes);let s=i==null?void 0:i.fontFamily;i!=null&&i.style&&this.value&&(s=(l=Le.getFont((n=i.mode)!=null?n:"math",this,b(f({variant:"normal"},i.style),{letterShapeStyle:i.letterShapeStyle})))!=null?l:void 0),s||(s="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,(i==null?void 0:i.maxFontSize)!==void 0&&(this.maxFontSize=i.maxFontSize),sp(this,s)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(let i of this.children)i.selected(t)}setStyle(t,i,r){if(i===void 0)return;let a=br(i,r);a.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=a)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=br(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=br(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=br(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=br(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){let i=t.parent;if(!i)return this;t.isPhantom&&this.setStyle("opacity",0);let r=t.color;r&&r!==i.color&&this.setStyle("color",r);let a=t.backgroundColor;this.isSelected&&(a=Nh(a)),a&&a!==i.backgroundColor&&(this.setStyle("background-color",a),this.setStyle("display","inline-block"));let o=t.scalingFactor;return this.scale=o,this.skew*=o,this.italic*=o,this}toMarkup(){var t,i,r,a;let o=(t=this.value)!=null?t:"";if(this.children)for(let p of this.children)o+=p.toMarkup();let n="";if(this.svgBody)n=Qh(this.svgBody);else if(this.svgOverlay){n='<span style="',n+="display: inline-block;",n+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,n+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,n+='">',n+=o,n+="</span>",n+='<svg style="position:absolute;overflow:visible;',n+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;let p=(i=this.cssProperties)==null?void 0:i.padding;p?(n+=`top:${p};`,n+=`left:${p};`,n+=`width:calc(100% - 2 * ${p} );`):n+="top:0;left:0;width:100%;",n+="z-index:2;",n+='"',this.svgStyle&&(n+=this.svgStyle),n+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,n+=`>${this.svgOverlay}</svg>`}let l="",s=this.classes.split(" ");s.push((r={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?r:""),this.caret==="latex"&&s.push("ML__latex-caret"),this.isSelected&&s.push("ML__selected");let u=s.length===1?s[0]:s.filter((p,m,y)=>p.length>0&&y.indexOf(p)===m).join(" ");if(u.length>0&&(l+=` class="${u}"`),this.id&&(l+=` data-atom-id=${this.id}`),this.cssId&&(l+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(l+=" "+Object.keys(this.attributes).map(p=>`${p}="${this.attributes[p]}"`).join(" ")),this.htmlData){let p=this.htmlData.split(",");for(let m of p){let y=m.match(/([^=]+)=(.+$)/);if(y){let M=y[1].trim().replace(/ /g,"-");M&&(l+=` data-${M}="${y[2]}" `)}else{let M=m.trim().replace(/ /g,"-");M&&(l+=` data-${M} `)}}}let c=(a=this.cssProperties)!=null?a:{};this.hasExplicitWidth&&c.width===void 0&&(c.width=`${Math.ceil(this._width*100)/100}em`);let d=Object.keys(c).map(p=>`${p}:${c[p]}`);if(this.scale!==void 0&&this.scale!==1&&(o.length>0||n.length>0)&&d.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){let p=this.htmlStyle.split(";"),m="";for(let y of p){let M=y.match(/([^=]+):(.+$)/);if(M){let g=M[1].trim().replace(/ /g,"-");g&&(m+=`${g}:${M[2]};`)}}m&&(l+=` style="${m}"`)}d.length>0&&(l+=` style="${d.join(";")}"`);let h="";return l.length>0||n.length>0?h=`<span${l}>${o}${n}</span>`:h=o,this.caret==="text"?h+='<span class="ML__text-caret"></span>':this.caret==="math"&&(h+='<span class="ML__caret"></span>'),h}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;let i=this.children&&this.children.length>0,r=t.children&&t.children.length>0;if(i||r)return!1;if(t.cssProperties||this.cssProperties){for(let s of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&s in t.cssProperties||this.cssProperties&&s in this.cssProperties)return!1}let a=this.cssProperties?Object.keys(this.cssProperties).length:0,o=t.cssProperties?Object.keys(t.cssProperties).length:0;if(a!==o)return!1;if(a>0){for(let s of Object.keys(this.cssProperties))if(this.cssProperties[s]!==t.cssProperties[s])return!1}let n=this.classes.trim().replace(/\s+/g," ").split(" "),l=t.classes.trim().replace(/\s+/g," ").split(" ");if(n.length!==l.length)return!1;n.sort(),l.sort();for(let[s,u]of n.entries())if(u==="vertical-separator"||u!==l[s])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function rl(e){if(!e||e.length===0)return[];e[0].children=rl(e[0].children);let t=[e[0]];for(let i=1;i<e.length;i++)t[t.length-1].tryCoalesceWith(e[i])||(e[i].children=rl(e[i].children),t.push(e[i]));return t}function zo(e){return e.children&&(e.children=rl(e.children)),e}function $o(e,t){if(!e)return new S(null,t);let i=new S(null,{classes:"ML__strut",type:"ignore"});i.setStyle("height",Math.max(0,e.height),"em");let r=[i];if(e.depth!==0){let a=new S(null,{classes:"ML__strut--bottom",type:"ignore"});a.setStyle("height",e.height+e.depth,"em"),a.setStyle("vertical-align",-e.depth,"em"),r.push(a)}return r.push(e),new S(r,b(f({},t),{type:"lift"}))}function io(e){let t=ep(e)/2,i=new S(null,{maxFontSize:0});return i.height=t+.166,i.depth=t-.166,i.svgBody=e,i}function sp(e,t){var i;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let r=0;r<e.value.length;r++){let a=Ii(e.value.codePointAt(r),t);e.height=Math.max(e.height,a.height),e.depth=Math.max(e.depth,a.depth),e._width+=a.width,e.skew=a.skew,e.italic=a.italic}return}if(e.children&&e.children.length>0){let r=-1/0,a=-1/0,o=0;for(let n of e.children)n.height>r&&(r=n.height),n.depth>a&&(a=n.depth),o=Math.max(o,(i=n.maxFontSize)!=null?i:0);e.height=r,e.depth=a,e._width=e.children.reduce((n,l)=>n+l.width,0),e.maxFontSize=o}}function up(e){if("individualShift"in e){let t=e.individualShift,i=t[0],r=[i],a=-i.shift-i.box.depth,o=a;for(let n=1;n<t.length;n++){let l=t[n],s=-l.shift-o-l.box.depth,u=s-(i.box.height+i.box.depth);o=o+s,r.push(u),r.push(l),i=l}return[r,a]}if("top"in e){let t=e.top;for(let i of e.children)t-=typeof i=="number"?i:i.box.height+i.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){let t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){let t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function cp(e){var t;let[i,r]=up(e);if(!i)return[[],0,0];let a=new S(null,{classes:"pstrut"}),o=0;for(let m of i)if(typeof m!="number"){let y=m.box;o=Math.max(o,y.maxFontSize,y.height)}o+=2,a.height=o,a.setStyle("height",o,"em");let n=[],l=r,s=r,u=r,c=0;for(let m of i){if(typeof m=="number")u+=m;else{let y=m.box,M=(t=m.classes)!=null?t:[],g=new S([a,y],{classes:M.join(" "),style:m.style});y.setStyle("height",y.height+y.depth,"em"),y.setStyle("display","inline-block"),g.setStyle("top",-o-u-y.depth,"em"),m.marginLeft&&g.setStyle("margin-left",m.marginLeft,"em"),m.marginRight&&g.setStyle("margin-right",m.marginRight,"em"),n.push(g),u+=y.height+y.depth,c=Math.max(c,g.width)}l=Math.min(l,u),s=Math.max(s,u)}n.forEach(m=>{m.softWidth=c});let d=new S(n,{classes:"vlist"});if(d.softWidth=c,d.height=s,d.setStyle("height",s,"em"),l>=0)return[[new S(d,{classes:"vlist-r"})],s,-l];let h=new S(new S(null),{classes:"vlist"});h.height=-l,h.setStyle("height",-l,"em");let p=new S(8203,{classes:"vlist-s",maxFontSize:0});return p.softWidth=0,p.height=0,p.depth=0,[[new S([d,p],{classes:"vlist-r"}),new S(h,{classes:"vlist-r"})],s,-l]}var re=class extends S{constructor(e,t){var i;let[r,a,o]=cp(e);super(r.length===1?r[0]:r,{type:t==null?void 0:t.type,classes:((i=t==null?void 0:t.classes)!=null?i:"")+" vlist-t"+(r.length===2?" vlist-t2":"")}),this.height=a,this.depth=o,this.softWidth=r.reduce((n,l)=>Math.max(n,l.width),0)}};function dp(e,t){var i,r,a,o,n;let l=e.metrics,s=new S(t.base),u=(i=t.baseShift)!=null?i:0,c=(r=t.slant)!=null?r:0,d=0,h=0;t.above&&(d=(a=t.aboveShift)!=null?a:Math.max(l.bigOpSpacing1,l.bigOpSpacing3-t.above.depth)),t.below&&(h=(o=t.belowShift)!=null?o:Math.max(l.bigOpSpacing2,l.bigOpSpacing4-t.below.height));let p=null;if(t.below&&t.above){let m=l.bigOpSpacing5+t.below.height+t.below.depth+h+s.depth+u;p=new re({bottom:m,children:[l.bigOpSpacing5,{box:t.below,marginLeft:-c,classes:["ML__center"]},h,{box:s,classes:["ML__center"]},d,{box:t.above,marginLeft:c,classes:["ML__center"]},l.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)p=new re({top:s.height-u,children:[l.bigOpSpacing5,{box:t.below,marginLeft:-c,classes:["ML__center"]},h,{box:s,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){let m=s.depth+u;p=new re({bottom:m,children:[{box:s,classes:["ML__center"]},d,{box:t.above,marginLeft:c,classes:["ML__center"]},l.bigOpSpacing5]}).wrap(e)}else{let m=s.depth+u;p=new re({bottom:m,children:[{box:s},l.bigOpSpacing5]}).wrap(e)}return new S(p,{type:(n=t.type)!=null?n:"op"})}var Dl=7,go=6,Po=5,si=4,Ui=3,Be=2,hi=1,fe=0,Ft=class{constructor(e,t,i){this.id=e,this.sizeDelta=t,this.cramped=i;let r={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(zc).reduce((a,o)=>b(f({},a),{[o]:zc[o][r]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return ot[[fe,hi,fe,hi,Be,Ui,Be,Ui][this.id]]}get sub(){return ot[[fe,fe,fe,fe,Be,Be,Be,Be][this.id]]}get fracNum(){return ot[[fe,hi,fe,hi,Be,Ui,si,Po][this.id]]}get fracDen(){return ot[[fe,fe,fe,fe,Be,Be,si,si][this.id]]}get cramp(){return ot[[fe,fe,Be,Be,si,si,go,go][this.id]]}get isTight(){return this.sizeDelta<0}},vr={7:new Ft(Dl,0,!1),6:new Ft(go,0,!0),5:new Ft(Po,0,!1),4:new Ft(si,0,!0),3:new Ft(Ui,-3,!1),2:new Ft(Be,-3,!0),1:new Ft(hi,-4,!1),0:new Ft(fe,-4,!0)},ot=b(f({},vr),{displaystyle:vr[Dl],textstyle:vr[Po],scriptstyle:vr[Ui],scriptscriptstyle:vr[hi]});function z0(e,t){var i;if(!e)return 0;let r={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Qi,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(i=e.unit)!=null?i:"pt"];if(Number.isFinite(t)){let a=10**t;return Math.round(e.dimension/Qi*r*a)/a}return e.dimension*r}function $0(e,t){if(e===null)return 0;let i=z0(e)/Qi;if(Number.isFinite(t)){let r=10**t;return Math.round(i*r)/r}return i}function Fn(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function hp(e){let t=Fn(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${Fn(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${Fn(e.shrink)}`),t}function ce(e){var t,i;if(e==null)return null;let r="";if("dimension"in e&&(r=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(r=hp(e)),"number"in e)if(!("base"in e)||e.base==="decimal")r=Number(e.number).toString();else if(e.base==="alpha")r=`\`${String.fromCodePoint(e.number)}`;else{let a=Math.round(e.number)>>>0;e.base==="hexadecimal"?(r=Number(a).toString(16).toUpperCase(),a<=255?r=r.padStart(2,"0"):a<=65535?r=r.padStart(4,"0"):a<=16777215?r=r.padStart(6,"0"):r=r.padStart(8,"0"),r=`"${r}`):e.base==="octal"&&(r=Number(a).toString(8),a<=63?r=r.padStart(2,"0"):a<=30583?r=r.padStart(4,"0"):r=r.padStart(8,"0"),r=`'${r}`)}return"register"in e&&("factor"in e&&(e.factor===-1?r="-":e.factor!==1&&(r=Number(e.factor).toString())),"global"in e&&e.global&&(r+="\\global"),r+=`\\${e.register}`),"string"in e&&(r=e.string),(i=e.relax)!=null&&i&&(r+="\\relax"),r}function tt(e,t){return e==null?null:"number"in e?b(f({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?b(f({},e),{factor:e.factor*t}):b(f({},e),{factor:t}):"dimension"in e?b(f({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:tt(e.glue,t),shrink:tt(e.shrink,t),grow:tt(e.grow,t)}:e.shrink?{glue:tt(e.glue,t),shrink:tt(e.shrink,t)}:e.grow?{glue:tt(e.glue,t),grow:tt(e.grow,t)}:{glue:tt(e.glue,t)}:null}var pp={"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 P0(){return f({},pp)}function Bl(){return{registers:P0(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"▢",letterShapeStyle:z.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:To,backgroundColorMap:kl,getMacro:e=>A0(e,Sl())}}var $=class O0{constructor(t,i){var r,a,o,n,l,s,u,c,d,h,p,m,y,M,g;let _;t!=null&&t.parent?(this.parent=t.parent,_=t.parent,this.registers={}):(_=f(f({},Bl()),(r=t==null?void 0:t.from)!=null?r:{}),this.registers=_.registers),_.atomIdsSettings&&(this.atomIdsSettings=f({},_.atomIdsSettings)),this.renderPlaceholder=_.renderPlaceholder,this.isPhantom=(n=(o=t==null?void 0:t.isPhantom)!=null?o:(a=this.parent)==null?void 0:a.isPhantom)!=null?n:!1,this.letterShapeStyle=_.letterShapeStyle,this.minFontScale=_.minFontScale,i!=null&&i.color&&i.color!=="none"?this.color=i.color:this.color=(s=(l=this.parent)==null?void 0:l.color)!=null?s:"",i!=null&&i.backgroundColor&&i.backgroundColor!=="none"?this.backgroundColor=i.backgroundColor:this.backgroundColor=(c=(u=this.parent)==null?void 0:u.backgroundColor)!=null?c:"",i!=null&&i.fontSize&&i.fontSize!=="auto"&&i.fontSize!==((d=this.parent)==null?void 0:d.size)?this.size=i.fontSize:this.size=(p=(h=this.parent)==null?void 0:h.size)!=null?p:Cl;let D=(y=(m=this.parent)==null?void 0:m.mathstyle)!=null?y:ot.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(_ instanceof O0)switch(t.mathstyle){case"cramp":D=D.cramp;break;case"superscript":D=D.sup;break;case"subscript":D=D.sub;break;case"numerator":D=D.fracNum;break;case"denominator":D=D.fracDen;break}switch(t.mathstyle){case"textstyle":D=ot.textstyle;break;case"displaystyle":D=ot.displaystyle;break;case"scriptstyle":D=ot.scriptstyle;break;case"scriptscriptstyle":D=ot.scriptscriptstyle;break}}this.mathstyle=D,this.smartFence=_.smartFence,this.placeholderSymbol=_.placeholderSymbol,this.colorMap=(M=_.colorMap)!=null?M:w=>w,this.backgroundColorMap=(g=_.backgroundColorMap)!=null?g:w=>w,this.getMacro=_.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 t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Dl||this.mathstyle.id===go}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Qn[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var i;if((i=this.registers)!=null&&i[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){let i=this.getRegister(t);if(typeof i=="number")return i;if(typeof i=="string")return Number(i)}getRegisterAsGlue(t){var i;if((i=this.registers)!=null&&i[t]){let r=this.registers[t];return typeof r=="object"&&"glue"in r?r:typeof r=="object"&&"dimension"in r?{glue:{dimension:r.dimension}}:typeof r=="number"?{glue:{dimension:r}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,i){return $0(this.getRegisterAsDimension(t),i)}getRegisterAsDimension(t){var i;if((i=this.registers)!=null&&i[t]){let r=this.registers[t];return typeof r=="object"&&"glue"in r?r.glue:typeof r=="object"&&"dimension"in r?r:typeof r=="number"?{dimension:r}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,i){if(i===void 0){delete this.registers[t];return}this.registers[t]=i}evaluate(t){if(!t||!("register"in t))return t;let i=this;if("global"in t&&t.global)for(;i.parent;)i=i.parent;let r=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(r=t.factor);let a=i.getRegister(t.register);if(a===void 0)return;if(typeof a=="string")return{string:Number(a).toString()+a};if(typeof a=="number")return{number:r*a};let o=i.evaluate(a);if(o!==void 0)return"string"in o?{string:Number(a).toString()+o.string}:"number"in o?{number:r*o.number}:"dimension"in o?b(f({},o),{dimension:r*o.dimension}):"glue"in o?b(f({},o),{glue:b(f({},o.glue),{dimension:r*o.glue.dimension}),shrink:o.shrink?b(f({},o.shrink),{dimension:r*o.shrink.dimension}):void 0,grow:o.grow?b(f({},o.grow),{dimension:r*o.grow.dimension}):void 0}):t}toDimension(t){let i=this.evaluate(t);return i===void 0?null:"dimension"in i?i:"glue"in i?i.glue:"number"in i?{dimension:i.number}:null}toEm(t,i){if(t===null)return 0;let r=this.toDimension(t);return r===null?0:z0(r,i)/Qi}toNumber(t){if(t===null)return null;let i=this.evaluate(t);return i===void 0?null:"number"in i?i.number:"dimension"in i?i.dimension:"glue"in i?i.glue.dimension:"string"in i?Number(i.string):null}toColor(t){var i,r;if(t===null)return null;let a=this.evaluate(t);return a===void 0?null:"string"in a?(r=(i=this.colorMap)==null?void 0:i.call(this,a.string))!=null?r:a.string:null}toBackgroundColor(t){var i,r;if(t===null)return null;let a=this.evaluate(t);return a===void 0?null:"string"in a?(r=(i=this.backgroundColorMap)==null?void 0:i.call(this,a.string))!=null?r:a.string:null}},er=["body","above","below","superscript","subscript"];function ai(e){return typeof e=="string"&&er.includes(e)}function yo(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var v=class pt{constructor(t){var i,r,a,o,n,l;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(r=(i=t.command)!=null?i:this.value)!=null?r:"",this.mode=(a=t.mode)!=null?a:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=f({},t.style),this.displayContainsHighlight=(o=t.displayContainsHighlight)!=null?o:!1,this.captureSelection=(n=t.captureSelection)!=null?n:!1,this.skipBoundary=(l=t.skipBoundary)!=null?l:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,i,r){var a;if(!i)return null;let o=mp(i),n=[];for(let s of o){let u=s[0].style,c=fp(t,s,{style:{color:u.color,backgroundColor:u.backgroundColor,fontSize:u.fontSize}});c&&n.push(c)}if(n.length===0)return null;let l=((a=r==null?void 0:r.classes)!=null?a:"").trim();return n.length===1&&!l&&!(r!=null&&r.type)?n[0].wrap(t):new S(n,{classes:l,type:r==null?void 0:r.type}).wrap(t)}static serialize(t,i){return Le.serialize(t,i)}static commonAncestor(t,i){if(t===i||t.parent===i.parent)return t.parent;let r=new WeakSet,{parent:a}=t;for(;a;)r.add(a),a=a.parent;for(a=i.parent;a;){if(r.has(a))return a;a=a.parent}}static fromJson(t){return typeof t=="string"?new pt({type:"mord",value:t,mode:"math"}):new pt(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){let t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=f({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=gp(this.args)),this._branches)for(let i of Object.keys(this._branches))this._branches[i]&&(t[i]=this._branches[i].filter(r=>r.type!=="first").map(r=>r.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:i}=this;for(;i;)i.parent||i._changeCounter++,"verbatimLatex"in i&&(i.verbatimLatex=void 0),i._children=void 0,i=i.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,t):this.body&&this.command?P([G(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?P([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="​"?"":this.command}bodyToLatex(t){var i;return Le.serialize(this.body,b(f({},t),{defaultMode:(i=t.defaultMode)!=null?i:this.latexMode}))}aboveToLatex(t){return Le.serialize(this.above,t)}belowToLatex(t){return Le.serialize(this.below,t)}supsubToLatex(t){let i="";if(t=b(f({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){let r=Le.serialize(this.subscript,t);r.length===0?i+="_{}":r.length===1?/^[0-9]$/.test(r)?i+=`_${r}`:i+=`_{${r}}`:i+=`_{${r}}`}if(this.branch("superscript")!==void 0){let r=Le.serialize(this.superscript,t);r.length===0?i+="^{}":r.length===1?r==="′"?i+="^\\prime ":r==="″"?i+="^\\doubleprime ":/^[0-9]$/.test(r)?i+=`^${r}`:i+=`^{${r}}`:i+=`^{${r}}`}return i}get treeDepth(){let t=1,i=this.parent;for(;i;)i=i.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(ai(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];let t=[];for(let i of er)this._branches[i]&&t.push(i);return t}createBranch(t){return ai(t),ai(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return yo(this.parentBranch)?this.parentBranch[0]:-1}get col(){return yo(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,i;let r=typeof this.style.verbatimColor=="string",a=typeof this.style.verbatimBackgroundColor=="string",o=f(f({},(i=(t=this.parent)==null?void 0:t.computedStyle)!=null?i:{}),this.style);return delete o.variant,delete o.variantStyle,a||delete o.verbatimBackgroundColor,r||delete o.verbatimColor,o}applyStyle(t){this.isDirty=!0,this.style=f(f({},this.style),t),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 i of this.children)i.applyStyle(t)}getInitialBaseElement(){var t,i,r;return this.hasEmptyBranch("body")?this:((t=this.body)==null||t[0].type,(r=(i=this.body[1])==null?void 0:i.getInitialBaseElement())!=null?r: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(t){let i=this.branch(t);return i?(i.length>0,i[0].type,i.length===1):!0}setChildren(t,i){var r;if(!t||(ai(i),!ai(i)))return;(r=t[0])==null||r.type;let a=[this.makeFirstAtom(i),...t];this._branches?this._branches[i]=a:this._branches={[i]:a};for(let o of t)o.parent=this,o.parentBranch=i;this.isDirty=!0}makeFirstAtom(t){let i=new pt({type:"first",mode:this.mode});return i.parent=this,i.parentBranch=t,i}addChild(t,i){t.type,this.createBranch(i).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=i}addChildBefore(t,i){i.parentBranch;let r=this.createBranch(i.parentBranch);r.splice(r.indexOf(i),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=i.parentBranch}addChildAfter(t,i){i.parentBranch;let r=this.createBranch(i.parentBranch);r.splice(r.indexOf(i)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=i.parentBranch}addChildren(t,i){let r=this.createBranch(i);for(let a of t)a.parent=this,a.parentBranch=i,r.push(a);this.isDirty=!0}addChildrenAfter(t,i){t.length===0||t[0].type,i.parentBranch;let r=this.createBranch(i.parentBranch);r.splice(r.indexOf(i)+1,0,...t),this.isDirty=!0;for(let a of t)a.parent=this,a.parentBranch=i.parentBranch;return t[t.length-1]}removeBranch(t){let i=this.branch(t);if(ai(t)&&(this._branches[t]=void 0),!i)return[];for(let r of i)r.parent=void 0,r.parentBranch=void 0;return i[0].type,i.shift(),this.isDirty=!0,i}removeChild(t){if(t.parent,t.type==="first")return;let i=this.branch(t.parentBranch),r=i.indexOf(t);i.splice(r,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){let{siblings:t}=this;return t[t.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 t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){this.parent;let t=this.parent.branch(this.parentBranch);return t[t.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:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];let t=[];for(let i of er)if(this._branches[i])for(let r of this._branches[i])t.push(...r.children),t.push(r);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;let i=he(this.command,this.mode);if(i!=null&&i.render)return i.render(this,t);let r=new $({parent:t},this.style),a=this.createBox(r,{classes:this.parent?"":"ML__base"});return a?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(a=this.attachSupsub(r,{base:a})),a.wrap(r)):null}attachSupsub(t,i){var r;let a=i.base,o=this.superscript,n=this.subscript;if(!o&&!n)return a;let l=null,s=null,u=(r=i.isCharacterBox)!=null?r:this.isCharacterBox(),c=0;if(o){let y=new $({parent:t,mathstyle:"superscript"});l=pt.createBox(y,o),u||(c=a.height-t.metrics.supDrop*y.scalingFactor)}let d=0;if(n){let y=new $({parent:t,mathstyle:"subscript"});s=pt.createBox(y,n),u||(d=a.depth+t.metrics.subDrop*y.scalingFactor)}let h;t.isDisplayStyle?h=t.metrics.sup1:t.isCramped?h=t.metrics.sup3:h=t.metrics.sup2;let p=.5/Qi/t.scalingFactor,m=null;if(s&&l){c=Math.max(c,h,l.depth+.25*t.metrics.xHeight),d=Math.max(d,t.metrics.sub2);let y=t.metrics.defaultRuleThickness;if(c-l.depth-(s.height-d)<4*y){d=4*y-(c-l.depth)+s.height;let g=.8*t.metrics.xHeight-(c-l.depth);g>0&&(c+=g,d-=g)}let M=this.isExtensibleSymbol&&a.italic?-a.italic:0;m=new re({individualShift:[{box:s,shift:d,marginLeft:M},{box:l,shift:-c}]}).wrap(t)}else s&&!l?(d=Math.max(d,t.metrics.sub1,s.height-.8*Ot),m=new re({shift:d,children:[{box:s,marginRight:p,marginLeft:this.isCharacterBox()?-a.italic:0}]})):!s&&l&&(c=Math.max(c,h,l.depth+.25*Ot),m=new re({shift:-c,children:[{box:l,marginRight:p}]}));return new S([a,new S(m,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:i.type})}attachLimits(t,i){let r=this.superscript?pt.createBox(new $({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,a=this.subscript?pt.createBox(new $({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!r&&!a?i.base.wrap(t):dp(t,b(f({},i),{above:r,below:a}))}bind(t,i){if(!i||t.isPhantom||this.value==="​")return i;let r=this.parent;for(;r&&!r.captureSelection;)r=r.parent;return r!=null&&r.captureSelection||(this.id||(this.id=t.makeID()),i.atomID=this.id),i}createBox(t,i){var r,a,o,n;let l=(r=this.value)!=null?r:this.body,s=(a=i==null?void 0:i.boxType)!=null?a:il(this.type),u=(o=i==null?void 0:i.classes)!=null?o:"";this.mode==="text"&&(u+=" ML__text");let c=typeof l=="string"||l===void 0?new S(l??null,{type:s,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:b(f({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:u}):(n=pt.createBox(t,l,{type:s,classes:u}))!=null?n:new S(null);return t.isTight&&(c.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(c.italic=0),c.right=c.italic,this.bind(t,c),this.caret&&!this.superscript&&!this.subscript&&(c.caret=this.caret),c}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function mp(e){let t,i=[],r=[];for(let a of e)if(!t&&!a.style)r.push(a);else{let o=a.computedStyle;t&&o.color===t.color&&o.backgroundColor===t.backgroundColor&&o.fontSize===t.fontSize?r.push(a):(r.length>0&&i.push(r),r=[a],t=o)}return r.length>0&&i.push(r),i}function fp(e,t,i){var r,a,o,n,l;if(!t||t.length===0)return null;let s=new $({parent:e},i.style),u=!((r=s.atomIdsSettings)!=null&&r.groupNumbers),c=[];if(t.length===1){let h=t[0],p=h.render(s);p&&(u&&h.isSelected&&p.selected(!0),c=[p])}else{let h="",p=!0;for(let m of t){(a=s.atomIdsSettings)!=null&&a.groupNumbers&&h&&(p&&m.isDigit()||!p&&Tn(m))&&(s.atomIdsSettings.overrideID=h);let y=m.render(s);s.atomIdsSettings&&(s.atomIdsSettings.overrideID=void 0),y&&((o=s.atomIdsSettings)!=null&&o.groupNumbers&&((m.isDigit()||Tn(m))&&(!h||p!==m.isDigit())&&(p=m.isDigit(),h=(n=m.id)!=null?n:""),h&&(!(m.isDigit()||Tn(m))||!m.hasEmptyBranch("superscript")||!m.hasEmptyBranch("subscript"))&&(h="")),u&&m.isSelected&&y.selected(!0),c.push(y))}}if(c.length===0)return null;let d=new S(c,b(f({isTight:s.isTight},i),{type:(l=i.type)!=null?l:"lift"}));return d.isSelected=c.every(h=>h.isSelected),d.wrap(s)}function Tn(e){return e.mode==="text"}function gp(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof v?{atoms:t.map(i=>i.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(i=>i.toJson())}:t)}var Wr=class I0 extends v{constructor(t,i,r){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=i,this.verbatimLatex=i,this.applyStyle(r)}static fromJson(t){return new I0(t.command,t.value,t.style)}render(t){let i=this.createBox(t);return this.caret&&(i.caret=this.caret),i}_serialize(t){var i;return(i=this.verbatimLatex)!=null?i:L0("text",this.value.codePointAt(0))}};function yp(e,t){if(e.direction===t.direction){let i=e.ranges.length;if(t.ranges.length===i){let r=0;for(;r<i&&bp(e.ranges[r],t.ranges[r])==="equal";)r++;return r===i?"equal":"different"}}return"different"}function bp(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function pe(e){let t=1/0,i=-1/0;for(let r of e.ranges)t=Math.min(t,r[0],r[1]),i=Math.max(i,r[0],r[1]);return[t,i]}function $t(e){return typeof e=="number"&&!Number.isNaN(e)}function bo(e){return Array.isArray(e)&&e.length===2}function ro(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function vp(e,t){let i=e.at(t),r;if(i){r=i.mode;let a=i.parent;for(;!r&&a;)a&&(r=a.mode),a=a.parent}return r}function xp(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let i=!1,r=!1,a=!1,o=!1,n=!1,l=!1,s=!1,u=!1,c=!1,d=!1,h=!1,p=!1,m=!1,y=!1,M=!1,g=e[0],_=0;for(;g!=null&&g.type&&/^(subsup|placeholder)$/.test(g.type);)_+=1,g=e[_];return i=!g||g.type==="first",g&&(y=g.mode==="text",r=!y&&g.type==="mord"&&Gn.test(g.value),a=!y&&g.type==="mord"&&/\d+$/.test(g.value),o=!y&&g.isFunction,n=g.type==="genfrac",l=g.type==="surd",s=g.type==="mbin",u=g.type==="mrel",c=g.type==="mop"||g.type==="operator"||g.type==="extensible-symbol",d=g.type==="mpunct"||g.type==="minner",h=g.type==="array",p=g.type==="mopen",m=g.type==="mclose"||g.type==="leftright",M=g.type==="space"),t.after.includes("nothing")&&i||t.after.includes("letter")&&r||t.after.includes("digit")&&a||t.after.includes("function")&&o||t.after.includes("frac")&&n||t.after.includes("surd")&&l||t.after.includes("binop")&&s||t.after.includes("relop")&&u||t.after.includes("operator")&&c||t.after.includes("punct")&&d||t.after.includes("array")&&h||t.after.includes("openfence")&&p||t.after.includes("closefence")&&m||t.after.includes("text")&&y||t.after.includes("space")&&M?t.value:""}function Al(e,t,i){return i?xp(e,i[t]):""}var N0={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","∞":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","∆":"\\differentialD","∂":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","≠":"\\ne","!=":"\\ne","≥":"\\ge",">=":"\\ge","≤":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\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"},µ:"\\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",Ω:"\\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 vo(e,t){var i;let r=(i=t==null?void 0:t.format)!=null?i:"auto";return r==="auto"&&([r,e]=wp(e)),r==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",xe(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function xe(e,t){var i,r,a;if(!e)return"";let o=!1,n,l=(i=t.inlineShortcuts)!=null?i:N0;if(!o&&(e.startsWith("^")||e.startsWith("_"))&&(n=Zt(e.slice(1),{inlineShortcuts:l,noWrap:!0}),e=e[0]+"{"+n.match+"}",e+=xe(n.rest,t),o=!0),o||(n=e.match(/^(sqrt|\u221A)(.*)/),n&&(n=Zt(n[2],{inlineShortcuts:l,noWrap:!0}),e="\\sqrt{"+((r=n.match)!=null?r:"\\placeholder{}")+"}",e+=xe(n.rest,t),o=!0)),o||(n=e.match(/^(\\cbrt|\u221B)(.*)/),n&&(n=Zt(n[2],{inlineShortcuts:l,noWrap:!0}),e="\\sqrt[3]{"+((a=n.match)!=null?a:"\\placeholder{}")+"}",e+=xe(n.rest,t),o=!0)),o||(n=e.match(/^abs(.*)/),n&&(n=Zt(n[1],{inlineShortcuts:l,noWrap:!0}),e="\\left|"+n.match+"\\right|",e+=xe(n.rest,t),o=!0)),o||(n=e.match(/^["”“](.*?)["”“](.*)/),n&&(e="\\text{"+n[1]+"}",e+=xe(n[2],t),o=!0)),o||(n=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),n&&(e=qc(n[1],l),e+=xe(n[2],t),o=!0)),!o&&/^([fgh])[^a-zA-Z]/.test(e)&&(n=Zt(e.slice(1),{inlineShortcuts:l,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+n.match+"\\right)":e[0]+n.match,e+=xe(n.rest,t),o=!0),o||(n=e.match(/^([a-zA-Z]+)(.*)/),n&&(e=qc(n[1],l),e+=xe(n[2],t),o=!0)),!o)if(n=Zt(e,{inlineShortcuts:l,noWrap:!0}),n.match&&n.rest[0]==="/"){let s=Zt(n.rest.slice(1),{inlineShortcuts:l,noWrap:!0});s.match&&(e="\\frac{"+n.match+"}{"+s.match+"}"+xe(s.rest,t)),o=!0}else n.match&&(e=e.startsWith("(")?"\\left("+n.match+"\\right)"+xe(n.rest,t):n.match+xe(n.rest,t),o=!0);return o||(n=e.match(/^(\s+)(.*)$/),n&&(e=" "+xe(n[2],t),o=!0)),e}function Zt(e,t){let i="";e=e.trim();let r=e,a=e.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,l=1;for(;l<e.length&&n>0;)e[l]===a&&n++,e[l]===o&&n--,l++;n===0?(t.noWrap&&a==="("?i=xe(e.substring(1,l-1),t):(a==="{"&&o==="}"&&(a="\\{",o="\\}"),i="\\left"+a+xe(e.substring(1,l-1),t)+"\\right"+o),r=e.slice(Math.max(0,l))):(i=e.substring(1,l),r="")}else{let n=e.match(/^([a-zA-Z]+)/);if(n){let l=Al(null,e,t.inlineShortcuts);if(l)return l=l.replace("_{#?}",""),l=l.replace("^{#?}",""),{match:l,rest:e.slice(l.length)}}if(n=e.match(/^([a-zA-Z])/),n)return{match:n[1],rest:e.slice(1)};if(n=e.match(/^(-)?\d+(\.\d*)?/),n)return{match:n[0],rest:e.slice(n[0].length)};/^\\(left|right)/.test(e)||(n=e.match(/^(\\[a-zA-Z]+)/),n&&(r=e.slice(n[1].length),i=n[1]))}return{match:i,rest:r}}function qc(e,t){let i=Al(null,e,t);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=e,i}var q0=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Ll(e){let t=e.trim();for(let i of q0)if(t.startsWith(i[0])&&t.endsWith(i[1]))return[!0,t.substring(i[0].length,t.length-i[1].length)];return[!1,e]}function wp(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=Ll(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var _p="$$",kp="$$",Mp=(e,t,i)=>(q0.some(r=>t.startsWith(r[0])&&t.endsWith(r[1]))||(t=`${_p} ${t} ${kp}`),t),R0=class ao{constructor(t){ao._modes[t]=this}static onPaste(t,i,r){var a;if(!i.contentEditable&&i.userSelect==="none")return i.model.announce("plonk"),!1;if(typeof r=="string"){let n=new DataTransfer;n.setData("text/plain",r),r=n}let o=new ClipboardEvent("paste",{clipboardData:r,cancelable:!0});return(a=i.host)!=null&&a.dispatchEvent(o)?ao._modes[t].onPaste(i,r):!1}static copyToClipboard(t,i){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}let r=t.model,a=r.selectionIsCollapsed?[0,r.lastOffset]:pe(r.selection),o=r.getValue(a,i);navigator.clipboard.writeText(o).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,i){var r;if(!i.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}let a=t.model,o=a.selectionIsCollapsed?[0,a.lastOffset]:pe(a.selection),n=a.getAtoms(o);if(n.every(l=>l.mode==="text"||!l.mode))i.clipboardData.setData("text/plain",n.filter(l=>l instanceof Wr).map(l=>l.value).join(""));else if(n.every(l=>l.mode==="latex"))i.clipboardData.setData("text/plain",a.getAtoms(o,{includeChildren:!0}).map(l=>{var s;return(s=l.value)!=null?s:""}).join(""));else{let l;n.length===1&&n[0].verbatimLatex!==void 0?l=n[0].verbatimLatex:l=a.getValue(o,"latex-expanded"),i.clipboardData.setData("application/x-latex",l);try{i.clipboardData.setData("text/plain",t.options.onExport(t,l,o))}catch{}if(n.length===1){let s=n[0];(s.type==="root"||s.type==="group")&&(n=s.body.filter(u=>u.type!=="first"))}try{i.clipboardData.setData("application/json+mathlive",JSON.stringify(n.map(s=>s.toJson())))}catch{}if((r=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&r.ComputeEngine){let s=window.MathfieldElement.computeEngine;if(s)try{let u=s.jsonSerializationOptions;s.jsonSerializationOptions={metadata:["latex"]};let c=s.parse(a.getValue(o,"latex-unstyled"));s.jsonSerializationOptions=u;let d=JSON.stringify(c.json);d&&i.clipboardData.setData("application/json",d)}catch{}}}i.preventDefault()}static insert(t,i,r={}){var a;let o=r.mode==="auto"?t.mode:(a=r.mode)!=null?a:t.mode;return ao._modes[o].insert(t,i,r)}onPaste(t,i){return!1}insert(t,i,r){return!1}};R0._modes={};var J=R0,Sp=[{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+shift+/",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"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],Cp={"\\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 ui(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function Dp(e){var t,i;return(i=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?i:e.querySelector(".ML__latex-caret")}function Ar(e){let t=Dp(e);if(!t)return null;let i=t.getBoundingClientRect();return{x:i.right,y:i.bottom,height:i.height}}function Bp(e){var t;if(!e.parent)return"root";let i=(t=e.parent.id)!=null?t:"";return i+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,i}function V0(e,t,i){if(!t)return null;let r=e.field.getBoundingClientRect(),a=t.right-t.left,o=t.bottom-t.top,n=Math.ceil(t.left-r.left+e.field.scrollLeft*i),l=Math.ceil(t.top-r.top);return{left:n,right:n+a,top:l,bottom:l+o}}function H0(e){let t=e.getBoundingClientRect(),i=parseInt(getComputedStyle(e).marginRight),r={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+i};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return r;for(let a of e.children)if(a.nodeType===1&&"atomId"in a.dataset&&!a.classList.contains("pstrut")){let o=H0(a);r.left=Math.min(r.left,o.left),r.right=Math.max(r.right,o.right),r.top=Math.min(r.top,o.top),r.bottom=Math.max(r.bottom,o.bottom)}return r}function Ur(e,t){var i,r;if(!t.id)return null;let a=(r=(i=e.atomBoundsCache)==null?void 0:i.get(t.id))!=null?r:null;if(a!==null)return a;let o=e.field.querySelector(`[data-atom-id="${t.id}"]`);return a=o?H0(o):null,e.atomBoundsCache&&(a?e.atomBoundsCache.set(t.id,a):e.atomBoundsCache.delete(t.id)),a??null}function Ap(e,t,i){let r=new Map;for(let a of e.model.getAtoms(t,{includeChildren:!0})){if(i!=null&&i.excludeAtomsWithBackground&&a.style.backgroundColor)continue;let o=e.field,n=o.offsetWidth,l=Math.floor(o.getBoundingClientRect().width)/n;l=isNaN(l)?1:l;let s=V0(e,Ur(e,a),l);if(s){let u=Bp(a);if(r.has(u)){let c=r.get(u);r.set(u,{left:Math.min(c.left,s.left),right:Math.max(c.right,s.right),top:Math.min(c.top,s.top),bottom:Math.max(c.bottom,s.bottom)})}else r.set(u,s)}}return[...r.values()]}function j0(e,t){return e.model.selection.ranges.reduce((i,r)=>i.concat(...Ap(e,r,t)),[])}function El(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function W0(e){let t=0,i=0,r=e.offsetWidth,a=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,i+=e.offsetLeft,e=e.offsetParent;return new DOMRect(i,t,r,a)}var Lp=`@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), 80%, 40%));
  --_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 3px 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;
  line-height: 0.5;
  /* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
  color: var(--neutral-400);
}
.ML__composition {
  background: var(--_composition-background-color);
  color: var(--_composition-text-color);
  text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
  content: '';
  visibility: hidden;
  width: 0;
  display: inline-block;
  height: 0.76em;
  --_caret-width: clamp(2px, 0.08em, 10px);
  border: none;
  border-radius: calc(var(--_caret-width) / 2);
  border-right: var(--_caret-width) solid var(--_caret-color);
  margin-right: calc(-1 * var(--_caret-width));
  position: relative;
  left: -0.045em;
  bottom: -0.05em;
  animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
  content: '';
  visibility: hidden;
  width: 0;
  display: inline-block;
  height: 0.76em;
  --_caret-width: clamp(2px, 0.08em, 10px);
  border: none;
  border-radius: calc(var(--_caret-width) / 2);
  border-right: var(--_caret-width) solid var(--_caret-color);
  margin-right: calc(-1 * var(--_caret-width));
  position: relative;
  left: -0.045em;
  bottom: -0.05em;
  animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
  content: '';
  visibility: hidden;
  --_caret-width: clamp(2px, 0.08em, 10px);
  border: none;
  border-radius: calc(var(--_caret-width) / 2);
  border-right: var(--_caret-width) solid var(--_latex-color);
  margin-right: calc(-1 * var(--_caret-width));
  position: relative;
  left: -0.019em;
  animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
  visibility: visible;
}
.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;
}
.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 {
  box-sizing: border-box;
  background: transparent;
}
.ML__focused .ML__contains-highlight {
  background: var(--_contains-highlight-background-color);
}
.ML__raw-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;
  font-size: 0.8em;
  letter-spacing: -0.05em;
  color: var(--_latex-color);
}
.ML__suggestion {
  color: var(--neutral-500);
}
.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;
  }
}
menu [data-tooltip]::after {
  left: 100%;
  top: 0%;
}
menu .ML__base {
  cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
  /* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
  visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[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);
}
.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);
}
.variant-submenu {
  display: flex;
  flex-direction: column;
  padding: 8px;
}
.variant-submenu [part=menu-item] {
  font-size: 2rem;
  text-align: center;
  margin: 0;
}
.insert-matrix-submenu {
  display: grid;
  padding: 8px;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
  font-size: 21px;
  border: none;
  border-radius: 0;
  line-height: 21px;
  text-align: center;
  padding: 0;
  margin: 0;
}
.border-submenu [part=menu-item] {
  font-size: 2rem;
  line-height: 1.2;
  text-align: center;
}
.swatches-submenu {
  --_swatch-size: 2rem;
  --_columns: 4;
  display: flex;
  flex-flow: wrap;
  padding: 8px;
  max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
  box-sizing: border-box;
}
.menu-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: fit-content;
  height: fit-content;
  margin: 2px;
  padding: 0;
  background: var(--neutral-200);
}
.menu-swatch > .label {
  padding: 0;
  margin: 0;
  line-height: 0;
}
.menu-swatch > .label > span {
  display: inline-block;
  margin: 6px;
  min-width: var(--_swatch-size);
  min-height: var(--_swatch-size);
  border-radius: 50%;
}
.menu-swatch.active {
  background: var(--neutral-100);
  scale: 1.4;
}
.menu-swatch.active > .label > span {
  border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
  position: absolute;
  margin: 0;
  padding: 0;
  color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
  color: #000;
}
`,Ep=`.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;
}
/** The markup for a LaTeX formula, either in an editable mathfield or 
    in a static display.
*/
.ML__latex {
  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__latex .style-wrap {
  position: relative;
}
.ML__latex .mfrac {
  display: inline-block;
}
.ML__latex .left-right {
  display: inline-block;
}
.ML__latex .vlist-t {
  display: inline-table;
  table-layout: fixed;
  border-collapse: collapse;
}
.ML__latex .vlist-r {
  display: table-row;
}
.ML__latex .vlist {
  display: table-cell;
  vertical-align: bottom;
  position: relative;
}
.ML__latex .vlist > span {
  display: block;
  height: 0;
  position: relative;
}
.ML__latex .vlist > span > span {
  display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
  overflow: hidden;
  width: 0;
}
.ML__latex .vlist-t2 {
  margin-right: -2px;
}
.ML__latex .vlist-s {
  display: table-cell;
  vertical-align: bottom;
  font-size: 1px;
  width: 2px;
  min-width: 2px;
}
.ML__latex .msubsup {
  text-align: left;
}
.ML__latex .negativethinspace {
  display: inline-block;
  margin-left: -0.16667em;
  height: 0.71em;
}
.ML__latex .thinspace {
  display: inline-block;
  width: 0.16667em;
  height: 0.71em;
}
.ML__latex .mediumspace {
  display: inline-block;
  width: 0.22222em;
  height: 0.71em;
}
.ML__latex .thickspace {
  display: inline-block;
  width: 0.27778em;
  height: 0.71em;
}
.ML__latex .enspace {
  display: inline-block;
  width: 0.5em;
  height: 0.71em;
}
.ML__latex .quad {
  display: inline-block;
  width: 1em;
  height: 0.71em;
}
.ML__latex .qquad {
  display: inline-block;
  width: 2em;
  height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
  width: 0;
  position: relative;
  display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
  position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
  display: inline-block;
}
.ML__latex .llap > .inner {
  right: 0;
}
.ML__latex .rlap > .inner {
  left: 0;
}
.ML__latex .rule {
  display: inline-block;
  border: solid 0;
  position: relative;
  box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
  width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .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__latex .overline .overline-line:after,
.ML__latex .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__latex .stretchy {
  display: block;
  position: absolute;
  width: 100%;
  left: 0;
  overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
  content: '';
}
.ML__latex .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__latex .slice-1-of-2 {
  display: inline-flex;
  position: absolute;
  left: 0;
  width: 50.2%;
  overflow: hidden;
}
.ML__latex .slice-2-of-2 {
  display: inline-flex;
  position: absolute;
  right: 0;
  width: 50.2%;
  overflow: hidden;
}
.ML__latex .slice-1-of-3 {
  display: inline-flex;
  position: absolute;
  left: 0;
  width: 25.1%;
  overflow: hidden;
}
.ML__latex .slice-2-of-3 {
  display: inline-flex;
  position: absolute;
  left: 25%;
  width: 50%;
  overflow: hidden;
}
.ML__latex .slice-3-of-3 {
  display: inline-flex;
  position: absolute;
  right: 0;
  width: 25.1%;
  overflow: hidden;
}
.ML__latex .slice-1-of-1 {
  display: inline-flex;
  position: absolute;
  width: 100%;
  left: 0;
  overflow: hidden;
}
.ML__latex .nulldelimiter {
  display: inline-block;
}
.ML__latex .op-group {
  display: inline-block;
}
.ML__latex .op-symbol {
  position: relative;
}
.ML__latex .op-symbol.small-op {
  font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
  font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
  display: inline-block;
  min-width: 1px;
  box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
  display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
  text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
  text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
  text-align: left;
}
.ML__latex .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);
}
`,Kp=`#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);
}
`,Fp=`/* 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;
}
`,Tp=`/* 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);*/
}
`,zp=`.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 > .MLK__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 */
}
.MLK__rows > .MLK__row .tex {
  font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
  font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
  font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
  font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
  justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
  align-items: flex-start;
  padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
  align-items: flex-end;
  padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
  width: 0;
}
.MLK__rows > .MLK__row .w5 {
  width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
  width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
  width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
  width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
  width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
  font-size: 80%;
  padding-top: 10px;
  font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
  background: transparent;
  border: none;
  pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
  height: 6px;
  margin-top: 3px;
  margin-bottom: 0;
  width: 100%;
  border-radius: 0;
  border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
  background: var(--_toolbar-background);
  border: none;
  color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
  background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
  font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__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 > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
  background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
  background: var(--_keycap-primary-background);
  color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
  background: var(--_keycap-primary-background-hover);
  color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
  color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
  color: white;
}
.MLK__rows > .MLK__row .warning {
  background: #cd0030;
  color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
  width: 24px;
  height: 24px;
  min-height: 24px;
}
/** A regular keycap
 * Use the :where() pseudo-class to give it a very low specifity, 
 * so that it can be overriden by custom style.
 */
:where(.MLK__rows > .MLK__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;
}
:where(.MLK__rows > .MLK__row  div):hover {
  overflow: visible;
  background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row  div) .ML__latex {
  pointer-events: none;
  touch-action: none;
}
:where(.MLK__rows > .MLK__row  div) svg.svg-glyph {
  margin: 8px 0;
  width: 20px;
  height: 20px;
  min-height: 20px;
}
:where(.MLK__rows > .MLK__row  div) svg.svg-glyph-lg {
  margin: 8px 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
}
:where(.MLK__rows > .MLK__row  div).MLK__tex-math {
  font-size: 25px;
}
:where(.MLK__rows > .MLK__row  div).is-pressed {
  background: var(--_keycap-background-pressed);
  color: var(--_keycap-text-pressed);
  --_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row  div).action.is-active,
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row  div).action.is-pressed {
  z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row  div).action.is-active aside,
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row  div).action.is-pressed aside {
  display: none;
}
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row  div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row  div).action.is-pressed .MLK__shift {
  display: none;
}
:where(.MLK__rows > .MLK__row  div).shift.is-pressed,
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row  div).action.is-pressed {
  background: var(--_keycap-background-pressed);
  color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row  div).shift.is-active,
:where(.MLK__rows > .MLK__row  div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row  div).action.is-active {
  background: var(--_keycap-background-active);
  color: var(--_keycap-text-active);
  --_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row  div) small {
  color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__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__latex {
  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 > .MLK__row > div.fnbutton {
    font-size: 16px;
  }
  .MLK__rows > .MLK__row > div.bigfnbutton {
    font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
  }
  .MLK__rows > .MLK__row > div.small {
    font-size: 13px;
  }
  .MLK__rows > .MLK__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 > .MLK__row > div > small {
    font-size: 14px;
  }
}
@media (max-height: 768px) {
  .MLK__rows {
    --_keycap-height: max(var(--keycap-height, 42px), 42px);
  }
  .MLK__rows > .MLK__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));
}
`,$p=`: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: #fff8f7;
  --red-50: #fff1ef;
  --red-100: #ffeae6;
  --red-200: #ffcac1;
  --red-300: #ffa495;
  --red-400: #ff7865;
  --red-500: #f21c0d;
  --red-600: #e50018;
  --red-700: #d30024;
  --red-800: #bd002c;
  --red-900: #a1002f;
  --orange-25: #fffbf8;
  --orange-50: #fff7f1;
  --orange-100: #fff3ea;
  --orange-200: #ffe1c9;
  --orange-300: #ffcca2;
  --orange-400: #ffb677;
  --orange-500: #fe9310;
  --orange-600: #f58700;
  --orange-700: #ea7c00;
  --orange-800: #dc6d00;
  --orange-900: #ca5b00;
  --brown-25: #fff8ef;
  --brown-50: #fff1df;
  --brown-100: #ffe9ce;
  --brown-200: #ebcca6;
  --brown-300: #cdaf8a;
  --brown-400: #af936f;
  --brown-500: #856a47;
  --brown-600: #7f5e34;
  --brown-700: #78511f;
  --brown-800: #6e4200;
  --brown-900: #593200;
  --yellow-25: #fffdf9;
  --yellow-50: #fffcf2;
  --yellow-100: #fffaec;
  --yellow-200: #fff2ce;
  --yellow-300: #ffe8ab;
  --yellow-400: #ffdf85;
  --yellow-500: #ffcf33;
  --yellow-600: #f1c000;
  --yellow-700: #dfb200;
  --yellow-800: #c9a000;
  --yellow-900: #ad8a00;
  --lime-25: #f4ffee;
  --lime-50: #e9ffdd;
  --lime-100: #ddffca;
  --lime-200: #a8fb6f;
  --lime-300: #94e659;
  --lime-400: #80d142;
  --lime-500: #63b215;
  --lime-600: #45a000;
  --lime-700: #268e00;
  --lime-800: #007417;
  --lime-900: #005321;
  --green-25: #f5fff5;
  --green-50: #ebffea;
  --green-100: #e0ffdf;
  --green-200: #a7ffa7;
  --green-300: #5afa65;
  --green-400: #45e953;
  --green-500: #17cf36;
  --green-600: #00b944;
  --green-700: #00a34a;
  --green-800: #008749;
  --green-900: #00653e;
  --teal-25: #f3ffff;
  --teal-50: #e6fffe;
  --teal-100: #d9fffe;
  --teal-200: #8dfffe;
  --teal-300: #57f4f4;
  --teal-400: #43e5e5;
  --teal-500: #17cfcf;
  --teal-600: #00c2c0;
  --teal-700: #00b5b1;
  --teal-800: #00a49e;
  --teal-900: #009087;
  --cyan-25: #f7fcff;
  --cyan-50: #eff8ff;
  --cyan-100: #e7f5ff;
  --cyan-200: #c2e6ff;
  --cyan-300: #95d5ff;
  --cyan-400: #61c4ff;
  --cyan-500: #13a7ec;
  --cyan-600: #069eda;
  --cyan-700: #0095c9;
  --cyan-800: #0088b2;
  --cyan-900: #0a7897;
  --blue-25: #f7faff;
  --blue-50: #eef5ff;
  --blue-100: #e5f1ff;
  --blue-200: #bfdbff;
  --blue-300: #92c2ff;
  --blue-400: #63a8ff;
  --blue-500: #0d80f2;
  --blue-600: #0077db;
  --blue-700: #006dc4;
  --blue-800: #0060a7;
  --blue-900: #005086;
  --indigo-25: #f8f7ff;
  --indigo-50: #f1efff;
  --indigo-100: #eae7ff;
  --indigo-200: #ccc3ff;
  --indigo-300: #ac99ff;
  --indigo-400: #916aff;
  --indigo-500: #63c;
  --indigo-600: #5a21b2;
  --indigo-700: #4e0b99;
  --indigo-800: #3b0071;
  --indigo-900: #220040;
  --purple-25: #fbf7ff;
  --purple-50: #f8f0ff;
  --purple-100: #f4e8ff;
  --purple-200: #e4c4ff;
  --purple-300: #d49aff;
  --purple-400: #c36aff;
  --purple-500: #a219e6;
  --purple-600: #9000c4;
  --purple-700: #7c009f;
  --purple-800: #600073;
  --purple-900: #3d0043;
  --magenta-25: #fff8fb;
  --magenta-50: #fff2f6;
  --magenta-100: #ffebf2;
  --magenta-200: #ffcddf;
  --magenta-300: #ffa8cb;
  --magenta-400: #ff7fb7;
  --magenta-500: #eb4799;
  --magenta-600: #da3689;
  --magenta-700: #c82179;
  --magenta-800: #b00065;
  --magenta-900: #8a004c;
}
@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;
  }
}
:host([theme='dark']) {
  --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';
  --ui-font-size: 14px;
  --ui-line-height: 1.5;
  --ui-letter-spacing: 0.007em;
  --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, 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);
  }
}
:host([theme='dark']) {
  --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', '微软雅黑', SimSun, '宋体',
    STXihei, '华文细黑', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
  --ui-font-family: -apple-system, system-ui, 'Noto Sans',
    'Microsoft JhengHei UI', 'Microsoft JhengHei', '微軟正黑體', '新細明體',
    'PMingLiU', '細明體', 'MingLiU', sans-serif;
}
: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',
    '游ゴシック', '游ゴシック体', YuGothic, 'Yu Gothic', 'メイリオ', Meiryo,
    'MS Pゴシック', 'MS PGothic', sans-serif;
}
: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', '맑은 고딕', 'Apple SD Gothic Neo',
    '애플 SD 산돌고딕 Neo', 'Apple SD 산돌고딕 Neo', '돋움', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
  --ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
    'Noto Sans', 'Apple SD Gothic Neo', '애플 SD 산돌고딕 Neo',
    'Apple SD 산돌고딕 Neo', '돋움', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
  --ui-font-size: 1rem;
  --ui-line-height: 1.7;
  --ui-letter-spacing: 0;
}
:dir(rtl) {
  --ui-line-height: auto;
  --ui-letter-spacing: 0;
}
`,Pp=`.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;
  overflow: visible;
  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;
  /* The [popover] elements have a 1px solid black border. Ugh. */
  border: none;
  width: fit-content;
  height: fit-content;
}
: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: var(--ui-font-size);
  line-height: var(--ui-line-height);
  letter-spacing: var(--ui-letter-spacing);
}
: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;
  text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
  margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
  font-weight: bold;
  opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
  margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
  margin-inline-start: 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-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
  color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
  font-family: var(--ui-font-family);
  margin-inline-start: 12px;
  opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
  opacity: 0.85;
}
.ui-trailing-chevron {
  display: flex;
  margin-inline-start: 24px;
  width: 10px;
  height: 10px;
  margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
  transform: scaleX(-1);
}
.ui-checkmark {
  display: flex;
  margin-inline-end: -11px;
  margin-inline-start: -4px;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
.ui-mixedmark {
  display: flex;
  margin-inline-end: -11px;
  margin-inline-start: -4px;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
`,oi;function ci(e){let t="";switch(e){case"mathfield-element":t=`
    :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":t=Ep;break;case"mathfield":t=Lp;break;case"environment-popover":t=Kp;break;case"suggestion-popover":t=Fp;break;case"keystroke-caption":t=Tp;break;case"virtual-keyboard":t=zp;break;case"ui":t=$p;break;case"menu":t=Pp;break}return t}function $i(e){return oi||(oi={}),oi[e]||(oi[e]=new CSSStyleSheet,oi[e].replaceSync(ci(e))),oi[e]}var gt;function bt(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;let i=window.document.createElement("style");i.id=`mathlive-style-${e}`,i.append(window.document.createTextNode(ci(e))),window.document.head.appendChild(i);return}if(gt||(gt={}),((t=gt[e])!=null?t:0)!==0)gt[e]+=1;else{let i=$i(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,i],gt[e]=1}}function Nt(e){if("adoptedStyleSheets"in document&&gt!=null&&gt[e]&&(gt[e]-=1,gt[e]<=0)){let t=oi[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==t)}}var Oo=class U0 extends v{constructor(t){var i;super(b(f({},t),{type:"accent",body:(i=t.body)!=null?i:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new U0(t)}toJson(){return b(f({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var i;let r=new $({parent:t,mathstyle:"cramp"},this.style),a=(i=v.createBox(r,this.body))!=null?i:new S("▢",{style:this.style}),o=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(o=a.skew);let n=Math.min(a.height,Ot),l;if(this.svgAccent)l=io(this.svgAccent),n=r.metrics.bigOpSpacing1-n;else if(this.accent){let u=new S(this.accent,{fontFamily:"Main-Regular"});u.italic=0;let c=this.accent===8407?" ML__accent-vec":"";l=new S(new S(u),{classes:"ML__accent-body"+c})}l=new re({shift:0,children:[{box:new S(a)},-n,{box:l,marginLeft:a.left+2*o,classes:["ML__center"]}]});let s=new S(l,{type:"lift"});return this.caret&&(s.caret=this.caret),this.bind(r,s.wrap(r)),this.attachSupsub(r,{base:s})}},Io={"(":")","{":"}","[":"]","|":"|","\\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"},xo=Object.fromEntries(Object.entries(Io).map(([e,t])=>[t,e]));function No(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"∣":8739,"∥":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}[e])!=null?t:e.codePointAt(0)}function Op(e,t,i,r){var a;let o=new S(No(e),{fontFamily:"Main-Regular",isSelected:r.isSelected,classes:"ML__small-delim "+((a=r.classes)!=null?a:"")}).wrap(t);return i&&o.setTop((1-t.scalingFactor)*He),o}function J0(e,t,i,r,a){var o,n;let l=new $({parent:r,mathstyle:"textstyle"},a==null?void 0:a.style),s=new S(No(e),{fontFamily:`Size${t}-Regular`,isSelected:a.isSelected,classes:((o=a.classes)!=null?o:"")+` ML__delim-size${t}`,type:(n=a.type)!=null?n:"ignore"}).wrap(l);return i&&s.setTop((1-l.scalingFactor)*He),s}function X0(e,t,i,r,a){var o;let n,l,s,u;n=s=u=No(e),l=null;let c="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?s=n=u=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?s=n=u=8741:e==="\\uparrow"?s=u=9168:e==="\\Uparrow"?s=u=8214:e==="\\downarrow"?n=s=9168:e==="\\Downarrow"?n=s=8214:e==="\\updownarrow"?(n=8593,s=9168,u=8595):e==="\\Updownarrow"?(n=8657,s=8214,u=8659):e==="["||e==="\\lbrack"?(n=9121,s=9122,u=9123,c="Size4-Regular"):e==="]"||e==="\\rbrack"?(n=9124,s=9125,u=9126,c="Size4-Regular"):e==="\\lfloor"||e==="⌊"?(s=n=9122,u=9123,c="Size4-Regular"):e==="\\lceil"||e==="⌈"?(n=9121,s=u=9122,c="Size4-Regular"):e==="\\rfloor"||e==="⌋"?(s=n=9125,u=9126,c="Size4-Regular"):e==="\\rceil"||e==="⌉"?(n=9124,s=u=9125,c="Size4-Regular"):e==="("||e==="\\lparen"?(n=9115,s=9116,u=9117,c="Size4-Regular"):e===")"||e==="\\rparen"?(n=9118,s=9119,u=9120,c="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(n=9127,l=9128,u=9129,s=9130,c="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(n=9131,l=9132,u=9133,s=9130,c="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(n=9127,u=9129,s=9130,c="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(n=9131,u=9133,s=9130,c="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(n=9127,u=9133,s=9130,c="Size4-Regular"):e==="\\rmoustache"||e==="⎱"?(n=9131,u=9129,s=9130,c="Size4-Regular"):e==="\\surd"?(n=57345,u=9143,s=57344,c="Size4-Regular"):e==="\\ulcorner"?(n=9484,s=u=32):e==="\\urcorner"?(n=9488,s=u=32):e==="\\llcorner"?(u=9492,s=n=32):e==="\\lrcorner"&&(n=9496,s=n=32);let d=Ii(n,c),h=d.height+d.depth,p=Ii(s,c),m=p.height+p.depth,y=Ii(u,c),M=y.height+y.depth,g=0,_=1;if(l!==null){let te=Ii(l,c);g=te.height+te.depth,_=2}let D=h+M+g,w=Math.max(0,Math.ceil((t-D)/(_*m))),L=D+w*_*m,K=He;i&&(K=K*r.scalingFactor);let E=L/2-K,I=.008,V=[];V.push({box:new S(u,{fontFamily:c})}),V.push(-I);let C=new S(s,{fontFamily:c});if(l===null)for(let te=0;te<w;te++)V.push({box:C});else{for(let te=0;te<w;te++)V.push({box:C});V.push(-I),V.push({box:new S(l,{fontFamily:c})}),V.push(-I);for(let te=0;te<w;te++)V.push({box:C})}V.push(-I),V.push({box:new S(n,{fontFamily:c})});let Se="";c==="Size1-Regular"?Se=" delim-size1":c==="Size4-Regular"&&(Se=" delim-size4");let je=new re({bottom:E,children:V},{classes:Se});return new S(je,b(f({},a??{}),{classes:((o=a==null?void 0:a.classes)!=null?o:"")+" ML__delim-mult"}))}var G0=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","⌊","⌋","⌈","⌉"]),Ip=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","⟮","⟯","⎰","⎱"]),Z0=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Np=[0,1.2,1.8,2.4,3];function qp(e,t,i,r){return e===void 0||e==="."?bi(i,r.classes):(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),G0.has(e)||Z0.has(e)?J0(e,t,!1,i,r):Ip.has(e)?X0(e,Np[t],!1,i,r):null)}var Rp=[{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}],Vp=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Hp=[{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 jp(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(e.type,"Size4-Regular")}function Wp(e,t,i,r){let a={"-4":0,"-3":1,0:2}[r.mathstyle.sizeDelta];for(let o=a;o<i.length&&i[o].type!=="stack";o++){let n=Ii(e,jp(i[o]));if(n.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let l=n.height+n.depth;if(i[o].type==="small"&&(i[o].mathstyle==="scriptscriptstyle"?l*=Math.max(Qn[Math.max(1,r.size-2)],r.minFontScale):i[o].mathstyle==="scriptstyle"&&(l*=Math.max(Qn[Math.max(1,r.size-1)],r.minFontScale))),l>t)return i[o]}return i[i.length-1]}function wo(e,t,i,r,a,o){if(!t||t.length===0||t===".")return bi(a);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let n;Z0.has(t)?n=Rp:G0.has(t)?n=Hp:n=Vp;let l=Wp(No(t),i,n,a),s=new $({parent:a,mathstyle:l.mathstyle},o==null?void 0:o.style);return l.type==="small"?Op(t,s,r,b(f({},o),{type:e})):l.type==="large"?J0(t,l.size,r,s,b(f({},o),{type:e})):(l.type,X0(t,i,r,s,b(f({},o),{type:e})))}function qr(e,t,i,r,a,o){if(t===".")return bi(a,o==null?void 0:o.classes);let n=He*a.scalingFactor,l=901,s=5/Qi,u=Math.max(i-n,r+n),c=Math.max(u/500*l,2*u-s);return wo(e,t,c,!0,a,o)}function bi(e,t){let i=new S(null,{classes:" nulldelimiter "+(t??""),type:"ignore"});return i.width=e.getRegisterAsEm("nulldelimiterspace"),i.wrap(new $({parent:e,mathstyle:"textstyle"}))}var vt=class Y0 extends v{constructor(t){var i;super({type:"placeholder",command:"\\placeholder",mode:(i=t==null?void 0:t.mode)!=null?i:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new Y0(t)}toJson(){return super.toJson()}render(t){let i;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?i=t.renderPlaceholder(t):i=this.createBox(t),this.caret&&(i.classes+=" ML__placeholder-selected"),i}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},Q0=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ed=["cases","dcases","rcases"],td=["align","align*","aligned","gather","gathered","split"],Up=["array","subequations","eqnarray"];function Jp(e){return Up.concat(td).concat(ed).concat(Q0).includes(e)}function id(e){return Q0.includes(e)}function Xp(e){return ed.includes(e)}function Gp(e){return td.includes(e)}function Zp(e,t,i){let r=0;for(let u of i)"align"in u&&(r+=1);let a=0,o=[];for(let u of t){let c=0;for(a=Math.max(a,Math.min(u.length,r));c<u.length;){let d=[],h=Math.min(u.length,c+r);for(;c<h;){let p=u[c];p.length===0?d.push([new v({type:"first",mode:e.mode})]):p[0].type!=="first"?d.push([new v({type:"first",mode:e.mode}),...p]):(p.slice(1).some(m=>m.type==="first"),d.push(p)),c+=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 n=[];for(let u of o){if(u.length!==a)for(let c=u.length;c<a;c++)u.push([new v({type:"first",mode:e.mode}),new vt]);n.push(u)}let l=0,s=0;for(let u of n){s=0;for(let c of u){for(let d of c)d.parent=e,d.parentBranch=[l,s];s+=1}l+=1}return e.isDirty=!0,n}var R=class rd extends v{constructor(t,i,r,a={}){var o;super({type:"array"}),this.environmentName=t,this.rowGaps=r,a.mathstyleName&&(this.mathstyleName=a.mathstyleName),a.columns&&(a.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=a.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=Zp(this,i,this.colFormat),a.leftDelim&&(this.leftDelim=a.leftDelim),a.rightDelim&&(this.rightDelim=a.rightDelim),a.arraycolsep!==void 0&&(this.arraycolsep=a.arraycolsep),this.colSeparationType=a.colSeparationType,a.arraystretch!==void 0&&(this.arraystretch=a.arraystretch),this.minColumns=(o=a.minColumns)!=null?o:1}static fromJson(t){return new rd(t.environmentName,t.array,t.rowGaps,t)}toJson(){let t=b(f({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(i=>i.map(r=>r.map(a=>a.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var i;if(yo(t))return(i=this.array[t[0]][t[1]])!=null?i:void 0}createBranch(t){var i;return yo(t)?(this.isDirty=!0,(i=this.branch(t))!=null?i:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(ai(t))return super.removeBranch(t);let i=this.branch(t);return this.array[t[0]][t[1]]=void 0,i.forEach(r=>{r.parent=void 0,r.parentBranch=void 0}),i[0].type,i.shift(),this.isDirty=!0,i}get hasChildren(){return this.children.length>0}get children(){let t=[];for(let i of this.array)for(let r of i)if(r)for(let a of r)t.push(...a.children),t.push(a);return[...t,...super.children]}render(t){var i,r,a,o,n,l;let s=new $({parent:t,mathstyle:this.mathstyleName},this.style),u=s.getRegisterAsEm("arrayrulewidth"),c=s.getRegisterAsEm("arraycolsep"),d=s.getRegisterAsEm("doublerulesep"),h=(r=(i=this.arraystretch)!=null?i:s.getRegisterAsNumber("arraystretch"))!=null?r:1,p=typeof this.arraycolsep=="number"?this.arraycolsep:c;this.colSeparationType==="small"&&(p=.2778*(new $({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));let m=h*Yh,y=.7*m,M=.3*m,g=0,_=[],D=0,w=this.array.length;for(let j=0;j<w;++j){let Q=this.array[j];D=Math.max(D,Q.length);let ae=new $({parent:s,mathstyle:this.mathstyleName},this.style),We=y/ae.scalingFactor,Ue=M/ae.scalingFactor,Je={cells:[],height:0,depth:0,pos:0};for(let Ie of Q){let Xo=(a=v.createBox(ae,Ie,{type:"ignore"}))!=null?a:new S(null,{type:"ignore"});Ue=Math.max(Ue,Xo.depth),We=Math.max(We,Xo.height),Je.cells.push(Xo)}let Xe=(o=$0(this.rowGaps[j]))!=null?o:0;Xe>0&&(Xe+=M,Ue=Math.max(Ue,Xe),Xe=0),j<w-1&&!id(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Ue+=s.getRegisterAsEm("jot")),Je.height=We,Je.depth=Ue,g+=We,Je.pos=g,g+=Ue+Xe,_.push(Je)}let L=g/2+He,K=[];for(let j=0;j<D;j++){let Q=[];for(let ae of _){let We=ae.cells[j];We.depth=ae.depth,We.height=ae.height,Q.push({box:We,shift:ae.pos-L})}Q.length>0&&K.push(new re({individualShift:Q}))}let E=[],I=!1,V=!1,C=0,Se=!this.leftDelim,{colFormat:je}=this;for(let j of je){if("align"in j&&C>=K.length)break;if("align"in j)I?E.push(Va(2*p)):(V||Se)&&E.push(Va(p)),E.push(new S(K[C],{classes:"col-align-"+j.align})),C++,I=!0,V=!1,Se=!1;else if("gap"in j){if(typeof j.gap=="number")E.push(Va(j.gap));else{let Q=Yp(t,_,L,j.gap);Q&&E.push(Q)}I=!1,V=!1,Se=!1}else if("separator"in j){let Q=new S(null,{classes:"vertical-separator"});Q.height=g,Q.setStyle("height",g,"em"),Q.setStyle("border-right",`${u}em ${j.separator} currentColor`),Q.setStyle("vertical-align",-(g-L),"em");let ae=0;V?ae=d-u:I&&(ae=p-u),Q.left=ae,E.push(Q),I=!1,V=!0,Se=!1}}I&&!this.rightDelim&&E.push(Va(p));let te=new S(E,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(te.caret=this.caret),this.bind(t,te);let wt=te.height,Ce=te.depth,be=this.bind(t,new S([this.bind(t,qr("open",(n=this.leftDelim)!=null?n:".",wt,Ce,s,{isSelected:this.isSelected})),te,this.bind(t,qr("close",(l=this.rightDelim)!=null?l:".",wt,Ce,s,{isSelected:this.isSelected}))],{type:"ord"}));return be?(be.setStyle("display","inline-block"),this.caret&&(be.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:be}))):null}_serialize(t){var i;let r=[];if(this.environmentName==="lines"?r.push("{\\displaylines"):r.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(r.push("{"),this.colFormat!==void 0)for(let a of this.colFormat)"align"in a&&typeof a.align=="string"?r.push(a.align):"separator"in a&&a.separator==="solid"?r.push("|"):"separator"in a&&a.separator==="dashed"&&r.push(":");r.push("}")}for(let a=0;a<this.array.length;a++){for(let o=0;o<this.array[a].length;o++)o>0&&r.push(" & "),r.push(v.serialize(this.array[a][o],t));if(a<this.array.length-1){let o=this.rowGaps[a];o!=null&&o.dimension?r.push(`\\\\[${o.dimension} ${(i=o.unit)!=null?i:"pt"}] `):r.push("\\\\ ")}}return this.environmentName==="lines"?r.push("}"):r.push(`\\end{${this.environmentName}}`),P(r)}getCell(t,i){return this.array[t][i]}setCell(t,i,r){this.type==="array"&&Array.isArray(this.array)&&this.array[t][i];for(let o of this.array[t][i])o.parent=void 0,o.parentBranch=void 0;let a=r;(r.length===0||r[0].type!=="first")&&(a=[new v({type:"first",mode:this.mode}),...r]),this.array[t][i]=a;for(let o of a)o.parent=this,o.parentBranch=[t,i];this.isDirty=!0}addRowBefore(t){this.type==="array"&&Array.isArray(this.array);let i=[];for(let r=0;r<this.colCount;r++)i.push(Ra(this));this.array.splice(t,0,i);for(let r=t;r<this.rowCount;r++)for(let a=0;a<this.colCount;a++){let o=this.array[r][a];if(o)for(let n of o)n.parentBranch=[r,a]}this.isDirty=!0}addRowAfter(t){this.type==="array"&&Array.isArray(this.array);let i=[];for(let r=0;r<this.colCount;r++)i.push(Ra(this));this.array.splice(t+1,0,i);for(let r=t+1;r<this.rowCount;r++)for(let a=0;a<this.colCount;a++){let o=this.array[r][a];if(o)for(let n of o)n.parentBranch=[r,a]}this.isDirty=!0}removeRow(t){this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t;let i=this.array.splice(t,1);for(let r of i)for(let a of r)if(a)for(let o of a)o.parent=void 0,o.parentBranch=void 0;for(let r=t;r<this.rowCount;r++)for(let a=0;a<this.colCount;a++){let o=this.array[r][a];if(o)for(let n of o)n.parentBranch=[r,a]}this.isDirty=!0}addColumnBefore(t){this.type==="array"&&Array.isArray(this.array);for(let i of this.array)i.splice(t,0,Ra(this));for(let i=0;i<this.rowCount;i++)for(let r=t;r<this.colCount;r++){let a=this.array[i][r];if(a)for(let o of a)o.parentBranch=[i,r]}this.isDirty=!0}addColumnAfter(t){this.type==="array"&&Array.isArray(this.array);for(let i of this.array)i.splice(t+1,0,Ra(this));for(let i=0;i<this.rowCount;i++)for(let r=t+1;r<this.colCount;r++){let a=this.array[i][r];if(a)for(let o of a)o.parentBranch=[i,r]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){this.type==="array"&&Array.isArray(this.array)&&this.colCount>t;for(let i of this.array){let r=i.splice(t,1);for(let a of r)if(a)for(let o of a)o.parent=void 0,o.parentBranch=void 0}for(let i=0;i<this.rowCount;i++)for(let r=t;r<this.colCount;r++){let a=this.array[i][r];if(a)for(let o of a)o.parentBranch=[i,r]}this.isDirty=!0}get cells(){let t=[];for(let i of this.array)for(let r of i)r&&t.push(r.filter(a=>a.type!=="first"));return t}};function Ra(e){let t=new v({type:"first",mode:e.mode});t.parent=e;let i=new vt;return i.parent=e,[t,i]}function Va(e){let t=new S(null,{classes:"arraycolsep"});return t.width=e,t}function Yp(e,t,i,r){if(!r)return null;let a=[];for(let o of t){let n=v.createBox(e,r,{type:"ignore"});n&&(n.depth=o.depth,n.height=o.height,a.push({box:n,shift:o.pos-i}))}return new re({individualShift:a}).wrap(e)}var qt=class ad extends v{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new ad(t)}toJson(){return b(f({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var i,r,a,o;let n=v.createBox(t,this.body,{type:"lift"});if(!n)return null;let l=t.toEm((i=this.offset)!=null?i:{dimension:0});n.depth+=l,n.setStyle("display","inline-block"),n.setStyle("position","relative"),n.setStyle("height",Math.floor(100*n.height+n.depth)/100,"em"),n.setStyle("vertical-align",-Math.floor(100*n.height)/100,"em");let s=new $({parent:t},this.style),u=s.toEm((r=this.padding)!=null?r:{register:"fboxsep"}),c=new S(null,{classes:"ML__box"});c.height=n.height+u,c.depth=n.depth+u,c.setStyle("box-sizing","border-box"),c.setStyle("position","absolute"),c.setStyle("top",-u+.3,"em"),c.setStyle("left",0),c.setStyle("height",c.height+c.depth,"em"),c.setStyle("width","100%"),this.backgroundcolor&&c.setStyle("background-color",(a=s.toColor(this.backgroundcolor))!=null?a:"transparent"),this.framecolor&&c.setStyle("border",`${s.getRegisterAsEm("fboxrule",2)}em solid ${(o=s.toColor(this.framecolor))!=null?o:"black"}`),this.border&&c.setStyle("border",this.border);let d=new S([c,n],{type:"lift"});return d.setStyle("display","inline-block"),d.setStyle("position","relative"),d.setStyle("line-height",0),d.height=n.height+u+(l>0?l:0),d.depth=n.depth+u+(l<0?-l:0),d.setStyle("padding-left",u,"em"),d.setStyle("padding-right",u,"em"),d.setStyle("height",Math.floor(100*(n.height+n.depth+2*u+Math.abs(l)))/100,"em"),d.setStyle("margin-top",-u,"em"),d.setStyle("top",Math.floor(100*(n.depth-n.height+2*u-l))/100,"em"),d.setStyle("vertical-align",Math.floor(100*(n.depth+2*u))/100,"em"),this.caret&&(d.caret=this.caret),this.attachSupsub(t,{base:d})}_serialize(t){return t.skipStyles?P([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},od=class nd extends v{constructor(t,i){var r;super({type:"composition",mode:(r=i==null?void 0:i.mode)!=null?r:"math",value:t})}static fromJson(t){return new nd(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){let i=new S(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,i),this.caret&&(i.caret=this.caret),i}_serialize(t){return""}},ni=class ld extends v{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new ld(t.command)}toJson(){return super.toJson()}render(t){let i=this.createBox(t,{classes:"ML__error"});return this.caret&&(i.caret=this.caret),i}},sd=class ud extends v{constructor(t,i,r){super({type:"group",mode:i,style:r}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new ud(t.body,t.mode,t.style)}render(t){let i=v.createBox(t,this.body,{type:this.boxType});return i?(this.caret&&(i.caret=this.caret),this.bind(t,i)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,t):`{${this.bodyToLatex(t)}}`}},Z=class cd extends v{constructor(t,i,r){super({type:"leftright",style:r.style,displayContainsHighlight:!0}),this.variant=t,this.body=i,this.leftDelim=r.leftDelim,this.rightDelim=r.rightDelim}static fromJson(t){var i;return new cd((i=t.variant)!=null?i:"",t.body,t)}toJson(){let t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var i,r;let a=this.matchingRightDelim();return this.variant==="left...right"?P(["\\left",(i=this.leftDelim)!=null?i:".",this.bodyToLatex(t),"\\right",a]):this.variant==="mleft...mright"?P(["\\mleft",(r=this.leftDelim)!=null?r:".",this.bodyToLatex(t),"\\mright",a]):P([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),a])}matchingRightDelim(){var t,i;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;let r=(t=this.leftDelim)!=null?t:".";return(i=Io[r])!=null?i:r}render(t){var i,r;let a=new $({parent:t},this.style);this.body;let o=new $({parent:t,mathstyle:"textstyle"},this.style),n=(i=v.createBox(a,this.body,{type:"inner"}))!=null?i:new S(null,{type:"inner"}),l=n.height/o.scalingFactor,s=n.depth/o.scalingFactor,u=[];if(this.leftDelim&&u.push(this.bind(o,qr("open",this.leftDelim,l,s,o,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),n&&(dd(n.children,this,a,l,s),u.push(n)),this.rightDelim){let p=this.containsCaret?" ML__contains-caret":"",m=this.rightDelim;m==="?"&&(a.smartFence?(m=this.matchingRightDelim(),p+=" ML__smart-fence__close"):m="."),u.push(this.bind(o,qr("close",m,l,s,o,{isSelected:this.isSelected,classes:p+" ML__close",mode:this.mode,style:this.style})))}let c=this.variant==="mleft...mright",d=this.leftSibling;d&&(!c&&d.isFunction&&(c=!0),!c&&d.type==="subsup"&&(r=d.leftSibling)!=null&&r.isFunction&&(c=!0));let h=new S(u,{type:c?"close":"inner",classes:"left-right"});return h.setStyle("margin-top",`${-n.depth}em`),h.setStyle("height",`${n.height+n.depth}em`),this.caret&&(h.caret=this.caret),this.bind(a,h.wrap(a))}};function dd(e,t,i,r,a){if(e)for(let o=0;o<e.length;o++){let n=e[o];n.type==="middle"?(e[o]=t.bind(i,qr("inner",n.value,r,a,i,{isSelected:t.isSelected})),e[o].caret=n.caret,e[o].isSelected=n.isSelected,e[o].cssId=n.cssId,e[o].htmlData=n.htmlData,e[o].htmlStyle=n.htmlStyle,e[o].attributes=n.attributes,e[o].cssProperties=n.cssProperties):n.children&&dd(n.children,t,i,r,a)}}var hd=class pd extends v{constructor(t,i){var r;super({type:"macro",command:t,style:i.style}),this.body=i.body,i.captureSelection===void 0?i.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=i.captureSelection,this.macroArgs=i.args,this.expand=(r=i.expand)!=null?r:!1}static fromJson(t){return new pd(t.command,t)}toJson(){let t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var i;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((i=this.macroArgs)!=null?i:"")}render(t){let i=v.createBox(t,this.body);return i?(this.caret&&(i.caret=this.caret),this.bind(t,i)):null}},Qp=class md extends v{constructor(){super({type:"macro-argument"})}static fromJson(t){return new md}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},fd=class gd extends v{constructor(t,i,r=!1,a,o){var n;super({type:"prompt",mode:(n=o==null?void 0:o.mode)!=null?n:"math",style:o==null?void 0:o.style,command:"\\placeholder"}),this.body=a,this.correctness=i,this.placeholderId=t,this.locked=r,this.captureSelection=this.locked}static fromJson(t){return new gd(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){let t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(i=>i.type!=="first").map(i=>i.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){let i=new $({parent:t}),r=i.getRegisterAsEm("fboxsep"),a=r,o=r,n=v.createBox(t,this.body);if(!n)return null;n.height||(n.height=i.metrics.xHeight),n.setStyle("vertical-align",-n.height,"em"),this.correctness==="correct"?n.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&n.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");let l=new S(n,{type:"ord"});l.setStyle("display","inline-block"),l.setStyle("height",n.height+n.depth,"em"),l.setStyle("vertical-align",-o,"em");let s="ML__prompt ";this.locked?s+=" ML__lockedPromptBox ":s+=" ML__editablePromptBox ",this.correctness==="correct"?s+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(s+=" ML__incorrectPromptBox "),this.containsCaret&&(s+=" ML__focusedPromptBox ");let u=new S(null,{classes:s,attributes:{part:"prompt"}});u.height=l.height+o,u.depth=l.depth+o,u.width=l.width+2*a,u.setStyle("box-sizing","border-box"),u.setStyle("position","absolute"),u.setStyle("height",l.height+l.depth+2*o,"em"),a===0&&u.setStyle("width","100%"),a!==0&&(u.setStyle("width",`calc(100% + ${2*a}em)`),u.setStyle("top",r,"em"),u.setStyle("left",-a,"em")),(!this.body||this.body.length===1)&&(u.width=3*a,u.setStyle("width",`calc(100% + ${3*a}em)`),u.setStyle("left",-1.5*a,"em"));let c="";this.correctness==="incorrect"&&(c+='<line x1="3%"  y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),c&&(u.svgOverlay=c);let d=new S([u,l],{classes:"ML__prompt-atom"});return d.setStyle("position","relative"),d.setStyle("display","inline-block"),d.setStyle("line-height",0),d.height=l.height+o+.2,d.depth=l.depth+o,d.left=a,d.right=a,d.setStyle("height",l.height+o,"em"),d.setStyle("top",l.depth-l.height,"em"),d.setStyle("vertical-align",l.depth+o,"em"),d.setStyle("margin-left",.5,"em"),d.setStyle("margin-right",.5,"em"),this.caret&&(d.caret=this.caret),this.bind(i,this.attachSupsub(t,{base:d}))}_serialize(t){var i;let r=(i=this.bodyToLatex(t))!=null?i:"";if(t.skipPlaceholders)return r;let a="\\placeholder";return this.placeholderId&&(a+=`[${this.placeholderId}]`),this.correctness==="correct"?a+="[correct]":this.correctness==="incorrect"&&(a+="[incorrect]"),this.locked&&(a+="[locked]"),G(a,r)}},qo=class yd extends v{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){let i=new yd(t);for(let r of er)t[r]&&i.setChildren(t[r],r);return i}render(t){var i;let r=new $({parent:t,isPhantom:!0}),a=this.leftSibling,o=(i=a.render(r))!=null?i:new S(null),n=new S(null);return n.height=o.height,n.depth=o.depth,this.attachSupsub(t,{base:n,isCharacterBox:a.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function Ki(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var bd=class{constructor(e,t,i){this.errors=[],this.index=0,this.endCount=0;var r,a,o,n;i!=null||(i={}),this.tokens=e,this.context=t instanceof $&&!(i!=null&&i.parseMode)&&!i.mathstyle?t:new $({from:t,mathstyle:i.mathstyle},i.style),this.args=(r=i.args)!=null?r:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(a=i.style)!=null?a:{},parseMode:(o=i.parseMode)!=null?o:"math",mathstyle:(n=i.mathstyle)!=null?n:"displaystyle",tabular:!1}}beginContext(e){var t,i,r;let a=this.parsingContext,o={parent:a,mathlist:[],style:f({},a.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:a.parseMode,mathstyle:(i=e==null?void 0:e.mathstyle)!=null?i:a.mathstyle,tabular:(r=e==null?void 0:e.tabular)!=null?r:!1};this.parsingContext=o}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(f({before:Gt(this.tokens.slice(this.index,this.index+10)),after:Gt(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 f({},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.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new qo({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;let{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){let i=he(this.tokens[t],this.parseMode);return!i||i.definitionType==="symbol"||i.ifMode&&!i.ifMode.includes(this.parseMode)?!1:(e=i.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;let e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;let t=(e=this.args)==null?void 0:e.call(this,"?");return t?ye(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new vt({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){let t=this.index,i=this.end(),r="";for(;!i;){let o=this.get();Ki(o)?(r+=o,i=this.end()||r.length>=e.length):i=!0}let a=e.toUpperCase()===r.toUpperCase();return a||(this.index=t),a}scanString(){let e="";for(;!this.end();){let t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(Ki(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),i=1;for(;!t;){let r=this.get();r==="<space>"?e+=" ":r==="<{>"?(e+="{",i+=1):r==="<}>"?(i-=1,i>0?e+="}":this.index-=1):r==="<$>"?e+="$":r==="<$$>"?e+="$$":e+=r,t=i===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",i=1;for(;i>0&&!this.end();){let r=this.get();r==="<}>"?(i-=1,i>0&&(t+="}")):r==="<{>"?(i+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(r)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[r])!=null?e:r)}return t}scanNumber(e=!0){var t,i;let r=!1,a=this.peek();for(;a==="<space>"||a==="+"||a==="-";)this.get(),a==="-"&&(r=!r),a=this.peek();e=!!e;let o=10,n=/\d/;if(this.match("'"))o=8,n=/[0-7]/,e=!0;else if(this.match('"'))o=16,n=/[\dA-F]/,e=!0;else if(this.match("x"))o=16,n=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return a=this.get(),a?a.length===2&&a.startsWith("\\")?{number:(r?-1:1)*((t=a.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(r?-1:1)*((i=a.codePointAt(0))!=null?i:0),base:"alpha"}:null;let l="";for(;this.hasPattern(n);)l+=this.get();if(!e&&(this.match(".")||this.match(",")))for(l+=".";this.hasPattern(n);)l+=this.get();let s=e?Number.parseInt(l,o):Number.parseFloat(l);return Number.isNaN(s)?null:{number:r?-s:s,base:o===16?"hexadecimal":o===8?"octal":"decimal"}}scanRegister(){var e;let t=this.index,i=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return i;let r=!1;if(i===null)for(;;){let o=this.peek();if(o==="-")r=!r;else if(o!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();let o=this.get();return o.startsWith("\\")?i?{register:o,global:!0,factor:(r?-1:1)*i.number}:r?{register:o,global:!0,factor:-1}:{register:o,global:!0}:(this.index=t,null)}let a=this.get();return a!=null&&a.startsWith("\\")?(a=a.substring(1),this.context.registers[a]?!r||i!==null?{register:a,factor:(r?-1:1)*((e=i==null?void 0:i.number)!=null?e:1)}:{register:a}:(this.index=t,null)):(this.index=t,null)}scanValue(){let e=this.scanRegister();if(e)return e;let t=this.index,i=this.scanGlueOrDimen();if(i&&("unit"in i||"glue"in i&&"unit"in i.glue))return i;this.index=t;let r=this.scanNumber();if(r)return r;if(this.end()||!Ki(this.peek()))return null;let a=this.scanString();return a.length>0?{string:a}:null}scanDimen(){let e=this.scanNumber(!1);if(e===null)return null;let t=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:t,unit:i}:{dimension:t}}scanGlueOrDimen(){let e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;let t={glue:e};if(this.matchKeyword("plus")){let i=this.scanDimen();if(i)t.grow=i;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){let i=this.scanDimen();if(i)t.shrink=i;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();let e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){let t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(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 t=this.scan(i=>i===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});let t=this.scan(i=>i===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;let e=this.scanArgument("string");if(!e)return null;let t=Jh(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;let i=[];if(t.params)for(let l of t.params)if(l.isOptional)i.push(this.scanOptionalArgument(l.type));else{let s=this.scanArgument(l.type);s||this.onError({code:"missing-argument",arg:e}),i.push(s)}this.beginContext({tabular:t.tabular});let r=[],a=[],o=[],n=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),n=!0),!n&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),n=!0),!n)if(this.matchColumnSeparator())o.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){o.push(this.mathlist),this.mathlist=[];let l=null;this.skipWhitespace(),this.match("[")&&(l=this.scanDimen(),this.skipWhitespace(),this.match("]")),a.push(l??{dimension:0}),r.push(o),o=[]}else this.mathlist.push(...this.scan(l=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(l)));while(!n);return o.push(this.mathlist),o.length>0&&r.push(o),this.endContext(),t.createAtom(e,r,a,i)}scanExpression(){let e=this.mathlist;if(this.mathlist=[],this.parseExpression()){let t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=n=>n==="<}>");let t="",i=null,r=[],a=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),i=he(t,"math"),i&&(r=this.scanArguments(i)[1]),a=this.mathlist,this.mathlist=[]):this.parseExpression();let o;return t?(r.unshift(this.mathlist),a&&r.unshift(a),o=[i.createAtom({command:t,args:r,style:this.style,mode:this.parseMode})]):o=this.mathlist,this.endContext(),o}scanGroup(){let e=this.index;if(!this.match("<{>"))return null;let t=this.scan(r=>r==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});let i=new sd(t,this.parseMode,this.style);return i.verbatimLatex=Gt(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 t=new Z("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();let e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Ki(e)&&!e.startsWith("\\"))return null;this.next();let t=he(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.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 e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new ni("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ni("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}let i=this.scanDelim();if(!i)return this.onError({code:"unexpected-delimiter"}),new ni(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();let r=this.mathlist;this.endContext();let a=(e=this.scanDelim())!=null?e:".";return new Z(t==="\\right"?"left...right":"mleft...mright",r,{leftDelim:i,rightDelim:a,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;let t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new v({type:"mord",command:"\\doubleprime",mode:"math",value:"′′"}),"superscript"):t.addChild(new v({type:"mord",command:"\\prime",mode:"math",value:"′"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(B(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;let e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),i=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!i)return!1;let r=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return r===null?!1:(r.explicitSubsupPlacement=!0,e&&(r.subsupPlacement="over-under"),t&&(r.subsupPlacement="adjacent"),i&&(r.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t,i=[],r=e.infix?2:0;for(;r<e.params.length;){let a=e.params[r];a.type==="rest"?i.push(this.scan(o=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(o))):a.isOptional?i.push(this.scanOptionalArgument(a.type)):a.type.endsWith("*")?t=a.type.slice(0,-1):i.push(this.scanArgument(a.type)),r+=1}return[t,i]}scanSymbolOrLiteral(){let e=this.peek();if(!e)return null;this.next();let t;if(Ki(e)){let i=Le.createAtom(this.parseMode,e,f({},this.style));return i?[i]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){let i=he(e,this.parseMode);if(!i)return this.onError({code:"unknown-command",arg:e}),[new ni(e)];if(i.definitionType==="symbol"){let r=f({},this.style);i.variant&&(r.variant=i.variant),t=new v({type:i.type,command:e,style:r,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 ni(e)];i.createAtom&&(t=i.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();let i=this.parseMode;if(e==="auto"&&(e=i),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==i&&this.beginContext({mode:"math"});let a=this.scanSymbolOrLiteral();return e!==i&&this.endContext(),a}if(e==="text"){e!==i&&this.beginContext({mode:"text"});let a=this.scanSymbolOrLiteral();return e!==i&&this.endContext(),a}return null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let a=this.mathlist;return this.endContext(),{group:a}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let a=this.mathlist;return this.endContext(),{group:a}}let r=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());let a=this.mathlist;return this.endContext(),{group:a}}return e==="string"?r=this.scanString():e==="balanced-string"?r=this.scanBalancedString():e==="colspec"?r=this.scanColspec():e==="value"&&(r=this.scanValue()),this.skipUntilToken("<}>"),r}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){let i={},r=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(let a of r){let o=a.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(o)i.padding={dimension:parseInt(o[1]),unit:o[2]};else{let n=a.match(/^\s*border\s*:\s*(.*)/);n?i.border=n[1]:i.backgroundcolor={string:a}}}t=i}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(i=>i==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,i,r;if(e==="\\placeholder"){let l=this.scanOptionalArgument("string"),s=this.scanOptionalArgument("math"),u=v.serialize(s,{defaultMode:"math"}),c=[],d;!d&&u==="correct"?d="correct":!d&&u==="incorrect"?d="incorrect":u!==""&&(c=s);let h=this.scanOptionalArgument("string")==="locked",p=this.scanArgument("auto"),m;return p&&Array.isArray(p)&&p.length>0?m=p:p&&typeof p=="object"&&"group"in p?m=p.group:m=c,l?[new fd(l,d,h,m??c,{mode:this.parseMode,style:this.style})]:[new vt({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){let l=this.index,s=this.scanLiteralGroup()||this.next();if(!s)return null;if(this.context.registers[s.substring(1)]){let u=this.scanArgument("string");u!==null&&(this.context.registers[s.substring(1)]=u);let c=P([e,Gt(this.tokens.slice(l,this.index))]);return[new v({type:"text",value:"",verbatimLatex:c})]}}let a=this.scanMacro(e);if(a)return[a];let o=he(e,this.parseMode);if(!o)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(l=>new v({type:"text",value:l,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new ni(e)]);let n=this.index;if(o.definitionType==="symbol"){let l=f({},this.style);o.variant&&(l.variant=o.variant),a=new v({type:o.type,command:e,style:l,value:String.fromCodePoint(o.codepoint),mode:this.parseMode})}else{if(o.ifMode&&!o.ifMode.includes(this.parseMode))return[];let l=this.parseMode;o.applyMode&&(this.parseMode=o.applyMode);let s,u=[];if(o.parse?u=o.parse(this):[s,u]=this.scanArguments(o),this.parseMode=l,o.applyMode&&!o.applyStyle&&!o.createAtom)return B(u[0]);if(o.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof o.createAtom=="function")a=o.createAtom({command:e,args:u,style:this.style,mode:this.parseMode}),s&&(a.body=B(this.scanArgument(s)));else if(typeof o.applyStyle=="function"){let c=f(f({},this.style),o.applyStyle(e,u,this.context)),d=this.parseMode;if(o.applyMode&&(this.parseMode=o.applyMode),s){let h=this.style;this.style=c;let p=this.scanArgument(s);return this.style=h,this.parseMode=d,B(p)}this.style=c}else a=new v({type:"mord",command:(i=o.command)!=null?i:e,style:f({},this.style),value:e,mode:(r=o.applyMode)!=null?r:this.parseMode})}if(!a)return null;if(a instanceof v&&a.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){let l=P([e,Gt(this.tokens.slice(n,this.index))]);l&&(a.verbatimLatex=l)}if(a.verbatimLatex===null&&(a.verbatimLatex=void 0),a.isFunction&&this.smartFence){let l=this.scanSmartFence();if(l)return[a,l]}return[a]}scanSymbolCommandOrLiteral(){let e=this.get();if(!e)return null;if(Ki(e)){let t=Le.createAtom(this.parseMode,e,f({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){let i=this.scanSmartFence();if(i)return[t,i]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new Wr(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;let i=this.context.getMacro(e);if(!i)return null;let r=this.index,a=i.args,o={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let n=1;n<=a;n++){let l=this.scanLiteralGroup();if(!l){let s=this.index;this.scanExpression(),l=Gt(this.tokens.slice(s,this.index))}o[n]=l}return new hd(e,{expand:i.expand,captureSelection:i.captureSelection,args:r===this.index?null:Gt(this.tokens.slice(r,this.index)),style:this.parsingContext.style,body:ye(i.def,{context:this.context,parseMode:this.parseMode,args:n=>o[n],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,i,r;let a=(r=(i=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?i:this.scanGroup())!=null?r:this.scanLeftRight();if(a===null){if(this.parseSupSub()||this.parseLimits())return!0;a=this.scanSymbolCommandOrLiteral()}return a?(Array.isArray(a)?this.mathlist.push(...a):this.mathlist.push(a),!0):!1}};function ye(e,t){var i,r,a,o;let n=(i=t==null?void 0:t.args)!=null?i:void 0,l=new bd(fo(e,n),t==null?void 0:t.context,{args:n,mathstyle:(r=t==null?void 0:t.mathstyle)!=null?r:"displaystyle",parseMode:(a=t==null?void 0:t.parseMode)!=null?a:"math",style:(o=t==null?void 0:t.style)!=null?o:{}}),s=[];for(;!l.end();)s.push(...l.scan(()=>!1));return s}function vd(e,t){var i;let r=new bd(fo(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(i=t==null?void 0:t.parseMode)!=null?i:"math"});for(;!r.end();)r.scan();return r.errors}var xd=class wd extends v{constructor(t,i){super({type:"chem"},{command:t,mode:"math"});let r=X.go(k.go(i,t==="\\pu"?"pu":"ce"),!1);this.body=ye(r),this._verbatimLatex=t+"{"+i+"}",this.arg=i,this.captureSelection=!0}static fromJson(t){return new wd(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return b(f({},super.toJson()),{arg:this.arg})}render(t){let i=v.createBox(t,this.body,{type:"inner"});return this.caret&&(i.caret=this.caret),this.bind(t,i)}_serialize(t){return this.verbatimLatex,this.verbatimLatex}};x(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new xd(e.command,(t=e.args[0])!=null?t:"")}});var k={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var i="0",r={};r.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var a,o=10,n=[];;){a!==e?(o=10,a=e):o--;var l=k.stateMachines[t],s=l.transitions[i]||l.transitions["*"];e:for(var u=0;u<s.length;u++){var c=k.patterns.match_(s[u].pattern,e);if(c){for(var d=s[u].task,h=0;h<d.action_.length;h++){var p;if(l.actions[d.action_[h].type_])p=l.actions[d.action_[h].type_](r,c.match_,d.action_[h].option);else if(k.actions[d.action_[h].type_])p=k.actions[d.action_[h].type_](r,c.match_,d.action_[h].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+d.action_[h].type_+")"];k.concatArray(n,p)}if(i=d.nextState||i,e.length>0){if(d.revisit||(e=c.remainder),!d.toContinue)break e}else return n}}if(o<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=k.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var i=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return i?{match_:i[0],remainder:e.substr(i[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return k.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return k.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return k.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return k.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return k.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return k.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return k.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return k.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return k.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return k.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return k.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return k.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return k.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\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(e){return k.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return k.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return k.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return k.patterns.findObserveGroups(e,"",/^\\[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(e){return k.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return k.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return k.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return k.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return k.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return k.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return k.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return k.patterns.findObserveGroups(e,"\\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(e){var t;if(t=e.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))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var i=k.patterns.findObserveGroups(e,"","$","$","");return i&&(t=i.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,i,r,a,o,n,l,s,u){var c=function(g,_){if(typeof _=="string")return g.indexOf(_)!==0?null:_;var D=g.match(_);return D?D[0]:null},d=function(g,_,D){for(var w=0;_<g.length;){var L=g.charAt(_),K=c(g.substr(_),D);if(K!==null&&w===0)return{endMatchBegin:_,endMatchEnd:_+K.length};if(L==="{")w++;else if(L==="}"){if(w===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];w--}_++}return null},h=c(e,t);if(h===null||(e=e.substr(h.length),h=c(e,i),h===null))return null;var p=d(e,h.length,r||a);if(p===null)return null;var m=e.substring(0,r?p.endMatchEnd:p.endMatchBegin);if(o||n){var y=this.findObserveGroups(e.substr(p.endMatchEnd),o,n,l,s);if(y===null)return null;var M=[m,y.match_];return{match_:u?M.join(""):M,remainder:y.remainder}}else return{match_:m,remainder:e.substr(p.endMatchEnd)}},match_:function(e,t){var i=k.patterns.patterns[e];if(i===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof i=="function")return k.patterns.patterns[e](t);var r=t.match(i);if(r){var a;return r[2]?a=[r[1],r[2]]:r[1]?a=r[1]:a=r[0],{match_:a,remainder:t.substr(r[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,i){return{type_:i}},"insert+p1":function(e,t,i){return{type_:i,p1:t}},"insert+p1+p2":function(e,t,i){return{type_:i,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return k.go(t,"text")},"{text}":function(e,t){var i=["{"];return k.concatArray(i,k.go(t,"text")),i.push("}"),i},"tex-math":function(e,t){return k.go(t,"tex-math")},"tex-math tight":function(e,t){return k.go(t,"tex-math tight")},bond:function(e,t,i){return{type_:"bond",kind_:i||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return k.go(t)},"1/2":function(e,t){var i=[];t.match(/^[+\-]/)&&(i.push(t.substr(0,1)),t=t.substr(1));var r=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return r[1]=r[1].replace(/\$/g,""),i.push({type_:"frac",p1:r[1],p2:r[2]}),r[3]&&(r[3]=r[3].replace(/\$/g,""),i.push({type_:"tex-math",p1:r[3]})),i},"9,9":function(e,t){return k.go(t,"9,9")}},createTransitions:function(e){var t,i,r,a,o={};for(t in e)for(i in e[t])for(r=i.split("|"),e[t][i].stateArray=r,a=0;a<r.length;a++)o[r[a]]=[];for(t in e)for(i in e[t])for(r=e[t][i].stateArray||[],a=0;a<r.length;a++){var n=e[t][i];if(n.action_){n.action_=[].concat(n.action_);for(var l=0;l<n.action_.length;l++)typeof n.action_[l]=="string"&&(n.action_[l]={type_:n.action_[l]})}else n.action_=[];for(var s=t.split("|"),u=0;u<s.length;u++)if(r[a]==="*")for(var c in o)o[c].push({pattern:s[u],task:n});else o[r[a]].push({pattern:s[u],task:n})}return o},stateMachines:{}};k.stateMachines={ce:{transitions:k.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"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(e,t){var i;if((e.d||"").match(/^[0-9]+$/)){var r=e.d;e.d=void 0,i=this.output(e),e.b=r}else i=this.output(e);return k.actions["o="](e,t),i},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var i=[];return k.concatArray(i,this.output(e)),k.concatArray(i,k.actions.bond(e,t,"-")),i}else e.d=t},"- after o/d":function(e,t,i){var r=k.patterns.match_("orbital",e.o||""),a=k.patterns.match_("one lowercase greek letter $",e.o||""),o=k.patterns.match_("one lowercase latin letter $",e.o||""),n=k.patterns.match_("$one lowercase latin letter$ $",e.o||""),l=t==="-"&&(r&&r.remainder===""||a||o||n);l&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!r&&o&&(e.o="$"+e.o+"$");var s=[];return l?(k.concatArray(s,this.output(e)),s.push({type_:"hyphen"})):(r=k.patterns.match_("digits",e.d||""),i&&r&&r.remainder===""?(k.concatArray(s,k.actions["d="](e,t)),k.concatArray(s,this.output(e))):(k.concatArray(s,this.output(e)),k.concatArray(s,k.actions.bond(e,t,"-")))),s},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:k.go(t,"o")}},comma:function(e,t){var i=t.replace(/\s*$/,""),r=i!==t;return r&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:i}:{type_:"comma enumeration M",p1:i}},output:function(e,t,i){var r;if(!e.r)r=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!i||(e.sb&&r.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&i!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&k.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),r.push({type_:"chemfive",a:k.go(e.a,"a"),b:k.go(e.b,"bd"),p:k.go(e.p,"pq"),o:k.go(e.o,"o"),q:k.go(e.q,"pq"),d:k.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var a;e.rdt==="M"?a=k.go(e.rd,"tex-math"):e.rdt==="T"?a=[{type_:"text",p1:e.rd||""}]:a=k.go(e.rd);var o;e.rqt==="M"?o=k.go(e.rq,"tex-math"):e.rqt==="T"?o=[{type_:"text",p1:e.rq||""}]:o=k.go(e.rq),r={type_:"arrow",r:e.r,rd:a,rq:o}}for(var n in e)n!=="parenthesisLevel"&&n!=="beginsWithBond"&&delete e[n];return r},"oxidation-output":function(e,t){var i=["{"];return k.concatArray(i,k.go(t,"oxidation")),i.push("}"),i},"frac-output":function(e,t){return{type_:"frac-ce",p1:k.go(t[0]),p2:k.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:k.go(t[0]),p2:k.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:k.go(t[0]),p2:k.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:k.go(t[0]),p2:k.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:k.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,i){return{type_:"operator",kind_:i||t}}}},a:{transitions:k.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:k.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:k.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(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var i in e)delete e[i];return t}}}},pq:{transitions:k.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(e,t){return{type_:"state of aggregation subscript",p1:k.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:k.go(t[1],"pq")}}}},bd:{transitions:k.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(e,t){return{type_:"color",color1:t[0],color2:k.go(t[1],"bd")}}}},oxidation:{transitions:k.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:k.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var i in e)delete e[i];return t}}}},"tex-math tight":{transitions:k.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var i in e)delete e[i];return t}}}},"9,9":{transitions:k.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:k.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(e,t){var i=[];return t[0]==="+-"||t[0]==="+/-"?i.push("\\pm "):t[0]&&i.push(t[0]),t[1]&&(k.concatArray(i,k.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?k.concatArray(i,k.go(t[2],"pu-9,9")):i.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?i.push({type_:"cdot"}):i.push({type_:"times"}))),t[5]&&i.push("10^{"+t[5]+"}"),i},"number^":function(e,t){var i=[];return t[0]==="+-"||t[0]==="+/-"?i.push("\\pm "):t[0]&&i.push(t[0]),k.concatArray(i,k.go(t[1],"pu-9,9")),i.push("^{"+t[2]+"}"),i},operator:function(e,t,i){return{type_:"operator",kind_:i||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,i=k.patterns.match_("{(...)}",e.d||"");i&&i.remainder===""&&(e.d=i.match_);var r=k.patterns.match_("{(...)}",e.q||"");if(r&&r.remainder===""&&(e.q=r.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:k.go(e.d,"pu"),q:k.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:a.d,p2:a.q}:(t=a.d,a.d.length>1||a.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),k.concatArray(t,a.q))}else t=k.go(e.d,"pu-2");for(var o in e)delete e[o];return t}}},"pu-2":{transitions:k.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(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var i=k.patterns.match_("{(...)}",e.rm||"");i&&i.remainder===""?t=k.go(i.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var r in e)delete e[r];return t}}},"pu-9,9":{transitions:k.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(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var i=e.text_.length%3;i===0&&(i=3);for(var r=e.text_.length-3;r>0;r-=3)t.push(e.text_.substr(r,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,i)),t.reverse()}else t.push(e.text_);for(var a in e)delete e[a];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var i=e.text_.length-3,r=0;r<i;r+=3)t.push(e.text_.substr(r,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(r))}else t.push(e.text_);for(var a in e)delete e[a];return t}}}};var X={go:function(e,t){if(!e)return"";for(var i="",r=!1,a=0;a<e.length;a++){var o=e[a];typeof o=="string"?i+=o:(i+=X._go2(o),o.type_==="1st-level escape"&&(r=!0))}return!t&&!r&&i&&(i="{"+i+"}"),i},_goInner:function(e){return e&&X.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var i={a:X._goInner(e.a),b:X._goInner(e.b),p:X._goInner(e.p),o:X._goInner(e.o),q:X._goInner(e.q),d:X._goInner(e.d)};i.a&&(i.a.match(/^[+\-]/)&&(i.a="{"+i.a+"}"),t+=i.a+"\\,"),(i.b||i.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(i.b||"")+"}}_{\\hphantom{"+(i.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(i.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(i.p||"")+"}}}"),i.o&&(i.o.match(/^[+\-]/)&&(i.o="{"+i.o+"}"),t+=i.o),e.dType==="kv"?((i.d||i.q)&&(t+="{\\vphantom{X}}"),i.d&&(t+="^{"+i.d+"}"),i.q&&(t+="_{\\smash[t]{"+i.q+"}}")):e.dType==="oxidation"?(i.d&&(t+="{\\vphantom{X}}",t+="^{"+i.d+"}"),i.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+i.q+"}}")):(i.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+i.q+"}}"),i.d&&(t+="{\\vphantom{X}}",t+="^{"+i.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+X._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+X._goInner(e.p1);break;case"bond":if(t=X._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var r="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+r+"}{"+r+"}{"+r+"}{"+r+"}";break;case"pu-frac":var a="\\frac{"+X._goInner(e.p1)+"}{"+X._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+X._goInner(e.p1)+"}{"+X._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+X._goInner(e.p1)+"}{"+X._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+X._goInner(e.p1)+"}{"+X._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+X._goInner(e.p1)+"}_{"+X._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+X._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var o={rd:X._goInner(e.rd),rq:X._goInner(e.rq)},n=X._getArrow(e.r);o.rd||o.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(n="\\long"+n,o.rd&&(n="\\overset{"+o.rd+"}{"+n+"}"),o.rq&&(e.r==="<-->"?n="\\underset{\\lower2mu{"+o.rq+"}}{"+n+"}":n="\\underset{\\lower6mu{"+o.rq+"}}{"+n+"}"),n=" {}\\mathrel{"+n+"}{} "):(o.rq&&(n+="[{"+o.rq+"}]"),n+="{"+o.rd+"}",n=" {}\\mathrel{\\x"+n+"}{} "):n=" {}\\mathrel{\\long"+n+"}{} ",t=n;break;case"operator":t=X._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"→":return"rightarrow";case"⟶":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"⇌":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){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(e){switch(e){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."]}}},_d=class kd extends v{constructor(t){super(b(f({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new kd(t)}toJson(){return b(f({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new S(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,t):G(this.command,this.value)}},Md=class Sd extends v{constructor(t){super(b(f({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new Sd(t)}toJson(){return b(f({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let i=qp(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return i?(i=this.bind(t,i),this.caret&&(i.caret=this.caret),i):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);return i!=null&&i.serialize?i.serialize(this,t):G(this.command,this.value)}},Jr=class Cd extends v{constructor(t,i,r,a){var o,n;super({type:"enclose",command:t,style:a.style}),this.body=i,this.backgroundcolor=a.backgroundcolor,r.updiagonalarrow&&(r.updiagonalstrike=!1),r.box&&(r.left=!1,r.right=!1,r.bottom=!1,r.top=!1),this.notation=r,this.shadow=(o=a.shadow)!=null?o:"none",this.strokeWidth=(n=a.strokeWidth)!=null?n:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=a.strokeStyle,this.svgStrokeStyle=a.svgStrokeStyle,this.strokeColor=a.strokeColor,this.borderStyle=a.borderStyle,this.padding=a.padding,this.captureSelection=!1}static fromJson(t){return new Cd(t.command,t.body,t.notation,t)}toJson(){return b(f({},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(t){var i;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let r=he(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);let a=(i=this.command)!=null?i:"";if(this.command==="\\enclose"){a+="{"+Object.keys(this.notation).join(" ")+"}";let o="",n="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(o+=n+'mathbackground="'+this.backgroundcolor+'"',n=","),this.shadow&&this.shadow!=="auto"&&(o+=n+'shadow="'+this.shadow+'"',n=","),this.strokeWidth||this.strokeStyle!=="solid"?(o+=n+this.borderStyle,n=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(o+=n+'mathcolor="'+this.strokeColor+'"',n=","),o&&(a+=`[${o}]`)}return G(a,this.bodyToLatex(t))}render(t){let i=new $({parent:t},this.style),r=v.createBox(i,this.body);if(!r)return null;let a=em(this.borderStyle),o=i.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});r.setStyle("position","relative"),r.setStyle("display","inline-block"),r.setStyle("top",o,"em"),r.setStyle("height",r.height+r.depth,"em"),r.setStyle("width",r.width,"em");let n=new S(null,{classes:"ML__notation"}),l=r.height+r.depth+2*o,s=r.width+2*o,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(o.toString(),(o+r.depth+r.height).toString(),(o+r.width).toString(),o.toString());let h=1,p=.03*Math.sqrt(s*s+l*l)*h,m=r.width*p,y=(r.depth+r.height)*p,M=o+r.width,g=o;g+y-.4*m<0&&(g=.4*m-y),u+='<polygon points="',u+=`${M},${g} ${M-m-.4*y},${g+y-.4*m} `,u+=`${M-.7*m},${g+.7*y} ${M-m+.4*y},${g+y+.4*m} `,u+=`${M},${g}`,u+=`" stroke='none' fill="${this.strokeColor}"`,u+="/>"}let c=0;if(this.notation.phasorangle){let h=Rc(i),p=(r.height+r.depth+2*h+o).toString(),m=(r.height+r.depth)/2;u+=this.line(o.toString(),p,(o+m+r.width).toString(),p),u+=this.line(o.toString(),p,(o+m).toString(),(o-h).toString()),l+=h,c=m,r.left+=l/2-o}if(this.notation.longdiv){let h=Rc(i);l+=h,u+=this.line(o.toString(),o.toString(),(o+r.width).toString(),o.toString());let p=.3;c=p+h,r.left+=p+h,r.setTop(o+h),u+='<path d="',u+=`M ${o} ${o}  a${p} ${(r.depth+r.height+2*h)/2}, 0, 1, 1, 0 ${r.depth+r.height+2*h} "`,u+=` stroke-width="${tm(i)}" stroke="${this.strokeColor}" fill="none"`,u+="/>"}if(n.width=r.width+2*o+c,n.height=r.height+o,n.depth=r.depth+o,n.setStyle("box-sizing","border-box"),n.setStyle("left",`calc(-${a} / 2 )`),n.setStyle("height",`${Math.floor(100*l)/100}em`),n.setStyle("top",`calc(${a} / 2 )`),this.backgroundcolor&&n.setStyle("background-color",this.backgroundcolor),this.notation.box&&n.setStyle("border","1px solid red"),this.notation.actuarial&&(n.setStyle("border-top",this.borderStyle),n.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(n.setStyle("border-bottom",this.borderStyle),n.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(n.setStyle("border-radius","8px"),n.setStyle("border",this.borderStyle)),this.notation.circle&&(n.setStyle("border-radius","50%"),n.setStyle("border",this.borderStyle)),this.notation.top&&n.setStyle("border-top",this.borderStyle),this.notation.left&&n.setStyle("border-left",this.borderStyle),this.notation.right&&n.setStyle("border-right",this.borderStyle),this.notation.bottom&&n.setStyle("border-bottom",this.borderStyle),u){let h="";this.shadow==="auto"&&(h+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(h+=`filter: drop-shadow(${this.shadow})`),h+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,h+=' stroke-linecap="round"',this.svgStrokeStyle&&(h+=` stroke-dasharray="${this.svgStrokeStyle}"`),n.svgStyle=h,n.svgOverlay=u}let d=new S([n,r]);return d.setStyle("position","relative"),d.setStyle("vertical-align",o,"em"),d.setStyle("height",`${Math.floor(100*(r.height+r.depth+2*o))/100}em`),d.setStyle("display","inline-block"),d.height=n.height,d.depth=n.depth,d.width=n.width-2*o,d.left=o,d.right=o,this.caret&&(d.caret=this.caret),d.wrap(i)}line(t,i,r,a){return`<line x1="${Ha(t)}"  y1="${Ha(i)}" x2="${Ha(r)}" y2="${Ha(a)}" vector-effect="non-scaling-stroke"></line>`}};function Ha(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function em(e){if(!e)return"1px";let t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function tm(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function Rc(e){let t=e.isDisplayStyle?Ot:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var ar=class Dd extends v{constructor(t,i,r){var a,o;super(b(f({},r),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=i,this.hasBarLine=(a=r==null?void 0:r.hasBarLine)!=null?a:!0,this.continuousFraction=(o=r==null?void 0:r.continuousFraction)!=null?o:!1,this.numerPrefix=r==null?void 0:r.numerPrefix,this.denomPrefix=r==null?void 0:r.denomPrefix,this.mathstyleName=r==null?void 0:r.mathstyleName,this.leftDelim=r==null?void 0:r.leftDelim,this.rightDelim=r==null?void 0:r.rightDelim,this.fractionNavigationOrder=r==null?void 0:r.fractionNavigationOrder}static fromJson(t){return new Dd(t.above,t.below,t)}toJson(){let t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),f(f({},super.toJson()),t)}get children(){if(this._children)return this._children;let t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(let i of this.below)t.push(...i.children),t.push(i);for(let i of this.above)t.push(...i.children),t.push(i)}else{for(let i of this.above)t.push(...i.children),t.push(i);for(let i of this.below)t.push(...i.children),t.push(i)}return this._children=t,t}render(t){var i,r;let a=new $({parent:t,mathstyle:this.mathstyleName},this.style),o=a.metrics,n=new $({parent:a,mathstyle:this.continuousFraction?"":"numerator"},this.style),l=this.numerPrefix?new S([new S(this.numerPrefix),v.createBox(n,this.above)],{isTight:n.isTight,type:"ignore"}):(i=v.createBox(n,this.above,{type:"ignore"}))!=null?i:new S(null,{type:"ignore"}),s=new $({parent:a,mathstyle:this.continuousFraction?"":"denominator"},this.style),u=this.denomPrefix?new S([new S(this.denomPrefix),v.createBox(s,this.below,{type:"ignore"})]):(r=v.createBox(s,this.below,{type:"ignore"}))!=null?r:new S(null,{type:"ignore"}),c=this.hasBarLine?o.defaultRuleThickness:0,d,h=0,p;a.isDisplayStyle?(d=n.metrics.num1,h=c>0?3*c:7*c,p=s.metrics.denom1):(c>0?(d=n.metrics.num2,h=c):(d=n.metrics.num3,h=3*o.defaultRuleThickness),p=s.metrics.denom2);let m=[];this.isSelected&&m.push("ML__selected");let y=l.depth,M=u.height,g;if(c<=0){let E=d-y-(M-p);E<h&&(d+=(h-E)/2,p+=(h-E)/2),g=new re({individualShift:[{box:l,shift:-d,classes:[...m,"ML__center"]},{box:u,shift:p,classes:[...m,"ML__center"]}]}).wrap(a)}else{let E=new S(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});E.softWidth=Math.max(l.width,u.width),E.height=c/2,E.depth=c/2;let I=He+c/2;d<h+y+I&&(d=h+y+I);let V=He-c/2;p<h+M-V&&(p=h+M-V),g=new re({individualShift:[{box:u,shift:p,classes:[...m,"ML__center"]},{box:E,shift:-V,classes:m},{box:l,shift:-d,classes:[...m,"ML__center"]}]}).wrap(a)}let _=a.isDisplayStyle?o.delim1:o.delim2,D=this.leftDelim?this.bind(t,wo("open",this.leftDelim,_,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):bi(a,"open"),w=null;this.continuousFraction?w=new S(null,{type:"close"}):this.rightDelim?w=this.bind(t,wo("close",this.rightDelim,_,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):w=bi(a,"close");let L=new S([D,g,w],{isTight:a.isTight,type:"inner",classes:"mfrac"}),K=this.bind(t,L);return this.caret&&(K.caret=this.caret),this.attachSupsub(t,{base:K})}},se=class Bd extends v{constructor(t,i){var r;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(r=i==null?void 0:i.isSuggestion)!=null?r:!1,this.isError=!1}static fromJson(t){let i=new Bd(t.value);return t.isSuggestion&&(i.isSuggestion=!0),t.isError&&(i.isError=!0),i}toJson(){let t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),f({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){let i=new S(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return i?(this.caret&&(i.caret=this.caret),this.bind(t,i)):null}},Er=class Ad extends v{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(i=>new se(i)),this.skipBoundary=!1}static fromJson(t){return new Ad("")}toJson(){return super.toJson()}render(t){let i=v.createBox(t,this.body);return i?(this.caret&&(i.caret=this.caret),this.bind(t,i)):null}_serialize(t){var i,r;return(r=(i=this.body)==null?void 0:i.map(a=>a.value).join(""))!=null?r:""}},Kl=class Ld extends v{constructor(t,i){super(b(f({},i),{type:"extensible-symbol",isFunction:i==null?void 0:i.isFunction})),this.value=t,this.variant=i==null?void 0:i.variant,this.subsupPlacement=i==null?void 0:i.limits}static fromJson(t){return new Ld(t.symbol,t)}toJson(){let t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var i;let r=t.isDisplayStyle&&this.value!=="\\smallint",a=new S(this.value,{fontFamily:r?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(r?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!a)return null;a.right=a.italic;let o=(a.height-a.depth)/2-He*t.scalingFactor,n=a.italic;a.setTop(o);let l=a;if(this.superscript||this.subscript){let s=(i=this.subsupPlacement)!=null?i:"auto";l=s==="over-under"||s==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:a,baseShift:o,slant:n}):this.attachSupsub(t,{base:a})}return new S(this.bind(t,l),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,t);let r=[];return r.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&r.push("\\limits"),this.subsupPlacement==="adjacent"&&r.push("\\nolimits"),this.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(this.supsubToLatex(t)),P(r)}},vi=class Ed extends v{constructor(t){let i=t.body;super(b(f({},t),{type:"overlap",body:typeof i=="string"?[new v({value:i})]:i,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new Ed(t)}toJson(){let t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),f(f({},super.toJson()),t)}render(t){let i=v.createBox(t,this.body,{classes:"inner"});return i?(this.caret&&(i.caret=this.caret),this.bind(t,new S([i,new S(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Oe=class Kd extends v{constructor(t){var i,r,a,o;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(i=t.skipBoundary)!=null?i:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(r=t.boxType)!=null?r:"ord",this.paddedBody=(a=t.paddedBody)!=null?a:!1,this.paddedLabels=(o=t.paddedLabels)!=null?o:!1}static fromJson(t){return new Kd(t)}toJson(){let t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let i=this.svgBody?io(this.svgBody):v.createBox(t,this.body,{type:"ignore"}),r=new $({parent:t,mathstyle:"scriptstyle"},this.style),a=null;this.svgAbove?a=io(this.svgAbove):this.above&&(a=v.createBox(r,this.above,{type:"ignore"}));let o=null;this.svgBelow?o=io(this.svgBelow):this.below&&(o=v.createBox(r,this.below,{type:"ignore"})),this.paddedBody&&(i=new S([bi(t,"open"),i,bi(t,"close")],{type:"ignore"}));let n=im(t,{base:i,above:a,below:o,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return n?(this.subsupPlacement==="over-under"?n=this.attachLimits(t,{base:n,type:n.type}):n=this.attachSupsub(t,{base:n}),this.caret&&(n.caret=this.caret),this.bind(t,n)):null}};function im(e,t){if(!t.base)return null;if(!t.above&&!t.below){let l=new S(t.base,{type:t.type});return l.setStyle("position","relative"),l}let i=0;t.above&&(i=e.metrics.bigOpSpacing5);let r=null,a=t.base,o=0,n=["ML__center"];if(t.paddedAboveBelow&&n.push("ML__label_padding"),t.below&&t.above){let l=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+a.depth+o;r=new re({bottom:l,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:n},{box:a,classes:["ML__center"]},i,{box:t.above,classes:n},e.metrics.bigOpSpacing5]})}else t.below?r=new re({top:a.height-o,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:n},{box:a,classes:["ML__center"]}]}):t.above&&(r=new re({bottom:a.depth+o,children:[{box:a,classes:["ML__center"]},i,{box:t.above,classes:n},e.metrics.bigOpSpacing5]}));return new S(r,{type:t.type})}var Xr=class Fd extends v{constructor(t){var i,r,a,o;super(b(f({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(i=t.isInvisible)!=null?i:!1,this.smashDepth=(r=t.smashDepth)!=null?r:!1,this.smashHeight=(a=t.smashHeight)!=null?a:!1,this.smashWidth=(o=t.smashWidth)!=null?o:!1}static fromJson(t){return new Fd(t)}toJson(){let t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),f(f({},super.toJson()),t)}render(t){let i=new $({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return this.isInvisible,v.createBox(i,this.body,{classes:"inner"});let r=v.createBox(this.isInvisible?i:t,this.body);if(!r)return null;if(this.smashWidth){let a=new S(null,{classes:"fix"});return new S([r,a],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return r;if(this.smashHeight&&(r.height=0),this.smashDepth&&(r.depth=0),r.children)for(let a of r.children)this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0);return new re({firstBaseline:[{box:r}]},{type:r.type}).wrap(t)}},Gr=class Td extends v{constructor(t){var i;super(f({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(i=t==null?void 0:t.braced)!=null?i:!1}static fromJson(t){return new Td(t)}toJson(){let t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var i;if(this.command==="space")return new S(this.mode==="math"?null:" ");let r;if(this.width!==void 0)r=new S(null,{classes:"mspace"}),r.left=t.toEm(this.width);else{let a=(i={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?i:"mediumspace";r=new S(null,{classes:a})}return r=this.bind(t,r),this.caret&&(r.caret=this.caret),r}_serialize(t){var i;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let r=he(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);let a=(i=this.command)!=null?i:"";return this.width===void 0?a:this._braced&&!("register"in this.width)?`${a}{${ce(this.width)}}`:`${a}${ce(this.width)}`}},zd=class $d extends v{constructor(t){var i;super(b(f({},t),{type:"surd",mode:(i=t.mode)!=null?i:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new $d(b(f({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,t);let r=this.command,a=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?G(`${r}[${this.aboveToLatex(t)}]`,a):/^[0-9]$/.test(a)?`${r}${a}`:G(r,a)}get children(){if(this._children)return this._children;let t=[];if(this.above)for(let i of this.above)t.push(...i.children),t.push(i);if(this.body)for(let i of this.body)t.push(...i.children),t.push(i);return this._children=t,t}render(t){var i;let r=new $({parent:t,mathstyle:"cramp"},this.style),a=(i=v.createBox(r,this.body,{type:"inner"}))!=null?i:new S(null),o=r.scalingFactor,n=r.metrics.defaultRuleThickness/o,l=t.isDisplayStyle?Ot:n,s=new S(null,{classes:"ML__sqrt-line",style:this.style});s.height=n,s.softWidth=a.width;let u=o*(n+l/4),c=Math.max(o*2*l,a.height+a.depth)+u+n,d=new $({parent:t},this.style),h=this.bind(d,new S(wo("inner","\\surd",c,!1,d,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!h)return null;let p=h.height+h.depth-n;p>a.height+a.depth+u&&(u=(u+p-(a.height+a.depth))/2),h.setTop(h.height-a.height-u);let m=this.bind(t,new re({firstBaseline:[{box:new S(a)},u-2*n,{box:s},n]})),y=v.createBox(new $({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!y){let _=new S([h,m],{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(t,_)}let M=new re({shift:-.6*(Math.max(h.height,m.height)-Math.max(h.depth,m.depth)),children:[{box:y}]}),g=new S([new S(M,{classes:"ML__sqrt-index",type:"ignore"}),h,m],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return g.height=h.height,g.depth=h.depth,this.caret&&(g.caret=this.caret),this.bind(t,g)}},rm=class extends S{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function oo(e,t){if(!e.parent)return;let i=e.parent.children,r=i.indexOf(e),a=r-1;for(;a>=0&&i[a].type==="ignore";)a-=1;if(a<0&&e.parent.parent&&e.parent.type==="lift"){oo(e.parent,t);return}r>0&&i[r-1].type==="skip"?i[r-1].width+=t:i.splice(r,0,new rm(t))}var am={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}},om={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function nm(e){Kr(e,(t,i)=>{i.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(i.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(i.type)&&(t.type="ord"),i.type!=="ignore"&&(t=i)})}function Zr(e,t){if(!e.children)return e;let i=e.children;nm(i);let r=t.getRegisterAsEm("thinmuskip"),a=t.getRegisterAsEm("medmuskip"),o=t.getRegisterAsEm("thickmuskip");return Kr(i,(n,l)=>{var s,u,c;if(!n)return;let d=n.type,h=l.isTight?(s=om[d])!=null?s:null:(u=am[d])!=null?u:null,p=(c=h==null?void 0:h[l.type])!=null?c:null;p===3&&oo(l,r),p===4&&oo(l,a),p===5&&oo(l,o)}),e}function Kr(e,t,i=void 0){if(!e)return i;e=[...e];for(let r of e)r.type==="lift"?i=Kr(r.children,t,i):r.type==="ignore"?Kr(r.children,t):(t(i,r),Kr(r.children,t),i=r);return i}var Fl=class Pd extends v{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new v({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new Pd(b(f({},t),{tooltip:It(t.tooltip)}))}toJson(){var t;let i=(t=this.tooltip.body)==null?void 0:t.filter(r=>r.type!=="first").map(r=>r.toJson());return b(f({},super.toJson()),{tooltip:i})}render(t){let i=v.createBox(new $,this.body);if(!i)return null;let r=new $({parent:t,mathstyle:"displaystyle"},{fontSize:Cl}),a=zo(Zr(new S(this.tooltip.render(r),{classes:"ML__tooltip-content"}),r)),o=new S([a,i],{classes:"ML__tooltip-container"});return this.caret&&(o.caret=this.caret),this.bind(t,o)}},xi=class Od extends v{constructor(t,i){super(b(f({},i),{type:"operator",isFunction:i==null?void 0:i.isFunction})),this.value=t,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(t){return new Od(t.symbol,t)}toJson(){let t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var i;let r=new S(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle}),a=r;if(this.superscript||this.subscript){let o=(i=this.subsupPlacement)!=null?i:"auto";a=o==="over-under"||o==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:r}):this.attachSupsub(t,{base:r})}return new S(this.bind(t,a),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;let i=he(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,t);let r=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&r.push("\\limits"),this.subsupPlacement==="adjacent"&&r.push("\\nolimits"),this.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(this.supsubToLatex(t)),P(r)}};function It(e){if(_e(e))return e.map(r=>It(r));if(typeof e=="string")return v.fromJson(e);e=f({},e);for(let r of er)e[r]&&(e[r]=It(e[r]));e.args&&(e.args=lm(e.args)),e.array&&(e.array=It(e.array));let t=e.type,i;t==="accent"&&(i=Oo.fromJson(e)),t==="array"&&(i=R.fromJson(e)),t==="box"&&(i=qt.fromJson(e)),t==="chem"&&(i=xd.fromJson(e)),t==="composition"&&(i=od.fromJson(e)),t==="delim"&&(i=_d.fromJson(e)),t==="enclose"&&(i=Jr.fromJson(e)),t==="error"&&(i=ni.fromJson(e)),t==="extensible-symbol"&&(i=Kl.fromJson(e)),t==="genfrac"&&(i=ar.fromJson(e)),t==="group"&&(i=sd.fromJson(e)),t==="latex"&&(i=se.fromJson(e)),t==="latexgroup"&&(i=Er.fromJson(e)),t==="leftright"&&(i=Z.fromJson(e)),t==="macro"&&(i=hd.fromJson(e)),t==="macro-argument"&&(i=Qp.fromJson(e)),t==="operator"&&(i=xi.fromJson(e)),t==="overlap"&&(i=vi.fromJson(e)),t==="overunder"&&(i=Oe.fromJson(e)),t==="placeholder"&&(i=vt.fromJson(e)),t==="prompt"&&(i=fd.fromJson(e)),t==="phantom"&&(i=Xr.fromJson(e)),t==="sizeddelim"&&(i=Md.fromJson(e)),t==="spacing"&&(i=Gr.fromJson(e)),t==="subsup"&&(i=qo.fromJson(e)),t==="surd"&&(i=zd.fromJson(e)),t==="text"&&(i=Wr.fromJson(e)),t==="tooltip"&&(i=Fl.fromJson(e)),i||(i=v.fromJson(e));for(let r of er)e[r]&&i.setChildren(e[r],r);return e.verbatimLatex!==void 0&&(i.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(i.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(i.explicitSubsupPlacement=!0),e.isFunction&&(i.isFunction=!0),e.isExtensibleSymbol&&(i.isExtensibleSymbol=!0),e.skipBoundary&&(i.skipBoundary=!0),e.captureSelection&&(i.captureSelection=!0),i}function lm(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(i=>It(i))}:typeof t=="object"&&"atoms"in t?t.atoms.map(i=>It(i)):t)}var sm={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"]},al={"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]$/},Id=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,um=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,cm=[/^[a-z]$/,/^[A-Z]$/,Id,um],dm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},hm=class extends Le{constructor(){super("math")}createAtom(e,t,i){var r,a,o,n;if(t===null)return new v({type:"mord",mode:"math",command:e,value:e,style:i});let l=window.MathfieldElement.isFunction((r=t.command)!=null?r:e);if(t.definitionType==="symbol"){let u=new v({type:(a=t.type)!=null?a:"mord",mode:"math",command:(o=t.command)!=null?o:e,value:String.fromCodePoint(t.codepoint),style:i});return l&&(u.isFunction=!0),e.startsWith("\\")&&(u.verbatimLatex=e),u}let s=new v({type:"mord",mode:"math",command:(n=t.command)!=null?n:e,value:e,style:i});return l&&(s.isFunction=!0),e.startsWith("\\")&&(s.verbatimLatex=e),s}serialize(e,t){let i=pm(e,b(f({},t),{defaultMode:"math"}));return i.length===0||t.defaultMode!=="text"?i:["$ ",...i," $"]}getFont(e,t){t.variant;let{variant:i}=t,{variantStyle:r}=t;i==="normal"&&!r&&/[\u00A3\u0131\u0237]/.test(e.value)&&(i="main",r="italic"),i==="normal"&&!r&&e.value.length===1&&cm.forEach((l,s)=>{var u;l.test(e.value)&&dm[(u=t.letterShapeStyle)!=null?u:"tex"][s]==="it"&&(r="italic")}),r==="up"&&(r=void 0);let a=r?i+"-"+r:i,[o,n]=sm[a];return al[i]&&!al[i].test(e.value)?(e.value=S0(e.value,i,r),null):(Id.test(e.value)&&(e.classes+=" lcGreek"),n&&(e.classes+=" "+n),o)}};function pm(e,t){let{parent:i}=e[0],r=Vc(i);return Rt(e,"variant").map(a=>{let o=Vc(a[0]),n="";o&&o!==r&&(n={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 l=P(a.map(s=>s._serialize(t)));return n?G(n,l):l})}function Vc(e){if(!e)return"";let{style:t}=e;if(t.variant===void 0)return"";let i=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(i+="-"+t.variantStyle),i}new hm;function mm(e,t){return e.map(i=>i._serialize(t))}function fm(e,t){return Rt(e,"fontShape").map(i=>{let r=mm(i,t),{fontShape:a}=i[0].style,o="";return a==="it"&&(o="\\textit"),a==="sl"&&(o="\\textsl"),a==="sc"&&(o="\\textsc"),a==="n"&&(o="\\textup"),!o&&a?`{${G("\\fontshape",a)}${P(r)}}`:o?G(o,P(r)):P(r)})}function gm(e,t){return Rt(e,"fontSeries").map(i=>{let r=fm(i,t),{fontSeries:a}=i[0].style,o="";return a==="b"&&(o="\\textbf"),a==="l"&&(o="\\textlf"),a==="m"&&(o="\\textmd"),a&&!o?`{${G("\\fontseries",a)}${P(r)}}`:o?G(o,P(r)):P(r)})}function ym(e,t){return Rt(e,"fontSize").map(i=>{var r,a;let o=gm(i,t),n=(a=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(r=i[0].style.fontSize)!=null?r:""])!=null?a:"";return n?`${n} ${P(o)}`:P(o)})}function bm(e,t,i){return Rt(e,"fontFamily").map(r=>{var a,o;let n=ym(r,t),l=(o={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(a=r[0].style.fontFamily)!=null?a:""])!=null?o:"";return l?`\\${l}{${P(n)}}`:r[0].style.fontFamily?`{\\fontfamily{${r[0].style.fontFamily}} ${P(n)}}`:i?`\\text{${P(n)}}`:P(n)})}var Hc={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},vm=class extends Le{constructor(){super("text")}createAtom(e,t,i){return t&&t.definitionType==="symbol"?new Wr(e,String.fromCodePoint(t.codepoint),i??{}):null}serialize(e,t){return bm(e,b(f({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var i,r,a,o,n;let{fontFamily:l}=t;if(Hc[l]?e.classes+=" "+Hc[l]:l&&e.setStyle("font-family",l),t.fontShape&&(e.classes+=" ",e.classes+=(i={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?i:""),t.fontSeries){let s=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);s&&(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"}[(r=s[1])!=null?r:""])!=null?a:"",e.classes+=" ",e.classes+=(n={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"}[(o=s[2])!=null?o:""])!=null?n:"")}return"Main-Regular"}};new vm;var xm=class extends Le{constructor(){super("latex")}createAtom(e){return new se(e)}serialize(e,t){return e.filter(i=>i instanceof se&&!i.isSuggestion).map(i=>i.value)}getFont(){return null}};new xm;var wm={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["x","X","≈","˛"],KeyC:["j","J","∆","Ô"],KeyD:["e","E","´","´"],KeyE:[".",">","≥","˘"],KeyF:["u","U","¨","¨"],KeyG:["i","I","ˆ","ˆ"],KeyH:["d","D","∂","Î"],KeyI:["c","C","ç","Ç"],KeyJ:["h","H","˙","Ó"],KeyK:["t","T","†","ˇ"],KeyL:["n","N","˜","˜"],KeyM:["m","M","µ","Â"],KeyN:["b","B","∫","ı"],KeyO:["r","R","®","‰"],KeyP:["l","L","¬","Ò"],KeyQ:["'",'"',"æ","Æ"],KeyR:["p","P","π","∏"],KeyS:["o","O","ø","Ø"],KeyT:["y","Y","¥","Á"],KeyU:["g","G","©","˝"],KeyV:["k","K","˚",""],KeyW:[",","<","≤","¯"],KeyX:["q","Q","œ","Œ"],KeyY:["f","F","ƒ","Ï"],KeyZ:[";",":","…","Ú"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","^","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["[","{","“","”"],Equal:["]","}","‘","’"],BracketLeft:["/","?","÷","¿"],BracketRight:["=","+","≠","±"],Backslash:["\\","|","«","»"],Semicolon:["s","S","ß","Í"],Quote:["-","_","–","—"],Backquote:["`","~","`","`"],Comma:["w","W","∑","„"],Period:["v","V","√","◊"],Slash:["z","Z","Ω","¸"],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:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},ol={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],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","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","^","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["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:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Nd={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],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","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},qd={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:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},_m={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],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:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}},km={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","€",""],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:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Mm={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],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","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:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:["	","","	",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}},Sm={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],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:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}},Cm={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","€",""],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:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Dm={id:"linux.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","€","€"],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:["z","Z","←","¥"],KeyZ:["y","Y","»","›"],Digit1:["1","!","¹","¡"],Digit2:["2",'"',"²","⅛"],Digit3:["3","§","³","£"],Digit4:["4","$","¼","¤"],Digit5:["5","%","½","⅜"],Digit6:["6","&","¬","⅝"],Digit7:["7","/","{","⅞"],Digit8:["8","(","[","™"],Digit9:["9",")","]","±"],Digit0:["0","=","}","°"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:["	","","	",""],Space:[" "," "," "," "],Minus:["ß","?","\\","¿"],Equal:["́","̀","̧","̨"],BracketLeft:["ü","Ü","̈","̊"],BracketRight:["+","*","~","¯"],Backslash:["#","'","’","̆"],Semicolon:["ö","Ö","̋","̣"],Quote:["ä","Ä","̂","̌"],Backquote:["̂","°","′","″"],Comma:[",",";","·","×"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],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:["<",">","|","̱"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Bm={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","ß",""],KeyC:["c","C","©"," "],KeyD:["d","D","∂","∆"],KeyE:["e","E","€","€"],KeyF:["f","F","ƒ","fi"],KeyG:["g","G","","fl"],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","·","#","•"],Digit4:["4","$","¢","£"],Digit5:["5","%","∞","‰"],Digit6:["6","&","¬"," "],Digit7:["7","/","÷","⁄"],Digit8:["8","(","“","‘"],Digit9:["9",")","”","’"],Digit0:["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:["º","ª","\\","°"]}},Am={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","€",""],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","·","#",""],Digit4:["4","$","~",""],Digit5:["5","%","€",""],Digit6:["6","&","¬",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["¡","¿","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["ç","Ç","}",""],Semicolon:["ñ","Ñ","",""],Quote:["´","¨","{",""],Backquote:["º","ª","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Lm={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","æ","Æ"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],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","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","·","#","£"],Digit4:["4","$","~","$"],Digit5:["5","%","½","⅜"],Digit6:["6","&","¬","⅝"],Digit7:["7","/","{","⅞"],Digit8:["8","(","[","™"],Digit9:["9",")","]","±"],Digit0:["0","=","}","°"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:["	","","	",""],Space:[" "," "," "," "],Minus:["'","?","\\","¿"],Equal:["¡","¿","̃","~"],BracketLeft:["̀","̂","[","̊"],BracketRight:["+","*","]","̄"],Backslash:["ç","Ç","}","̆"],Semicolon:["ñ","Ñ","~","̋"],Quote:["́","̈","{","{"],Backquote:["º","ª","\\","\\"],Comma:[",",";","─","×"],Period:[".",":","·","÷"],Slash:["-","_","̣","̇"],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:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function Rd(e){let t=e.split("+"),i={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(i.shift=!0),t.includes("alt")&&(i.alt=!0),t.includes("ctrl")&&(i.ctrl=!0),t.includes("cmd")&&(i.cmd=!0),t.includes("win")&&(i.win=!0),t.includes("meta")&&(i.meta=!0),i}function Ni(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var Em={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]"},_o=[];function Tl(){switch(rr()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function De(e){(!e.platform||e.platform===Tl())&&_o.push(e)}function Km(e,t){var i;let r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return r;for(let[a,o]of Object.entries(t.mapping)){if(o[0]===e)return r.key=`[${a}]`,r;if(o[1]===e)return r.shift=!0,r.key=`[${a}]`,r;if(o[2]===e)return r.alt=!0,r.key=`[${a}]`,r;if(o[3]===e)return r.shift=!0,r.alt=!0,r.key=`[${a}]`,r}return r.key=(i=Em[e])!=null?i:"",r}function Fm(e){if(e.code)return e;let t=Object.entries(Rr().mapping),i=!1,r=!1,a="";for(let o=0;o<4;o++){for(let[n,l]of t)if(l[o]===e.key){a=n,o===3?(i=!0,r=!0):o===2?i=!0:o===1&&(r=!0);break}if(a)break}return new KeyboardEvent(e.type,b(f({},e),{altKey:i,shiftKey:r,code:a}))}function Tm(e){var t,i;if(!e||e.key==="Unidentified"||e.key==="Dead")return;let r=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(let a of _o)((t=a.mapping[e.code])==null?void 0:t[r])===e.key?a.score+=1:(i=a.mapping[e.code])!=null&&i[r]&&(a.score=0);_o.sort((a,o)=>o.score-a.score)}function Rr(){return _o[0]}function zm(){switch(Tl()){case"apple":return ol;case"windows":return Nd;case"linux":return qd}return ol}switch(Tl()){case"apple":De(ol),De(_m),De(Bm),De(Sm);break;case"windows":De(Nd),De(km),De(Am),De(Cm);break;case"linux":De(qd),De(Mm),De(Lm),De(Dm);break}De(wm);function zl(e){var t;let i=/macos|ios/.test(rr()),r=e.split("+"),a="";for(let o of r)a&&(a+=i?" ":'<span class="ML__shortcut-join">+</span>'),o.startsWith("[Key")?a+=o.slice(4,5):o.startsWith("Key")?a+=o.slice(3,4):o.startsWith("[Digit")?a+=o.slice(6,7):o.startsWith("Digit")?a+=o.slice(5,6):a+=(t={cmd:"⌘",meta:i?"⌘":"Ctrl",shift:i?"⇧":"Shift",alt:i?"⌥":"Alt",ctrl:i?"⌃":"Ctrl","\n":i?"⏎":"Return","[return]":i?"⏎":"Return","[enter]":i?"⌤":"Enter","[tab]":i?"⇥":"Tab","[escape]":"Esc","[backspace]":i?"⌫":"Backspace","[delete]":i?"⌦":"Del","[pageup]":i?"⇞":"Page Up","[pagedown]":i?"⇟":"Page Down","[home]":i?"⤒":"Home","[end]":i?"⤓":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣"}[o.toLowerCase()])!=null?t:o.toUpperCase();return a}function ko(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){let t=[...e.touches].reduce((r,a)=>({x:r.x+a.clientX,y:r.y+a.clientY}),{x:0,y:0}),i=e.touches.length;return{x:t.x/i,y:t.y/i}}}function pi(e){let t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function $m(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var Pm=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 Ro(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:Pm.has(e.code)}function Mo(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var nt=class mt{static get scrim(){return mt._scrim||(mt._scrim=new mt),mt._scrim}static open(t){mt.scrim.open(t)}static close(){mt.scrim.close()}static get state(){return mt.scrim.state}static get element(){return mt.scrim.element}constructor(t){var i,r;this.lightDismiss=(i=t==null?void 0:t.lightDismiss)!=null?i:!0,this.translucent=(r=t==null?void 0:t.translucent)!=null?r:!1,this.state="closed"}get element(){if(this._element)return this._element;let t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var i;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=Mo();let{element:r}=this;((i=t==null?void 0:t.root)!=null?i:document.body).appendChild(r),r.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);let a=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";let o=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${o+a}px`,t!=null&&t.child&&r.append(t.child),this.state="open"}close(){var t,i,r,a;if(this.state!=="open"){this.element.parentElement;return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;let{element:o}=this;o.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),o.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(i=this.savedMarginRight)!=null?i:"",Mo()!==this.savedActiveElement&&((a=(r=this.savedActiveElement)==null?void 0:r.focus)==null||a.call(r)),o.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function Om(e,t,i){let r=null,a=null,o=!1,n=!1,l=!1,s=new AbortController,u=s.signal;return e.addEventListener("keydown",c=>{if(o||c.key==="Process"||c.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(c.code)){r=null;return}r=c,a=null,i.onKeystroke(c)?e.textContent="":r=null},{capture:!0,signal:u}),e.addEventListener("keypress",c=>{o||(r&&a&&i.onKeystroke(r),a=c)},{capture:!0,signal:u}),e.addEventListener("compositionstart",c=>{e.textContent="",o=!0,i.onCompositionStart(c.data)},{capture:!0,signal:u}),e.addEventListener("compositionupdate",c=>{o&&i.onCompositionUpdate(c.data)},{capture:!0,signal:u}),e.addEventListener("compositionend",c=>{e.textContent="",o&&(o=!1,i.onCompositionEnd(c.data))},{capture:!0,signal:u}),e.addEventListener("beforeinput",c=>c.stopImmediatePropagation(),{signal:u}),e.addEventListener("input",c=>{var d;if(!o&&(e.textContent="",c.inputType!=="insertCompositionText")){if(c.inputType==="insertFromPaste"){c.preventDefault(),c.stopPropagation();return}i.onInput((d=c.data)!=null?d:""),c.preventDefault(),c.stopPropagation()}},{signal:u}),e.addEventListener("paste",c=>{e.focus({preventScroll:!0}),e.textContent="",i.onPaste(c)||c.preventDefault(),c.stopImmediatePropagation()},{signal:u}),e.addEventListener("cut",c=>i.onCut(c),{capture:!0,signal:u}),e.addEventListener("copy",c=>i.onCopy(c),{capture:!0,signal:u}),e.addEventListener("blur",c=>{var d,h;if(((h=(d=c.relatedTarget)==null?void 0:d._mathfield)==null?void 0:h.element)===t){e.focus({preventScroll:!0}),c.preventDefault(),c.stopPropagation();return}let p=nt.state;if(p==="open"||p==="opening"){c.preventDefault(),c.stopPropagation();return}if(c.relatedTarget===c.target.getRootNode().host){c.preventDefault(),c.stopPropagation();return}l||n||(l=!0,r=null,a=null,i.onBlur(),l=!1)},{capture:!0,signal:u}),e.addEventListener("focus",c=>{l||n||(n=!0,i.onFocus(),n=!1)},{capture:!0,signal:u}),{dispose:()=>s.abort(),cancelComposition:()=>{o&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!n&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>Mo()===e,setAriaLabel:c=>e.setAttribute("aria-label",c),setValue:c=>{var d;e.textContent=c,e.style.left="-1000px",(d=window.getSelection())==null||d.selectAllChildren(e)},moveTo:(c,d)=>{e.style.top=`${d}px`,e.style.left=`${c}px`}}}function Pi(e){var t;if(!e||!Ro(e))return"";let i;return e.key==="Unidentified"&&e.target&&(i=e.target.value),i=(t=i??e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(i)&&(i=""),i}function Vd(e){e=Fm(e);let t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function Im(e){if(Pe()){let t=rr(),i=e.startsWith("!"),r=e.endsWith(t);if(i&&!r||!i&&r)return!0}return e==="!other"?!1:e==="other"}function Nm(e,t,i){if(e.length===0)return"";let r=Ni(Rd(Vd(i))),a=Ni({key:i.key,shift:i.shiftKey,alt:i.altKey,ctrl:i.ctrlKey,meta:i.metaKey||i.ctrlKey&&/macos|ios/.test(rr()),cmd:!1,win:!1});for(let o=e.length-1;o>=0;o--)if((e[o].key===r||e[o].key===a)&&(!e[o].ifMode||e[o].ifMode===t))return e[o].command;return""}function jc(e){let t=e;return _e(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function qm(e,t){let i=[];if(typeof t=="string"){let o=Cp[t];_e(o)?i=o.slice():o&&i.push(o)}let r=jc(t),a=new RegExp("^"+r.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(let o of e)a.test(jc(o.command))&&i.push(o.key);return i.map(zl)}function Rm(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;let i=Rd(e.key),r=e.ifPlatform;if(i.cmd){if(r&&r!=="macos"&&r!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+r+`"
"cmd" modifier can only be used with macOS or iOS platform.`);r||(r=rr()==="ios"?"ios":"macos"),i.win=!1,i.cmd=!1,i.meta=!0}if(i.win){if(r&&r!=="windows")throw new Error('Unexpected "win" modifier with platform "'+r+`"
"win" modifier can only be used with Windows platform.`);r="windows",i.win=!1,i.cmd=!1,i.meta=!0}if(r&&!Im(r))return;if(/^\[.+\]$/.test(i.key))return b(f({},e),{key:Ni(i)});let a=Km(i.key,t);if(!a)return b(f({},e),{key:Ni(i)});if(a.shift&&i.shift||a.alt&&i.alt)throw new Error(`The keybinding ${e.key} (${nl(e.command)}) is conflicting with the key combination ${Ni(a)} using the ${t.displayName} keyboard layout`);return a.shift=a.shift||i.shift,a.alt=a.alt||i.alt,a.meta=i.meta,a.ctrl=i.ctrl,b(f({},e),{key:Ni(a)})}function nl(e){if(Array.isArray(e)){let t=[...e];return t.shift()+"("+t.map(i=>typeof i=="string"?`"${i}"`:i.toString()).join(", ")+")"}return e}function Vm(e,t){let i=[],r=[];for(let a of e)try{let o=Rm(a,t);if(!o)continue;let n=r.find(l=>l.key===o.key&&l.ifMode===o.ifMode);if(n)throw new Error(`Ambiguous key binding ${a.key} (${nl(a.command)}) matches ${n.key} (${nl(n.command)}) with the ${t.displayName} keyboard layout`);r.push(o)}catch(o){o instanceof Error&&i.push(o.message)}return[r,i]}var Hm=class extends J{constructor(){super("latex")}createAtom(e){return new se(e)}onPaste(e,t){if(!t)return!1;let i=typeof t=="string"?t:t.getData("application/x-latex")||t.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"}),Y(e)),e.startRecording(),!0):!1}insert(e,t,i){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;i||(i={}),i.insertionMode||(i.insertionMode="replaceSelection"),i.selectionMode||(i.selectionMode="placeholder");let{silenceNotifications:r}=e;i.silenceNotifications&&(e.silenceNotifications=!0);let a=e.silenceNotifications;e.silenceNotifications=!0,i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pe(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 o=[];for(let s of t)Uh.test(s)&&o.push(new se(s));let n=e.at(e.position);if(n instanceof Er&&(n=n.lastChild),!(n.parent instanceof Er)){let s=new Er("");n.parent.addChildAfter(s,n),n=s.firstChild}let l=n.parent.addChildrenAfter(o,n);return e.silenceNotifications=a,i.selectionMode==="before"||(i.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(l)):l&&(e.position=e.offsetOf(l))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=r,!0}};function jm(e){return e.atoms.find(t=>t.type==="latexgroup")}function Vr(e){var t,i;let r=e.atoms.find(a=>a.type==="latexgroup");return r?(i=(t=r.body)==null?void 0:t.filter(a=>a.type==="latex"))!=null?i:[]:[]}function Hd(e,t){var i;let r=0,a=!1,o=Number.isFinite(t==null?void 0:t.before)?(i=t==null?void 0:t.before)!=null?i:0:e.lastOffset;for(;r<=o&&!a;){let s=e.at(r);a=s instanceof se&&s.isSuggestion,a||r++}if(!a)return[void 0,void 0];let n=r,l=!1;for(;n<=o&&!l;){let s=e.at(n);l=!(s instanceof se&&s.isSuggestion),l||n++}return[r-1,n-1]}new Hm;function Vo(e){let t=Vr(e.model).filter(i=>i.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(let i of t)i.parent.removeChild(i)}}function Yr(e,t){var i;let{model:r}=e;Vo(e);for(let c of Vr(r))c.isError=!1;if(!r.selectionIsCollapsed||e.options.popoverPolicy==="off"){ir(e);return}let a=[],o=r.at(r.position);for(;o&&o instanceof se&&/^[a-zA-Z\*]$/.test(o.value);)o=o.leftSibling;if(o&&o instanceof se&&o.value==="\\")for(a.push(o),o=o.rightSibling;o&&o instanceof se&&/^[a-zA-Z\*]$/.test(o.value);)a.push(o),o=o.rightSibling;let n=a.map(c=>c.value).join(""),l=Xh(e,n);if(l.length===0){if(/^\\[a-zA-Z\*]+$/.test(n))for(let c of a)c.isError=!0;ir(e);return}let s=(i=t==null?void 0:t.atIndex)!=null?i:0;e.suggestionIndex=s<0?l.length-1:s%l.length;let u=l[e.suggestionIndex];if(u!==n){let c=a[a.length-1];c.parent.addChildrenAfter([...u.slice(n.length-u.length)].map(d=>new se(d,{isSuggestion:!0})),c),gi(e,{interactive:!0})}Um(e,l)}function Wc(e){let[t,i]=Hd(e,{before:e.position});if(t===void 0||i===void 0)return!1;let r=!1;return e.getAtoms([t,i]).forEach(a=>{a.isSuggestion&&(a.isSuggestion=!1,r=!0)}),r}function tr(e,t="accept",i){var r,a;ir(e);let o=jm(e.model);if(!o)return!1;if(t==="accept-suggestion"||t==="accept-all"){let s=Vr(e.model).filter(u=>u.isSuggestion);if(s.length!==0){for(let u of s)u.isSuggestion=!1;e.model.position=e.model.offsetOf(s[s.length-1])}if(t==="accept-suggestion")return s.length!==0}let n=Vr(e.model).filter(s=>!s.isSuggestion).map(s=>s.value).join(""),l=o.leftSibling;return o.parent.removeChild(o),e.model.position=e.model.offsetOf(l),e.switchMode((r=i==null?void 0:i.mode)!=null?r:"math"),t==="reject"||(J.insert(e.model,n,{selectionMode:(a=i==null?void 0:i.selectItem)!=null&&a?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Ho(e){var t;let i=document.getElementById(e);return i?i.dataset.refcount=Number(Number.parseInt((t=i.dataset.refcount)!=null?t:"0")+1).toString():(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.dataset.refcount="1",i.id=e,document.body.append(i)),i}function $l(e){var t;let i=document.getElementById(e);if(!i)return;let r=Number.parseInt((t=i.getAttribute("data-refcount"))!=null?t:"0");r<=1?i.remove():i.dataset.refcount=Number(r-1).toString()}function Wm(e,t){let i=new $({from:e.context}),r=new v({mode:"math",type:"root",body:ye(t,{context:i})}),a=zo(Zr(new S(r.render(i),{classes:"ML__base"}),i));return $o(a,{classes:"ML__latex"}).toMarkup()}function Um(e,t){var i;if(t.length===0){ir(e);return}let r="";for(let[o,n]of t.entries()){let l=n,s=Wm(e,n),u=qm(e.keybindings,l).join("<br>");r+=`<li role="button" data-command="${l}" ${o===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${l}</span><span class="ML__popover__command">${s}</span>`,u&&(r+=`<span class="ML__popover__keybinding">${u}</span>`),r+="</li>"}let a=Jm(e,`<ul>${r}</ul>`);ll()&&((i=a.querySelector(".ML__popover__current"))==null||i.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var o;a&&!ll()&&(a.classList.add("is-visible"),jo(e),(o=a.querySelector(".ML__popover__current"))==null||o.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function ll(){let e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function jo(e,t){var i;if(!e.element||e.element.mathfield!==e||!ll())return;if(((i=e.model.at(e.model.position))==null?void 0:i.type)!=="latex"){ir(e);return}if(t!=null&&t.deferred){setTimeout(()=>jo(e),32);return}let r=Ar(e.field);if(!r)return;let a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerWidth-document.documentElement.clientWidth,l=window.innerHeight-document.documentElement.clientHeight,s=window.mathVirtualKeyboard.boundingRect.height,u=document.getElementById("mathlive-suggestion-popover");r.x+u.offsetWidth/2>o-n?u.style.left=`${o-u.offsetWidth-n}px`:r.x-u.offsetWidth/2<0?u.style.left="0":u.style.left=`${r.x-u.offsetWidth/2}px`;let c=r.y-r.height;a-l-s-r.y<c?(u.classList.add("ML__popover--reverse-direction"),u.classList.remove("top-tip"),u.classList.add("bottom-tip"),u.style.top=`${r.y-r.height-u.offsetHeight-15}px`):(u.classList.remove("ML__popover--reverse-direction"),u.classList.add("top-tip"),u.classList.remove("bottom-tip"),u.style.top=`${r.y+15}px`)}function ir(e){e.suggestionIndex=0;let t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function Jm(e,t){let i=document.getElementById("mathlive-suggestion-popover");return i||(i=Ho("mathlive-suggestion-popover"),bt("suggestion-popover"),bt("core"),i.addEventListener("pointerdown",r=>r.preventDefault()),i.addEventListener("click",r=>{let a=r.target;for(;a&&!a.dataset.command;)a=a.parentElement;a&&(tr(e,"reject"),J.insert(e.model,a.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),i.innerHTML=window.MathfieldElement.createHTML(t),i}function Xm(){document.getElementById("mathlive-suggestion-popover")&&($l("mathlive-suggestion-popover"),Nt("suggestion-popover"),Nt("core"))}function Gm(){let e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.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 t=e[1],i=t.match(/http.*\.ts[\?:]/);return i&&(t=e[2]),i=t.match(/(https?:.*):[0-9]+:[0-9]+/),i||(i=t.match(/at (.*(\.ts))[\?:]/),i||(i=t.match(/at (.*(\.mjs|\.js))[\?:]/))),i?i[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var ja=null,Uc,Jc,zn=((Jc=(Uc=globalThis==null?void 0:globalThis.document)==null?void 0:Uc.currentScript)==null?void 0:Jc.src)||Gm();async function jd(e){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(ja===null)try{let t=await fetch(zn,{method:"HEAD"});t.status===200&&(ja=t.url)}catch{console.error(`Invalid URL "${e}" (relative to "${zn}")`)}return new URL(e,ja??zn).href}function Zm(e,t,i={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,i)}var Ae="not-loaded";async function Ym(){return Ae="not-loaded",Wo()}async function Wo(){var e;if(Ae==="not-loaded"){if(Ae="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){Ae="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){let t=["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(o=>o.family);if(t.every(o=>i.includes(o))){Ae="ready";return}if(!window.MathfieldElement.fontsDirectory){Ae="not-loaded";return}let r=await jd(window.MathfieldElement.fontsDirectory);if(!r){document.body.classList.add("ML__fonts-did-not-load"),Ae="error";return}let a=[["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(o=>Zm(o[0].replace(/-[a-zA-Z]+$/,""),`${r}/${o[0]}`,o[1]));try{(await Promise.all(a.map(o=>{try{return o.load()}catch{}}))).forEach(o=>document.fonts.add(o)),Ae="ready";return}catch(o){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${r}"`,{cause:o}),document.body.classList.add("ML__fonts-did-not-load")}Ae="error"}}}function Qm(e){let t=0;for(let i=0;i<e.length;i++)t=t*31+e.charCodeAt(i),t=t|0;return Math.abs(t)}function Y(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{ui(e)&&e.dirty&&(e.atomBoundsCache=new Map,gi(e,t),e.atomBoundsCache=void 0)})))}function e1(e,t){var i;t=t??{};let r=new $({from:b(f({},e.context),{atomIdsSettings:{seed:t.forHighlighting?Qm(v.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(i=t.forHighlighting)!=null?i:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),a=e.model.root.render(r);return $o(Zr(a,r),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Wd(e,t){let{model:i}=e;i.root.caret=void 0,i.root.isSelected=!1,i.root.containsCaret=!0;for(let r of i.atoms)r.caret=void 0,r.isSelected=!1,r.containsCaret=!1;if(i.selectionIsCollapsed){let r=i.at(i.position);r.caret=e.model.mode;let a=r.parent;for(;a;)a.containsCaret=!0,a=a.parent}else{let r=i.getAtoms(i.selection,{includeChildren:!0});for(let a of r)a.isSelected=!0}return e1(e,t).toMarkup()}function gi(e,t){if(!ui(e))return;t!=null||(t={});let i=e.element.querySelector("[part=virtual-keyboard-toggle]");i&&(i.style.display=e.hasEditableContent?"":"none");let r=e.field;if(!r)return;let a=e.isSelectionEditable&&e.hasFocus(),o=r.classList.contains("ML__focused");o&&!a?r.classList.remove("ML__focused"):!o&&a&&r.classList.add("ML__focused");let n=Wd(e,t),l=e.element.querySelector("[part=menu-toggle]");if(l&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?l.style.display="none":l.style.display=""),e.model.atoms.length<=1){let s=e.options.contentPlaceholder;s&&(n+=`<span part=placeholder class="ML__content-placeholder">${ne(s)}</span>`)}r.innerHTML=window.MathfieldElement.createHTML(n),So(e,t.interactive),e.dirty=!1}function So(e,t){let i=e.field;if(!i)return;for(let l of i.querySelectorAll(".ML__selection, .ML__contains-highlight"))l.remove();!(t!=null&&t)&&Ae!=="error"&&Ae!=="ready"&&setTimeout(()=>{Ae==="ready"?So(e):setTimeout(()=>So(e),128)},32);let r=e.model,a=i.offsetWidth,o=i.getBoundingClientRect().width,n=Math.floor(o)/a;if(n=isNaN(n)?1:n,r.selectionIsCollapsed){jo(e,{deferred:!0});let l=r.at(r.position);for(;l&&l.type!=="prompt"&&!(l.containsCaret&&l.displayContainsHighlight);)l=l.parent;if(l!=null&&l.containsCaret&&l.displayContainsHighlight){let s=V0(e,Ur(e,l),n);if(s){s.left/=n,s.right/=n,s.top/=n,s.bottom/=n;let u=document.createElement("div");u.classList.add("ML__contains-highlight"),u.style.position="absolute",u.style.left=`${s.left+1}px`,u.style.top=`${Math.ceil(s.top)}px`,u.style.width=`${Math.ceil(s.right-s.left)}px`,u.style.height=`${Math.ceil(s.bottom-s.top)}px`,i.insertBefore(u,i.childNodes[0])}}return}for(let l of t1(j0(e,{excludeAtomsWithBackground:!0}))){l.left/=n,l.right/=n,l.top/=n,l.bottom/=n;let s=document.createElement("div");s.classList.add("ML__selection"),s.style.position="absolute",s.style.left=`${l.left}px`,s.style.top=`${l.top}px`,s.style.width=`${Math.ceil(l.right-l.left)}px`,s.style.height=`${Math.ceil(l.bottom-l.top-1)}px`,i.insertBefore(s,i.childNodes[0])}}function t1(e){let t=[];for(let i of e){let r=!1;for(let a of t)if(i.left===a.left&&i.right===a.right&&i.top===a.top&&i.bottom===a.bottom){r=!0;break}r||t.push(i)}e=t,t=[];for(let i of e){let r=0;for(let a of e)if(i.left>=a.left&&i.right<=a.right&&i.top>=a.top&&i.bottom<=a.bottom&&(r+=1,r>1))break;r===1&&t.push(i)}return t}var Ud=3,lt;function Me(e,t){t=f({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t??{}),lt||(lt={});for(let i of Object.keys(e))lt[i],lt[i]=b(f({},t),{fn:e[i]})}function Pl(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Pl(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,i=>i[1].toUpperCase()),lt[t]}function Ji(e){var t;return(t=Pl(e))==null?void 0:t.target}function i1(e,t){var i;if(!t)return!1;let r,a=[],o=!1,n=!1;_e(t)?(r=t[0],a=t.slice(1)):r=t,r=r.replace(/-\w/g,u=>u[1].toUpperCase());let l=lt[r],s=l==null?void 0:l.target;if(s==="model"){if(!e.isSelectionEditable&&l!=null&&l.changeContent)return e.model.announce("plonk"),!1;/^(delete|add)/.test(r)&&(r!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(r)),/^complete/.test(r)||Vo(e),lt[r].fn(e.model,...a),Yr(e),n=!0,o=!0}else if(s==="virtual-keyboard")n=(i=window.mathVirtualKeyboard.executeCommand(t))!=null?i:!1,o=!0;else if(lt[r]){if(!e.isSelectionEditable&&l!=null&&l.changeContent)return e.model.announce("plonk"),!1;/^(undo|redo)/.test(r)&&e.flushInlineShortcutBuffer(),n=lt[r].fn(e,...a),o=!0}else throw new Error(`Unknown command "${r}"`);return s!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||l!=null&&l.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),l!=null&&l.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),n&&Y(e),o}function r1(e,t){var i;if(!e)return!1;e.focus(),Mh.keypressVibration&&w0()&&navigator.vibrate(Ud);let r=Pl(t);window.MathfieldElement.playSound((i=r==null?void 0:r.audioFeedback)!=null?i:"keypress");let a=e.executeCommand(t);return e.scrollIntoView(),a}Me({performWithFeedback:(e,t)=>r1(e,t)});function a1(e){return Yr(e,{atIndex:e.suggestionIndex+1}),!1}function o1(e){return Yr(e,{atIndex:e.suggestionIndex-1}),!1}Me({complete:tr},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0});Me({nextSuggestion:a1,previousSuggestion:o1},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Co="mathlive#virtual-keyboard-message";function Ol(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===Co}var n1=class Jd{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 Jd),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,i,r){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(i)||this.listeners[t].add(i)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(i=>{typeof i=="function"?i(t):i==null||i.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,i,r){this.listeners[t]&&this.listeners[t].delete(i)}handleEvent(t){if(Ol(t)){if(!El(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){let{action:i}=t;if(i==="execute-command"){let{command:r}=t;Ji(r)==="virtual-keyboard"&&this.executeCommand(r);return}if(i==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(i==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,i={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can‘t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(f({type:Co,action:t},i),this.targetOrigin)}},l1={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:"≤"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"≥"}},"[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:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;≠∈",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]"]]}},no={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"],",":["{,}",".",";","\\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’t"},"è","é","ê","ë"],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"},"ñ"],o:["ø","œ","ò","ó","ô","ö","œ"],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"}],u:["ù","ú","û","ü"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["ý","ÿ"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>⁻³⧸₁₈ em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>³⧸₁₈ em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>⁴⧸₁₈ em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>⁵⧸₁₈ em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"⅓ em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"½ em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Fr;function Xd(e,t){var i,r,a;let o=Vt.singleton;if(!o)return;let n=qi(e),l=(r=(i=o.getKeycap(n==null?void 0:n.id))==null?void 0:i.variants)!=null?r:"";if(typeof l=="string"&&!Gd(l)||Array.isArray(l)&&l.length===0){t==null||t();return}let s={},u="";for(let y of u1(l)){let M=Yd(y),g=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);s[g]=M;let[_,D]=Uo(M);u+=`<div id=${g} class="item ${D}">${_}</div>`}let c=document.createElement("div");c.setAttribute("aria-hidden","true"),c.className="MLK__variant-panel",c.style.height="auto";let d=Object.keys(s).length,h=5;d===1?h=1:d===2||d===4?h=2:d===3||d===5||d===6?h=3:d>=7&&d<14&&(h=4),c.style.width=`calc(var(--variant-keycap-length) * ${h} + 12px)`,c.innerHTML=Mh.createHTML(u),nt.open({root:(a=o==null?void 0:o.container)==null?void 0:a.querySelector(".ML__keyboard"),child:c}),Fr=new AbortController;let{signal:p}=Fr,m=e==null?void 0:e.getBoundingClientRect();if(m){m.top-c.clientHeight<0&&(c.style.width="auto",d<=6?c.style.height="56px":d<=12?c.style.height="108px":d<=18?c.style.height="205px":c.classList.add("compact"));let y=Math.max(0,Math.min(window.innerWidth-c.offsetWidth,(m.left+m.right-c.offsetWidth)/2)),M=m.top-c.clientHeight+5;c.style.transform=`translate(${y}px, ${M}px)`,c.classList.add("is-visible"),requestAnimationFrame(()=>{c.addEventListener("pointerup",g=>{let _=qi(g.target);!(_!=null&&_.id)||!s[_.id]||(sl(s[_.id]),Tr(),t==null||t(),g.preventDefault())},{capture:!0,passive:!1,signal:p}),c.addEventListener("pointerenter",g=>{let _=qi(g.target);!(_!=null&&_.id)||!s[_.id]||_.classList.add("is-active")},{capture:!0,signal:p}),c.addEventListener("pointerleave",g=>{let _=qi(g.target);!(_!=null&&_.id)||!s[_.id]||_.classList.remove("is-active")},{capture:!0,signal:p}),window.addEventListener("pointercancel",()=>{Tr(),t==null||t()},{signal:p}),window.addEventListener("pointerup",()=>{Tr(),t==null||t()},{signal:p})})}}function Tr(){Fr==null||Fr.abort(),Fr=null,nt.state==="open"&&nt.close()}function s1(e){if(e==="foreground-color"){let t=[];for(let i of Object.keys(fi))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+fi[i]+'"></span>',command:["applyStyle",{color:i}]});return t}if(e==="background-color"){let t=[];for(let i of Object.keys(mi))t.push({class:"swatch-button",label:'<span style="background:'+mi[i]+'"></span>',command:["applyStyle",{backgroundColor:i}]});return t}}function Gd(e){return no[e]!==void 0}function u1(e){var t;return typeof e!="string"?e:(no[e]||(no[e]=(t=s1(e))!=null?t:[]),no[e])}function c1(e){return typeof e=="string"?e:Object.entries(e).map(([t,i])=>`${t}:${i} !important`).join(";")}function d1(e){return Object.keys(e).map(t=>`${t} {${c1(e[t])}}`).join("")}function xr(e){if(!e)return"";let t=new $,i=new v({mode:"math",type:"root",body:ye(e,{context:t,args:a=>a==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),r=zo(Zr(new S(i.render(t),{classes:"ML__base"}),t));return $o(r,{classes:"ML__latex"}).toMarkup()}function zr(e){if(Array.isArray(e))return e.map(i=>zr(i)).flat();let t=typeof e=="string"?{markup:e}:e;return"rows"in t&&Array.isArray(t.rows)&&(t.rows=t.rows.map(i=>i.map(r=>Yd(r)))),t.id!=null||(t.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[t]}function h1(){var e,t;let i=window.mathVirtualKeyboard.alphabeticLayout;if(i==="auto"){let n=Rr();n&&(i=n.virtualLayout),(!i||i==="auto")&&(i=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[z.locale.slice(0,2)])!=null?e:"qwerty")}let r={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^  pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},a=(t=r[i])!=null?t:r.qwerty,o=i==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"é"},variants:"2"},{label:"3",shift:{latex:"ù"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"è"},variants:"7"},{label:"8",shift:{latex:"ê"},variants:"8"},{label:"9",shift:{latex:"ç"},variants:"9"},{label:"0",shift:{latex:"à"},variants:"0"}]]:[[{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 n of a){let l=[];for(let s of n)/[a-z]/.test(s)?l.push({label:s,class:"hide-shift",shift:{label:s.toUpperCase()},variants:Gd(s)?s:void 0}):s==="~"?i!=="dvorak"?l.push("[backspace]"):l.push({label:"[backspace]",width:1}):s==="^"?l.push("[shift]"):s===" "&&l.push("[separator-5]");o.push(l)}return o.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:zr({rows:o})}}function Zd(e){if(e==="alphabetic")return h1();if(typeof e=="string")return Zd(l1[e]);let t;if("rows"in e&&Array.isArray(e.rows)){let a=e,o=ho(a,["rows"]);t=b(f({},o),{layers:zr({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){let a=e,o=ho(a,["markup"]);t=b(f({},o),{layers:zr(e.markup)})}else t=f({},e),"layers"in e?t.layers=zr(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let i=!1,r=!1;for(let a of t.layers)if(a.rows)for(let o of a.rows.flat()){Xi(o)&&(i=!0);let n=o.command;typeof n=="string"&&["undo","redo","cut","copy","paste"].includes(n)&&(r=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=i),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!r),t}function p1(e,t){var i,r;let a='<div class="left">';if(e.normalizedLayouts.length>1)for(let[o,n]of e.normalizedLayouts.entries()){let l=n,s=[o===t?"selected":"layer-switch"];l.tooltip&&s.push("MLK__tooltip"),l.labelClass&&s.push(...l.labelClass.split(" ")),a+=`<div class="${s.join(" ")}"`,l.tooltip&&(a+=" data-tooltip='"+((i=F(l.tooltip))!=null?i:l.tooltip)+"' "),o!==t&&(a+=`data-layer="${l.layers[0].id}"`),a+=`>${(r=l.label)!=null?r:"untitled"}</div>`}return a+="</div>",a}function m1(e,t){let i="";if(e.editToolbar==="none")return"";let r=[];t.selectionIsCollapsed?r.push("undo","redo","pasteFromClipboard"):r.push("cutToClipboard","copyToClipboard","pasteFromClipboard");let a={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
          data-command='"undo"'
          data-tooltip='${F("tooltip.undo")}'>
          <svg><use xlink:href='#svg-undo' /></svg>
      </div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
          data-command='"redo"'
          data-tooltip='${F("tooltip.redo")}'>
          <svg><use xlink:href='#svg-redo' /></svg>
      </div>`,cutToClipboard:`
        <div class='action'
            data-command='"cutToClipboard"'
            data-tooltip='${F("tooltip.cut to clipboard")}'>
            <svg><use xlink:href='#svg-cut' /></svg>
        </div>
    `,copyToClipboard:`
        <div class='action'
            data-command='"copyToClipboard"'
            data-tooltip='${F("tooltip.copy to clipboard")}'>
            <svg><use xlink:href='#svg-copy' /></svg>
        </div>
    `,pasteFromClipboard:`
        <div class='action'
            data-command='"pasteFromClipboard"'
            data-tooltip='${F("tooltip.paste from clipboard")}'>
            <svg><use xlink:href='#svg-paste' /></svg>
        </div>
    `};return i+=r.map(o=>a[o]).join(""),i}function f1(e){for(let t of e)g1(t)}function g1(e){let t=Vt.singleton;if(!t)return;let i={};if(!e.id){if(e.hasAttribute("data-label")&&(i.label=e.dataset.label),e.hasAttribute("data-latex")&&(i.latex=e.dataset.latex),e.hasAttribute("data-key")&&(i.key=e.dataset.key),e.hasAttribute("data-insert")&&(i.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(i.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(i.aside=e.dataset.aside),e.className&&(i.class=e.className),!i.label&&!i.latex&&!i.key&&!i.insert&&(i.latex=e.innerText,i.label=e.innerHTML),e.hasAttribute("data-command"))try{i.command=JSON.parse(e.dataset.command)}catch{}e.id=t.registerKeycap(i)}if(!e.innerHTML){let[r,a]=Uo(i);e.innerHTML=window.MathfieldElement.createHTML(r)}}function y1(){bt("virtual-keyboard"),bt("core"),Wo()}function b1(){Nt("core"),Nt("virtual-keyboard")}var v1=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">

<symbol id="svg-delete-backward" viewBox="0 0 576 512">
  <path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>

<symbol id="svg-shift" viewBox="0 0 384 512">
  <path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>

<symbol id="svg-commit" viewBox="0 0 512 512">
  <path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>


<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>

<symbol id="svg-command" viewBox="0 0 640 512">
  <path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>

<symbol id="svg-undo" viewBox="0 0 512 512">
  <path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
  <path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
  <path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
  <path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
  <path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
  <path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function x1(e){e.resetKeycapRegistry(),y1();let t=document.createElement("div");t.className="ML__keyboard";let i=document.createElement("div");i.className="MLK__plate",i.innerHTML=window.MathfieldElement.createHTML(v1+e.normalizedLayouts.map((n,l)=>w1(e,n,l)).join(""));let r=document.createElement("div");r.className="MLK__backdrop",r.appendChild(i),t.appendChild(r),t.addEventListener("pointerdown",k1,{passive:!1});let a=t.querySelectorAll(".ML__edit-toolbar");if(a)for(let n of a)n.addEventListener("click",l=>{var s,u;let c=l.target,d="";for(;c&&!d;)d=(s=c==null?void 0:c.getAttribute("data-command"))!=null?s:"",c=(u=c==null?void 0:c.parentElement)!=null?u:null;d&&e.executeCommand(JSON.parse(d))});f1(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));let o=t.querySelectorAll(".MLK__layer");o.length>0;for(let n of o)n.addEventListener("pointerdown",l=>l.preventDefault());return e.currentLayer=e.latentLayer,t}function w1(e,t,i){let r=[];if(!("layers"in t))return"";for(let a of t.layers)r.push(`<div tabindex="-1" class="MLK__layer" id="${a.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(r.push("<div class='MLK__toolbar' role='toolbar'>"),r.push(p1(e,i)),t.displayEditToolbar&&r.push('<div class="ML__edit-toolbar right"></div>'),r.push("</div>")),r.push(_1(e,a)),r.push("</div>");return r.join("")}function _1(e,t){if(typeof t=="string")return t;let i="";if(typeof t.style=="string"?i+=`<style>${t.style}</style>`:typeof t.style=="object"&&(i+=`<style>${d1(t.style)}</style>`),t.backdrop&&(i+=`<div class='${t.backdrop}'>`),t.container&&(i+=`<div class='${t.container}'>`),t.rows){i+="<div class=MLK__rows>";for(let r of t.rows){i+="<div dir='ltr' class=MLK__row>";for(let a of r)if(a){let o=e.registerKeycap(a),[n,l]=Uo(a);/(^|\s)separator/.test(l)?i+=`<div class="${l}"`:i+=`<div tabindex="-1" id="${o}" class="${l}"`,a.tooltip&&(i+=` data-tooltip="${a.tooltip}"`),i+=`>${n}</div>`}i+="</div>"}i+="</div>"}else t.markup&&(i+=t.markup);return t.container&&(i+="</div>"),t.backdrop&&(i+="</div>"),i}function Uo(e,t={shifted:!1}){var i,r,a,o,n,l,s;let u="",c=(i=e.class)!=null?i:"";if(t.shifted&&Xi(e)&&(c+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?u=xr(e.shift):typeof e.shift=="object"&&(u=e.shift.label?e.shift.label:(r=xr(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?r:""),typeof e.shift=="object"&&(c=(o=(a=e.shift.class)!=null?a:e.class)!=null?o:"");else{if(u=e.label?e.label:(n=xr(e.latex||e.insert||"")||e.key)!=null?n:"",e.shift){let d;typeof e.shift=="string"?d=xr(e.shift):e.shift.label?d=e.shift.label:d=(l=xr(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?l:"",u+=`<span class="MLK__shift">${d}</span>`}e.aside&&(u+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(c)&&(c+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(c)||(c+=" MLK__keycap"),!/\bw[0-9]+\b/.test(c)&&e.width&&(c+=(s={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?s:""),[u,c||"MLK__keycap"]}var Yt={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"↑",command:["performWithFeedback","moveUp"],shift:{label:"↟",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"↓",command:["performWithFeedback","moveDown"],shift:{label:"↡",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",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:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"≠",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost  if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",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:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function Yd(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!Yt[e])return{latex:e};e={label:e}}let i;return"label"in e&&e.label&&Yt[e.label]&&(i=b(f(f({},Yt[e.label]),e),{label:Yt[e.label].label})),"key"in e&&e.key&&Yt[e.key]&&(i=b(f(f({},Yt[e.key]),e),{key:Yt[e.key].key})),i?(i.command==="insertDecimalSeparator"&&(i.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(i=f(f({},i),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(i=f(f({},i),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(i=f(f({},i),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(i=f(f({},i),window.mathVirtualKeyboard.tabKeycap)),i):e}var $r;function k1(e){var t;if(e.button!==0)return;let i=Vt.singleton;if(!i)return;let r=e.target;for(;r&&!r.getAttribute("data-layer");)r=r.parentElement;if(r){i.currentLayer=(t=r.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}let a=qi(e.target);if(!(a!=null&&a.id))return;let o=i.getKeycap(a.id);if(!o)return;e.type;let n=new AbortController,l=n.signal;a.classList.add("is-pressed"),a.addEventListener("pointerenter",Wa(n),{capture:!0,signal:l}),a.addEventListener("pointerleave",Wa(n),{capture:!0,signal:l}),a.addEventListener("pointercancel",Wa(n),{signal:l}),a.addEventListener("pointerup",Wa(n),{signal:l}),Xi(o)&&(a.classList.add("is-active"),i.shiftPressCount++),o.variants&&($r&&clearTimeout($r),$r=setTimeout(()=>{a.classList.contains("is-pressed")&&(a.classList.remove("is-pressed"),a.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Xd(a,()=>{n.abort(),a==null||a.classList.remove("is-active")}))},300)),e.preventDefault()}function Wa(e){return t=>{let i=qi(t.target);if(!(i!=null&&i.id))return;let r=Vt.singleton;if(!r)return;let a=r.getKeycap(i.id);if(a){if(t.type==="pointerenter"&&t.target===i&&t.isPrimary&&i.classList.add("is-pressed"),t.type==="pointercancel"){i.classList.remove("is-pressed"),Xi(a)&&(r.shiftPressCount--,i.classList.toggle("is-active",r.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===i){i.classList.remove("is-pressed"),Xi(a)&&(r.shiftPressCount--,i.classList.toggle("is-active",r.isShifted));return}if(t.type==="pointerup"){$r&&clearTimeout($r),Xi(a)?i.classList.toggle("is-active",r.isShifted):i.classList.contains("is-pressed")&&(i.classList.remove("is-pressed"),r.isShifted&&a.shift?typeof a.shift=="string"?r.executeCommand(["insert",a.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):sl(a.shift):sl(a),r.shiftPressCount===1&&!t.shiftKey&&(r.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function sl(e){var t;let i=e.command;!i&&e.insert&&(i=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!i&&e.key&&(i=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!i&&e.latex&&(i=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),i||(i=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=Vt.singleton)==null||t.executeCommand(i)}function M1(e){if(e.nodeType!==1)return!1;let t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function qi(e){if(!e)return;let t=e;for(;t&&!M1(t);)t=t.parentElement;return t??void 0}function Xi(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var Vt=class Qd{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,i,r;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(i=(t=window.document)==null?void 0:t.body)!=null?i:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(a=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(r=window.top)==null||r.addEventListener("message",this)}catch{window.addEventListener("message",this)}document.body.addEventListener("focusin",a=>{let o=a.target;o!=null&&o.isConnected&&setTimeout(()=>{let n=Xc();n&&!n.readOnly&&n.mathVirtualKeyboardPolicy==="auto"&&Eh()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",a=>{a.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Xc()||this.hide()},300)})}get currentLayer(){var t,i,r;return(r=(i=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:i.id)!=null?r:""}set currentLayer(t){var i;if(!this._element){this.latentLayer=t;return}let r=t?this._element.querySelector(`#${t}.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(t){var i;this._shiftPressCount=t>2||t<0?0:t,(i=this._element)==null||i.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){let i="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[i]=t,i}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){let i=this.normalizedLayouts;for(let r of i)for(let a of r.layers)if(a.id===t)return a}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){let i=Array.isArray(t)?[...t]:[t],r=i.findIndex(a=>a==="default");r>=0&&i.splice(r,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(i),this._normalizedLayouts=i.map(a=>Zd(a))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new Qd}catch{this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,i,r){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(i)||this.listeners[t].add(i)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(i=>{typeof i=="function"?i(t):i==null||i.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,i,r){this.listeners[t]&&this.listeners[t].delete(i)}get element(){return this._element}set element(t){var i;this._element!==t&&((i=this._element)==null||i.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;let i=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return i?i.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,i;let r=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${r}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);let a=r-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${a}px)`:`${a}px`}else(i=this._element)==null||i.style.setProperty("--_keyboard-height",`${r}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;let t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;let t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));let i=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(i)for(let r of i){let a=this.getKeycap(r.id);if(a){let[o,n]=Uo(a,{shifted:this.isShifted});r.innerHTML=window.MathfieldElement.createHTML(o),r.className=n}}}show(t){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 a=this._element.getElementsByClassName("MLK__plate")[0];if(a&&this.observer.observe(a),r===window.document.body){let o=r.style.paddingBottom;this.originalContainerBottomPadding=o;let n=a.offsetHeight-1;r.style.paddingBottom=o?`calc(${o} + ${n}px)`:`${n}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,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var a;return(a=this._element)==null?void 0:a.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var i;let r=this.container;if(r&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;let a=this._element.getElementsByClassName("MLK__plate")[0];a&&this.observer.unobserve(a),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}),Tr(),b1(),(i=this._element)==null||i.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(r.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,i;return(i=(t=this.element)==null?void 0:t.offsetHeight)!=null?i:0}buildAndAttachElement(){var t;this.element,this.element=x1(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",i=>{i.shiftKey||((i.ctrlKey||i.button===2)&&Xd(i.target),i.preventDefault(),i.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(Ol(t)){if(!El(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(t.source,this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,i){let{action:r}=t;if(r==="execute-command"){let{command:a}=t,o=Ji(a);if(window.top!==void 0&&o!=="virtual-keyboard")return;this.executeCommand(a);return}if((r==="connect"||r==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},i),r!=="disconnect"&&window===window.top){if(r==="show"){typeof t.animate<"u"?this.show({animate:t.animate}):this.show();return}if(r==="hide"){typeof t.animate<"u"?this.hide({animate:t.animate}):this.hide();return}if(r==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(r==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},i);return}}}sendMessage(t,i,r){if(r||(r=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||r===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:f({type:Co,action:t},i)}));return}if(r)r.postMessage(f({type:Co,action:t},i),{targetOrigin:this.targetOrigin});else if(i.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:i.command})),t==="execute-command"&&Array.isArray(i.command)&&i.command[0]==="insert"){let a=i.command[1].split("");for(let o of a)this.dispatchEvent(new KeyboardEvent("keydown",{key:o,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:o,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},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(t){let i=this._element;if(!i)return;i.classList.toggle("is-math-mode",t.mode==="math"),i.classList.toggle("is-text-mode",t.mode==="text"),i.classList.toggle("can-undo",t.canUndo),i.classList.toggle("can-redo",t.canRedo),i.classList.toggle("can-copy",!t.selectionIsCollapsed),i.classList.toggle("can-copy",!t.selectionIsCollapsed),i.classList.toggle("can-paste",!0);let r=i.querySelectorAll(".ML__edit-toolbar");if(r)for(let a of r)a.innerHTML=m1(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let i,r=[],a=Ji(t);return _e(t)?(i=t[0],i==="performWithFeedback"&&(t=t.slice(1),a=Ji(t)),r=t.slice(1)):i=t,i=i.replace(/-\w/g,o=>o[1].toUpperCase()),a==="virtual-keyboard"?lt[i].fn(void 0,...r):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Xc(){var e,t;let i=Mo(),r=null;for(;i;){if("host"in i&&((t=(e=i.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){r=i.host;break}i=i.parentNode}return r}if(Pe()&&!("mathVirtualKeyboard"in window))if(window===window.top){let e=Vt.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>n1.singleton,configurable:!0});function Do(e){let t={};for(let i of Object.keys(e))switch(i){case"scriptDepth":let r=e.scriptDepth;if(_e(r))t.scriptDepth=[r[0],r[1]];else if(typeof r=="number")t.scriptDepth=[r,r];else if(typeof r=="string"){let[o,n]=r.split(",").map(l=>parseInt(l.trim()));t.scriptDepth=[o,n]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let a=e.mathVirtualKeyboardPolicy.toLowerCase();if(a==="sandboxed"){if(window!==window.top){let o=Vt.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>o})}a="manual"}t.mathVirtualKeyboardPolicy=a;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?z.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5:  valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=Yn(e.macros);break;default:_e(e[i])?t[i]=[...e[i]]:typeof e[i]=="object"&&!(e[i]instanceof Element)&&i!=="computeEngine"?t[i]=f({},e[i]):t[i]=e[i]}return t}function di(e,t){let i;typeof t=="string"?i=[t]:t===void 0?i=Object.keys(e):i=t;let r={};for(let a of i)e[a]===null?r[a]=null:_e(e[a])?r[a]=[...e[a]]:typeof e[a]=="object"&&!(e[a]instanceof Element)&&a!=="computeEngine"?r[a]=f({},e[a]):r[a]=e[a];return typeof t=="string"?r[t]:r}function lo(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:To,backgroundColorMap:kl,letterShapeStyle:z.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"▢",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:Sp,inlineShortcuts:N0,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Mp,value:""}}function Gc(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function Pt(e,t){!e||!t||(_e(e)?e.forEach(i=>Pt(i,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),Pt(e.body,t),Pt(e.above,t),Pt(e.below,t),Pt(e.subscript,t),Pt(e.superscript,t)))}function ul(e,t,i,r){function a(n,l){for(let s of o)if(s.style[n]!==l)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;let o=e.getAtoms(t,{includeChildren:!0});r.operation==="toggle"&&(i.color&&a("color",i.color)&&(i.color="none",delete i.verbatimColor),i.backgroundColor&&a("backgroundColor",i.backgroundColor)&&(i.backgroundColor="none",delete i.verbatimBackgroundColor),i.fontFamily&&a("fontFamily",i.fontFamily)&&(i.fontFamily="none"),i.fontSeries&&a("fontSeries",i.fontSeries)&&(i.fontSeries="auto"),i.fontShape&&a("fontShape",i.fontShape)&&(i.fontShape="auto"),i.fontSize&&a("fontSize",i.fontSize)&&(i.fontSize=Cl),i.variant&&a("variant",i.variant)&&(i.variant="normal"),i.variantStyle&&a("variantStyle",i.variantStyle)&&(i.variantStyle=""));for(let n of o)n.applyStyle(i);return!0}function S1(e,t){let i=e.at(e.position);if(i.type==="composition")i.value=t;else{let{caret:r}=i;i.caret=void 0;let a=new od(t,{mode:i.mode});a.caret=r,i.parent.addChildAfter(a,i),e.position+=1}}function C1(e){let t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}B0(["math","displaymath"],$e);B0("center",$e);x("displaylines","",{parse:e=>{let t=[],i=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([i]),i=[]):i.push(...e.scan(r=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(r)))}while(!0);return e.endContext(),t.push([i]),t},createAtom:e=>new R("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})});xt("array","{columns:colspec}",(e,t,i,r)=>new R(e,Il(t),i,{columns:r[0],mathstyleName:"textstyle"}));xt(["equation","equation*","subequations"],"",(e,t,i)=>new R(e,Il(t),i,{columns:[{align:"c"}]}));xt(["multline","multline*"],"",$e);xt(["align","align*","aligned","eqnarray"],"",$e);xt("split","",$e);xt(["gather","gathered"],"",$e);xt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",$e);xt(["smallmatrix","smallmatrix*"],"[columns:colspec]",$e);xt(["cases","dcases","rcases"],"",$e);function D1(e){for(let t of e)for(let i of t)if(i.length>0)return!1;return!0}function Il(e,t=1){return D1(e)?Array(t).fill([[new v({type:"first"}),new vt]]):e.map(i=>i.length===0?[[new v({type:"first"})]]:i.map(r=>r.length===0?[new v({type:"first"})]:(r[0].type!=="first"&&r.unshift(new v({type:"first"})),r)))}function $e(e,t=[[[]]],i=[],r=[]){switch(t=Il(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new R(e,t,i,{mathstyleName:"textstyle"});case"displaymath":return new R(e,t,i,{mathstyleName:"textstyle"});case"center":return new R(e,t,i,{columns:[{align:"c"}]});case"multline":case"multline*":return new R(e,t,i,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new R(e,t,i,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new R(e,t,i,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Qt(r[0])});case"bmatrix":case"bmatrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Qt(r[0])});case"Bmatrix":case"Bmatrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Qt(r[0])});case"vmatrix":case"vmatrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Qt(r[0])});case"Vmatrix":case"Vmatrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Qt(r[0])});case"matrix":case"matrix*":return new R(e,t,i,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Qt(r==null?void 0:r[0])});case"smallmatrix":case"smallmatrix*":return new R(e,t,i,{mathstyleName:"scriptstyle",columns:Qt(r==null?void 0:r[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new R(e,t,i,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new R(e,t,i,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new R(e,t,i,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let a=0;for(let l of t)a=Math.max(a,l.length);let o=[{gap:0},{align:"r"},{gap:.25},{align:"l"}],n=2;for(;n<a;)o.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),n+=2;return o.push({gap:0}),new R(e,t,i,{arraycolsep:0,columns:o,minColumns:2})}}return new R(e,t,i,{mathstyleName:"textstyle"})}function Qt(e){return e??[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function B1(e,t){let i=e.at(e.position);for(;i&&!(i.parent instanceof R);)i=i.parent;if(i&&i.type==="array"&&i.environmentName,!i||!(i.parent instanceof R)){let r=e.at(e.position);if(i=r,!i.parent.parent){let a=e.extractAtoms([e.position,e.lastOffset]),o=e.extractAtoms([0,e.position]);o.length===0&&(o=Ja()),a.length===0&&(a=Ja());let n;return t.endsWith("column")?(n=$e("split",[[o,a]]),e.root=n,ei(n,0,0)?ti(e,n,0,0):ei(n,0,1)?ti(e,n,0,1):e.position=e.offsetOf(r)):(n=$e("lines",[[o],[a]]),e.root=n,ei(n,0,0)?ti(e,n,0,0):ei(n,1,0)?ti(e,n,1,0):e.position=e.offsetOf(r)),[void 0,[0,0]]}if(i.parent instanceof Z){let a=i.parent,o=e.extractAtoms([e.position,e.offsetOf(a.lastChild)]),n=e.extractAtoms([e.offsetOf(a.firstChild),e.position]);n.length===0&&(n=Ja()),o.length===0&&(o=Ja());let l="pmatrix",s=a.leftDelim,u=a.rightDelim;s==="("&&(u===")"||u==="?")?l="pmatrix":(s==="["||s==="\\lbrack")&&(u==="]"||u==="\\rbrack"||u==="?")?l="bmatrix":s==="\\vert"&&u==="\\vert"?l="vmatrix":s==="\\Vert"&&u==="\\Vert"?l="Vmatrix":(s==="{"||s==="\\lbrace")&&(u==="."||u==="?")&&(l="cases");let c=$e(l,t.endsWith("column")?[[n,o]]:[[n],[o]]);return a.parent.addChildBefore(c,a),a.parent.removeChild(a),ei(c,0,0)?ti(e,c,0,0):t.endsWith("column")?ei(c,0,1)?ti(e,c,0,1):e.position=e.offsetOf(i):ei(c,1,0)?ti(e,c,1,0):e.position=e.offsetOf(i),[void 0,[0,0]]}}return i&&i.parent instanceof R?[i.parent,i.parentBranch]:[void 0,[0,0]]}function ei(e,t,i){let r=e.getCell(t,i);return!r||r.length!==2?!1:r[1].type==="placeholder"}function A1(e,t,i,r){let a=t.getCell(i,r);return a?[e.offsetOf(a[0]),e.offsetOf(a[a.length-1])]:-1}function ti(e,t,i,r){let a=A1(e,t,i,r);typeof a!="number"&&e.setSelection(a)}function Ua(e,t,i,r,a){let o=t.getCell(i,r);o&&e.setPositionHandlingPlaceholder(e.offsetOf(o[a==="start"?0:o.length-1]))}function Jo(e,t){let[i,[r,a]]=B1(e,t);if(i)switch(t){case"after row":i.addRowAfter(r),Ua(e,i,r+1,0,"end");break;case"after column":if(i.maxColumns<=i.colCount){e.announce("plonk");return}i.addColumnAfter(a),Ua(e,i,r,a+1,"end");break;case"before row":i.addRowBefore(r),Ua(e,i,r,0,"start");break;case"before column":if(i.maxColumns<=i.colCount){e.announce("plonk");return}i.addColumnBefore(a),Ua(e,i,r,a,"start");break}}function eh(e){return e.contentWillChange({inputType:"insertText"})?(Jo(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function L1(e){return e.contentWillChange({inputType:"insertText"})?(Jo(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function th(e){return e.contentWillChange({inputType:"insertText"})?(Jo(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function E1(e){return e.contentWillChange({inputType:"insertText"})?(Jo(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function ih(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let i=".",r=".";switch(t){case"pmatrix":case"pmatrix*":i="(",r=")";break;case"bmatrix":case"bmatrix*":i="[",r="]";break;case"Bmatrix":case"Bmatrix*":i="\\lbrace",r="\\rbrace";break;case"vmatrix":case"vmatrix*":i="\\vert",r="\\vert";break;case"Vmatrix":case"Vmatrix*":i="\\Vert",r="\\Vert";break;case"matrix":case"matrix*":i=".",r=".";break;case"cases":case"dcases":i="\\lbrace";break;case"rcases":r="\\rbrace";break}let a=e.at(e.position),o=a.type==="array"?a:e.parentEnvironment;return o.environmentName=t,o.leftDelim=i,o.rightDelim=r,e.contentDidChange({}),!0}function rh(e,t){let i=e.at(e.position);for(;i&&!(Array.isArray(i.parentBranch)&&i.parent instanceof R);)i=i.parent;if(Array.isArray(i==null?void 0:i.parentBranch)&&(i==null?void 0:i.parent)instanceof R){let r=i.parent,a=i.parentBranch,o;switch(t){case"row":if(r.rowCount>1){r.removeRow(a[0]);let n=r.getCell(Math.max(0,a[0]-1),a[1]);o=e.offsetOf(n[n.length-1])}break;case"column":if(r.colCount>r.minColumns){r.removeColumn(a[1]);let n=r.getCell(a[0],Math.max(0,a[1]-1));o=e.offsetOf(n[n.length-1])}break}o&&e.setPositionHandlingPlaceholder(o)}}function K1(e){return e.contentWillChange({inputType:"deleteContent"})?(rh(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function F1(e){return e.contentWillChange({inputType:"deleteContent"})?(rh(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}Me({addRowAfter:eh,addColumnAfter:th,addRowBefore:L1,addColumnBefore:E1,removeRow:K1,removeColumn:F1,setEnvironment:ih},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Ja(){return[new vt]}var ah=class oh{constructor(t){this.recording=!1,this.model=t,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(t){t&&this.index>=0&&(this.stack[this.index].selection=t),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(t){return this.recording?(t&&t===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>oh.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t??"",!0):!1}};ah.maximumDepth=1e3;var T1=ah;function cl(e,t,i){if(e.at(t).mode!=="text")return t;let r=i==="backward"?-1:1,a;if(Nr.test(e.at(t).value)){let o=t,n;do n=e.at(o).mode==="text"&&Nr.test(e.at(o).value),o+=r;while(e.at(o)&&n);a=e.at(o)?o-2*r:o-r}else if(/\s/.test(e.at(t).value)){let o=t;for(;e.at(o)&&e.at(o).mode==="text"&&/\s/.test(e.at(o).value);)o+=r;if(!e.at(o))a=o-r;else{let n=!0;do n=e.at(o).mode==="text"&&!/\s/.test(e.at(o).value),o+=r;while(e.at(o)&&n);a=e.at(o)?o-2*r:o-r}}else{let o=t;for(;e.at(o)&&e.at(o).mode==="text"&&!/\s/.test(e.at(o).value);)o+=r;a=e.at(o)?o:o-r;let n=!0;for(;e.at(o)&&n;)n=e.at(o).mode==="text"&&/\s/.test(e.at(o).value),n&&(a=o),o+=r;a=e.at(o)?o-2*r:o-r}return a-(r>0?0:1)}function Ri(e,t,i){var r,a,o,n,l,s,u;let c=e.position;(r=i==null?void 0:i.extend)!=null&&r||e.collapseSelection(t);let d=e.at(e.position);if(t==="forward"&&(d.type==="subsup"?(d=d.rightSibling,d||(d=e.at(e.position+1))):d=e.at(e.position+1)),!d)return e.announce("plonk"),!1;let h=e.offsetOf(d);if(d instanceof Wr)h=cl(e,h,t);else if(d instanceof se)if(d.isSuggestion)for(;d&&d instanceof se;)d.isSuggestion=!1,h=e.offsetOf(d),d=d.rightSibling;else if(t==="forward"){if(d=d.rightSibling,!d||!(d instanceof se))return e.announce("plonk"),!1;for(;d&&d instanceof se&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.rightSibling}else{if(d=d.leftSibling,!d||!(d instanceof se))return e.announce("plonk"),!1;for(;d&&d instanceof se&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.leftSibling}else if(t==="forward"&&d.type==="mopen"){let p=0;do d.type==="mopen"?p+=1:d.type==="mclose"&&(p-=1),d=d.rightSibling;while(!d.isLastSibling&&p!==0);h=e.offsetOf(d.leftSibling)}else if(t==="backward"&&d.type==="mclose"){let p=0;do d.type==="mopen"?p+=1:d.type==="mclose"&&(p-=1),d=d.leftSibling;while(!d.isFirstSibling&&p!==0);h=e.offsetOf(d)}else if(t==="backward")if(d.type==="first")for(;h>0&&d.type==="first";)h-=1,d=e.at(h);else{let p=d.type;d.type==="subsup"&&(h=e.offsetOf(e.at(h).leftSibling)),h-=1;let m=(a=e.at(h))==null?void 0:a.type;for(;h>=0&&m===p;)((o=e.at(h))==null?void 0:o.type)==="subsup"?h=e.offsetOf(e.at(h).leftSibling):h-=1,m=e.at(h).type}else{let{type:p}=d,m=(n=e.at(h))==null?void 0:n.type,{lastOffset:y}=e;for(;h<=y&&(m===p||m==="subsup");){for(;((l=e.at(h).rightSibling)==null?void 0:l.type)==="subsup";)h=e.offsetOf(e.at(h).rightSibling);h+=1,m=(s=e.at(h))==null?void 0:s.type}h-=1}if((u=i==null?void 0:i.extend)!=null&&u){if(!e.setSelection(e.anchor,h))return e.announce("plonk"),!1}else{if(h===e.position)return e.announce("plonk"),!1;e.position=h}return e.announce("move",c),e.mathfield.stopCoalescingUndo(),!0}function st(e,t,i){var r,a;if(i=i??{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){let[l,s]=Hd(e);l!==void 0&&s!==void 0&&e.deleteAtoms([l,s])}if(t==="upward")return $1(e,i);if(t==="downward")return P1(e,i);if(i.extend){let l=so(e,e.position,t);l<0&&(l=0),l>e.lastOffset&&(l=e.lastOffset);let s=e.setSelection(e.anchor,l);return e.mathfield.stopCoalescingUndo(),s}if(e.selectionIsPlaceholder){e.collapseSelection(t);let l=st(e,t);return e.mathfield.stopCoalescingUndo(),l}let o=e.position,n=o;if(e.collapseSelection(t)?(o=e.position,nh(e,o)||(o=so(e,o,t))):o=so(e,o,t),o<0||o>e.lastOffset){let l=!0;return e.silenceNotifications||(l=(a=(r=e.mathfield.host)==null?void 0:r.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?a:!0),l&&e.announce("plonk"),l}return e.setPositionHandlingPlaceholder(o),e.mathfield.stopCoalescingUndo(),e.announce("move",n),!0}function so(e,t,i){return t=t+(i==="forward"?1:-1),t<0||t>e.lastOffset||nh(e,t)?t:so(e,t,i)}function nh(e,t){var i;let r=e.at(t),a=r.parent;for(;a&&!a.inCaptureSelection;)a=a.parent;return!(a!=null&&a.inCaptureSelection||(i=r.parent)!=null&&i.skipBoundary&&(!r.isFirstSibling&&r.isLastSibling||r.type==="first")||e.mathfield.hasEditablePrompts&&!r.parentPrompt)}function z1(e,t,i){let r=1/0,a=0;for(;a<t.length;a++){let o=W0(e.getHTMLElement(t[a])).right,n=Math.abs(i-o);if(n<=r)r=n;else break}return t[a-1]}function Bo(e,t,i,r,a){let o=e.mathfield.hasEditablePrompts,n=o?i.filter(u=>u.type==="prompt"&&!u.captureSelection):i,l=W0(e.mathfield.getHTMLElement(t)).right,s=e.offsetOf(z1(e.mathfield,n,l))-(o?1:0);if(r){let[u,c]=e.selection.ranges[0],d;s<(a==="up"?u:c)?d={ranges:[[s,c]],direction:"backward"}:d={ranges:[[u,s]],direction:"forward"},e.setSelection(d)}else e.setPositionHandlingPlaceholder(s);e.announce(`move ${a}`)}function $1(e,t){var i,r;let a=(i=t==null?void 0:t.extend)!=null?i:!1;a||e.collapseSelection("backward");let o=()=>{var s,u;let c=!0;return e.silenceNotifications||(c=(u=(s=e.mathfield.host)==null?void 0:s.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0),e.announce(c?"plonk":"line"),c},n=e.at(e.position),l=n;for(;l&&l.parentBranch!=="below"&&!(Array.isArray(l.parentBranch)&&l.parent instanceof R);)l=l.parent;if(Array.isArray(l==null?void 0:l.parentBranch)&&l.parent instanceof R){let s=l.parent;if(l.parentBranch[0]<1)return o();let u=l.parentBranch[0]-1,c=s.array[u][l.parentBranch[1]];if(!c.some(d=>d.type==="prompt"&&!d.captureSelection)&&e.mathfield.hasEditablePrompts)return o();Bo(e,n,c,a,"up")}else if(l){let s=(r=l.parent.branch("above"))!=null?r:l.parent.createBranch("above");if(!s.some(u=>u.type==="prompt"&&u.placeholderId)&&e.mathfield.hasEditablePrompts)return o();Bo(e,n,s,a,"up")}else return o();return e.mathfield.stopCoalescingUndo(),!0}function P1(e,t){var i,r;let a=(i=t==null?void 0:t.extend)!=null?i:!1;a||e.collapseSelection("forward");let o=()=>{var s,u;let c=!0;return e.silenceNotifications||(c=(u=(s=e.mathfield.host)==null?void 0:s.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0),e.announce(c?"plonk":"line"),c},n=e.at(e.position),l=n;for(;l&&l.parentBranch!=="above"&&!(Array.isArray(l.parentBranch)&&l.parent instanceof R);)l=l.parent;if(Array.isArray(l==null?void 0:l.parentBranch)&&l.parent instanceof R){let s=l.parent;if(l.parentBranch[0]+1>s.array.length-1)return o();let u=l.parentBranch[0]+1,c=s.array[u][l.parentBranch[1]];if(!c.some(d=>d.type==="prompt"&&!d.captureSelection)&&e.mathfield.hasEditablePrompts)return o();Bo(e,n,c,a,"down")}else if(l){let s=(r=l.parent.branch("below"))!=null?r:l.parent.createBranch("below");if(!s.some(u=>u.type==="prompt")&&e.mathfield.hasEditablePrompts)return o();Bo(e,n,s,a,"down")}else return o();return!0}function lh(e){let t=e.position,i=e.at(t).parent;return i!=null&&i.parent?(e.position=e.offsetOf(i),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function O1(e){let t=0,i=e.at(e.position),r=!1;for(;i;)(!i.hasEmptyBranch("superscript")||!i.hasEmptyBranch("subscript"))&&(t+=1),i.hasEmptyBranch("superscript")?i.hasEmptyBranch("subscript")||(r=!1):r=!0,i=i.parent;return r?t:0}function I1(e){let t=0,i=e.at(e.position),r=!1;for(;i;)(!i.hasEmptyBranch("superscript")||!i.hasEmptyBranch("subscript"))&&(t+=1),i.hasEmptyBranch("superscript")?i.hasEmptyBranch("subscript")||(r=!0):r=!1,i=i.parent;return r?t:0}function Zc(e){var t;if(e.collapseSelection(),O1(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let i=e.at(e.position);return i.subsupPlacement===void 0&&(((t=i.rightSibling)==null?void 0:t.type)!=="subsup"&&i.parent.addChildAfter(new qo({style:i.computedStyle}),i),i=i.rightSibling),i.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(i.superscript[0]))),!0}function Yc(e){var t;if(e.collapseSelection(),I1(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let i=e.at(e.position);return i.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&i.parent.addChildAfter(new qo({style:e.at(e.position).computedStyle}),i),i=e.at(e.position+1)),i.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(i.subscript[0]))),!0}function N1(){function e(s){let u=[],c=[];return[...s.querySelectorAll(`input, select, textarea, a[href], button,
        [tabindex], audio[controls], video[controls],
        [contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((d,h)=>{let p=r(d);p===0?u.push(d):c.push({documentOrder:h,tabIndex:p,node:d})}),c.sort((d,h)=>d.tabIndex===h.tabIndex?d.documentOrder-h.documentOrder:d.tabIndex-h.tabIndex).map(d=>d.node).concat(u)}function t(s){return!(!i(s)||a(s)||r(s)<0)}function i(s){return!(s.disabled||s.type==="hidden"&&s.tagName.toUpperCase()==="INPUT"||l(s))}function r(s){var u;let c=Number.parseInt((u=s.getAttribute("tabindex"))!=null?u:"NaN",10);return Number.isNaN(c)?s.contentEditable==="true"||(s.nodeName==="AUDIO"||s.nodeName==="VIDEO")&&s.getAttribute("tabindex")===null?0:s.tabIndex:c}function a(s){return s.tagName.toUpperCase()==="INPUT"&&s.type==="radio"&&!n(s)}function o(s,u){for(let c of s)if(c.checked&&c.form===u)return c;return null}function n(s){var u;if(!s.name)return!0;let c=((u=s.form)!=null?u:s.ownerDocument).querySelectorAll('input[type="radio"][name="'+s.name+'"]'),d=o(c,s.form);return!d||d===s}function l(s){if(!Pe()||s===document.activeElement||s.contains(document.activeElement))return!1;if(getComputedStyle(s).visibility==="hidden")return!0;let u=s.getBoundingClientRect();if(u.width===0||u.height===0)return!0;for(;s;){if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}return Pe()?e(document.body):[]}function ge(e,t,i="forward"){let r=e.position;if(Array.isArray(t)){let a=e.offsetOf(t[0]),o=e.offsetOf(t[t.length-1]);return i==="forward"?e.setSelection(a,o):e.setSelection(o,a),e.announce("move",r),e.mathfield.stopCoalescingUndo(),!0}return i==="forward"?ge(e,[t.leftSibling,t]):ge(e,[t,t.leftSibling])}function Ve(e,t){let i=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{let r=e.offsetOf(t);t.type==="placeholder"?e.setSelection(r-1,r):e.position=r}return e.announce("move",i),e.mathfield.stopCoalescingUndo(),!0}function Ao(e,t,i=!0){var r,a;let o=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&st(e,t);let n,l=e.at(e.anchor).parentPrompt;l?t==="forward"?n=e.offsetOf(l)+1:n=e.offsetOf(l.leftSibling):n=Math.max(e.position+o,0);let s=dl(e,n,t);if(!s||t==="forward"&&e.offsetOf(s)<n||t==="backward"&&e.offsetOf(s)>n){if(!i||!((a=(r=e.mathfield.host)==null?void 0:r.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||a))return e.announce("plonk"),!1;let u=N1();if(!document.activeElement||u.length<=1)return e.announce("plonk"),!1;let c=u.indexOf(document.activeElement)+o;return c<0&&(c=u.length-1),c>=u.length&&(c=0),u[c].focus(),e.mathfield.stopCoalescingUndo(),!0}return Ve(e,s),!0}function dl(e,t=0,i="forward"){return e.findAtom(r=>r.type==="placeholder"||r.type==="prompt"||!e.mathfield.readOnly&&r.treeDepth>2&&r.isFirstSibling&&r.isLastSibling,t,i)}Me({moveToOpposite:e=>{let t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},i=e.at(e.position),{parent:r}=i;if(!r)return e.announce("plonk"),!1;let a=i.parentBranch,o;if(typeof a=="string"&&(o=t[a]),!o){let l=i.subsupPlacement?Yc(e):Zc(e);return e.mathfield.stopCoalescingUndo(),l}r.branch(o)||r.createBranch(o);let n=e.setSelection(e.getBranchRange(e.offsetOf(r),o));return e.mathfield.stopCoalescingUndo(),n},moveBeforeParent:e=>{let{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>lh(e),moveToNextChar:e=>st(e,"forward"),moveToPreviousChar:e=>st(e,"backward"),moveUp:e=>st(e,"upward"),moveDown:e=>st(e,"downward"),moveToNextWord:e=>Ri(e,"forward"),moveToPreviousWord:e=>Ri(e,"backward"),moveToGroupStart:e=>{let t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{let t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,i,r,a;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Ao(e,"forward");let o=e.at(e.position);if(o.mode==="text"){if(e.selectionIsCollapsed){let d=o;for(;d&&d.mode==="text";)d=d.leftSibling;let h=o;for(;((t=h.rightSibling)==null?void 0:t.mode)==="text";)h=h.rightSibling;if(d&&h)return ge(e,[d,h])}if(o.rightSibling.mode==="text"){let d=o;for(;d&&d.mode==="text";)d=d.rightSibling;return d?(Ve(e,(i=d.leftSibling)!=null?i:d),e.mathfield.switchMode("math"),!0):Ve(e,e.lastOffset)}}let n=e.at(e.anchor).parentPrompt,l=n?e.offsetOf(n)+1:Math.max(e.position+1,0),s=dl(e,l,"forward");if(s)return Ve(e,s);let u=Qc(e,o,d=>d.type==="leftright"||d.type==="text","forward");if(u){if(u.mode==="text"){let d=u;for(;d&&d.mode==="text";)d=d.rightSibling;return ge(e,[(r=u.leftSibling)!=null?r:u,(a=d.leftSibling)!=null?a:d])}return ge(e,u)}let c=o.parent;if(c){if(c.type==="leftright"||c.type==="surd")return ge(e,c);if(o.parentBranch==="superscript"&&c.subscript)return ge(e,c.subscript);if(o.parentBranch==="above"&&c.below)return ge(e,c.below);if(o.parentBranch==="superscript"||o.parentBranch==="subscript")return Ve(e,c);if(o.parentBranch==="above"||o.parentBranch==="below")return ge(e,c)}return Ve(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return Ao(e,"backward");let i=e.at(e.position),r=i.mode;if(r==="text"){if(e.selectionIsCollapsed){let l=i;for(;l&&l.mode==="text";)l=l.leftSibling;let s=i;for(;((t=s.rightSibling)==null?void 0:t.mode)==="text";)s=s.rightSibling;if(l&&s)return ge(e,[l,s])}for(;i&&i.mode==="text";)i=i.leftSibling;return i?Ve(e,i):Ve(e,0)}let a=e.at(e.anchor).parentPrompt,o=a?e.offsetOf(a.leftSibling):Math.max(e.position-1,0),n=dl(e,o,"backward");if(n)return Ve(e,n);if(r==="math"){let l=Qc(e,i,u=>u.type==="leftright"||u.type==="text","backward");if(l){if(l.mode==="text"){let u=l;for(;u&&u.mode==="text";)u=u.leftSibling;return ge(e,[l,u])}return ge(e,l)}let s=i.parent;if(s){if(s.type==="leftright"||s.type==="surd")return ge(e,s);if(i.parentBranch==="subscript"&&s.superscript)return ge(e,s.superscript);if(i.parentBranch==="below"&&s.above)return ge(e,s.above);if(i.parentBranch==="superscript"||i.parentBranch==="subscript")return Ve(e,s);if(i.parentBranch==="above"||i.parentBranch==="below")return ge(e,s)}return Ve(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Zc,moveToSubscript:Yc},{target:"model",changeSelection:!0});Me({moveToNextPlaceholder:e=>Ao(e,"forward"),moveToPreviousPlaceholder:e=>Ao(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function Qc(e,t,i,r){if(r==="forward"){let o=t.rightSibling;for(;o&&!i(o);)o=o.rightSibling;return o}let a=t.leftSibling;for(;a&&!i(a);)a=a.leftSibling;return a}function Xa(e,t,i){typeof t=="function"&&(i=t,t=1/0),t===void 0&&(t=1/0);let r=e.position,a=!1,o="";for(;!a;){let n=e.at(r);a=t===0||n===void 0||n.type==="first"||n.mode!=="math"||!(n.type&&/mord|mpunct|operator/.test(n.type)||n.type==="mop"&&/[a-zA-Z ]+/.test(n.value))||!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript")||typeof i=="function"&&!i(n),a||(n.mode="text",n.command=n.value,n.verbatimLatex=void 0,o+=n.value),r-=1,t-=1}e.contentDidChange({data:o,inputType:"insertText"})}function wr(e,t,i){typeof t=="function"&&(i=t,t=1/0),t===void 0&&(t=1/0);let r=e.position,a=!1,o=[];for(;!a;){let n=e.at(r);a=t===0||!n||n.type==="first"||n.isFirstSibling||n.mode!=="text"||n.value===" "||typeof i=="function"&&!i(n),a||(o.push(v.serialize([n],{defaultMode:"math"})),n.mode="math"),r-=1,t-=1}Nl(e),e.contentDidChange({data:P(o),inputType:"insertText"})}function Nl(e){var t;let i=e.position-1;for(;i>=0&&((t=e.at(i))==null?void 0:t.mode)==="math";)i-=1;if(!(i<0)&&e.at(i).mode==="text"&&e.at(i).value===" "&&e.at(i-1).mode==="math"){e.at(i-1).parent.removeChild(e.at(i-1));let r=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=r,e.contentDidChange({inputType:"deleteContent"})}}function q1(e){let t="",i=e.position,r=!1;for(;!r;){let a=e.at(i);r=!(a&&(a.mode==="text"||a.mode==="math"&&a.type&&/mord|mpunct/.test(a.type))),r||(t=a.value+t),i-=1}return t}function R1(e,t,i){let{model:r}=e;if(r.mode==="latex"||!r.at(r.position).isLastSibling||!i||!Ro(i))return!1;let a=Pi(i);if(!r.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(a));let o=q1(r)+a;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(a))return!0;if(/[\^_]/.test(a))return/(^|\s)[a-zA-Z][^_]$/.test(o)&&wr(r,1),!0;let n={")":"(","}":"{","]":"["}[a],{parent:l}=r.at(r.position);if(n&&l instanceof Z&&l.leftDelim===n)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(o))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(a))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(o))return wr(r,1),!1;if(/\D\.[^\d\s]$/.test(o)){wr(r,1);let s=r.at(r.position);return s.value="⋅",s.style.variant="normal",s.command="\\cdot",s.verbatimLatex=void 0,r.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(o)||/\.\d$/.test(o)||/\([\d+\-.]$/.test(o))return wr(r,1),!0;if(/\([a-z][,;]$/.test(o))return wr(r,2),!0;if(/[\d+\-=><*|]$/.test(a))return Nl(r),!0}else{if(t==="[Space]")return Xa(r,void 0,n=>/[a-z][:,;.]$/.test(n.value)),!0;if(/[a-zA-Z]{3,}$/.test(o)&&!/(dxd|abc|xyz|uvw)$/.test(o))return Xa(r,void 0,n=>/[a-zA-Z]/.test(n.value)),!0;if(/(^|\W)(if)$/i.test(o))return Xa(r,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 Xa(r,void 0,n=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(n.value)),!0;if(a==="?"||a==="."&&!/[\d-+]\.$/.test(o))return!0}return!1}function V1(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;let i=sh(),r=e.element.getBoundingClientRect();i.style.left=`${r.left}px`,i.style.top=`${r.top-64}px`,i.innerHTML=window.MathfieldElement.createHTML("<span>"+(zl(t)||t)+"</span>"+i.innerHTML),i.style.visibility="visible",setTimeout(()=>{i.childNodes.length>0&&i.childNodes[i.childNodes.length-1].remove(),i.childNodes.length===0&&(i.style.visibility="hidden")},3e3)}function H1(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){let t=sh();t.innerHTML=""}else{let t=Ho("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function sh(){return document.getElementById("mathlive-keystroke-caption-panel")||(bt("keystroke-caption"),bt("core"),Ho("mathlive-keystroke-caption-panel"))}function j1(){document.getElementById("mathlive-keystroke-caption-panel")&&($l("mathlive-keystroke-caption-panel"),Nt("core"),Nt("keystroke-caption"))}function uh(e,t){var i,r,a;let{model:o}=e,n=Vd(t);if(t.isTrusted){Tm(t);let p=Rr();e.keyboardLayout!==p.id&&(e.keyboardLayout=p.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,V1(e,n),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let l,s="",u,c=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(o.mode==="math")if(n==="[Backspace]")c.pop();else if(!Ro(t))e.flushInlineShortcutBuffer();else{let p=Pi(t),m=[...(r=(i=c[c.length-1])==null?void 0:i.keystrokes)!=null?r:[],p];c.push({state:o.getState(),keystrokes:m,leftSiblings:W1(e)});let y=0,M="";for(;!l&&y<m.length;)u=c.length-(m.length-y),M=m.slice(y).join(""),l=Al(c[u].leftSiblings,M,e.options.inlineShortcuts),!l&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(M)&&(l=e.options.onInlineShortcut(e,M)),y+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(l?e.switchMode("math"):R1(e,n,t)&&(e.switchMode({math:"text",text:"math"}[o.mode]),s=""))}if(!l){if(s||(s=Nm(e.keybindings,o.mode,t)),!s&&(n==="[Enter]"||n==="[Return]")){let p=!1;return o.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(p=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),p||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),o.contentDidChange({inputType:"insertLineBreak"})),p}if((!s||n==="[Space]")&&o.mode==="math"){if(n==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return J.insert(o,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),s="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;let p=o.at(o.position+1),m=o.at(o.position-1);if((p==null?void 0:p.mode)==="text"||(m==null?void 0:m.mode)==="text")return J.insert(o," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(a=o.at(o.position))!=null&&a.isDigit()&&window.MathfieldElement.decimalSeparator===","&&Pi(t)===","&&(s="insertDecimalSeparator")}}if(!l&&!s){if(o.mathfield.smartFence){if(pl(o,Pi(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{let{parent:p}=o.at(o.position);if(p instanceof Z&&p.rightDelim==="?"&&o.at(o.position).isLastSibling&&/^[)}\]|]$/.test(n))return e.snapshot(),p.isDirty=!0,p.rightDelim=n,o.position+=1,o.selectionDidChange(),o.contentDidChange({data:Pi(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!o.selectionIsCollapsed){let m=Pi(t);if(m==="("||m==="{"||m==="["){let y={"(":"(","{":"\\lbrace","[":"\\lbrack"}[m],M={"(":")","{":"\\rbrace","[":"\\rbrack"}[m],[g,_]=pe(o.selection);return e.snapshot(),o.position=_,J.insert(o,M,{format:"latex"}),o.position=g,J.insert(o,y,{format:"latex"}),o.setSelection(g+1,_+1),o.contentDidChange({data:m,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}let d=o.at(Math.max(o.position,o.anchor)),{parent:h}=d;if(s==="moveAfterParent"&&(h==null?void 0:h.type)==="leftright"&&d.isLastSibling&&e.options.smartFence&&pl(o,".",e.defaultStyle)&&(s="",Y(e)),e.keyboardDelegate.cancelComposition(),s)e.executeCommand(s);else if(l){let p=e.effectiveStyle;o.setState(c[u].state);let m=c[c.length-1].keystrokes;for(let y of m)J.insert(o,y,{silenceNotifications:!0,style:p});e.snapshot("insert-shortcut"),o.setState(c[u].state),o.deferNotifications({content:!0,selection:!0,data:l,type:"insertText"},()=>(J.insert(o,l,{format:"latex",style:p}),Nl(e.model),l.endsWith(" ")&&(e.switchMode("text"),J.insert(o," ",{style:p,mode:"text"})),e.snapshot(),o.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,o.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function hl(e,t,i){let{model:r}=e;if(!e.isSelectionEditable){r.announce("plonk");return}i!=null||(i={}),i.focus&&e.focus(),i.feedback&&window.MathfieldElement.playSound("keypress"),typeof i.mode=="string"&&(e.switchMode(i.mode),e.snapshot());let a=E0(t),o=window.mathVirtualKeyboard;if(o!=null&&o.isShifted&&(a=typeof a=="string"?a.toUpperCase():a.map(s=>s.toUpperCase())),i.simulateKeystroke){let s=!0;for(let u of a)uh(e,new KeyboardEvent("keypress",{key:u}))&&(s=!1);if(s)return}let n=r.at(r.position),l=f(f({},n.computedStyle),e.defaultStyle);if(r.selectionIsCollapsed||(r.deleteAtoms(pe(r.selection)),e.snapshot("delete")),r.mode==="latex")r.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{Vo(e);for(let s of a)J.insert(r,s);e.snapshot("insert-latex"),Yr(e)});else if(r.mode==="text"){for(let s of a)J.insert(r,s,{style:l});e.snapshot("insert-text")}else if(r.mode==="math")for(let s of a)U1(e,s,l,n);e.dirty=!0,e.scrollIntoView()}function W1(e){let t=e.model,i=[],r=t.at(Math.min(t.position,t.anchor));for(;r.type!=="first";)i.push(r),r=r.leftSibling;return i}function U1(e,t,i,r){let a=e.model,o={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(o=["insert",e.options.mathModeSpace]),o){e.executeCommand(o);return}if(/\d/.test(t)&&e.options.smartSuperscript&&r.parentBranch==="superscript"&&r.parent.type!=="mop"&&r.parent.type!=="operator"&&r.parent.type!=="extensible-symbol"&&r.hasNoSiblings){J1(a),J.insert(a,t,{style:i}),e.snapshot(),lh(a),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){let n=e.adoptStyle==="left"?r:r.parent?r.rightSibling:null;(n==null?void 0:n.type)==="mord"&&/[a-zA-Z0-9]/.test(n.value)&&(i=f({},i),n.style.variant&&(i.variant=n.style.variant),n.style.variantStyle&&(i.variantStyle=n.style.variantStyle))}J.insert(a,t,{style:i}),e.snapshot(`insert-${a.at(a.position).type}`)}function J1(e){e.selectionIsCollapsed||(e.deleteAtoms(pe(e.selection)),e.mathfield.snapshot("delete"))}function pl(e,t,i){if(!t||e.mode!=="math")return!1;let r=e.at(e.position),{parent:a}=r,o={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!o)return!1;let n=xo[o],l=Io[o];if(!e.selectionIsCollapsed){e.mathfield.snapshot();let[s,u]=pe(e.selection),c=e.extractAtoms([s,u]),d=a.addChildrenAfter([new Z("left...right",c,{leftDelim:o,rightDelim:l})],e.at(s));return e.setSelection(e.offsetOf(d.firstChild),e.offsetOf(d.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:o,inputType:"insertText"}),!0}if(o==="|"){let s=a instanceof Z?a.leftDelim+a.rightDelim:"";if(s==="\\lbrace\\rbrace"||s==="\\{\\}"||s==="\\lbrace?")return e.mathfield.snapshot(),J.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:i}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:o,inputType:"insertText"}),!0}if(l){if(a instanceof Z&&a.firstChild===r&&(a.leftDelim==="?"||a.leftDelim==="."))return a.leftDelim=o,a.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(a instanceof Z)){let d=r;for(;d&&!(d.type==="mclose"&&d.value===l);)d=d.rightSibling;if(d){e.mathfield.snapshot();let h=e.extractAtoms([e.offsetOf(r),e.offsetOf(d)]);return h.pop(),a.addChildrenAfter([new Z("left...right",h,{leftDelim:o,rightDelim:l})],r),e.position=e.offsetOf(a.firstChild)+1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}let s=e.offsetOf(r.lastSibling),u;for(u=e.position;u<=s;u++){let d=e.at(u);if(d instanceof Z&&(d.leftDelim==="?"||d.leftDelim===".")&&e0(o,d.rightDelim))break}let c=e.at(u);if(u<=s&&c instanceof Z){c.leftDelim=o,e.mathfield.snapshot();let d=e.extractAtoms([e.position,u-1]);return d=d.filter(h=>h.type!=="first"),c.addChildren(d,c.parentBranch),e.position+=1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(a instanceof Z&&(a.leftDelim==="?"||a.leftDelim===".")&&e0(o,a.rightDelim)){a.isDirty=!0,a.leftDelim=o,e.mathfield.snapshot();let d=e.extractAtoms([e.offsetOf(r.firstSibling),e.position]);for(let h of d)a.parent.addChildBefore(h,a);return e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(a instanceof Z&&a.leftDelim==="|")){if(e.mathfield.snapshot(),J.insert(e,`\\left${o}\\right?`,{format:"latex",style:i}),r.lastSibling.type!=="first"){let d=e.offsetOf(r.lastSibling),h=e.extractAtoms([e.position,d]);e.at(e.position).body=h,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(n){let s=r;for(;s;){if(s.type==="mopen"&&s.value===n){e.mathfield.snapshot();let p=s.leftSibling,m=e.extractAtoms([e.offsetOf(s.leftSibling),e.offsetOf(r)]);m.shift();let y=new Z("left...right",m,{leftDelim:n,rightDelim:o});return a.addChildrenAfter([y],p),e.position=e.offsetOf(y),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}s=s.leftSibling}if(a instanceof Z&&r.isLastSibling&&$n(a.leftDelim,o))return e.mathfield.snapshot(),a.isDirty=!0,a.rightDelim=o,e.position+=1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;let u=e.offsetOf(r.firstSibling),c;for(c=e.position;c>=u;c--){let p=e.at(c);if(p instanceof Z&&(p.rightDelim==="?"||p.rightDelim===".")&&$n(p.leftDelim,o))break}let d=e.at(c);if(c>=u&&d instanceof Z)return e.mathfield.snapshot(),d.rightDelim=o,d.addChildren(e.extractAtoms([c,e.position]),d.parentBranch),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(a instanceof Z&&(a.rightDelim==="?"||a.rightDelim===".")&&$n(a.leftDelim,o))return e.mathfield.snapshot(),a.isDirty=!0,a.rightDelim=o,a.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(r.lastSibling)]),a.parentBranch),e.position=e.offsetOf(a),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;let h=a.parent;return h instanceof Z&&(h.rightDelim==="?"||h.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(h),pl(e,o,i)):!1}return!1}function $n(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):Io[e]===t:!0}function e0(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):xo[t]===e:!0}Me({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{let t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:H1,toggleContextMenu:e=>{let t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,i,r)=>(e.switchMode(t,i,r),!0),insert:(e,t,i)=>e.insert(t,i),typedText:(e,t,i)=>(hl(e,t,i),!0),insertDecimalSeparator:e=>{let t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,i)=>{let r=e.getPrompts(),a="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o=0;for(;r.includes(a)&&o<100;){if(o===99)return console.error("could not find a unique ID after 100 tries"),!1;a="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o++}return e.insert(`\\placeholder[${t??a}]{}`,i),!0}});Me({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"});Me({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(Yr(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Y(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function X1(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();let i=ml(e,t),{model:r}=e;return r.selectionIsCollapsed?(e.defaultStyle.fontSeries&&i.fontSeries===e.defaultStyle.fontSeries&&(i.fontSeries="auto"),i.fontShape&&i.fontShape===e.defaultStyle.fontShape&&(i.fontShape="auto"),i.color&&i.color===e.defaultStyle.color&&(i.color="none"),i.backgroundColor&&i.backgroundColor===e.defaultStyle.backgroundColor&&(i.backgroundColor="none"),i.fontSize&&i.fontSize===e.defaultStyle.fontSize&&(i.fontSize="auto"),e.defaultStyle=f(f({},e.defaultStyle),i)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{r.selection.ranges.forEach(a=>ul(r,a,i,{operation:"toggle"})),e.snapshot("style-change")}),!0}Me({applyStyle:X1},{target:"mathfield",canUndo:!0,changeContent:!0});function ml(e,t){var i,r,a,o,n,l,s,u,c,d;let h={};if(typeof t.color=="string"){let m=(r=e.colorMap((i=t.color)!=null?i:t.verbatimColor))!=null?r:"none";m!==t.color&&(h.verbatimColor=(a=t.verbatimColor)!=null?a:t.color),h.color=m}if(typeof t.backgroundColor=="string"){let m=(n=e.backgroundColorMap((o=t.backgroundColor)!=null?o:t.verbatimBackgroundColor))!=null?n:"none";m!==t.backgroundColor&&(h.verbatimBackgroundColor=(l=t.verbatimBackgroundColor)!=null?l:t.backgroundColor),h.backgroundColor=m}typeof t.fontFamily=="string"&&(h.fontFamily=t.fontFamily),typeof t.series=="string"&&(h.fontSeries=t.series),typeof t.fontSeries=="string"&&(h.fontSeries=t.fontSeries.toLowerCase()),h.fontSeries&&(h.fontSeries=(s={bold:"b",medium:"m",normal:"m"}[h.fontSeries])!=null?s:h.fontSeries),typeof t.shape=="string"&&(h.fontShape=t.shape),typeof t.fontShape=="string"&&(h.fontShape=t.fontShape.toLowerCase()),h.fontShape&&(h.fontShape=(u={italic:"it",up:"n",upright:"n",normal:"n"}[h.fontShape])!=null?u:h.fontShape),t.variant&&(h.variant=t.variant.toLowerCase()),t.variantStyle&&(h.variantStyle=t.variantStyle.toLowerCase());let p=(c=t.size)!=null?c:t.fontSize;return typeof p=="number"?h.fontSize=Math.max(1,Math.min(10,p)):typeof p=="string"&&(h.fontSize=(d={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[p.toLowerCase()])!=null?d:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[p]),h}function fl(e){let[t,i]=pe(e.selection);if(t=t0(e,t,"backward"),i=t0(e,i,"forward"),t===i){let r=e.at(t);if(r.type==="leftright")return e.setSelection(e.offsetOf(r.firstChild)-1,i);if(r.type==="first"&&(r.parent.type==="leftright"||r.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(r.parent.lastChild)+1);e.setSelection(t-1,i)}else e.setSelection(t,i);return!0}function t0(e,t,i){var r,a,o;let n=e.at(t);if(!n)return t;let l=i==="forward"?1:-1;if(n.mode==="text"){for(;n&&!(n.mode!=="text"||!Nr.test(n.value));)t+=l,n=e.at(t);return i==="backward"?t-1:t}if(n.mode==="latex"){if(/[a-zA-Z\*]/.test(n.value))if(i==="backward")for(;n&&n.mode==="latex"&&n.value!=="\\"&&/[a-zA-Z]/.test(n.value);)t+=l,n=e.at(t);else for(;n&&n.mode==="latex"&&/[a-zA-Z\*]/.test(n.value);)t+=l,n=e.at(t);else if(n.value==="{"){if(i==="forward"){for(;n&&n.mode==="latex"&&n.value!=="}";)t+=l,n=e.at(t);return t}return t-1}else if(n.value==="}"){if(i==="backward"){for(;n&&n.mode==="latex"&&n.value!=="{";)t+=l,n=e.at(t);return t-1}return t}return t-1}if(n.mode==="math"){if(n.isDigit()){for(;(r=e.at(t+l))!=null&&r.isDigit();)t+=l;return i==="backward"?t-1:t}if(n.style.variant||n.style.variantStyle){let s=(a=e.at(t))==null?void 0:a.style;for(;s&&s.variant===n.style.variant&&s.variantStyle===n.style.variantStyle;)s=(o=e.at(t+l))==null?void 0:o.style,t+=l;return i==="backward"?t-1:t}return t}return t}Me({selectGroup:e=>{let t=fl(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>st(e,"forward",{extend:!0}),extendSelectionBackward:e=>st(e,"backward",{extend:!0}),extendToNextWord:e=>Ri(e,"forward",{extend:!0}),extendToPreviousWord:e=>Ri(e,"backward",{extend:!0}),extendSelectionUpward:e=>st(e,"upward",{extend:!0}),extendSelectionDownward:e=>st(e,"downward",{extend:!0}),extendToNextBoundary:e=>Ri(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>Ri(e,"backward",{extend:!0}),extendToGroupStart:e=>{let t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{let t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{let t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{let t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var ii=null,_r=0,Lo=class ze{static start(t,i,r,a){var o;ze.element=t,(o=ze.controller)==null||o.abort(),ze.controller=new AbortController;let n={signal:ze.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",r,n),t.addEventListener("pointerup",a,n),t.addEventListener("pointercancel",a,n),gl(i)&&(ze.pointerId=i.pointerId,t.setPointerCapture(i.pointerId))):(window.addEventListener("mousemove",r,n),window.addEventListener("blur",a,n),window.addEventListener("mouseup",a,n))}static stop(){var t;(t=ze.controller)==null||t.abort(),ze.controller=void 0,typeof ze.pointerId=="number"&&(ze.element.releasePointerCapture(ze.pointerId),ze.pointerId=void 0)}};function gl(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function i0(e,t){var i;if(t.buttons>1)return;e.atomBoundsCache=new Map;let r=e,a,o=!1,n=!1,l="none",s=!1,u=!1,c=t.clientX,d=t.clientY,h=Date.now(),p=r.field,m=setInterval(()=>{s?p.scroll({top:0,left:p.scrollLeft-16}):u&&p.scroll({top:0,left:p.scrollLeft+16})},32);function y(){Lo.stop(),o=!1,clearInterval(m),e.element.classList.remove("tracking"),t&&t.preventDefault()}function M(_){if(!r.hasFocus()){y();return}let D=_.clientX,w=_.clientY,L=gl(_)&&_.pointerType==="touch"?20:5;if(Date.now()<h+500&&Math.abs(c-D)<L&&Math.abs(d-w)<L){_.preventDefault(),_.stopPropagation();return}let K=p.getBoundingClientRect();u=D>K.right,s=D<K.left;let E=a;gl(_)&&(_.isPrimary||(E=Pr(r,_.clientX,_.clientY,{bias:0})));let I=Pr(r,D,w,{bias:D<=c?D===c?0:-1:1});E>=0&&I>=0&&(r.model.extendSelectionTo(E,I),Y(e)),n&&fl(r.model)}ii&&Math.abs(ii.x-c)<5&&Math.abs(ii.y-d)<5&&Date.now()<ii.time+500?(_r+=1,ii.time=h):(ii={x:c,y:d,time:h},_r=1);let g=p.getBoundingClientRect();if(c>=g.left&&c<=g.right&&d>=g.top&&d<=g.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",a=Pr(e,c,d,{bias:0}),a>=0){if(e.element.classList.add("tracking"),t.shiftKey){let _=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,a),Wc(e.model)||_?l="all":l="selection"}else e.model.at(a).type==="placeholder"?(e.model.setSelection(a-1,a),l="selection"):((i=e.model.at(a).rightSibling)==null?void 0:i.type)==="placeholder"?(e.model.setSelection(a,a+1),l="selection"):(e.model.position=a,Wc(e.model)?l="all":l="selection");e.defaultStyle={},t.detail===3||_r>2?(y(),(t.detail===3||_r===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},l="all")):o||(o=!0,Lo.start(p,t,M,y),(t.detail===2||_r===2)&&(n=!0,fl(e.model),l="all"))}e.hasFocus()||(l="none",e.focus({preventScroll:!0}))}else ii=null;e.stopCoalescingUndo(),l!=="none"&&(e.model.selectionIsCollapsed&&(l="all"),Y(e)),t.preventDefault()}function G1(e,t,i){if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)return 0;let r=e-(i.left+i.right)/2,a=t-(i.top+i.bottom)/2;return r*r+a*a}function ch(e,t,i,r,a){if(!i.id)return[1/0,null];if(t.has(i.id))return t.get(i.id);let o=Ur(e,i);if(!o)return[1/0,null];let n=[1/0,null];if(i.hasChildren&&!i.captureSelection&&r>=o.left&&r<=o.right)for(let l of i.children){let s=ch(e,t,l,r,a);s[0]<=n[0]&&(n=s)}return n[1]||(n=[G1(r,a,o),i]),t.set(i.id,n),n}function Z1(e,t,i){let[,r]=ch(e,new Map,e.model.root,t,i);return r}function Pr(e,t,i,r){var a;let o=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!o)return 0;if(t>o.right||i>o.bottom+8)return e.model.lastOffset;if(t<o.left||i<o.top-8)return 0;r=r??{},r.bias=(a=r.bias)!=null?a:0;let n=Z1(e,t,i),l=[],s=n;for(;s;)l.unshift(s),s=s.parent;for(let c of l)if(c.captureSelection){n=c;break}let u=e.model.offsetOf(n);if(u<0)return-1;if(n.leftSibling)if(r.bias===0&&n.type!=="placeholder"){let c=Ur(e,n);c&&t<(c.left+c.right)/2&&(u=e.model.offsetOf(n.leftSibling))}else r.bias<0&&(u=e.model.offsetOf(n.leftSibling));return u}var Y1=class extends J{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let i="",r="auto",a=typeof t!="string"?t.getData("application/json+mathlive"):"";if(a)try{let o=JSON.parse(a);if(o&&Array.isArray(o)){e.snapshot();let n=It(o),{model:l}=e;l.selectionIsCollapsed||l.deleteAtoms(pe(l.selection));let s=l.at(l.position);if(s.parent instanceof R){s.parentBranch;let u=[],c=[];n[0].type==="first"&&n.shift(),n[n.length-1].type==="first"&&n.pop();for(let m of n)m.type==="first"&&c.length>0?(u.push(c),c=[m]):c.push(m);c.length>0&&u.push(c);let d=Number(s.parentBranch[0]),h=Number(s.parentBranch[1]),p=s.parent.maxColumns;for(;s.parent.colCount-h<u.length&&s.parent.colCount<p;)s.parent.addColumn();s.parent.addChildrenAfter(u[0],s);for(let m=1;m<u.length;m++)h++,h>=p&&(h=0,s.parent.addRowAfter(d),d++),s.parent.setCell(d,h,u[m])}else s.parent.addChildrenAfter(n.filter(u=>u.type!=="first"),s);return l.position=l.offsetOf(n[n.length-1]),l.contentDidChange({inputType:"insertFromPaste"}),Y(e),!0}}catch{}if(a=typeof t!="string"?t.getData("application/json"):"",a&&window.MathfieldElement.computeEngine)try{let o=JSON.parse(a);if(typeof o=="object"&&"latex"in o&&o.latex&&(i=o.latex),!i){let n=window.MathfieldElement.computeEngine.box(o);n&&!n.has("Error")&&(i=n.latex)}i||(r="latex")}catch{}if(!i&&typeof t!="string"&&(i=t.getData("application/x-latex"),i&&(r="latex")),i||(i=typeof t=="string"?t:t.getData("text/plain")),i){let o;return[o,i]=Ll(i),r==="auto"&&o&&(r="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,i,{format:r})&&(e.startRecording(),e.snapshot("paste"),Y(e)),e.startRecording(),!0}return!1}insert(e,t,i){var r,a;let o=typeof t=="string"?t:(a=(r=window.MathfieldElement.computeEngine)==null?void 0:r.box(t).latex)!=null?a:"";if(!i.silenceNotifications&&!e.contentWillChange({data:o,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 l=e.silenceNotifications;e.silenceNotifications=!0;let s={"?":"\\placeholder{}","@":"\\placeholder{}"};s[0]=i.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pe(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]);let u=-1;s[0]?s["@"]=s[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(u=ef(e),u>=0&&(s["@"]=e.getValue(u,e.position,"latex"))),s[0]||(s[0]=s["?"]);let c=!1,d=D=>(c=!0,s[D]),[h,p]=r0(e,t,d,i);if(!p)return!1;let m=p.length===1&&p[0].type==="genfrac";m&&u>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(s["@"]=s["?"],c=!1,[h,p]=r0(e,t,d,i)):u>=0&&e.deleteAtoms([u,e.position]);let{parent:y}=e.at(e.position),M=y.hasEmptyBranch("body");if(m&&h!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&y instanceof Z&&y.leftDelim==="("&&M){let D=y.parent,w=y.parentBranch;D.removeChild(y),D.setChildren(p,w)}let g=e.at(e.position);g.parent.addChildrenAfter(p,g),h==="latex"&&typeof t=="string"&&(y==null?void 0:y.type)==="root"&&M&&!c&&(y.verbatimLatex=t),e.silenceNotifications=l;let _=p[p.length-1];if(i.selectionMode==="placeholder"){let D=p.flatMap(w=>[w,...w.children]).find(w=>w.type==="placeholder");if(D){let w=e.offsetOf(D);e.setSelection(w-1,w),e.announce("move")}else _&&(e.position=e.offsetOf(_))}else i.selectionMode==="before"||(i.selectionMode==="after"?_&&(e.position=e.offsetOf(_)):i.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(_)));return e.contentDidChange({data:o,inputType:"insertText"}),e.silenceNotifications=n,!0}};function r0(e,t,i,r){var a;let o,n=[];if(typeof t!="string"||r.format==="math-json"){let l=window.MathfieldElement.computeEngine;if(!l)return["math-json",[]];[o,t]=["latex",l.box(t).latex],n=ye(t,{context:e.mathfield.context})}else typeof t=="string"&&r.format==="ascii-math"?([o,t]=vo(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),n=ye(t,{context:e.mathfield.context}),o!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Eo(n)):(r.format==="auto"||(a=r.format)!=null&&a.startsWith("latex"))&&(r.format==="auto"&&([o,t]=vo(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),r.format==="latex"&&([,t]=Ll(t)),n=ye(t,{context:e.mathfield.context,args:i}),r.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Eo(n));return Pt(n,r.style),[o??"latex",n]}function Q1(e){if(!e||(e[0].type,e.length>1))return null;let t=e[0];return t instanceof Z&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function Eo(e){if(e){for(let t=0;e[t];t++){let i=e[t];if(i instanceof Z&&i.leftDelim==="("){let r=0,a=0,o=0;for(let n=0;i.body[n];n++)i.body[n].type==="genfrac"&&(r++,a=n),o++;o===0&&r===1&&(e[t]=i.body[a])}}for(let t of e){for(let i of t.branches)if(!t.hasEmptyBranch(i)){Eo(t.branch(i));let r=Q1(t.branch(i));r&&t.setChildren(r,i)}if(t instanceof R)for(let i of t.cells)Eo(i)}}}function ef(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}let i=t,r=!1;if(t.type==="mclose"){let a=xo[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===a);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),r=!0}else t.type==="leftright"&&(t=t.leftSibling,r=!0);if(r)for(;!t.isFirstSibling&&(t.isFunction||a0(t));)t=t.leftSibling;else{let a=[];for(;!t.isFirstSibling&&(a0(t)||a.length>0);)t.type==="mclose"&&a.unshift(t.value),t.type==="mopen"&&a.length>0&&t.value===xo[a[0]]&&a.shift(),t=t.leftSibling}return i===t?-1:e.offsetOf(t)}function a0(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new Y1;var tf=class extends J{constructor(){super("text")}onPaste(e,t){if(!t)return!1;let i=typeof t=="string"?t:t.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"),Y(e)),e.startRecording(),!0):!1}insert(e,t,i={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;i.insertionMode||(i.insertionMode="replaceSelection"),i.selectionMode||(i.selectionMode="placeholder"),i.format||(i.format="auto");let{silenceNotifications:r}=e;i.silenceNotifications&&(e.silenceNotifications=!0);let a=e.silenceNotifications;e.silenceNotifications=!0,i.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pe(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 o=rf(t,e.mathfield.context);if(Pt(o,i.style),!o)return!1;let n=e.at(e.position),l=n.parent.addChildrenAfter(o,n);return e.silenceNotifications=a,i.selectionMode==="before"||(i.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(l)):l&&(e.position=e.offsetOf(l))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=r,!0}};function rf(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),ye(e,{context:t,parseMode:"text"})}new tf;function it(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var W=4,we=20,ie=2*(we+W),Ga=(e,t)=>`
  <line x1="${e+we}" y1="${t+we}" 
    x2="${e>t?e+we:7*we+10*W}" 
    y2="${e<t?t+we:7*we+10*W}"/>
  <svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
    <circle class="cls-2" cx="20" cy="20" r="20"/>
    <path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
  </svg>`,o0=(e,t)=>`
  <line x1="${e+we}" y1="${t+we}" 
    x2="${e>t?e+we:7*we+10*W}" 
    y2="${e<t?t+we:7*we+10*W}"/>
  <svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
    <circle class="cls-2" cx="20" cy="20" r="20"/>
    <path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
  </svg>`,Za=(e,t,i)=>`
  <svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
    <circle class="cls-2" cx="20" cy="20" r="20"/>
    <g transform="rotate(${i})" transform-origin="20 20">
      <path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
    </g>  
  </svg>`,af=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
viewBox=
"-2 -2 ${8*we+10*W+5} ${8*we+10*W+5}">
  <rect 
      class="MLEP__array-insert-background rows"
      x="0" 
      y="${ie+W}" 
      height="${3*ie}" 
      width="${ie}" 
      rx="${ie/2}"/>
      <rect 
      class="MLEP__array-insert-background columns"
      x="${ie+W}" 
      y="0" 
      height="${ie}" 
      width="${3*ie}" 
      rx="${ie/2}"/>
  <g data-command='"moveDown"'>
  ${Za(2*(W+ie),2*W+3*ie,0)}
  </g>
  <g data-command='"moveUp"'>
  ${Za(2*(W+ie),2*W+ie,180)}
  </g>
  <g data-command='"moveToNextWord"'>
  ${Za(2*W+3*ie,2*(W+ie),-90)}
  </g>
  <g data-command='"moveToPreviousWord"'>
  ${Za(2*W+ie,2*(W+ie),90)}
  </g>
  <g>

  <g data-command='"addColumnBefore"'>
  ${Ga(2*W+ie,W)}
  </g>
  <g data-command='"removeColumn"'>
  ${o0(2*W+2*ie,W)}
  </g>
  <g data-command='"addColumnAfter"'>
  ${Ga(2*W+3*ie,W)}
  </g>
  <g data-command='"addRowBefore"'>
  ${Ga(W,2*W+ie)}
  </g>
  <g data-command='"removeRow"'>
  ${o0(W,2*W+2*ie)}
  </g>
  <g data-command='"addRowAfter"'>
    ${Ga(W,2*W+3*ie)}
  </g>
</svg>`,of=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","matrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/></svg>`,nf=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
data-command='["setEnvironment","pmatrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
  <path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/></svg>`,dh=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","Bmatrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
  <path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/>
</svg>`,lf=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","bmatrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <path class="cls-2" d="m6,4h-3v16h3"/>
  <path class="cls-2" d="m22,4h3v16h-3"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/>
</svg>`,sf=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","vmatrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/>
  <line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
  <line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,uf=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30" 
  data-command='["setEnvironment","Vmatrix"]'>
  <rect class="cls-1" width="28" height="24"/>
  <circle cx="10" cy="8" r="1"/>
  <circle cx="14" cy="12" r="1"/>
  <circle cx="18" cy="16" r="1"/>
  <line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
  <line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
  <line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
  <line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,cf=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","cases"]'>
  <rect class="cls-1" width="28" height="24"/>
  <path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
  <circle cx="13" cy="8" r="1"/>
  <circle cx="13" cy="16" r="1"/>
  <circle cx="21" cy="8" r="1"/>
  <circle cx="21" cy="16" r="1"/>
</svg>`,df=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" 
  data-command='["setEnvironment","rcases"]'>
  <rect class="cls-1" width="28" height="24"/>
  <path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
  <circle cx="15" cy="8" r="1"/>
  <circle cx="15" cy="16" r="1"/>
  <circle cx="7" cy="8" r="1"/>
  <circle cx="7" cy="16" r="1"/>
</svg>`,Pn={matrix:of,pmatrix:nf,bmatrix:lf,Bmatrix:dh,vmatrix:sf,Vmatrix:uf},On={cases:cf,rcases:df,Bmatrix:dh};function hf(e){var t,i;let r=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!r)return;let a=0;r.forEach(p=>{(!a||p.length>a)&&(a=p.length)});let o=document.getElementById("mathlive-environment-popover");o||(o=Ho("mathlive-environment-popover"),bt("environment-popover"),bt("core"),o.setAttribute("aria-hidden","true"));let n,l=o.querySelector(".MLEP__environment-controls");l?n=l:(n=document.createElement("div"),o.innerHTML="",o.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=af;let s=[],u="",c=e.model.parentEnvironment.environmentName;if(id(c)){let p=mf(c);u=Pn[p]("active");let m=Pn,y=ho(m,[Rl(p)]);s=Object.values(y).map(M=>M("inactive"))}else if(Xp(c)){let p=ff(c);u=On[p]("active");let m=On,y=ho(m,[Rl(p)]);s=Object.values(y).map(M=>M("inactive"))}else Gp(c)&&(u=Pn.matrix("active"),s=Object.values(On).map(p=>p("inactive")));let d=document.createElement("div");d.className="MLEP__environment-delimiter-controls",d.style.display="flex",d.style.flexDirection="column",d.innerHTML=`
  <div class='MLEP__array-delimiter-options'>
  ${u}
  ${s.join("")}
  </div>`,u&&n.appendChild(d),n.querySelectorAll("[data-command]").forEach(p=>{let m=p.dataset.command,y=m;try{y=JSON.parse(m)}catch{}p.addEventListener("mousedown",M=>M.preventDefault()),y&&p.addEventListener("click",()=>e.executeCommand(y))});let h=(i=e.field)==null?void 0:i.getBoundingClientRect();h&&(o.style.top=`${window.scrollY+(h.top-o.clientHeight-15)}px`,o.style.left=`${h.left+20}px`,o.classList.add("is-visible"))}function yl(){let e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function pf(){document.getElementById("mathlive-environment-popover")&&($l("mathlive-environment-popover"),Nt("environment-popover"),Nt("core"))}function Ya(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){let i=e.model.parentEnvironment;if(i!=null&&i.array&&Jp(i.environmentName)){let r=e.options.environmentPopoverPolicy;t=r==="auto"||r==="on"}}t?hf(e):yl()}function mf(e){return e.replace("*","")}function ff(e){return e==="dcases"?"cases":e}function hh(e){let t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function n0(e,t,i){return t==="left"||t==="leading"&&i==="ltr"||t==="trailing"&&i==="rtl"?e.left:e.right}function In(e,t,i,r){return i==="middle"?e-t/2:i==="start"&&r==="rtl"||i==="end"&&r==="ltr"||i==="top"||i==="right"?Math.max(0,e-t):e}function gf(e,t,i,r){return i==="middle"?e-t/2:i==="start"&&r==="ltr"||i==="end"&&r==="rtl"||i==="top"||i==="right"?e:e-t}function yf(e,t){var i,r,a;let o=(i=hh(e))!=null?i:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";let n=e.getBoundingClientRect(),l=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight,s=Math.min(l,(r=t.height)!=null?r:n.height),u=In(t.location.y,s,t.verticalPos,o);u+s>window.innerHeight-8&&(t.alternateLocation?(u=In(t.alternateLocation.y,s,t.verticalPos,o),u+s>window.innerHeight-8&&(u=void 0)):u=void 0),Number.isFinite(u)||(u=Math.max(8,window.innerHeight-8-s),8+s>window.innerHeight-8&&(e.style.bottom="8px")),s=Math.min(u+s,window.innerHeight-8)-u;let c=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth,d=Math.min(c,(a=t.width)!=null?a:n.width),h=In(t.location.x,d,t.horizontalPos,o);h+d>window.innerWidth-8&&(t.alternateLocation?(h=gf(t.alternateLocation.x,d,t.verticalPos,o),h+d>window.innerWidth-8&&(h=void 0)):h=void 0),Number.isFinite(h)||(h=Math.max(8,window.innerWidth-8-d),8+d>window.innerWidth-8&&(e.style.right="8px")),d=Math.min(h+d,window.innerWidth-8)-h,o==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-h-d).toString()}px`:e.style.left=`${Math.ceil(h).toString()}px`,e.style.top=`${Math.ceil(u).toString()}px`,s!==n.height&&(e.style.height=`${Math.ceil(s).toString()}px`),d!==n.width&&(e.style.width=`${Math.ceil(d).toString()}px`)}function bf(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Vi(e){return"submenu"in e}function rt(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function bl(e){return"type"in e&&e.type==="divider"}function Nn(e){return"type"in e&&e.type==="heading"}var l0={};function qn(e){let t=l0[e];if(!t){let i;switch(e){case"checkmark":i=`<span aria-hidden="true" class="ui-checkmark"><svg  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
      </span>`;break;case"trailing-chevron":i='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":i='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(i){let r=document.createElement("template");r.innerHTML=i,l0[e]=r,t=r}}if(t){if("content"in t)return t.content.cloneNode(!0);let i=document.createElement("svg");return i.innerHTML=t.innerHTML,i}}var s0=80,ph=class{constructor(e,t){this._element=null;var i;this.parentMenu=t,this._declaration=e,Vi(e)?(this.type="submenu",this.submenu=new mh(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(i=e.type)!=null?i:"command",this.hasCheck=rt(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,i,r;let a=this._declaration;if(bl(a)){this.enabled=!1,this.checked=!1;return}Nn(a)&&(this.enabled=!1,this.checked=!1,this.visible=!0),rt(a)&&(this.checked=rt(a)&&((t=Fi(a.checked,e))!=null?t:!1)),(rt(a)||Vi(a))&&(this.enabled=(i=Fi(a.enabled,e))!=null?i:!0,this.visible=(r=Fi(a.visible,e))!=null?r:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(rt(a)||Nn(a)||Vi(a))&&(this.label=Fi(a.label,e),this.tooltip=Fi(a.tooltip,e),this.ariaLabel=Fi(a.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;let e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(qn("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(qn("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);let t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),rt(this._declaration)&&this._declaration.keyboardShortcut){let i=document.createElement("kbd");i.innerHTML=zl(this._declaration.keyboardShortcut),e.append(i)}this.type==="submenu"&&e.append(qn("trailing-chevron"))}get element(){if(this._element)return this._element;if(bl(this._declaration)){let i=document.createElement("li");return i.setAttribute("part","menu-divider"),i.setAttribute("role","divider"),this._element=i,i}let e=document.createElement("li");this._element=e,(rt(this._declaration)||Nn(this._declaration)||Vi(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));let t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!rt(this._declaration))return;let e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){let i=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&(t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(i)?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},s0)},s0)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}let i=this.element.getBoundingClientRect(),r=hh(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:n0(i,"trailing",r),y:i.top-4},alternateLocation:{x:n0(i,"leading",r),y:i.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;let t=this.rootMenu.lastMoveEvent;if(!t)return!1;let i=e.timeStamp-t.timeStamp;if(i>500)return!1;let r=e.clientX-t.clientX;if(vf(r,t.clientY-e.clientY,i)<=.2)return!1;let a="right";if(this.submenu.element){let o=this.submenu.element.getBoundingClientRect(),n=this.element.getBoundingClientRect();o.left<n.left+n.width/2&&(a="left")}return a==="right"?r>0:r<0}};function vf(e,t,i){return Math.hypot(e,t)/i}function Fi(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var mh=class Lr{constructor(t,i){this._element=null,this._activeMenuItem=null,this._dirty=!0;var r,a;this.parentMenu=(r=i==null?void 0:i.parentMenu)!=null?r:null,this._submenuClass=i==null?void 0:i.submenuClass,this.columnCount=(a=i==null?void 0:i.columnCount)!=null?a:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){let i=this.parentMenu;this.dispose(),this.parentMenu=i,t=[...t],this._menuItems=t.map(r=>r.onCreate?r.onCreate(r,this):new ph(r,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(i=>i.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){let i=t;this._element.scrollBy(0,i.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var i,r,a;this._menuItems.forEach(u=>u.updateState(t));let o=this.hasCheck;this.hasCheck=this._menuItems.some(u=>u.visible&&u.hasCheck),this.hasCheck!==o&&this._menuItems.forEach(u=>u.updateState(t));let n,l=0;for(let u of this._menuItems)u.type==="heading"?(n&&l===0&&(n.visible=!1),n=u,l=0):u.type==="divider"&&n?(n.visible=l>0,n=void 0,l=0):n&&u.visible&&(l+=1);n&&(n.visible=l>0);let s=!0;for(let u of this._menuItems)u.type==="divider"?(u.visible=!s,s=!0):u.visible&&(s=!1);(i=this.activeMenuItem)!=null&&i.visible||(this.activeMenuItem=null),!((r=this.activeMenuItem)!=null&&r.enabled)&&((a=this.activeMenuItem)==null?void 0:a.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(let{element:i,visible:r}of this._menuItems)i&&r&&this._element.append(i);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;let t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);let i=this._abortController.signal;return t.addEventListener("focus",this,{signal:i}),t.addEventListener("wheel",this,{passive:!0,signal:i}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var i,r,a,o;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){let n=this.activeMenuItem;n.active=!1,(i=n.submenu)==null||i.hide()}if(!((r=t==null?void 0:t.visible)==null||r)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(a=t.element)==null||a.focus({preventScroll:!0}):(o=this._element)==null||o.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,i=!1,r=this._menuItems;for(;!i&&t<=r.length-1;){let a=r[t];i=a.type!=="divider"&&a.visible&&a.enabled,t+=1}return i?r[t-1]:null}get lastMenuItem(){this.updateIfDirty();let t=this._menuItems,i=t.length-1,r=!1;for(;!r&&i>=0;){let a=t[i];r=a.type!=="divider"&&a.visible&&a.enabled,i-=1}return r?t[i+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();let i=this._menuItems.indexOf(this.firstMenuItem),r=this._menuItems.indexOf(this.lastMenuItem),a=this._menuItems.indexOf(this._activeMenuItem),o=1;for(;a>=i&&a<=r;){a+=t>0?1:-1;let n=this._menuItems[a];if(!n)break;if(n.visible&&n.enabled){if(o===Math.abs(t))return this._menuItems[a];o+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();let i=this._menuItems.filter(r=>r.visible&&r.enabled).indexOf(t);return i<0?-1:i%this.columnCount}static get collator(){return Lr._collator||(Lr._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Lr._collator}findMenuItem(t){var i;this.updateIfDirty();let r=this._menuItems.filter(l=>l.type!=="divider"&&l.visible&&l.enabled);if(r.length===0)return null;let a=Math.max(...r.map(l=>l.label.length))-t.length;if(a<0)return null;let o=null,n=0;for(;n<a&&!o;)o=(i=r.find(l=>Lr.collator.compare(t,l.label.substring(n,t.length))===0))!=null?i:null,n++;return o}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),Vl()&&(this.element.popover="manual",this.element.showPopover()),t.location&&yf(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,i,r,a,o;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Vl()&&(t=this._element)!=null&&t.popover&&this.element.hidePopover(),(r=(i=this.parentMenu)==null?void 0:i.element)==null||r.focus(),(o=(a=this._element)==null?void 0:a.parentNode)==null||o.removeChild(this._element)}set openSubmenu(t){var i,r,a,o;let n=t!==null;((i=this.activeMenuItem)==null?void 0:i.type)==="submenu"&&((r=this.activeMenuItem.element)==null||r.setAttribute("aria-expanded",n.toString())),(o=(a=this.activeMenuItem)==null?void 0:a.element)==null||o.classList.toggle("is-submenu-open",n),this.isSubmenuOpen=n}},fh=class gh extends mh{constructor(t,i){var r;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(r=i==null?void 0:i.host)!=null?r:null,this.isDynamic=t.some(yh),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){$m(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()}))}updateState(t){this._updating=!0,this.modifiers=t??this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=pi(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var i,r,a;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=pi(t));let o=!0,n=this.activeSubmenu,l=n.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":l==null||l.select(pi(t));break;case"ArrowRight":if((l==null?void 0:l.type)==="submenu")l.select(pi(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!l)n.activeMenuItem=n.firstMenuItem;else{let s=(i=n.getMenuItemColumn(l))!=null?i:-1;if(s>=0&&s<((r=n.columnCount)!=null?r:1)-1){let u=n.nextMenuItem(1);u&&(n.activeMenuItem=u)}}break;case"ArrowLeft":if(n===this.rootMenu)l||(n.activeMenuItem=n.firstMenuItem);else if((l&&(a=n.getMenuItemColumn(l))!=null?a:-1)<=0||!l){n.hide();let s=n.parentMenu.activeMenuItem;if(s){let{element:u}=s;u==null||u.focus(),u==null||u.classList.remove("is-submenu-open")}}else{let s=n.nextMenuItem(-1);s&&(n.activeMenuItem=s)}break;case"ArrowDown":n.activeMenuItem=n.nextMenuItem(n.columnCount);break;case"ArrowUp":n.activeMenuItem=n.nextMenuItem(-n.columnCount);break;case"Home":case"PageUp":n.activeMenuItem=n.firstMenuItem;break;case"End":case"PageDown":n.activeMenuItem=n.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);let s=n.findMenuItem(this.typingBuffer);s&&(n.activeMenuItem=s),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Ro(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;let s=n.findMenuItem(this.typingBuffer);s&&(n.activeMenuItem=s),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else o=!1}o&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return nt.element}connectScrim(t){let i=this.scrim;i.addEventListener("pointerup",this),i.addEventListener("contextmenu",this),i.addEventListener("keydown",this),i.addEventListener("keyup",this),i.addEventListener("pointermove",this),nt.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){let t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),nt.state==="open"&&nt.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(b(f({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,nt.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();let i=gh.SUBMENU_DELAY;if(i<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},i)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};fh.SUBMENU_DELAY=120;var xf=fh;function yh(e){return bl(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(rt(e)||Vi(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||rt(e)&&typeof e.checked=="function"?!0:Vi(e)?e.submenu.some(yh):!1}var Ko=class{};Ko.DELAY=300,Ko.MAX_DISTANCE=10;function wf(e){return new Promise((t,i)=>{let r=ko(e);r||t(!1);let a=r,o=setTimeout(()=>{n.abort(),t(bf(a,r)<Ko.MAX_DISTANCE)},Ko.DELAY),n=new AbortController,l=n.signal;for(let s of["pointermove","pointerup","pointercancel"])window.addEventListener(s,u=>{if(u.type==="pointerup"||u.type==="pointercancel")clearTimeout(o),n.abort(),t(!1);else if(u.type==="pointermove"){let c=ko(u);c&&(a=c)}},{passive:!0,signal:l})})}async function u0(e,t,i){if(e.type==="contextmenu"){let r=e;if(i.show({target:t,location:ko(r),modifiers:pi(r)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){let r=e;if(r.code==="ContextMenu"||r.code==="F10"&&r.shiftKey){let a=t==null?void 0:t.getBoundingClientRect();if(a&&i.show({target:t,location:{x:Math.ceil(a.left+a.width/2),y:Math.ceil(a.top+a.height/2)},modifiers:pi(r)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let r=e.target;for(;r&&t!==r;)r=r.parentNode;if(!r||!i.visible)return!1;let a=ko(e);if(await wf(e))return i.state!=="closed"?!1:(i.show({target:t,location:a}),!0)}return!1}var c0={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};x(Object.keys(c0),"{body:auto}",{createAtom:e=>new Oo(b(f({},e),{body:B(e.args[0]),accentChar:c0[e.command.slice(1)]}))});x(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{let t=D0(B(e.args[0]));return new Oo(b(f({},e),{body:B(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}});x(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new Oo(b(f({},e),{body:B(e.args[0]),svgAccent:"overarc"}))});x(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Oe(b(f({},e),{body:B(e.args[0]),svgBelow:"underarc"}))});x("utilde","{body:auto}",{createAtom:e=>{let t=B(e.args[0]),i=D0(t),r="widetilde"+(i.length>5?"4":["1","1","2","2","3","3"][i.length]);return new Oe(b(f({},e),{body:t,svgBelow:r,boxType:jr(t)}))}});x("^","{:string}",{createAtom:e=>{var t;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e.args[0]])!=null?t:"^"}))}});x("`","{:string}",{createAtom:e=>{var t;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e.args[0]])!=null?t:"`"}))}});x("'","{:string}",{createAtom:e=>{var t;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e.args[0]])!=null?t:"'"}))}});x('"',"{:string}",{createAtom:e=>{var t,i;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(i={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",A:"Ä",E:"Ë",I:"Ë",O:"Ö",U:"Ü"}[e.args[0]])!=null?i:'"'+e.args[0]:'"'}))}});x(".","{:string}",{createAtom:e=>{var t,i;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(i={a:"ȧ",e:"ė",i:"̇i",o:"ȯ",u:"̇u",A:"Ȧ",E:"Ė",I:"İ",O:"Ȯ",U:"̇U"}[e.args[0]])!=null?i:"."+e.args[0]:"."}))}});x("=","{:string}",{createAtom:e=>{var t,i;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(i={a:"ā",e:"ē",i:"ī",o:"ō",u:"ū",A:"Ā",E:"Ē",I:"Ī",O:"Ō",U:"Ū"}[e.args[0]])!=null?i:"="+e.args[0]:"="}))}});x("~","{:string}",{createAtom:e=>{var t;return new v(b(f({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e.args[0]])!=null?t:"´"}))}});x("c","{:string}",{createAtom:e=>{var t;return new v(b(f({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"ç",C:"Ç"}[e.args[0]])!=null?t:""}))}});x("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,i;let r=e.args,a={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(r[1]){let n=r[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(let l of n){let s=l.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(s)a.strokeWidth=s[1],a.strokeStyle=s[2],a.strokeColor=s[3];else{let u=l.match(/\s*([a-z]*)\s*=\s*"(.*)"/);u&&(u[1]==="mathbackground"?a.backgroundcolor=u[2]:u[1]==="mathcolor"?a.strokeColor=u[2]:u[1]==="padding"?a.padding=u[2]:u[1]==="shadow"&&(a.shadow=u[2]))}}a.strokeStyle==="dashed"?a.svgStrokeStyle="5,5":a.strokeStyle==="dotted"&&(a.svgStrokeStyle="1,5")}a.borderStyle=`${a.strokeWidth} ${a.strokeStyle} ${a.strokeColor}`;let o={};return((i=r[0])!=null?i:"").split(/[, ]/).filter(n=>n.length>0).forEach(n=>{o[n.toLowerCase()]=!0}),new Jr(e.command,B(r[2]),o,a)}});x("cancel","{body:auto}",{createAtom:e=>{var t;return new Jr(e.command,B(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}});x("bcancel","{body:auto}",{createAtom:e=>{var t;return new Jr(e.command,B(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}});x("xcancel","{body:auto}",{createAtom:e=>{var t;return new Jr(e.command,B(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}});x(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new Oe(b(f({},e),{body:B((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}});x("overbrace","{:auto}",{createAtom:e=>new Oe(b(f({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))});x(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Oe(b(f({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))});x(["underbrace"],"{:auto}",{createAtom:e=>new Oe(b(f({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))});x(["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:e=>{var t,i,r,a,o;return new Oe(b(f({},e),{svgBody:e.command.slice(1),above:((i=B((t=e.args)==null?void 0:t[1]))==null?void 0:i.length)===0?void 0:B((r=e.args)==null?void 0:r[1]),below:(o=B((a=e.args)==null?void 0:a[0]))!=null?o:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`});x(["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:e=>new xi(e.command.slice(1),b(f({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))});x(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new xi({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],b(f({},e),{limits:"over-under",variant:"main"}))});x(["lim","mod"],"",{ifMode:"math",createAtom:e=>new xi(e.command.slice(1),b(f({},e),{limits:"over-under",variant:"main"}))});x(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new xi(e.command.slice(1),b(f({},e),{limits:"over-under",isFunction:!0,variant:"main"}))});x(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{let i=e.createBox(t),r=i.caret;i.caret=void 0;let a=new S("°",{style:b(f({},e.style),{variant:"normal",variantStyle:"up"})});return new S([i,a],{type:"inner",isSelected:e.isSelected,caret:r})}});x("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new zd(b(f({},e),{body:B(e.args[1]),index:e.args[0]?B(e.args[0]):void 0}))});x(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{let t=f({},e),i=e.command,r=e.args;switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break}switch(i){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break}return new ar(r[0]?B(r[0]):[new vt],r[1]?B(r[1]):[new vt],t)},serialize:(e,t)=>{let i=e.aboveToLatex(t),r=e.belowToLatex(t);return/^[0-9]$/.test(i)&&/^[0-9]$/.test(r)?`${e.command}${i}${r}`:G(e.command,i,r)}});x(["brace","brack"],"",{infix:!0,createAtom:e=>new ar(B(e.args[0]),B(e.args[1]),b(f({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>P([e.aboveToLatex(t),e.command,e.belowToLatex(t)])});x(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,i,r=e.args;return e.command==="\\choose"&&(t="(",i=")"),new ar(B(r[0]),B(r[1]),b(f({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:i}))},serialize:(e,t)=>P([e.aboveToLatex(t),e.command,e.belowToLatex(t)])});x(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,i;let r=e.args;return new ar(B(r[0]),B(r[1]),b(f({},e),{leftDelim:(t=r[2])!=null?t:".",rightDelim:(i=r[3])!=null?i:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`});x("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new ar(B(e.args[0]),B(e.args[1]),b(f({},e),{hasBarLine:!0,numerPrefix:"∂",denomPrefix:"∂"}))});x(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new Kl({coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.command.slice(1)],b(f({},e),{limits:"auto",variant:"main"}))});x("smallint","",{ifMode:"math",createAtom:e=>new xi("∫",b(f({},e),{limits:"adjacent",variant:"main"}))});var d0={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};x(Object.keys(d0),"",{ifMode:"math",createAtom:e=>{let t=e.command,i=d0[t.slice(1)];return new Kl(i,b(f({},e),{limits:"adjacent",variant:{"⋒":"ams","⋓":"ams"}[i]}))}});x(["Re","Im"],"",{ifMode:"math",createAtom:e=>new xi({"\\Re":"ℜ","\\Im":"ℑ"}[e.command],b(f({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))});x("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new _d(b(f({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}});x("the","{:value}",{createAtom:e=>new v(b(f({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var i;let r=new $({parent:t},e.style),a="";e.isSelected&&(a+=" ML__selected");let o=r.evaluate(e.args[0]);return new S(((i=ce(o))!=null?i:"").split("").map(n=>new S(n,{type:"ord",classes:a,mode:e.mode,isSelected:e.isSelected,style:f({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:a}).wrap(r)},serialize:e=>{var t;return`\\the${(t=ce(e.args[0]))!=null?t:"\\relax"}`}});x("mathtip","{:auto}{:math}",{createAtom:e=>new Fl(b(f({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${v.serialize([e.tooltip],b(f({},t),{defaultMode:"math"}))}}`});x("texttip","{:auto}{:text}",{createAtom:e=>new Fl(b(f({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${v.serialize([e.tooltip],b(f({},t),{defaultMode:"text"}))}}`});x("error","{:math}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})});x("ensuremath","{:math}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(b(f({},t),{defaultMode:"math"}))}}`});x("color","{:value}",{applyStyle:(e,t,i)=>{var r,a;return{verbatimColor:(r=ce(t[0]))!=null?r:void 0,color:i.toColor((a=t[0])!=null?a:{string:"red"})}}});x("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,i)=>{var r,a;return{verbatimColor:(r=ce(t[0]))!=null?r:void 0,color:i.toColor((a=t[0])!=null?a:{string:"red"})}}});x("boxed","{content:math}",{createAtom:e=>new qt(b(f({},e),{body:B(e.args[0]),framecolor:{string:"black"}}))});x("colorbox","{:value}{:text*}",{applyStyle:(e,t,i)=>{var r,a;return{verbatimBackgroundColor:(r=ce(t[0]))!=null?r:void 0,backgroundColor:i.toBackgroundColor((a=t[0])!=null?a:{string:"yellow"})}}});x("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,i;return new qt(b(f({},e),{body:B(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(i=e.args[1])!=null?i:{string:"yellow"}}))},serialize:(e,t)=>{var i,r;return t.skipStyles?e.bodyToLatex(b(f({},t),{defaultMode:"text"})):G(e.command,(i=ce(e.framecolor))!=null?i:"",(r=ce(e.backgroundcolor))!=null?r:"",e.bodyToLatex(b(f({},t),{defaultMode:"text"})))}});x("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;let i=e.args[0],r=B(e.args[1]);return i?new qt(b(f({},e),{body:r,padding:i.padding,border:i.border,backgroundcolor:(t=i.backgroundcolor)!=null?t:void 0})):new qt(b(f({},e),{body:r}))},serialize:(e,t)=>{var i,r;if(t.skipStyles)return e.bodyToLatex(t);let a=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){let o=[];e.padding&&o.push((i=ce(e.padding))!=null?i:""),e.border&&o.push(`border: ${e.border}`),e.backgroundcolor&&o.push((r=ce(e.backgroundcolor))!=null?r:""),a+=`[${o.join(",")}]`}return G(a,e.bodyToLatex(t))}});x(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),render:(e,t)=>{let i=new $({parent:t,mathstyle:e.command.slice(1)},e.style),r=v.createBox(i,e.body,{type:"lift"});return e.caret&&(r.caret=e.caret),e.bind(t,r)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${P([e.command,e.bodyToLatex(t)])}}`});x(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})});x("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var i;return{fontSeries:(i=t[0])!=null?i:"auto"}}});x("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var i;return{fontShape:(i=t[0])!=null?i:"auto"}}});x("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var i;return{fontFamily:(i=t[0])!=null?i:"roman"}}});x("selectfont","",{ifMode:"text",applyStyle:()=>({})});x("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})});x(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})});x("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})});x("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})});x("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})});x("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})});x("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})});x("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})});x("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})});x("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})});x("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})});x("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})});x("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})});x("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})});x("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})});x("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})});x("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})});x("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})});x("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})});x("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})});x("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})});x("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})});x("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})});x("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})});x("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})});x("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})});x("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})});x("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})});x("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})});x(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})});x(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})});x("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})});x("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})});x("mbox","{:text}",{ifMode:"math",createAtom:e=>new v(b(f({},e),{type:"mord",body:B(e.args[0]),mode:"math"})),serialize:(e,t)=>G("\\mbox",e.bodyToLatex(b(f({},t),{defaultMode:"text"})))});x("text","{:text}",{ifMode:"math",applyMode:"text"});x(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var i;return e.createBox(t,{classes:(i=e.args[0])!=null?i:""})}});x(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var i;return!((i=e.args)!=null&&i[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var i;let r=e.createBox(t);return r.cssId=(i=e.args[0])!=null?i:"",r}});x("htmlData","{data:string}{content:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var i;return!((i=e.args)!=null&&i[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var i;let r=e.createBox(t);return r.htmlData=(i=e.args[0])!=null?i:"",r}});x(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var i;return!((i=e.args)!=null&&i[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var i;let r=e.createBox(t);return r.htmlStyle=(i=e.args[0])!=null?i:"",r}});x("em","{:rest}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});x("emph","{:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var h0={"\\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}};x(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new Md(b(f({},e),{delim:(t=e.args[0])!=null?t:".",size:h0[e.command].size,delimType:h0[e.command].mclass}))}});x(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new Gr(b(f({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}});x(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new Gr(b(f({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}});x("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new v(e),render:(e,t)=>{let i=0,r=t.mathstyle.id;(r===Po||r===si)&&(i=1),(r===Ui||r===Be)&&(i=2),(r===hi||r===fe)&&(i=3);let a=B(e.args[i]);return v.createBox(t,a)},serialize:(e,t)=>`\\mathchoice{${v.serialize(e.args[0],t)}}{${v.serialize(e.args[1],t)}}{${v.serialize(e.args[2],t)}}{${v.serialize(e.args[3],t)}}`});x("mathop","{:auto}",{createAtom:e=>new v(b(f({},e),{type:"mop",body:B(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var i;let r=v.createBox(t,e.body);if(e.superscript||e.subscript){let a=(i=e.subsupPlacement)!=null?i:"auto";r=a==="over-under"||a==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:r}):e.attachSupsub(t,{base:r})}return new S(e.bind(t,r),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{let i=[G(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&i.push("\\limits"),e.subsupPlacement==="adjacent"&&i.push("\\nolimits"),e.subsupPlacement==="auto"&&i.push("\\displaylimits")),i.push(e.supsubToLatex(t)),P(i)}});x(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new v(b(f({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:B(e.args[0])}))});x(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{let t=B(e.args[0]).map(i=>{var r;return i.type!=="first"&&(i.type="mord",i.value=(r={"∗":"*","−":"-"}[i.value])!=null?r:i.value,i.isFunction=!1,!i.style.variant&&!i.style.variantStyle&&(i.style.variant="main",i.style.variantStyle="up")),i});return new v(b(f({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var i;let r=v.createBox(t,e.body);if(e.superscript||e.subscript){let a=(i=e.subsupPlacement)!=null?i:"auto";r=a==="over-under"||a==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:r}):e.attachSupsub(t,{base:r})}return e.caret&&(r.caret=e.caret),new S(e.bind(t,r),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{let i=[G(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&i.push("\\limits"),e.subsupPlacement==="adjacent"&&i.push("\\nolimits"),e.subsupPlacement==="auto"&&i.push("\\displaylimits")),i.push(e.supsubToLatex(t)),P(i)}});x(["char","unicode"],"{charcode:value}",{createAtom:e=>new v(b(f({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${ce((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let i=t.evaluate(e.args[0]);return(!i||!("number"in i))&&(i={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(i.number),e.createBox(t)}});x("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new v(e),render:(e,t)=>{var i,r,a;let o=new $({parent:t,mathstyle:"textstyle"},e.style),n=o.toEm((i=e.args[0])!=null?i:{dimension:0}),l=o.toEm((r=e.args[1])!=null?r:{dimension:10}),s=o.toEm((a=e.args[2])!=null?a:{dimension:10}),u=new S(null,{classes:"rule",type:"ord"});return u.width=l,u.height=s+n,u.depth=-n,u.setStyle("border-right-width",l,"em"),u.setStyle("border-top-width",s,"em"),u.setStyle("border-color",e.style.color),u.setStyle("vertical-align",n,"em"),e.isSelected&&u.setStyle("opacity","50%"),e.bind(o,u),e.caret&&(u.caret=e.caret),u.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${ce(e.args[0])}]`:""}{${ce(e.args[1])}}{${ce(e.args[2])}}`});x(["overline","underline"],"{:auto}",{createAtom:e=>new v(b(f({},e),{body:B(e.args[0])})),render:(e,t)=>{let i=e.command.substring(1),r=new $({parent:t,mathstyle:"cramp"},e.style),a=v.createBox(r,e.body);if(!a)return null;let o=r.metrics.defaultRuleThickness/r.scalingFactor,n=new S(null,{classes:i+"-line"});n.height=o,n.maxFontSize=o*1.125*r.scalingFactor;let l;return i==="overline"?l=new re({shift:0,children:[{box:a},3*o,{box:n},o]}):l=new re({top:a.height,children:[o,{box:n},3*o,{box:a}]}),e.caret&&(l.caret=e.caret),new S(l,{classes:i,type:"ignore"})}});x("overset","{:auto}{base:auto}",{createAtom:e=>{let t=B(e.args[1]);return new Oe(b(f({},e),{above:B(e.args[0]),body:t,skipBoundary:!1,boxType:jr(t)}))},serialize:(e,t)=>G(e.command,e.aboveToLatex(t),e.bodyToLatex(t))});x("underset","{:auto}{base:auto}",{createAtom:e=>{let t=B(e.args[1]);return new Oe(b(f({},e),{below:B(e.args[0]),body:t,skipBoundary:!1,boxType:jr(t)}))},serialize:(e,t)=>G(e.command,e.belowToLatex(t),e.bodyToLatex(t))});x("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{let t=B(e.args[2]);return new Oe(b(f({},e),{above:B(e.args[0]),below:B(e.args[1]),body:t,skipBoundary:!1,boxType:jr(t)}))},serialize:(e,t)=>G(e.command,e.belowToLatex(t),e.bodyToLatex(t))});x(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Oe(b(f({},e),{body:B(e.args[2]),above:B(e.args[1]),below:B(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>G(e.command,e.aboveToLatex(t),e.bodyToLatex(t))});x("smash","[:string]{:auto}",{createAtom:e=>{var t,i,r,a;return new Xr(b(f({},e),{body:B(e.args[1]),smashHeight:(i=(t=e.args[0])==null?void 0:t.includes("t"))!=null?i:!0,smashDepth:(a=(r=e.args[0])==null?void 0:r.includes("b"))!=null?a:!0}))}});x(["vphantom"],"{:auto}",{createAtom:e=>new Xr(b(f({},e),{body:B(e.args[0]),isInvisible:!0,smashWidth:!0}))});x(["hphantom"],"{:auto}",{createAtom:e=>new Xr(b(f({},e),{body:B(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))});x(["phantom"],"{:auto}",{createAtom:e=>new Xr(b(f({},e),{body:B(e.args[0]),isInvisible:!0}))});x("not","{:math}",{createAtom:e=>{let t=B(e.args[0]);return t.length===0?new v(b(f({},e),{type:"mrel",value:""})):new v(b(f({},e),{body:[new vi(b(f({},e),{body:"",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{let i=e.args[0],r=i&&typeof i=="object"&&"group"in i;return e.value!==""?r?`\\not{${v.serialize(i.group,t)}}`:`\\not${v.serialize(i,t)}`:r?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);let i=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":jr(B(e.args[0])),r=v.createBox(t,e.body,{type:i});return e.caret&&(r.caret=e.caret),e.bind(t,r)}});x(["ne","neq"],"",{createAtom:e=>new v(b(f({},e),{type:"mrel",body:[new vi(b(f({},e),{body:"",align:"right",boxType:"rel"})),new v(b(f({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command});x("rlap","{:auto}",{createAtom:e=>new vi(b(f({},e),{body:B(e.args[0]),align:"right"}))});x("llap","{:auto}",{createAtom:e=>new vi(b(f({},e),{body:B(e.args[0]),align:"left"}))});x("mathrlap","{:math}",{createAtom:e=>new vi(b(f({},e),{body:B(e.args[0]),align:"left"}))});x("mathllap","{:math}",{createAtom:e=>new vi(b(f({},e),{body:B(e.args[0]),align:"left"}))});x("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new qt(b(f({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var i;return G("\\raisebox",(i=ce(e.offset))!=null?i:"0pt",e.bodyToLatex(t))}});x("raise","{:value}{:auto}",{createAtom:e=>{var t;return new qt(b(f({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var i;return G("\\raise",(i=ce(e.offset))!=null?i:"0pt",e.bodyToLatex(t))}});x("lower","{:value}{:auto}",{createAtom:e=>{var t;return new qt(b(f({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=tt(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var i,r;return G("\\lower",(r=ce(tt((i=e.offset)!=null?i:{dimension:0},-1)))!=null?r:"0pt",e.bodyToLatex(t))}});ue("0123456789/@.?!");C0(65,90);C0(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],["−",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");x(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new Gr(e)});x("space","",{createAtom:e=>new Gr(e)});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]]);var bh="<mo>&#x2061;</mo>",Fo="<mo>&#8290;</mo>";function uo(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(e,t){return!e||!t.generateID?"":` extid="${e}"`}function _f(e,t,i){var r,a,o,n,l,s,u,c,d,h,p;let m=!1;t=t??e.atoms.length;let y="",M="",g=e.atoms[e.index],_=(a=(r=g.style)==null?void 0:r.variant)!=null?a:"",D=(n=(o=g.style)==null?void 0:o.variantStyle)!=null?n:"",w="";if(_||D){let K=S0(g.value,(l=g.style)==null?void 0:l.variant,(s=g.style)==null?void 0:s.variantStyle);if(K!==g.value)return e.index+=1,y=`<mi${H(g.id,i)}>${K}</mi>`,yt(y,e,i)||(e.mathML+=y,e.lastType="mi"),!0;w=(u={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"}[D+_])!=null?u:"",w=` mathvariant="${w}"`}let L={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."};if(g.command==="!")return e.index+=1,y="<mo>!</mo>",yt(y,e,i)||(e.mathML+=y,e.lastType="mo"),!0;if(L[g.command]){e.index+=1;let K=`<mi${H(g.id,i)}${w}>${L[g.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(K=Fo+K),yt(K,e,i)||(e.mathML+=K,e.lastType="mi"),!0}if(g.command==="\\operatorname")M=Gi(g.body),e.index+=1;else if(_||D)for(;e.index<t&&(g.type==="mord"||g.type==="macro")&&!g.isDigit()&&_===((d=(c=g.style)==null?void 0:c.variant)!=null?d:"")&&D===((p=(h=g.style)==null?void 0:h.variantStyle)!=null?p:"");)M+=Gi([g]),e.index+=1,g=e.atoms[e.index];else(g.type==="mord"||g.type==="macro")&&!g.isDigit()&&(M+=Gi([g]),e.index+=1);if(M.length>0){m=!0,y=`<mi${w}>${M}</mi>`;let K=e.lastType;y.endsWith(">f</mi>")||y.endsWith(">g</mi>")?(y+=bh,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(y)?"mo":"mi",yt(y,e,i)||((K==="mi"||K==="mn"||K==="mtext"||K==="fence")&&(y=Fo+y),e.mathML+=y)}return m}function kf(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Mf(e){let t=-1,i=e.index,r=!1,a=!1;for(;i<e.atoms.length&&!r&&!a;){let o=e.atoms[i];r=!o.isDigit(),a=!r&&o.superscript!==void 0,i++}return a&&(t=i-1),t}function yt(e,t,i){var r;let a=t.atoms[t.index-1];if(!a)return!1;if(!a.superscript&&!a.subscript)if(((r=t.atoms[t.index])==null?void 0:r.type)==="subsup")a=t.atoms[t.index],t.index+=1;else return!1;let o=t.lastType;t.lastType="";let n=N(a.superscript,i);t.lastType="";let l=N(a.subscript,i);if(t.lastType=o,!n&&!l)return!1;let s="";return n&&l?s=`<msubsup>${e}${l}${n}</msubsup>`:n?s=`<msup>${e}${n}</msup>`:l&&(s=`<msub>${e}${l}</msub>`),t.mathML+=s,t.lastType="",!0}function Sf(e,t,i){t=t??e.atoms.length;let r=e.index,a="";for(;e.index<t&&e.atoms[e.index].mode==="text";)a+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return a.length>0?(e.mathML+=`<mtext ${H(e.atoms[r].id,i)}>${a}</mtext>`,e.lastType="mtext",!0):!1}function Cf(e,t,i){t=t??e.atoms.length;let r=e.index,a="",o=Mf(e);for(o>=0&&o<t&&(t=o);e.index<t&&e.atoms[e.index].isDigit();)a+=e.atoms[e.index].asDigit(),e.index+=1;return a.length<=0?!1:(a="<mn"+H(e.atoms[r].id,i)+">"+a+"</mn>",o<0&&kf(e)&&(o=e.index,e.index+=1),yt(a,e,i)||(e.mathML+=a,e.lastType="mn"),!0)}function Df(e,t,i){let r=!1;t=t??e.atoms.length;let a="",o="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let n=!1,l=0,s=e.index,u=-1,c=s+1;for(;c<t&&!n;)e.atoms[c].type==="mopen"?l+=1:e.atoms[c].type==="mclose"&&(l-=1),l===-1&&(n=!0,u=c),c+=1;n&&(a="<mrow>",a+=yi(e.atoms[s],i),a+=N(e.atoms,i,s+1,u),a+=yi(e.atoms[u],i),a+="</mrow>",e.index=u+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=Fo),yt(a,e,i)&&(r=!0,e.lastType="",a=""),o="fence")}return a.length>0&&(r=!0,e.mathML+=a,e.lastType=o),r}function Bf(e,t,i){let r=!1;t=t??e.atoms.length;let a="",o="",n=e.atoms[e.index];if(!n)return!1;let l={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉"};if(l[n.command]){e.index+=1;let s=`<mo${H(n.id,i)}>${l[n.command]}</mo>`;return yt(s,e,i)||(e.mathML+=s,e.lastType="mo"),!0}if(e.index<t&&(n.type==="mbin"||n.type==="mrel"))a+=vl(e.atoms[e.index],i),e.index+=1,o="mo";else if(e.index<t&&(n.type==="mop"||n.type==="operator"||n.type==="extensible-symbol")){if(n.subsupPlacement==="over-under"&&(n.superscript||n.subscript)){let s=yi(n,i);return n.superscript&&n.subscript?(a+="<munderover>"+s,a+=N(n.subscript,i),a+=N(n.superscript,i),a+="</munderover>"):n.superscript?(a+="<mover>"+s,a+=N(n.superscript,i),a+="</mover>"):n.subscript&&(a+="<munder>"+s,a+=N(n.subscript,i),a+="</munder>"),e.mathML+=a,e.lastType="mo",e.index+=1,!0}{let s=e.atoms[e.index],u=s.value==="\\operatorname",c=u?'<mi class="MathML-Unit"'+H(s.id,i)+">"+Gi(s.value)+"</mi>":yi(s,i);a+=c,!u&&!/^<mo>(.*)<\/mo>$/.test(c)?(a+=bh,o="applyfunction"):o=u?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(a)&&(a=Fo+a),e.index+=1}return a.length>0&&(r=!0,yt(a,e,i)||(e.mathML+=a,e.lastType=o)),r}function N(e,t,i,r){t!=null||(t={});let a={atoms:[],index:i??0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")a.mathML=e.toString();else if(typeof e=="string")a.mathML=e;else if(e instanceof v)a.mathML=vl(e,t);else if(Array.isArray(e)){a.atoms=e;let o=0;for(r=r||(e?e.length:0);a.index<r;)if(Sf(a,r,t)||Cf(a,r,t)||_f(a,r,t)||Bf(a,r,t)||Df(a,r,t))o+=1;else if(a.index<r){let n=vl(a.atoms[a.index],t);a.lastType==="mn"&&n.length>0&&a.atoms[a.index].type==="genfrac"&&(n="<mo>&#x2064;</mo>"+n),a.atoms[a.index].type==="genfrac"?a.lastType="mfrac":a.lastType="",a.index+=1,yt(n,a,t)?o+=1:n.length>0&&(a.mathML+=n,o+=1)}o>1&&(a.mathML="<mrow>"+a.mathML+"</mrow>")}return a.mathML}function yi(e,t){let i="",r=Gi(e.value);return r&&(i="<mo"+H(e.id,t)+">"+r+"</mo>"),i}function Gi(e){if(!e)return"";if(typeof e=="string")return uo(e);if(!Array.isArray(e)&&typeof e.body=="string")return uo(e.body);let t="";for(let i of e)typeof i.value=="string"&&(t+=i.value);return uo(t)}function vl(e,t){var i,r,a,o,n,l,s,u,c,d,h,p,m,y,M,g,_,D,w,L,K,E;if(e.mode==="text")return`<mi${H(e.id,t)}>${e.value}</mi>`;let I={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",longleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",longrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",longrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xleftrightarrows:"⇄",xRightleftharpoons:"⇌",longRightleftharpoons:"⇌",xLeftrightharpoons:"⇋",longLeftrightharpoons:"⇋"},V={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5},C="",Se="",je,te,wt,Ce,be,j,{command:Q}=e;if(e.command==="\\error")return`<merror${H(e.id,t)}>${N(e.body,t)}</merror>`;let ae={"\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉"},We={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":C=N(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(C+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(C+="<mo>"+(ae[e.leftDelim]||e.leftDelim)+"</mo>")),C+="<mtable",e.colFormat){for(C+=' columnalign="',wt=0;wt<e.colFormat.length;wt++)e.colFormat[wt].align&&(C+={l:"left",c:"center",r:"right"}[e.colFormat[wt].align]+" ");C+='"'}for(C+=">",te=0;te<e.array.length;te++){for(C+="<mtr>",je=0;je<e.array[te].length;je++)C+="<mtd>"+N(e.array[te][je],t)+"</mtd>";C+="</mtr>"}C+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(C+="<mo>"+(ae[e.leftDelim]||e.rightDelim)+"</mo>"),C+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(C+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(C+="<mo"+H(e.id,t)+">"+(ae[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(C+="<mfrac>",C+=N(e.above,t)||"<mi>&nbsp;</mi>",C+=N(e.below,t)||"<mi>&nbsp;</mi>",C+="</mfrac>"):(C+="<mtable"+H(e.id,t)+">",C+="<mtr>"+N(e.above,t)+"</mtr>",C+="<mtr>"+N(e.below,t)+"</mtr>",C+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(C+="<mo"+H(e.id,t)+">"+(ae[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(C+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(C+="<msqrt"+H(e.id,t)+">",C+=N(e.body,t),C+="</msqrt>"):(C+="<mroot"+H(e.id,t)+">",C+=N(e.body,t),C+=N(e.above,t),C+="</mroot>");break;case"leftright":let Ue=e,Je=Ue.leftDelim;C="<mrow>",Je&&Je!=="."&&(C+=`<mo${H(e.id,t)}>${(i=ae[Je])!=null?i:Je}</mo>`),e.body&&(C+=N(e.body,t));let Xe=Ue.matchingRightDelim();Xe&&Xe!=="."&&(C+=`<mo${H(e.id,t)}>${(r=ae[Xe])!=null?r:Xe}</mo>`),C+="</mrow>";break;case"sizeddelim":case"delim":C+=`<mo${H(e.id,t)}>${ae[e.value]||e.value}</mo>`;break;case"accent":C+='<mover accent="true"'+H(e.id,t)+">",C+=N(e.body,t),C+="<mo>"+(We[Q]||e.accent)+"</mo>",C+="</mover>";break;case"line":case"overlap":break;case"overunder":be=e.above,Ce=e.below,(e.svgAbove||be)&&(e.svgBelow||Ce)?j=e.body:be&&be.length>0?(j=e.body,(o=(a=e.body)==null?void 0:a[0])!=null&&o.below?(Ce=e.body[0].below,j=e.body[0].body):((l=(n=e.body)==null?void 0:n[0])==null?void 0:l.type)==="first"&&(u=(s=e.body)==null?void 0:s[1])!=null&&u.below&&(Ce=e.body[1].below,j=e.body[1].body)):Ce&&Ce.length>0&&(j=e.body,(d=(c=e.body)==null?void 0:c[0])!=null&&d.above?(be=e.body[0].above,j=e.body[0].body):((p=(h=e.body)==null?void 0:h[0])==null?void 0:p.type)==="first"&&(y=(m=e.body)==null?void 0:m[1])!=null&&y.above&&(be=e.body[1].overscript,j=e.body[1].body)),(e.svgAbove||be)&&(e.svgBelow||Ce)?(C+=`<munderover ${H(e.id,t)}>`,C+=(M=I[e.svgBody])!=null?M:N(j,t),C+=(g=I[e.svgBelow])!=null?g:N(Ce,t),C+=(_=I[e.svgAbove])!=null?_:N(be,t),C+="</munderover>"):e.svgAbove||be?(C+=`<mover ${H(e.id,t)}>`+((D=I[e.svgBody])!=null?D:N(j,t)),C+=(w=I[e.svgAbove])!=null?w:N(be,t),C+="</mover>"):(e.svgBelow||Ce)&&(C+=`<munder ${H(e.id,t)}>`+((L=I[e.svgBody])!=null?L:N(j,t)),C+=(K=I[e.svgBelow])!=null?K:N(Ce,t),C+="</munder>");break;case"placeholder":C+="?";break;case"mord":{C=typeof e.value=="string"?e.value:Q,Q==="\\char"?C="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":C.length>0&&C.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?C="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?C=e.value.charAt(0):(console.error("Did not expect this"),C=""));let Ie=/\d/.test(C)?"mn":"mi";C=`<${Ie}${H(e.id,t)}>${uo(C)}</${Ie}>`;break}case"mbin":case"mrel":case"minner":C=yi(e,t);break;case"mpunct":C='<mo separator="true"'+H(e.id,t)+">"+Q+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="​"&&(C="<mo"+H(e.id,t)+">",C+=Q==="\\operatorname"?e.body:Q||e.body,C+="</mo>");break;case"box":C='<menclose notation="box"',e.backgroundcolor&&(C+=' mathbackground="'+e.backgroundcolor+'"'),C+=H(e.id,t)+">"+N(e.body,t)+"</menclose>";break;case"spacing":C+='<mspace width="'+((E=V[Q])!=null?E:0)+'em"/>';break;case"enclose":C='<menclose notation="';for(let Ie in e.notation)Object.prototype.hasOwnProperty.call(e.notation,Ie)&&e.notation[Ie]&&(C+=Se+Ie,Se=" ");C+=H(e.id,t)+'">'+N(e.body,t)+"</menclose>";break;case"prompt":C='<menclose notation="roundexbox""">'+N(e.body,t)+"</menclose>";break;case"space":C+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":C+=yi(e,t);break;case"mclose":C+=yi(e,t);break;case"macro":{let Ie=e.command+Gi(e.macroArgs);Ie&&(C+=`<mo ${H(e.id,t)}>${Ie}</mo>`)}break;case"latexgroup":C+=N(e.body,t);break;case"latex":C+="<mtext"+H(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":C+=N(e.body,t);break;case"text":C+=`<mtext ${H(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${H(e.id,t)} displaystyle="true">${N(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${H(e.id,t)} displaystyle="false">${N(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return C}var Ti={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma  <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"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 ","​":"","−":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\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 <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Rn={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 Af(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function kr(e){let t=0;if(_e(e))for(let i of e)i.type!=="first"&&(t+=1);return t===1}function Lf(e){if(_e(e)){for(let t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function p0(e){let t="";if(_e(e))for(let i of e)i.type!=="first"&&typeof i.value=="string"&&(t+=i.value);return t}function Ef(e){return e?e.map(t=>t.value).join(""):""}function T(e,t){var i,r,a,o,n;function l(c){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(c)?` <say-as interpret-as="character">${c}</say-as>`:/[A-Z]/.test(c)?`capital <say-as interpret-as="character">${c.toLowerCase()}</say-as>`:c:/[a-z]/.test(c)?" '"+c.toUpperCase()+"'":/[A-Z]/.test(c)?" 'capital "+c.toUpperCase()+"'":c}function s(c){return"<emphasis>"+c+"</emphasis>"}if(!t)return"";let u="";if(_e(t)){let c=!1,d=!1;for(let h=0;h<t.length;h++)t[h].type!=="first"&&(t[h].mode!=="text"&&(d=!1),h<t.length-2&&t[h].type==="mopen"&&t[h+2].type==="mclose"&&t[h+1].type==="mord"?(u+=" of ",u+=s(T(e,t[h+1])),h+=2):t[h].mode==="text"?d?u+=(i=t[h].value)!=null?i:" ":(d=!0,u+=T("text",t[h])):t[h].isDigit()?c?u+=t[h].asDigit():(c=!0,u+=T(e,t[h])):(c=!1,u+=T(e,t[h])))}else if(t.mode==="text")t.id&&e==="math"&&(u+='<mark name="'+t.id.toString()+'"/>'),u+=t.value;else{t.id&&e==="math"&&(u+='<mark name="'+t.id.toString()+'"/>');let c="",d="",h="",p=!1,{command:m}=t;switch(m){case"\\vec":return"vector "+T(e,t.body);case"\\acute":return T(e,t.body)+" acute";case"\\grave":return T(e,t.body)+" grave";case"\\dot":return"dot over"+T(e,t.body);case"\\ddot":return"double dot over"+T(e,t.body);case"\\mathring":return"ring over"+T(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+T(e,t.body);case"\\bar":return T(e,t.body)+" bar";case"\\breve":return T(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+T(e,t.body);case"\\hat":case"\\widehat":return"hat over"+T(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+T(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+T(e,t.body)}switch(t.type){case"prompt":let y=t.body.length>1?'start input . <break time="500ms"/> '+T(e,t.body)+'. <break time="500ms"/> end input':"blank";u+=' <break time="300ms"/> '+y+'. <break time="700ms"/>'+((r=t.correctness)!=null?r:"")+' . <break time="700ms"/> ';break;case"array":let M=t.array,g=t.environmentName;if(Object.keys(Rn).includes(g)){u+=` begin ${Rn[g]} `;for(let w=0;w<M.length;w++){w>0&&(u+=","),u+=` row ${w+1} `;for(let L=0;L<M[w].length;L++)L>0&&(u+=","),u+=` column ${L+1}: `,u+=T("math",M[w][L])}u+=` end ${Rn[g]} `}break;case"group":m==="\\ne"?u+=" not equal ":(m==="\\not"&&(u+=" not "),u+=T("math",t.body));break;case"root":u+=T("math",t.body);break;case"genfrac":if(c=T("math",t.above),d=T("math",t.below),kr(t.above)&&kr(t.below)){let w={"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 "}[p0(t.above)+"/"+p0(t.below)];w?u=w:u+=c+" over "+d}else u+=' the fraction <break time="150ms"/>'+c+' over <break time="150ms"/>'+d+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(h=T("math",t.body),t.hasEmptyBranch("above"))u+=kr(t.body)?" the square root of "+h+" , ":' the square root of <break time="200ms"/>'+h+'. <break time="200ms"/> End square root';else{let w=T("math",t.above);w=w.trim();let L=w.replace(/<mark([^/]*)\/>/g,"");L==="3"?u+=' the cube root of <break time="200ms"/>'+h+'. <break time="200ms"/> End cube root':L==="n"?u+=' the nth root of <break time="200ms"/>'+h+'. <break time="200ms"/> End root':u+=' the root with index: <break time="200ms"/>'+w+', of <break time="200ms"/>'+h+'. <break time="200ms"/> End root'}break;case"leftright":{let w=t;u+=(a=w.leftDelim?Ti[w.leftDelim]:void 0)!=null?a:w.leftDelim,u+=T("math",t.body),u+=(o=w.rightDelim?Ti[w.rightDelim]:void 0)!=null?o:w.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":let _=m.replace(/^\\/g,""),D=Sl()[_];D&&(D!=null&&D.expand?u+=T("math",t.body):u+=`${_} `);break;case"placeholder":u+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(m==="\\mathbin"||m==="\\mathrel"||m==="\\mathopen"||m==="\\mathclose"||m==="\\mathpunct"||m==="\\mathord"||m==="\\mathinner"){u=T(e,t.body);break}let w=t.isDigit()?t.asDigit():t.value,L=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(L=t.value,w=L),e==="text")u+=w;else{if(t.type==="mbin"&&(u+='<break time="150ms"/>'),w){let K=Ti[w]||(L?Ti[L.trim()]:"");if(K)u+=" "+K;else{let E=L?Af(L.trim()):"";u+=E||l(w)}}else u+=T("math",t.body);t.type==="mbin"&&(u+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="​"){let w=t.command;if(w==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let L=T("math",t.superscript);L=L.trim();let K=T("math",t.subscript);K=K.trim(),u+=' the summation from <break time="200ms"/>'+K+'<break time="200ms"/> to  <break time="200ms"/>'+L+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if(t.hasEmptyBranch("subscript"))u+=" the summation of";else{let L=T("math",t.subscript);L=L.trim(),u+=' the summation from <break time="200ms"/>'+L+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if(w==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let L=T("math",t.superscript);L=L.trim();let K=T("math",t.subscript);K=K.trim(),u+=' the product from <break time="200ms"/>'+K+'<break time="200ms"/> to <break time="200ms"/>'+L+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if(t.hasEmptyBranch("subscript"))u+=" the product  of ";else{let L=T("math",t.subscript);L=L.trim(),u+=' the product from <break time="200ms"/>'+L+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if(w==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let L=T("math",t.superscript);L=L.trim();let K=T("math",t.subscript);K=K.trim(),u+=' the integral from <break time="200ms"/>'+s(K)+'<break time="200ms"/> to <break time="200ms"/>'+s(L)+' <break time="200ms"/> of ',p=!0}else u+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){let L=(n=Ti[t.value])!=null?n:t.command?Ti[t.command]:void 0;u+=L||" "+t.value}else t.command&&(t.command==="\\mathop"?u+=T("math",t.body):t.command==="\\operatorname"?u+=Ef(t.body):u+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":h=T("math",t.body),u+=" crossed out "+h+". End crossed out.";break}if(!p&&!t.hasEmptyBranch("superscript")){let y=T(e,t.superscript);y=y.trim();let M=y.replace(/<[^>]*>/g,"");if(kr(t.superscript)){if(e==="math"){let g=Lf(t.superscript);g&&(u+='<mark name="'+g+'"/>')}M==="′"?u+=" prime ":M==="2"?u+=" squared ":M==="3"?u+=" cubed ":Number.isNaN(Number.parseInt(M))?u+=" to the "+y+"; ":u+=' to the <say-as interpret-as="ordinal">'+M+"</say-as> power; "}else Number.isNaN(Number.parseInt(M))?u+=" raised to the "+y+"; ":u+=' raised to the <say-as interpret-as="ordinal">'+M+"</say-as> power; "}if(!p&&!t.hasEmptyBranch("subscript")){let y=T("math",t.subscript);y=y.trim(),u+=kr(t.subscript)?" sub "+y:" subscript "+y+". End subscript. "}}return u}function Zi(e){var t,i;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){let a=N(e);if(a){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=b(f({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=b(f({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=b(f({},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 n="";try{n=o.toSpeech(a)}catch(l){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",l)}return n}return""}let r=T("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let a="";window.MathfieldElement.speechEngineRate&&(a='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),r='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+a+"<p><s>"+r+"</s></p>"+(a?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&rr()==="macos"?r=r.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):r=r.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return r}var Mr={"\\ne":"≠","\\neq":"≠","−":"-","-":"-","\\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"},Sr={"\\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 Kf(e){let t="";for(let i of e){let r=t[t.length-1];r!==void 0&&/\d/.test(r)&&/^\d/.test(i)&&(t+=" "),t+=i}return t}function ee(e){var t,i,r,a,o,n,l,s,u,c,d,h,p;if(!e)return"";if(_e(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(ee).join("");if(e[0].mode==="text"){let D=0,w="";for(;((t=e[D])==null?void 0:t.mode)==="text";)w+=e[D].body?ee(e[D].body):e[D].value,D++;return`"${w}" ${ee(e.slice(D))}`}let g=0,_=[];for(;e[g]&&e[g].mode==="math";){let D="";for(;e[g]&&e[g].type==="mord"&&/\d/.test(e[g].value);)D+=e[g++].value;D?_.push(D):_.push(ee(e[g++]))}return _.push(ee(e.slice(g))),Kf(_)}if(e.mode==="text")return`"${e.value}"`;let m="",{command:y}=e,M;if(y==="\\placeholder")return`(${ee(e.body)})`;switch(e.type){case"accent":let g={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[y];m=`${g??""} ${ee(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(E=>E.value).join("");case"group":case"root":m=(i=Mr[y])!=null?i:ee(e.body);break;case"genfrac":{let E=e;(E.leftDelim||E.rightDelim)&&(m=E.leftDelim==="."||!E.leftDelim?"{:":E.leftDelim),E.hasBarLine?(m+="(",m+=ee(E.above),m+=")/(",m+=ee(E.below),m+=")"):(m+="("+ee(E.above)+"),",m+="("+ee(E.below)+")"),(E.leftDelim||E.rightDelim)&&(m+=E.rightDelim==="."||!E.rightDelim?"{:":E.rightDelim)}break;case"surd":m+=e.hasEmptyBranch("above")?"sqrt("+ee(e.body)+")":"root("+ee(e.above)+")("+ee(e.body)+")";break;case"latex":m=e.value;break;case"leftright":{let E=e,I=E.leftDelim;m+=I==="."||!I?"{:":I,m+=ee(E.body);let V=E.matchingRightDelim();m+=V==="."||!V?":}":V}break;case"sizeddelim":case"delim":m=e.value;break;case"overlap":break;case"overunder":break;case"mord":m=(a=(r=Mr[y])!=null?r:y)!=null?a:typeof e.value=="string"?e.value:"",m.startsWith("\\")&&(m+=" "),M=y?y.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,M?m=String.fromCodePoint(Number.parseInt("0x"+M[1])):m.length>0&&m.startsWith("\\")&&(m=typeof e.value=="string"?e.value.charAt(0):e.command),m=Ff(m,e.style);break;case"mbin":case"mrel":case"minner":m=(n=(o=Mr[y])!=null?o:Sr[y])!=null?n:e.value;break;case"mopen":case"mclose":m=e.value;break;case"mpunct":m=(l=Sr[y])!=null?l:y;break;case"mop":case"operator":case"extensible-symbol":e.value!=="​"&&(Sr[y]?m=Sr[y]:m=y==="\\operatorname"?ee(e.body):(s=e.value)!=null?s:y,m+=" ");break;case"array":let _=e.array,D=e.environmentName,w=(u={bmatrix:["[","]"],"bmatrix*":["[","]"]}[D])!=null?u:["(",")"],L=[];for(let E of _){let I=[];for(let V of E)I.push(w[0]+ee(V)+w[1]);L.push(I.join(","))}let K=(c={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[D])!=null?c:["(",")"];m=K[0]+L.join(",")+K[1];break;case"box":break;case"spacing":m=(d=Mr[y])!=null?d:" ";break;case"enclose":m="("+ee(e.body)+")";break;case"space":m=" ";break;case"subsup":m="";break;case"macro":m=(p=(h=Mr[y])!=null?h:Sr[y])!=null?p:ee(e.body);break}if(!e.hasEmptyBranch("subscript")){m+="_";let g=ee(e.subscript);m+=g.length!==1?`(${g})`:g}if(!e.hasEmptyBranch("superscript")){m+="^";let g=ee(e.superscript);m+=g.length!==1?`(${g})`:g}return m}function Ff(e,t){if(!t)return e;let i=e;return t.variant==="double-struck"&&(i=`bbb "${i}"`),t.variant==="script"&&(i=`cc "${i}"`),t.variant==="fraktur"&&(i=`fr "${i}"`),t.variant==="sans-serif"&&(i=`sf "${i}"`),t.variant==="monospace"&&(i=`tt "${i}"`),t.variantStyle==="bold"&&(i=`bb "${i}"`),t.color?`color({${t.color}})(${i})`:i}function ne(e,t){var i,r;t!=null||(t={}),t.mathstyle=(i=t.mathstyle)!=null?i:"displaystyle";let a=new $({from:b(f({},Bl()),{renderPlaceholder:()=>new S(160,{maxFontSize:1}),letterShapeStyle:(r=t==null?void 0:t.letterShapeStyle)!=null?r:"tex"}),mathstyle:t.mathstyle}),o=new v({mode:"math",type:"root",body:ye(e,{context:a,parseMode:"math",mathstyle:t.mathstyle})}).render(a);return o?(zo(Zr(o,a)),$o(o,{classes:"ML__latex"}).toMarkup()):""}function k4(e){return vd(e,{context:Bl()})}function Tf(e,t={}){return N(ye(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function zf(e){let t=ye(e,{parseMode:"math",mathstyle:"displaystyle"});return Zi(t)}var Qa;function $f(e){var t,i;if(!Qa){let r=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;r?Qa=new r:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
        
        Load the library, for example with:
        
        import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(i=Qa==null?void 0:Qa.box(e).latex)!=null?i:""}function M4(e,t="math"){return ee(new v({type:"root",body:ye(e,{parseMode:t})}))}function S4(e){return vo(e,{format:"ascii-math"})[1]}function xl(e){if(typeof e=="string"){let t=Pf(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?If(e):"a"in e?vh(e):e}function Yi(e){return e<0?0:e>255?255:Math.round(e)}function Pf(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a>"u"&&(t.a=1),t}function wl(e){let[t,i,r]=[e.L,e.C,e.H],a=r*Math.PI/180,o={L:t,a:i*Math.cos(a),b:i*Math.sin(a)};return e.alpha!==void 0&&(o.alpha=e.alpha),o}function Of(e){let[t,i,r]=[e.L,e.a,e.b],a=Math.sqrt(i*i+r*r),o=Math.atan2(r,i)*180/Math.PI,n={L:t,C:a,H:o};return e.alpha!==void 0&&(n.alpha=e.alpha),n}function Vn(e){let[t,i,r]=[e.L,e.a,e.b],a=Math.pow(.9999999984505198*t+.39633779217376786*i+.2158037580607588*r,3),o=Math.pow(1.00000000888176*t-.10556134232365635*i-.0638541747717059*r,3),n=Math.pow(t*1.000000054672411-.0894841820949657*i-1.2914855378640917*r,3),l=4.076741661347994*a-3.307711590408193*o+.230969928729428*n,s=-1.2684380040921763*a+2.6097574006633715*o-.3413193963102197*n,u=-.004196086541837188*a-.7034186144594493*o+1.7076147009309444*n,c=d=>{let h=Math.abs(d);return h<=.0031308?d*12.92:(Math.sign(d)||1)*(1.055*Math.pow(h,1/2.4)-.055)};return[c(l),c(s),c(u)]}function Hn(e){let[t,i,r]=e;return t>=0&&t<=1&&i>=0&&i<=1&&r>=0&&r<=1}function jn(e,t){let[i,r,a]=e;return i=Yi(i*255),r=Yi(r*255),a=Yi(a*255),t!==void 0?{r:i,g:r,b:a,alpha:t}:{r:i,g:r,b:a}}function vh(e){let[t,i,r]=Vn(e);if(Hn([t,i,r]))return jn([t,i,r],e.alpha);let a=Of(e);if(a.C=0,[t,i,r]=Vn(wl(a)),!Hn([t,i,r]))return jn([t,i,r],e.alpha);let o=0,n=e.L,l=(o+n)/2;a.C=l;let s=.36/Math.pow(2,12);for(;n-o>s;)l=(o+n)/2,a.C=l,[t,i,r]=Vn(wl(a)),Hn([t,i,r])?o=l:n=l;return jn([t,i,r],e.alpha)}function If(e){return vh(wl(e))}function m0(e,t){let i=xl(e),r=xl(t),a=.56,o=.57,n=.62,l=.65,s=.022,u=1.414,c=.1,d=5e-4,h=1.14,p=.027,m=1.14,y=.027;function M(E){return E>=s?E:E+(s-E)**u}function g(E){return(E<0?-1:1)*Math.pow(Math.abs(E),2.4)}let _=M(g(r.r/255)*.2126729+g(r.g/255)*.7151522+g(r.b/255)*.072175),D=M(g(i.r/255)*.2126729+g(i.g/255)*.7151522+g(i.b/255)*.072175),w,L,K;return Math.abs(D-_)<d?L=0:D>_?(w=D**a-_**o,L=w*h):(w=D**l-_**n,L=w*m),Math.abs(L)<c?K=0:L>0?K=L-y:K=L+p,K*100}function xh(e,t,i){i!=null||(i="#fff"),t!=null||(t="#000");let r=m0(e,i),a=m0(e,t);return Math.abs(r)>Math.abs(a)?i:t}function Nf(e){let t=xl(e),i=((1<<24)+(Yi(t.r)<<16)+(Yi(t.g)<<8)+Yi(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(i+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),i[0]===i[1]&&i[2]===i[3]&&i[4]===i[5]&&i[6]===i[7]&&(i=i[0]+i[2]+i[4]+(t.alpha!==void 0&&t.alpha<1?i[6]:"")),"#"+i}function U(e){let t=wh(e),i="";for(let r of t){if(typeof r.value!="string")return"";i+=r.value}return i}function wh(e){let t=e.model.selection.ranges;return t.length!==1?[]:e.model.getAtoms(t[0])}function qf(e,t){let i=wh(e);if(i.length!==1)return!1;let r=al[t];return r?!!r.test(i[0].value):!1}function Rf(e,t){return U(e).length>0}function Vf(e){return[Wn(e,"double-struck","mathbb","tooltip.blackboard"),Wn(e,"fraktur","mathfrak","tooltip.fraktur"),Wn(e,"calligraphic","mathcal","tooltip.caligraphic"),Un(e,"up","mathrm","tooltip.roman-upright"),Un(e,"bold","mathbf","tooltip.bold"),Un(e,"italic","mathit","tooltip.italic")]}function Hf(e){return[{label:()=>ne(`\\vec{${U(e)}}`),visible:()=>U(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>ne(`\\overrightarrow{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>ne(`\\overleftarrow{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>ne(`\\dot{${U(e)}}`),visible:()=>U(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>ne(`\\ddot{${U(e)}}`),visible:()=>U(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>ne(`\\bar{${U(e)}}`),visible:()=>U(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>ne(`\\overline{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>ne(`\\overgroup{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>ne(`\\overbrace{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>ne(`\\underline{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>ne(`\\undergroup{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>ne(`\\underbrace{${U(e)}}`),visible:()=>U(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function jf(e){return[{label:()=>ne(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>ne(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>ne(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Wf(e){let t=[];for(let i of Object.keys(mi))t.push({class:(Nf(xh(mi[i]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${mi[i]} "></span>`,ariaLabel:()=>{var r;return(r=F(i))!=null?r:i},checked:()=>{var r;return{some:"mixed",all:!0}[(r=e.queryStyle({backgroundColor:i}))!=null?r:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:i},{operation:"toggle"}),e.adoptStyle="none"}});return t}function Uf(e){let t=[];for(let i of Object.keys(fi))t.push({class:(xh(fi[i])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${fi[i]} "></span>`,ariaLabel:()=>{var r;return(r=F(i))!=null?r:i},checked:()=>{var r;return{some:"mixed",all:!0}[(r=e.queryStyle({color:i}))!=null?r:!1]},onMenuSelect:()=>{e.applyStyle({color:i},{operation:"toggle"}),e.adoptStyle="none"}});return t}var Jf=class extends ph{constructor(e,t,i,r){super(e,t),this.row=i,this.col=r}set active(e){let t=this.parentMenu.children;if(e)for(let i of t)i.element.classList.toggle("active",i.row<=this.row&&i.col<=this.col);else for(let i of t)i.element.classList.remove("active")}};function Xf(e){let t=[];for(let i=1;i<=5;i++)for(let r=1;r<=5;r++)t.push({onCreate:(a,o)=>new Jf(a,o,i,r),label:"☐",tooltip:()=>F("tooltip.row-by-col",i,r),data:{row:i,col:r},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(i).fill(Array(r).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function Gf(e){return[{label:()=>F("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>ri(e)},{label:()=>F("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>ri(e)},{label:()=>F("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>ri(e),enabled:()=>{let t=e.model.parentEnvironment;if(!t)return!1;let[i,r]=Yf(e);return i<t.maxColumns}},{label:()=>F("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>ri(e)},{type:"divider"},{label:()=>F("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>ri(e)},{label:()=>F("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>ri(e)},{type:"divider"},{label:()=>F("menu.borders"),visible:()=>(Zf(e)||ri(e))&&e.isSelectionEditable,submenu:[{label:" ⋱ ",id:"environment-no-border",onMenuSelect:()=>Cr(e,"matrix")},{label:"(⋱)",id:"environment-parentheses",onMenuSelect:()=>Cr(e,"pmatrix")},{label:"[⋱]",id:"environment-brackets",onMenuSelect:()=>Cr(e,"bmatrix")},{label:"|⋱|",id:"environment-bar",onMenuSelect:()=>Cr(e,"vmatrix")},{label:"{⋱}",id:"environment-braces",onMenuSelect:()=>Cr(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>F("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:Xf(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>F("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>F("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{tr(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>F("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{tr(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>F("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>F("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:Vf(e),submenuClass:"variant-submenu"},{label:()=>F("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:Uf(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>F("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:Wf(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>F("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:Hf(e),submenuClass:"variant-submenu"},{label:()=>F("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&U(e).length>0,submenu:jf(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>F("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{let t=Qf(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>F("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,i;if(e.model.selectionIsCollapsed){let r=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!r){e.model.announce("plonk");return}e.insert(`=${r.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{let r=(i=window.MathfieldElement.computeEngine)==null?void 0:i.parse(e.getValue(e.model.selection)).simplify();if(!r){e.model.announce("plonk");return}e.insert(r.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";let i=(t=e.expression)==null?void 0:t.unknowns[0];return i?F("menu.solve-for",ne(i)):F("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;let i=e.expression,r=i==null?void 0:i.unknowns[0],a=(t=i.solve(r))==null?void 0:t.map(o=>{var n;return(n=o.simplify().latex)!=null?n:""});if(!a){e.model.announce("plonk");return}e.insert(`${r}=${a.length===1?a[0]:"\\left\\lbrace"+(a==null?void 0:a.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>F("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>F("menu.copy"),id:"copy",submenu:[{label:()=>F("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>J.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>F("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>J.copyToClipboard(e,"ascii-math")},{label:()=>F("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>J.copyToClipboard(e,"math-ml")}]},{label:()=>F("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>F("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function ri(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function Zf(e){return e.model.at(e.model.position).type==="array"}function Yf(e){var t;let i=(t=e.model.parentEnvironment)==null?void 0:t.array;return i?[i.length,i.reduce((r,a)=>Math.max(r,a.length),0)]:[0,0]}function Cr(e,t){Vo(e),e.flushInlineShortcutBuffer(),ih(e.model,t),Y(e)}function Qf(e){var t,i;let r;if(e.model.selectionIsCollapsed?r=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):r=(i=window.MathfieldElement.computeEngine)==null?void 0:i.parse(e.getValue(e.model.selection),{canonical:!1}),!r)return"";let a=r.evaluate();return a.isSame(r)&&(a=r.N()),a.latex}function Wn(e,t,i,r){return{label:()=>ne(`\\${i}{${U(e)}}`),tooltip:()=>{var a;return(a=F(r))!=null?a:r},visible:()=>qf(e,t),checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({variant:t}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Un(e,t,i,r){return{label:()=>ne(`\\${i}{${U(e)}}`),tooltip:()=>{var a;return(a=F(r))!=null?a:r},visible:()=>Rf(e),checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({variantStyle:t}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Hi(e,t){return e+Zi(t)}Me({speak:(e,t,i)=>e4(e,t,i)},{target:"mathfield"});function e4(e,t,i){var r,a;i=i??{withHighlighting:!1};let{model:o}=e;function n(c){let d=null;switch(c){case"all":d=o.root;break;case"selection":d=o.getAtoms(o.selection);break;case"left":{d=o.getAtoms(o.offsetOf(o.at(o.position).leftSibling),o.position);break}case"right":{d=o.getAtoms(o.position,o.offsetOf(o.at(o.position).rightSibling));break}case"group":d=o.getAtoms(o.getSiblingsRange(o.position));break;case"parent":{let{parent:h}=o.at(o.position);h!=null&&h.parent?d=h:d=o.root;break}default:d=o.root}return d}function l(c){let d="";switch(c){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:""+c;break}return d}let s=n(t);if(s===null)return(a=(r=window.MathfieldElement).speakHook)==null||a.call(r,l(t)),!1;(i.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");let u=Zi(s);return Pe()&&i.withHighlighting?(zt().readAloudMathfield=e,gi(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,u)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(u),!1}function t4(e){var t,i;if(Pe())if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){let r=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(r)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{let r=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((i=window.MathfieldElement.speechEngineVoice)!=null?i:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};r.synthesizeSpeech(a,(o,n)=>{if(o)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${o}`);else if(n!=null&&n.AudioStream){let l=new Uint8Array(n.AudioStream),s=new Blob([l.buffer],{type:"audio/mpeg"}),u=URL.createObjectURL(s);new Audio(u).play().catch(c=>console.log(c))}})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function _h(e){var t;let i;if(e.parent.type==="prompt")e.parentBranch==="body"&&(i="prompt");else if(e.parentBranch==="body")i=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(i="index"):e.parentBranch==="superscript"?i="superscript":e.parentBranch==="subscript"&&(i="subscript");return i??"parent"}function i4(e,t,i,r){let a="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")a=Hi("deleted: ",r);else if(t==="focus"||t.includes("move"))a=r4(e.model,i)+(e.model.selectionIsCollapsed?"":"selected: ")+a4(e.model);else if(t==="replacement")a=Hi("",e.model.at(e.model.position));else if(t==="line"){let o=Hi("",e.model.root);e.keyboardDelegate.setAriaLabel(o)}else a=r?Hi(t+" ",r):t;if(a){let o=e.ariaLiveText.textContent.includes(" ")?"   ":"   ";e.ariaLiveText.textContent=a+o}}function r4(e,t){if(Number.isNaN(t))return"";let i=e.at(t);if(!i||i.treeDepth<=e.at(e.position).treeDepth)return"";let r="",a=i.parent,o=e.at(e.position).parent;for(;a!==e.root&&a!==o;)r+=`out of ${_h(a)};`,a=a.parent;return r}function a4(e){if(!e.selectionIsCollapsed)return Hi("",e.getAtoms(e.selection));let t="",i=e.at(e.position),r=_h(i);return i.isFirstSibling&&(t=(r?"start of "+r:"unknown")+": "),i.isLastSibling?i.isFirstSibling||(t+=r?"end of "+r:"unknown"):t+=Hi("",i),t}var o4=class{constructor(e,t,i){this.mathfield=e,this.mode=t,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,t){var i;let r=this.silenceNotifications;this.silenceNotifications=(i=t==null?void 0:t.silenceNotifications)!=null?i:!0;let a={};if((t==null?void 0:t.type)==="undo"&&(a={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(a={inputType:"historyRedo"}),this.contentWillChange(a)){let o=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=It(e.content),this.selection=e.selection,this.silenceNotifications=o,this.contentDidChange(a)}this.silenceNotifications=r}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var i,r,a;let o=this.normalizeSelection(e,t);if(o===void 0)throw new TypeError("Invalid selection");if(o.ranges.length===1&&o.ranges[0][0]===o.ranges[0][1]){let c=o.ranges[0][0];if(!this.mathfield.dirty&&!((i=this.at(c))!=null&&i.parentPrompt)&&this.mathfield.hasEditablePrompts){if((r=this.at(c-1))!=null&&r.parentPrompt){this._anchor=this.normalizeOffset(c-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((a=this.at(c+1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(c+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=c,this._position=c,this._selection=o;return}let n=pe(o);o.direction==="backward"?[this._position,this._anchor]=n:[this._anchor,this._position]=n;let l=this.at(n[0]+1),s=this.at(n[1]),u=v.commonAncestor(l,s);(u==null?void 0:u.type)==="array"&&l.parent===u&&s.parent===u?this._selection={ranges:[n],direction:o.direction}:this._selection={ranges:[n],direction:o.direction},this._position>=0&&this._position<=this.lastOffset})}setPositionHandlingPlaceholder(e){var t;let i=this.at(e);(i==null?void 0:i.type)==="placeholder"?this.setSelection(e-1,e):((t=i==null?void 0:i.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,i instanceof se&&i.isSuggestion&&(i.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 t=this.at(e),{parent:i}=t;if(!i)return[0,this.lastOffset];let r=t.parent.branch(t.parentBranch);return[this.offsetOf(r[0]),this.offsetOf(r[r.length-1])]}getBranchRange(e,t){let i=this.at(e).branch(t);return[this.offsetOf(i[0]),this.offsetOf(i[i.length-1])]}getAtoms(e,t,i){let r=i??{};if(ro(e)){if(r=t??{},e.ranges.length>1)return e.ranges.reduce((u,c)=>[...u,...this.getAtoms(c,r)],[]);e=e.ranges[0]}let a,o;if($t(e)){if(a=e,!$t(t))return[];o=t}else[a,o]=e,r=t??{};if(!Number.isFinite(a))return[];r.includeChildren===void 0&&(r.includeChildren=!1),a<0&&(a=this.lastOffset-a+1),o<0&&(o=this.lastOffset-o+1);let n=Math.min(a,o)+1,l=Math.max(a,o);if(!r.includeChildren&&n===1&&l===this.lastOffset)return[this.root];let s=[];for(let u=n;u<=l;u++){let c=this.atoms[u];f0(this,c,n,l)&&s.push(c)}return r.includeChildren||(s=s.filter(u=>{let c=!1,{parent:d}=u;for(;d&&!c;)c=f0(this,d,n,l),d=d.parent;return!c})),s}getAllAtoms(e=0){let t=[],i=this.lastOffset;for(let r=e;r<=i;r++)t.push(this.atoms[r]);for(let r=0;r<e;r++)t.push(this.atoms[r]);return t}findAtom(e,t=0,i="forward"){let r,a=this.lastOffset;if(i==="forward"){for(let o=t;o<=a;o++)if(r=this.atoms[o],e(r))return r;for(let o=0;o<t;o++)if(r=this.atoms[o],e(r))return r;return}for(let o=t;o>=0;o--)if(r=this.atoms[o],e(r))return r;for(let o=a;o>t;o--)if(r=this.atoms[o],e(r))return r}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new v({type:"root",body:[]}),t;for(let i of t)i.parent.removeChild(i);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){let i=t??"latex";if(i.startsWith("latex"))return v.serialize([e],{expandMacro:i==="latex-expanded",skipStyles:i==="latex-unstyled",skipPlaceholders:i==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(i==="math-ml")return N(e);if(i==="spoken")return Zi(e);if(i==="spoken-text"){let r=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";let a=Zi(e);return window.MathfieldElement.textToSpeechMarkup=r,a}if(i==="spoken-ssml"||i==="spoken-ssml-with-highlighting"){let r=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";let a=Zi(e);return window.MathfieldElement.textToSpeechMarkup=r,a}return i==="ascii-math"?ee(e):(console.error(`MathLive 0.98.5: Unexpected format "${i}`),"")}getValue(e,t,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 r,a;if($t(e)&&$t(t)?(r=[this.normalizeRange([e,t])],a=i):bo(e)?(r=[this.normalizeRange(e)],a=t):ro(e)?(r=e.ranges,a=t):(r=[this.normalizeRange([0,-1])],a=e),a!=null||(a="latex"),a==="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 o=this.getValue({ranges:r},"latex-unstyled");try{let n=window.MathfieldElement.computeEngine.parse(o);return JSON.stringify(n.json)}catch(n){return JSON.stringify(["Error",`'${n.toString()}'`])}}if(a.startsWith("latex")){let o={expandMacro:a==="latex-expanded",skipStyles:a==="latex-unstyled",skipPlaceholders:a==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return P(r.map(n=>v.serialize(this.getAtoms(n),o)))}return r.map(o=>this.getAtoms(o).map(n=>this.atomToString(n,a)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{let i=this.normalizeRange([e,t]),[r,a]=i,{parent:o}=this.at(a);if(o&&(o.type==="genfrac"||o.type==="subsup"))for(;o!==this.root&&Jn(this,o,[r,a]);)a=this.offsetOf(o),o=o.parent;for(o=this.at(r).parent;o!==this.root&&Jn(this,o,[r,a]);)r=this.offsetOf(o.leftSibling),o=o.parent;if(o=this.at(a).parent,(o==null?void 0:o.type)==="genfrac")for(;o!==this.root&&Jn(this,o,[r,a]);)a=this.offsetOf(o),o=o.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[r,a]],direction:"none"}})}announce(e,t,i=[]){var r,a;((a=(r=this.mathfield.host)==null?void 0:r.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:i},cancelable:!0,bubbles:!0,composed:!0})))==null||a)&&i4(this.mathfield,e,t,i)}deferNotifications(e,t){let i=this._selection,r=this._anchor,a=this._position,o=this.silenceNotifications;this.silenceNotifications=!0;let n=this.root.changeCounter;t();let l=this.root.changeCounter!==n,s=r!==this._anchor||a!==this._position||yp(this._selection,i)==="different";return this.silenceNotifications=o,e.content&&l&&this.contentDidChange({inputType:e.type}),e.selection&&s&&this.selectionDidChange(),l||s}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,i]=e;return t=this.normalizeOffset(t),i=this.normalizeOffset(i),t<i?[t,i]:[i,t]}normalizeSelection(e,t){var i;let r;if($t(e)){let a=this.normalizeOffset(e);if($t(t)){let o=this.normalizeOffset(t);r=a<=o?{ranges:[[a,o]],direction:"none"}:{ranges:[[o,a]],direction:"backward"}}else r={ranges:[[a,a]],direction:"none"}}else if(bo(e)){let a=this.normalizeOffset(e[0]),o=this.normalizeOffset(e[1]);r=a<=o?{ranges:[[a,o]],direction:"none"}:{ranges:[[o,a]],direction:"backward"}}else ro(e)&&(r={ranges:e.ranges.map(a=>this.normalizeRange(a)),direction:(i=e.direction)!=null?i:"none"});return r}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 e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;let t=this.silenceNotifications;this.silenceNotifications=!0;let i=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,i}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(it(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;let i=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",b(f({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=i}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(it(this.mathfield)),this.silenceNotifications))return;let e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function f0(e,t,i,r){let a=e.offsetOf(t);if(a<i||a>r)return!1;if(!t.hasChildren)return!0;let o=e.offsetOf(t.firstChild);if(o>=i&&o<=r){let n=e.offsetOf(t.lastChild);if(n>=i&&n<=r)return!0}return!1}function Jn(e,t,i){if(!(t!=null&&t.hasChildren))return!1;let[r,a]=i,o=e.offsetOf(t.firstChild),n=e.offsetOf(t.lastChild);return o>=r&&o<=a&&n>=o&&n<=a}function Or(e,t,i,r){var a,o,n,l,s,u;let c=i.parent;if(c&&i instanceof Z){let d=!r&&t==="forward"||r==="body"&&t==="backward",h=d?e.offsetOf(i.firstChild):e.offsetOf(i.lastChild);return d?i.rightDelim!=="?"&&i.rightDelim!=="."?(i.leftDelim=".",i.isDirty=!0):(c.addChildrenAfter(i.removeBranch("body"),i),c.removeChild(i),h--):i.leftDelim!=="?"&&i.leftDelim!=="."?(i.rightDelim=".",i.isDirty=!0):(c.addChildrenAfter(i.removeBranch("body"),i),c.removeChild(i),h--),e.position=h,!0}if(c&&i.type==="surd"){if(t==="forward"&&!r||t==="backward"&&r==="body"){let d=i.leftSibling;i.hasChildren&&c.addChildrenAfter(i.removeBranch("body"),i),c.removeChild(i),e.position=e.offsetOf(d)}else t==="forward"&&r==="body"?e.position=e.offsetOf(i):!r&&t==="backward"?i.hasChildren?e.position=e.offsetOf(i.lastChild):(e.position=Math.max(0,e.offsetOf(i)-1),c.removeChild(i)):r==="above"&&(i.hasEmptyBranch("above")&&i.removeBranch("above"),t==="backward"?e.position=e.offsetOf(i.leftSibling):e.position=e.offsetOf(i.body[0]));return!0}if(c&&(i.type==="box"||i.type==="enclose")){let d=r&&t==="backward"||!r&&t==="forward"?i.leftSibling:i.lastChild;return c.addChildrenAfter(i.removeBranch("body"),i),c.removeChild(i),e.position=e.offsetOf(d),!0}if(i.type==="genfrac"||i.type==="overunder"){if(!r)return i.type==="overunder"&&i.hasEmptyBranch("body")||i.type==="genfrac"&&i.hasEmptyBranch("below")&&i.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?i.firstChild:i.lastChild),!0);let d=Hr.fractionNavigationOrder==="numerator-denominator"?"above":"below",h=d==="above"?"below":"above";if(c&&(t==="forward"&&r===d||t==="backward"&&r===h)){let p=i.removeBranch(d),m=i.removeBranch(h);return c.addChildrenAfter([...p,...m],i),c.removeChild(i),e.position=e.offsetOf(p.length>0?p[p.length-1]:m[0]),!0}return t==="backward"?e.position=e.offsetOf(i.leftSibling):e.position=e.offsetOf(i),!0}if(i.isExtensibleSymbol||i.type==="subsup"){if(!r&&t==="forward")return!1;if(!r){if(i.subscript||i.superscript){let d=t==="forward"?(n=(a=i.superscript)==null?void 0:a[0])!=null?n:(o=i.subscript)==null?void 0:o[0]:(u=(l=i.subscript)==null?void 0:l[0].lastSibling)!=null?u:(s=i.superscript)==null?void 0:s[0].lastSibling;return d&&(e.position=e.offsetOf(d)),!0}return!1}if(!i.hasChildren&&i.type==="subsup"){let d=t==="forward"?e.offsetOf(i):Math.max(0,e.offsetOf(i)-1);return i.parent.removeChild(i),e.position=d,!0}if(r==="superscript")if(t==="backward"){let d=e.offsetOf(i.firstChild)-1;e.position=d}else i.subscript?e.position=e.offsetOf(i.subscript[0]):e.position=e.offsetOf(i);else r==="subscript"&&(t==="backward"&&i.superscript?e.position=e.offsetOf(i.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(i.firstChild)-1:e.position=e.offsetOf(i));if(r&&i.hasEmptyBranch(r)&&(i.removeBranch(r),i.type==="subsup"&&!i.subscript&&!i.superscript)){let d=t==="forward"?e.offsetOf(i):Math.max(0,e.offsetOf(i)-1);i.parent.removeChild(i),e.position=d}return!0}if((c==null?void 0:c.type)==="genfrac"&&!r&&i.type!=="first"){let d=e.offsetOf(i.leftSibling);return c.removeChild(i),c.hasEmptyBranch("above")&&c.hasEmptyBranch("below")?(d=e.offsetOf(c.leftSibling),c.parent.removeChild(c),e.announce("delete",void 0,[c]),e.position=d,!0):(e.announce("delete",void 0,[i]),e.position=d,!0)}if(t==="backward"&&((c==null?void 0:c.command)==="\\ln"||(c==null?void 0:c.command)==="\\log")&&i.parentBranch!=="body"){let d=e.offsetOf(c.leftSibling);return c.parent.removeChild(c),e.announce("delete",void 0,[c]),e.position=d,!0}return!1}function n4(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&Or(e,"backward",t))){if(t!=null&&t.isFirstSibling){if(Or(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):at(e,pe(e.selection),"deleteContentBackward")}function l4(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,i;let r=e.at(e.position).rightSibling;if(r&&Or(e,"forward",r))return;if(r){if(e.at(e.position).isLastSibling&&Or(e,"forward",r.parent,r.parentBranch))return}else{if(r=e.at(e.position),r.isLastSibling&&Or(e,"forward",r.parent,r.parentBranch))return;r=void 0}if(e.position===e.lastOffset||!r){e.announce("plonk");return}r.parent.removeChild(r);let a=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(a==null?void 0:a.type)==="subsup";)a.parent.removeChild(a),a=(i=e.at(e.position))==null?void 0:i.rightSibling;e.announce("delete",void 0,[r])}):at(e,pe(e.selection),"deleteContentForward")}function at(e,t,i){let r=e.getAtoms(t);if(r.length>0&&r[0].parent){let a=r[0].parent.firstChild;a.type==="first"&&(a=a.rightSibling);let o=r[r.length-1].parent.lastChild,n=r[0];n.type==="first"&&(n=n.rightSibling);let l=r[r.length-1];if(n===a&&l===o){let s=r[0].parent;s.parent&&s.type!=="prompt"&&(t=[e.offsetOf(s.leftSibling),e.offsetOf(s)])}if(r.length===1&&r[0].type==="placeholder"&&r[0].parent.type==="genfrac"){let s=r[0].parent,u=r[0].parentBranch==="below"?"above":"below",c=e.offsetOf(s.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:i},()=>{var d,h;let p=s.removeBranch(u);if(p.length===1&&p[0].type==="placeholder")(h=s.parent)==null||h.removeChild(s),e.position=Math.max(0,c);else{let m=s.parent.addChildrenAfter(p,s);(d=s.parent)==null||d.removeChild(s),e.position=e.offsetOf(m)}})}}return e.deferNotifications({content:!0,selection:!0,type:i},()=>e.deleteAtoms(t))}Me({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&at(e,[0,-1],"deleteContent"),deleteForward:e=>l4(e),deleteBackward:e=>n4(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&at(e,[e.anchor,cl(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&at(e,[e.anchor,cl(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&at(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&at(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&at(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&at(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var s4=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;"  viewBox="0 0 576 512" role="img" aria-label="${F("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,u4=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${F("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,c4=class{constructor(e,t){this.focusBlurInProgress=!1;var i,r,a;this.options=f(b(f({},lo()),{macros:Sl(),registers:P0()}),Do(t)),this.eventController=new AbortController;let o=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},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 n=(r=(i=t.value)!=null?i:this.element.textContent)!=null?r:"";n=n.trim();let l=Gc(this.options),s=new v({type:"root",mode:l,body:ye(n,{context:this.context})});this.model=new o4(this,l,s),this.undoManager=new T1(this.model);let u=[];if(u.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),u.push('<span part=container class=ML__container aria-hidden=true  style="visibility:hidden">'),u.push("<span part=content class=ML__content>"),u.push(Wd(this)),u.push("</span>"),window.mathVirtualKeyboard&&(u.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),u.push(s4),u.push("</div>")),u.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),u.push(u4),u.push("</div>"),u.push("</span>"),u.push("<span class=ML__sr-only>"),u.push("<span role=status aria-live=assertive aria-atomic=true></span>"),u.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(u.join("")),!this.element.children){console.error("%cMathLive 0.98.5: 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._l10Subscription=z.subscribe(()=>z.update(this.element)),z.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",d=>d.stopImmediatePropagation(),{capture:!1,signal:o}),this.field.addEventListener("wheel",this,{passive:!1,signal:o}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:o}):this.field.addEventListener("mousedown",this,{signal:o}),(a=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||a.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(it(this)))},{signal:o}),this._menu=new xf(Gf(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:o});let c=this.element.querySelector("[part=menu-toggle]");c==null||c.addEventListener("pointerdown",d=>{if(d.currentTarget!==c||this._menu.state!=="closed")return;this.element.classList.add("tracking");let h=c.getBoundingClientRect();this._menu.modifiers=pi(d),this._menu.show({target:c,location:{x:h.left,y:h.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),d.preventDefault(),d.stopPropagation()},{signal:o}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(c.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Om(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:o}),document.addEventListener("scroll",this,{signal:o}),this.resizeObserver=new ResizeObserver(()=>Y(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:o}),Ae!=="ready"&&document.fonts.ready.then(()=>So(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;let e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){let i=t.branch("body");return!i||i.length<2?{}:this.adoptStyle==="right"?i[1].computedStyle:i[i.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(it(this)),Ya(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,yl())}showMenu(e){var t,i;let r=(i=(t=e==null?void 0:e.location)!=null?t:Ar(this.field))!=null?i:void 0,a=e==null?void 0:e.modifiers,o=this.element.querySelector("[part=container]");return this._menu.show({target:o,location:r,modifiers:a})}get colorMap(){return e=>{var t,i,r;return(r=(i=(t=this.options).colorMap)==null?void 0:i.call(t,e))!=null?r:To(e)}}get backgroundColorMap(){return e=>{var t,i,r,a,o,n;return(n=(o=(i=(t=this.options).backgroundColorMap)==null?void 0:i.call(t,e))!=null?o:(a=(r=this.options).colorMap)==null?void 0:a.call(r,e))!=null?n:kl(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,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}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),t=this.model.at(this.model.position),i=v.commonAncestor(e,t);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)return this.effectiveStyle;let e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};let t=f({},e[0].style);for(let i of e)for(let[r,a]of Object.entries(i.style))t[r]!==a&&delete t[r];return t}queryStyle(e){let t=ml(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;let i=Object.keys(t).length;if(i===0)return"all";if(i>1){for(let s of Object.keys(t)){let u=this.queryStyle({[s]:t[s]});if(u==="none")return"none";if(u==="some")return"some"}return"all"}let r=Object.keys(t)[0],a=t[r];if(this.model.selectionIsCollapsed)return this.effectiveStyle[r]===a?"all":"none";let o=this.model.getAtoms(this.model.selection,{includeChildren:!0}),n=o.length;if(n===0)return"none";let l=0;for(let s of o){if(s.type==="first"){n-=1;continue}s.style[r]===a&&(l+=1)}return l===0?"none":l===n?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;let[i,r]=Vm(this.options.keybindings,(e=Rr())!=null?e:zm());return((t=Rr())==null?void 0:t.score)>0&&(this._keybindings=i,r.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",r)),i}get menu(){return this._menu}setOptions(e){var t;this.options=f(f({},this.options),Do(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 i=this.options.defaultMode;i==="inline-math"&&(i="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==i&&(this.model.root.firstChild.mode=i),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");let r=v.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==r)&&J.insert(this.model,r,{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)&&Y(this)}getOptions(e){return di(this.options,e)}getOption(e){return di(this.options,e)}async handleEvent(e){var t;if(ui(this)){if(Ol(e)){if(!El(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");let{action:i}=e.data;if(i==="execute-command"){let r=e.data.command;if(Ji(r)==="virtual-keyboard")return;this.executeCommand(r)}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":this.userSelect!=="none"&&i0(this,e);break;case"pointerdown":this.userSelect!=="none"&&(i0(this,e),e.shiftKey===!1&&await u0(e,this.element.querySelector("[part=container]"),this._menu)&&Lo.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&await u0(e,this.element.querySelector("[part=container]"),this._menu)&&Lo.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Ya(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ui(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ui(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}}dispose(){if(!ui(this))return;z.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),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.ariaLiveText=void 0,j1(),Xm(),pf()}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 Ji(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(it(this))),!1):i1(this,e)}get errors(){return vd(this.model.getValue(),{context:this.context})}getValue(e,t,i){return this.model.getValue(e,t,i)}setValue(e,t){var i;t=t??{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(i=vp(this.model,this.model.position))!=null?i:"math");let r=this.undoManager.canUndo();J.insert(this.model,e,t)&&(Y(this),r||this.undoManager.reset(),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.98.5:  no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;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 r=window.mathVirtualKeyboard.boundingRect,a=this.host.getBoundingClientRect();a.bottom>r.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,a.bottom-r.top+8))}}this.dirty&&gi(this,{interactive:!0});let t=this.field.getBoundingClientRect(),i=null;if(this.model.selectionIsCollapsed)i=Ar(this.field);else{let r=j0(this);if(r.length>0){let a=-1/0,o=-1/0;for(let n of r)n.right>a&&(a=n.right),n.top<o&&(o=n.top);i={x:a+t.left-this.field.scrollLeft,y:o+t.top-this.field.scrollTop,height:0}}}if(this.host&&i){let r=this.host.getBoundingClientRect(),a=i.y,o=this.host.scrollTop;a<r.top?o=a-r.top+this.host.scrollTop:a>r.bottom&&(o=a-r.bottom+this.host.scrollTop+i.height),this.host.scroll({top:o,left:0})}if(i){let r=i.x-window.scrollX,a=this.field.scrollLeft;r<t.left?a=r-t.left+this.field.scrollLeft-20:r>t.right&&(a=r-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:a})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t??{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&w0()&&navigator.vibrate(Ud),window.MathfieldElement.playSound("keypress")),e==="\\\\"?eh(this.model):e==="&"?th(this.model):this.model.selectionIsCollapsed?J.insert(this.model,e,f({style:this.model.at(this.model.position).computedStyle},t)):J.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Y(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",i=""){var r;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;let a=this.model.mode;if(this.model.mode=e,!((r=this.host)!=null&&r.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=a;return}let o=this.model.mode,{model:n}=this;n.deferNotifications({content:!!i||!!t,selection:!0,type:"insertText"},()=>{let l=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){let s=ye(t,{context:this.context,parseMode:e});n.collapseSelection("forward");let u=n.at(n.position);n.position=n.offsetOf(u.parent.addChildrenAfter(s,u)),l=!0}if(this.model.mode=e,e==="latex"){let s=n.selectionIsCollapsed;tr(this,"accept");let u,c=n.at(n.position);if(s)u="\\";else{let h=pe(n.selection);u=this.model.getValue(h,"latex");let p=this.model.extractAtoms(h);p.length===1&&p[0].type==="placeholder"&&(u=t,s=!0),c=n.at(h[0])}let d=new Er(u);c.parent.addChildAfter(d,c),s?n.position=n.offsetOf(d.lastChild):n.setSelection(n.offsetOf(d.firstChild),n.offsetOf(d.lastChild))}else Vr(n).forEach(s=>{s.isError=!1});if(i){let s=ye(i,{context:this.context,parseMode:o});n.collapseSelection("forward");let u=n.at(n.position);n.position=n.offsetOf(u.parent.addChildrenAfter(s,u)),l=!0}return Y(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),l}),this.model.mode=e,window.mathVirtualKeyboard.update(it(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var i,r;let a={operation:"set",silenceNotifications:!1};bo(t)?a.range=t:(t.operation==="toggle"&&(a.operation="toggle"),a.range=t.range,a.silenceNotifications=(i=t.silenceNotifications)!=null?i:!1);let o=ml(this,e),n=(r=a.operation)!=null?r:"set";if(a.range===void 0&&this.model.selectionIsCollapsed){if(n==="set"){this.defaultStyle=f(f({},this.defaultStyle),o);return}let l=f({},this.defaultStyle);for(let s of Object.keys(o))l[s]===o[s]?(s==="color"&&delete l.verbatimColor,s==="backgroundColor"&&delete l.verbatimBackgroundColor,delete l[s]):l[s]=o[s];this.defaultStyle=l;return}this.model.deferNotifications({content:!a.silenceNotifications,type:"insertText"},()=>{if(a.range===void 0)for(let l of this.model.selection.ranges)ul(this.model,l,o,{operation:n});else ul(this.model,a.range,o,{operation:n})}),Y(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){let e=Ar(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){let i=Pr(this,e,t,{bias:0});if(i<0)return!1;let r=this.model.position;return this.model.position=i,this.model.announce("move",r),Y(this),!0}getPrompt(e){return this.model.findAtom(i=>i.type==="prompt"&&i.placeholderId===e)}getPromptValue(e,t){let i=this.getPrompt(e);if(!i)return"";let r=this.model.offsetOf(i.firstChild),a=this.model.offsetOf(i.lastChild);return this.model.getValue(r,a,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,i){if(t!==void 0){let r=this.getPrompt(e);if(!r){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}let a=this.model.getBranchRange(this.model.offsetOf(r),"body");this.model.setSelection(a),this.insert(t,b(f({},i),{insertionMode:"replaceSelection"}))}i!=null&&i.silenceNotifications&&(this.valueOnFocus=this.getValue()),Y(this)}setPromptState(e,t,i){let r=this.getPrompt(e);if(!r){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?r.correctness=void 0:typeof t=="string"&&(r.correctness=t),typeof i=="boolean"&&(r.locked=i,r.captureSelection=i),Y(this)}getPromptState(e){let t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){let t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(it(this)),(t=this.host)==null||t.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(it(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(it(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 e,t;let i=this.model;this.keyboardDelegate.setValue(i.getValue(this.model.selection,"latex-expanded"));{let r=i.at(i.position),a=(e=r.mode)!=null?e:Gc(this.options);this.model.mode!==a&&(this.model.mode==="latex"?(tr(this,"accept",{mode:a}),i.position=i.offsetOf(r)):this.switchMode(a))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(it(this)),Ya(this)}onContentWillChange(e){var t,i,r;return(r=(i=this.host)==null?void 0:i.dispatchEvent(new InputEvent("beforeinput",b(f({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?r:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),gi(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 e,t,i;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",ir(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(i=this.host)==null||i.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Y(this),this.focusBlurInProgress=!1,yl();let r=new AbortController,a=r.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{ui(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:a})},{once:!0,signal:a}),setTimeout(()=>r.abort(),100)}onInput(e){hl(this,e)}onKeystroke(e){return uh(this,e)}onCompositionStart(e){this.model.deleteAtoms(pe(this.model.selection));let t=Ar(this.field);t&&requestAnimationFrame(()=>{gi(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){S1(this.model,e),Y(this)}onCompositionEnd(e){C1(this.model),hl(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),J.onCopy(this,e),at(this.model,pe(this.model.selection),"deleteByCut"),this.snapshot("cut"),Y(this))}onCopy(e){J.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=J.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),jo(this),Ya(this)}onWheel(e){let t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;let i=this.field;t<0&&i.scrollLeft===0||t>0&&i.offsetWidth+i.scrollLeft>=i.scrollWidth||(i.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"▢",colorMap:i=>this.colorMap(i),backgroundColorMap:i=>this.backgroundColorMap(i),getMacro:i=>A0(i,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function kh(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(let t of e.children)kh(t)}function _l(e,t){var i;e&&(!t||((i=e.dataset)==null?void 0:i.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(r=>{r instanceof HTMLElement&&_l(r)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(r=>{r instanceof HTMLElement&&_l(r,t)})))}function d4(e,t){var i;if(!Pe())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}let r=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:(i=window.MathfieldElement.speechEngineVoice)!=null?i:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};zt().readAloudElement=e,r.synthesizeSpeech(a,(o,n)=>{if(o){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${o}`);return}if(!(n!=null&&n.AudioStream))return;let l=new TextDecoder("utf-8").decode(new Uint8Array(n.AudioStream));zt().readAloudMarks=l.split(`
`).map(s=>s?JSON.parse(s):{}),zt().readAloudTokens=[];for(let s of zt().readAloudMarks)s.value&&zt().readAloudTokens.push(s.value);zt().readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],r.synthesizeSpeech(a,(s,u)=>{if(s){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${s}`);return}if(!(u!=null&&u.AudioStream))return;let c=new Uint8Array(u.AudioStream),d=new Blob([c.buffer],{type:"audio/mpeg"}),h=URL.createObjectURL(d),p=zt();p.readAloudAudio?p.readAloudAudio.pause():(p.readAloudAudio=new Audio,p.readAloudAudio.addEventListener("ended",()=>{let m=p.readAloudMathfield;p.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),m?(gi(m),p.readAloudElement=null,p.readAloudMathfield=null,p.readAloudTokens=[],p.readAloudMarks=[],p.readAloudCurrentMark=""):kh(p.readAloudElement)}),p.readAloudAudio.addEventListener("timeupdate",()=>{let m="",y=p.readAloudAudio.currentTime*1e3+100;for(let M of p.readAloudMarks)M.time<y&&(m=M.value);p.readAloudCurrentMark!==m&&(p.readAloudCurrentToken=m,m&&m===p.readAloudFinalToken?p.readAloudAudio.pause():(p.readAloudCurrentMark=m,_l(p.readAloudElement,p.readAloudCurrentMark)))})),p.readAloudAudio.src=h,p.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),p.readAloudAudio.play()})})}Pe()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var O=new WeakMap,h4=.5,Tt={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},le=class li extends HTMLElement{static get formAssociated(){return zi()}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",placeholder:"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(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,Ym())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var i,r,a;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(i=t.spacebar)!=null?i:t.default,return:(r=t.return)!=null?r:t.default,delete:(a=t.delete)!=null?a:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return z.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),z.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return z.strings}static set strings(t){z.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,i;if(this._computeEngine===void 0){let r=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!r)return null;this._computeEngine=new r,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(i=this._computeEngine)!=null?i:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static async loadSound(t){delete this.audioBuffers[t];let i="";switch(t){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 r=this.soundsDirectory;if(!(r==null||r==="null"||i==="none"||i==="null"))try{let a=await(await fetch(await jd(`${r}/${i}`))).arrayBuffer(),o=await this.audioContext.decodeAudioData(a);this.audioBuffers[t]=o}catch{}}static async playSound(t){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&await this.audioContext.resume(),this.audioBuffers[t]||await this.loadSound(t),!this.audioBuffers[t])return;let i=this.audioContext.createBufferSource();i.buffer=this.audioBuffers[t];let r=this.audioContext.createGain();r.gain.value=h4,i.connect(r).connect(this.audioContext.destination),i.start()}constructor(t){if(super(),t){let i=[];for(let r of Object.keys(t))if(Tt[r])if(Tt[r].startsWith("mf."))if(Tt[r].startsWith(`mf.${r}`))i.push(`Option \`${r}\` cannot be used as a constructor option. Use ${Tt[r]}`);else{let a=Tt[r].match(/([a-zA-Z]+) =/);i.push(`Option \`${r}\` has been renamed \`${a[1]}\``)}else i.push(`Option \`${r}\` cannot be used as a constructor option. Use ${Tt[r]}`);if(i.length>0){console.group("%cMathLive 0.98.5: %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 r of i)console.warn(r);console.groupEnd()}}if(zi()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[$i("core"),$i("mathfield"),$i("mathfield-element"),$i("ui"),$i("menu")],this.shadowRoot.appendChild(document.createElement("span"));let i=document.createElement("slot");i.style.display="none",this.shadowRoot.appendChild(i)}else this.shadowRoot.innerHTML="<style>"+ci("core")+ci("mathfield")+ci("mathfield-element")+ci("ui")+ci("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var i;let r=this.shadowRoot.querySelector("slot:not([name])");this.value=(i=r==null?void 0:r.assignedNodes().map(a=>a.nodeType===3?a.textContent:"").join("").trim())!=null?i:""})}showMenu(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.showMenu(t))!=null?r:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var i;t.target===this&&!((i=this._mathfield)!=null&&i.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,i){var r,a;return(a=(r=this._mathfield)==null?void 0:r.getPromptValue(t,i))!=null?a:""}setPromptValue(t,i,r){var a;(a=this._mathfield)==null||a.setPromptValue(t,i,r)}getPromptRange(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.getPromptRange(t))!=null?r:null}getPrompts(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.getPrompts(t))!=null?r:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,i;return(i=(t=this._mathfield)==null?void 0:t.model.mode)!=null?i:this.defaultMode==="text"?"text":"math"}set mode(t){var i;(i=this._mathfield)==null||i.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: 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(t){var i,r;if(!this._mathfield)return;let a=(r=(i=li.computeEngine)==null?void 0:i.box(t).latex)!=null?r:null;a!==null&&this._mathfield.setValue(a),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: 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 t,i;return(i=(t=this._mathfield)==null?void 0:t.errors)!=null?i:[]}_getOptions(t){return this._mathfield?di(this._mathfield.options,t):O.has(this)?f({},di(f(f({},lo()),Do(O.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %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?di(this._mathfield.options,t):O.has(this)?di(f(f({},lo()),Do(O.get(this).options)),t):null}reflectAttributes(){let t=lo(),i=this._getOptions();Object.keys(li.optionsAttributes).forEach(r=>{let a=ft(r);li.optionsAttributes[r]==="on/off"?t[a]!==i[a]?this.setAttribute(r,i[a]?"on":"off"):this.removeAttribute(r):t[a]!==i[a]&&(li.optionsAttributes[r]==="boolean"?i[a]?this.setAttribute(r,""):this.removeAttribute(r):(typeof i[a]=="string"||typeof i[a]=="number")&&this.setAttribute(r,i[a].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %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([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(O.has(this)){let i=f(f({},O.get(this).options),t);O.set(this,b(f({},O.get(this)),{selection:{ranges:i.readOnly?[[0,0]]:[[0,-1]]},options:i}))}else O.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %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(t))Tt[i]&&console.warn(`\`mf.setOptions({${i}:...})\` -> ${Tt[i]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.executeCommand(t))!=null?r:!1}getValue(t,i,r){var a,o;if(this._mathfield)return this._mathfield.model.getValue(t,i,r);if(O.has(this)){let n,l,s;if(ro(t)?([n,l]=t.ranges[0],s=i):bo(t)?([n,l]=t,s=i):$t(t)&&$t(i)?(n=t,l=i,s=r):(n=0,l=-1,s=t),(s===void 0||s==="latex")&&n===0&&l===-1)return(o=(a=O.get(this).value)!=null?a:this.textContent)!=null?o:""}return""}setValue(t,i){if(this._mathfield&&t!==void 0){i!=null||(i={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,i);return}if(O.has(this)){let a=O.get(this).options;O.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0});return}let r=Dr(this);O.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:r,menuItems:void 0})}hasFocus(){var t,i;return(i=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?i:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,i){var r,a;return(a=(r=this._mathfield)==null?void 0:r.insert(t,i))!=null?a:!1}applyStyle(t,i){var r;return(r=this._mathfield)==null?void 0:r.applyStyle(t,i)}queryStyle(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.queryStyle(t))!=null?r:"none"}get caretPoint(){var t,i;return(i=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?i:null}set caretPoint(t){var i;t&&((i=this._mathfield)==null||i.setCaretPoint(t.x,t.y))}setCaretPoint(t,i){var r,a;return(a=(r=this._mathfield)==null?void 0:r.setCaretPoint(t,i))!=null?a:!1}offsetFromPoint(t,i,r){return this._mathfield?Pr(this._mathfield,t,i,r):-1}hitboxFromOffset(t){if(!this._mathfield)return null;let i=this._mathfield.model.at(t);if(!i)return null;let r=Ur(this._mathfield,i);return r?new DOMRect(r.left,r.top,r.right-r.left,r.bottom-r.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var i,r,a,o;nt.state==="closed"&&((r=(i=this._mathfield)==null?void 0:i.menu)==null?void 0:r.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((a=this._mathfield)==null||a.focus()),t.type==="blur"&&((o=this._mathfield)==null||o.blur()))}connectedCallback(){var t,i,r,a;let o=window.getComputedStyle(this),n=this.shadowRoot,l=o.userSelect!=="none";if(l)n.host.addEventListener("pointerdown",this,!0);else{let c=n.querySelector("span");c.style.pointerEvents="none"}n.host.addEventListener("focus",this,!0),n.host.addEventListener("blur",this,!0),zi()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),l&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");let s=n.querySelector("slot:not([name])");if(s)try{this._style=s.assignedElements().filter(c=>c.tagName.toLowerCase()==="style").map(c=>c.textContent).join("")}catch(c){console.error(c)}if(this._style){let c=document.createElement("style");c.textContent=this._style,n.appendChild(c)}let u="";if(this.hasAttribute("value")?u=this.getAttribute("value"):u=(t=s==null?void 0:s.assignedNodes().map(c=>c.nodeType===3?c.textContent:"").join("").trim())!=null?t:"",this._mathfield=new c4(n.querySelector(":host > span"),b(f({},(r=(i=O.get(this))==null?void 0:i.options)!=null?r:Dr(this)),{eventSink:this,value:u})),!O.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(let c of Object.keys(li.optionsAttributes))this.upgradeProperty(ft(c))}if(!((a=this._mathfield)!=null&&a.model)){this._mathfield=null;return}if(O.has(this)){let c=this._mathfield,d=O.get(this),h=d.menuItems;c.model.deferNotifications({content:!1,selection:!1},()=>{let p=d.value;p!==void 0&&c.setValue(p),c.model.selection=d.selection,O.delete(this)}),h&&(this.menuItems=h)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Wo()}disconnectedCallback(){var t,i;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=di(this._mathfield.options,Object.keys(li.optionsAttributes).map(a=>ft(a)));O.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(i=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?i:void 0,options:r}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){let i=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=i}}attributeChangedCallback(t,i,r){if(i===r)return;let a=r!==null;switch(t){case"contenteditable":Y(this._mathfield);break;case"disabled":this.disabled=a;break;case"read-only":case"readonly":this.readOnly=a;break}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){let i=!!t;i?(this.setAttribute("readonly",""),zi()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(zi()?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(t){var i;let r=!!t;r?this.setAttribute("disabled",""):this.removeAttribute("disabled"),zi()?this._internals.ariaDisabled=r?"true":"false":this.setAttribute("aria-disabled",r?"true":"false"),r&&(i=this._mathfield)!=null&&i.hasFocus&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){let t=this;return new Proxy({},{get:(i,r)=>{if(typeof r=="string")return t._getOption("registers")[r]},set(i,r,a){return typeof r!="string"?!1:(t._setOptions({registers:b(f({},t._getOption("registers")),{[r]:a})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,i,r;return this._mathfield?(t=this._mathfield.menu._menuItems.map(a=>a.menuItem))!=null?t:[]:(r=(i=O.get(this))==null?void 0:i.menuItems)!=null?r:[]}set menuItems(t){var i;if(this._mathfield){let r=(i=this._mathfield.element)==null?void 0:i.querySelector("[part=menu-toggle]");r&&(r.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}O.has(this)?O.set(this,b(f({},O.get(this)),{menuItems:t})):O.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Dr(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,i;return(i=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?i:!1}setPromptState(t,i,r){var a;(a=this._mathfield)==null||a.setPromptState(t,i,r)}getPromptState(t){var i,r;return(r=(i=this._mathfield)==null?void 0:i.getPromptState(t))!=null?r:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:O.has(this)?O.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,Y(this._mathfield);return}if(O.has(this)){O.set(this,b(f({},O.get(this)),{selection:t}));return}O.set(this,{value:void 0,selection:t,options:Dr(this),menuItems:void 0})}get selectionIsCollapsed(){let t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:O.has(this)?O.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,Y(this._mathfield)),O.has(this)){O.set(this,b(f({},O.get(this)),{selection:{ranges:[[t,t]]}}));return}O.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:Dr(this),menuItems:void 0})}getOffsetDepth(t){var i,r;return this._mathfield?((r=(i=this._mathfield.model.at(t))==null?void 0:i.treeDepth)!=null?r:2)-2:0}get lastOffset(){var t,i;return(i=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?i:-1}};le.version="0.98.5",le._fontsDirectory="./fonts",le._soundsDirectory="./sounds",le.keypressVibration=!0,le._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},le._plonkSound="plonk.wav",le.audioBuffers={},le.createHTML=e=>e,le._speechEngineRate="100%",le._speechEngineVoice="Joanna",le._textToSpeechMarkup="",le._textToSpeechRules="mathlive",le._textToSpeechRulesOptions={},le.speakHook=t4,le.readAloudHook=d4,le._decimalSeparator=".",le.fractionNavigationOrder="numerator-denominator",le._isFunction=e=>{var t,i;let r=window.MathfieldElement.computeEngine;return(i=(t=r==null?void 0:r.parse(e).domain)==null?void 0:t.isFunction)!=null?i:!1};var Hr=le;function ft(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,i)=>i.toUpperCase())}function Dr(e){let t={readOnly:!1},i=Hr.optionsAttributes;return Object.keys(i).forEach(r=>{if(e.hasAttribute(r)){let a=e.getAttribute(r);r==="placeholder"?t.contentPlaceholder=a??"":i[r]==="boolean"?t[ft(r)]=!0:i[r]==="on/off"?a==="on"?t[ft(r)]=!0:a==="off"?t[ft(r)]=!1:t[ft(r)]=void 0:i[r]==="number"?t[ft(r)]=Number.parseFloat(a??"0"):t[ft(r)]=a}}),t}function zi(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var Mh=Hr,g0,y0,b0;if(Pe()&&!((g0=window.customElements)!=null&&g0.get("math-field"))){window[y0=Symbol.for("io.cortexjs.mathlive")]!=null||(window[y0]={});let e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Hr,(b0=window.customElements)==null||b0.define("math-field",Hr)}function p4(e,t,i){let r=i,a=0,o=e.length;for(;r<t.length;){let n=t[r];if(a<=0&&t.slice(r,r+o)===e)return r;n==="\\"?r++:n==="{"?a++:n==="}"&&a--,r++}return-1}function eo(e,t,i,r,a="latex"){let o=[];for(let n of e)if(n.type==="text"){let l=n.data,s=!0,u=0,c;c=l.indexOf(t),c!==-1&&(u=c,u>0&&o.push({type:"text",data:l.slice(0,u)}),s=!1);let d=!1;for(;!d;){if(s){if(c=l.indexOf(t,u),c===-1){d=!0;break}u!==c&&o.push({type:"text",data:l.slice(u,c)}),u=c}else{if(c=p4(i,l,u+t.length),c===-1){d=!0;break}let h=l.slice(u+t.length,c);a==="ascii-math"&&([,h]=vo(h,{format:"ascii-math"})),o.push({type:"math",data:h,rawData:l.slice(u,c+i.length),mathstyle:r}),u=c+i.length}s=!s}u<l.length&&o.push({type:"text",data:l.slice(u)})}else o.push(n);return o}function Sh(e,t,i){let r=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([a,o])=>{r=eo(r,a,o,"textstyle")}),t!=null&&t.display&&t.display.forEach(([a,o])=>{r=eo(r,a,o,"displaystyle")}),i!=null&&i.inline&&i.inline.forEach(([a,o])=>{r=eo(r,a,o,"textstyle","ascii-math")}),i!=null&&i.display&&i.display.forEach(([a,o])=>{r=eo(r,a,o,"displaystyle","ascii-math")}),r}function m4(e,t){let i=document.createElement("span");i.setAttribute("translate","no");try{let r="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";i.innerHTML=window.MathfieldElement.createHTML(r)}catch(r){console.error(`MathLive 0.98.5:  Could not convert "${e}"' to MathML with ${r}`),i.textContent=e}return i.className="ML__sr-only",i}function f4(e,t,i,r){try{let a=t.renderToMarkup(e,{mathstyle:i,format:"html"}),o=document.createElement("span");return o.dataset.latex=e,o.style.display=i==="displaystyle"?"flex":"inline-flex",o.setAttribute("aria-hidden","true"),o.setAttribute("translate","no"),o.innerHTML=window.MathfieldElement.createHTML(a),o}catch(a){if(console.error("Could not parse'"+e+"' with ",a),r)return document.createTextNode(e)}return null}function ji(e,t,i,r){var a;let o=f4(e,i,t||"textstyle",r),n=(a=i.renderAccessibleContent)!=null?a:"";if(o&&/\b(mathml|speakable-text)\b/i.test(n)){let l=document.createElement("span");if(/\bmathml\b/i.test(n)&&i.renderToMathML&&l.append(m4(e,i)),/\bspeakable-text\b/i.test(n)&&i.renderToSpeakableText){let s=document.createElement("span");s.setAttribute("translate","no");let u=i.renderToSpeakableText(e);s.innerHTML=window.MathfieldElement.createHTML(u),s.className="ML__sr-only",l.append(s)}return l.append(o),l}return o}function g4(e,t){var i,r,a;let o=null;if((i=t.TeX)!=null&&i.processEnvironments&&/^\s*\\begin/.test(e)){o=document.createDocumentFragment();let n=ji(e,"",t,!0);n&&o.appendChild(n)}else{if(!e.trim())return null;let n=Sh(e,(r=t.TeX)==null?void 0:r.delimiters,(a=t.asciiMath)==null?void 0:a.delimiters);if(n.length===1&&n[0].type==="text")return null;o=document.createDocumentFragment();for(let l of n)if(l.type==="text")o.appendChild(document.createTextNode(l.data));else{let s=ji(l.data,l.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);s&&o.appendChild(s)}}return o}function Ch(e,t){var i,r,a,o,n,l,s,u,c,d,h,p,m,y,M,g;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){let _=(i=e.childNodes[0].textContent)!=null?i:"";if((r=t.TeX)!=null&&r.processEnvironments&&/^\s*\\begin/.test(_)){e.textContent="";let w=ji(_,"",t,!0);w&&e.append(w);return}let D=Sh(_,(a=t.TeX)==null?void 0:a.delimiters,(o=t.asciiMath)==null?void 0:o.delimiters);if(D.length===1&&D[0].type==="math"){e.textContent="";let w=ji(D[0].data,D[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);w&&e.append(w);return}if(D.length===1&&D[0].type==="text")return}for(let _=e.childNodes.length-1;_>=0;_--){let D=e.childNodes[_];if(D.nodeType===3){let w=g4((n=D.textContent)!=null?n:"",t);w&&(_+=w.childNodes.length-1,D.replaceWith(w))}else if(D.nodeType===1){let w=D,L=D.nodeName.toLowerCase();if(L==="script"){let K=D,E;if((l=t.processScriptTypePattern)!=null&&l.test(K.type))E=(s=K.textContent)!=null?s:"";else if((u=t.processMathJSONScriptTypePattern)!=null&&u.test(K.type))try{E=(d=t.serializeToLatex)==null?void 0:d.call(t,JSON.parse((c=K.textContent)!=null?c:""))}catch(I){console.error(I)}if(E){let I="textstyle";for(let C of K.type.split(";")){let[Se,je]=C.toLowerCase().split("=");Se.trim()==="mode"&&(I=je.trim()==="display"?"displaystyle":"textstyle")}let V=ji(E,I,t,!0);V&&K.parentNode.replaceChild(V,K)}}else if((p=(h=t.processClassPattern)==null?void 0:h.test(w.className))!=null&&p||!((y=(m=t.skipTags)==null?void 0:m.includes(L))!=null&&y||(g=(M=t.ignoreClassPattern)==null?void 0:M.test(w.className))!=null&&g))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){let K=e.textContent;e.textContent="";let E=ji(K??"","displaystyle",t,!0);E&&e.append(E)}else Ch(w,t)}}}var y4={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 b4(e,t){var i,r,a,o;try{let n=f(f({},y4),t);n.ignoreClassPattern=new RegExp((i=n.ignoreClass)!=null?i:""),n.processClassPattern=new RegExp((r=n.processClass)!=null?r:""),n.processScriptTypePattern=new RegExp((a=n.processScriptType)!=null?a:""),n.processMathJSONScriptTypePattern=new RegExp((o=n.processMathJSONScriptType)!=null?o:""),Wo(),bt("core"),Ch(e,n)}catch(n){n instanceof Error?console.error("renderMathInElement(): "+n.message):console.error("renderMathInElement(): Could not render math for element",e)}}function v4(e,t){let i=Vt.singleton;return i?(i.show(),Tr(),i.currentLayer=t,i.render(),i.focus(),!0):!1}function x4(){let e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}Me({switchKeyboardLayer:v4,toggleVirtualKeyboard:x4,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function zt(){var e;return globalThis[e=Symbol.for("io.cortexjs.mathlive")]!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function C4(){return console.warn("%cMathLive 0.98.5: %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 D4(e){_4(document.body,e)}function w4(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function _4(e,t){let i=w4(e);if(!i)return;let r=t??{};r.renderToMarkup!=null||(r.renderToMarkup=ne),r.renderToMathML!=null||(r.renderToMathML=Tf),r.renderToSpeakableText!=null||(r.renderToSpeakableText=zf),r.serializeToLatex!=null||(r.serializeToLatex=$f),b4(i,r)}var B4={mathlive:"0.98.5"};export{Hr as MathfieldElement,b4 as _renderMathInElement,S4 as convertAsciiMathToLatex,M4 as convertLatexToAsciiMath,ne as convertLatexToMarkup,Tf as convertLatexToMathMl,zf as convertLatexToSpeakableText,$f as convertMathJsonToLatex,zt as globalMathLive,C4 as makeSharedVirtualKeyboard,D4 as renderMathInDocument,_4 as renderMathInElement,k4 as validateLatex,B4 as version};
//# sourceMappingURL=mathlive.min-Fi-xmH1a.js.map