You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__RestFul__Edit__index.183...

3406 lines
1.4 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var qs=Math.pow;var zl=(mn,rn,he)=>new Promise((we,ct)=>{var Re=Be=>{try{Se(he.next(Be))}catch(Oe){ct(Oe)}},st=Be=>{try{Se(he.throw(Be))}catch(Oe){ct(Oe)}},Se=Be=>Be.done?we(Be.value):Promise.resolve(Be.value).then(Re,st);Se((he=he.apply(mn,rn)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[928],{40001:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},84105:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},18785:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},73331:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},15277:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},62772:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},61485:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},47472:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},87395:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(60499),ct=he(59301),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},st=Re,Se=he(7657),Be=function(Ne,ht){return ct.createElement(Se.Z,(0,we.Z)({},Ne,{ref:ht,icon:st}))},Oe=ct.forwardRef(Be),Ce=Oe},14618:function(){"use strict"},66552:function(){"use strict"},18760:function(mn,rn){"use strict";rn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},3352:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var mn={},rn="5.0",he={},we=null,ct=!1,Re=!1,st=null,Se=!1,Be=null,Oe=null,Ce=0;Ce<arguments.length;Ce++){var Me=arguments[Ce];if(Me!==null)switch(typeof Me){case"number":rn=Me.toFixed(1);break;case"string":Me.match(new RegExp("^[0-9]\\.[0-9]+$"))?rn=Me:st=Me;break;case"object":typeof Me.is3D!="undefined"?we=Me:he=Me;break;case"boolean":ct=Me,Re=!0;break}}we===null&&(we={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},he.material_id!==void 0&&!Re&&(ct=!0)),st!==null&&he.id===void 0&&(he.id=st);var Ne="",ht="",Ie=!1,He=null,mt=null,Ye=null,ot=!1,rt=null,Et=null,Zt=null,Je=null,lt=null;he.height!==void 0&&(he.height=Math.round(he.height)),he.width!==void 0&&(he.width=Math.round(he.width));var We=function(Ue){return parseFloat(Ue)>4?parseFloat(Ue):5};mn.setHTML5Codebase=function(Ue,Ge){Oe=Ue,ft(Ue,Ge)},mn.setJavaCodebase=mn.setJavaCodebaseVersion=mn.isCompiledInstalled=mn.setPreCompiledScriptPath=mn.setPreCompiledResourcePath=function(){},mn.setHTML5CodebaseVersion=function(Ue,Ge){var wt=parseFloat(Ue);if(wt!==NaN&&wt<5){console.log("The GeoGebra HTML5 codebase version "+wt+" is deprecated. Using version latest instead.");return}Be=Ue,xe(Ue,Ge)},mn.getHTML5CodebaseVersion=function(){return mt},mn.getParameters=function(){return he},mn.setFontsCSSURL=function(Ue){Je=Ue},mn.setGiacJSURL=function(Ue){},mn.setJNLPFile=function(Ue){Ne=Ue},mn.setJNLPBaseDir=function(Ue){},mn.inject=function(){function Ue(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Ge="auto",wt=he.id,dn,Rt=!1,an=0;an<arguments.length;an++){var $t=arguments[an];typeof $t=="string"?($t=$t.toLowerCase(),$t.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Ge=$t:wt=arguments[an]):typeof $t=="boolean"?Rt=$t:$t instanceof HTMLElement&&(dn=$t)}Bt();function Bt(){if(!Se){setTimeout(Bt,200);return}Ge=Ft(Ge);var Tt=dn||document.getElementById(wt);if(!Tt){console.log("possibly bug on ajax loading? ");return}if(mn.removeExistingApplet(Tt,!1),he.width===void 0&&Tt.clientWidth&&(he.width=Tt.clientWidth),he.height===void 0&&Tt.clientHeight&&(he.height=Tt.clientHeight),!(he.width&&he.height)&&Ge==="html5"&&(delete he.width,delete he.height),He=Ge,Ge==="screenshot")qe(Tt,he);else{var ge=!1;he.hasOwnProperty("playButton")&&he.playButton||he.hasOwnProperty("clickToLoad")&&he.clickToLoad?ge=!0:he.hasOwnProperty("playButtonAutoDecide")&&he.playButtonAutoDecide&&(ge=(!Ee()||Ue())&&Ve()),ge?(He="screenshot",Qt(Tt,he,Rt,Ge)):Ct(Tt,he,Rt)}}};function Ee(){try{return window.self!==window.top}catch(Ue){return!0}}function Ve(){return he.hasOwnProperty("screenshotGenerator")&&he.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}mn.getViews=function(){return we},mn.isJavaInstalled=function(){return!1};var Xe=function(Ue){var Ge=function(an){var $t=JSON.parse(an),Bt=function(se){return se.type=="G"||se.type=="E"},Tt=$t.elements?$t.elements.filter(Bt)[0]:$t;if(!Tt||!Tt.url){wt();return}he.fileName=Tt.url,bt(Tt.settings||{}),we.is3D=!0;var ge="https://www.geogebra.org/images/";mn.setPreviewImage(rt||Tt.previewUrl,ge+"GeoGebra_loading.png",ge+"applet_play.png"),Ue()},wt=function(){he.onError&&he.onError(),qt("Error: Fetching material (id "+he.material_id+") failed.",he)},dn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Rt="/materials/"+he.material_id+"?scope=basic";je("https://"+dn+"/api/proxy.php?path="+encodeURIComponent(Rt),Ge,wt)};function bt(Ue){var Ge=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(wt){Ue[wt]=!!Ue[wt]}),Ge.forEach(function(wt){he[wt]===void 0&&Ue[wt]!==void 0&&(he[wt]=Ue[wt])}),he.showToolBarHelp===void 0&&(he.showToolBarHelp=he.showToolBar)}function je(Ue,Ge,wt){var dn=new XMLHttpRequest;dn.open("GET",Ue),dn.onload=function(){Ge(dn.responseText)},dn.onerror=wt,dn.send()}mn.isHTML5Installed=function(){return!0},mn.getLoadedAppletType=function(){return He},mn.setPreviewImage=function(Ue,Ge,wt){rt=Ue,Et=Ge,Zt=wt},mn.removeExistingApplet=function(Ue,Ge){var wt;typeof Ue=="string"&&(Ue=document.getElementById(Ue)),He=null;var dn=null;for(wt=0;wt<Ue.childNodes.length;wt++){var Rt=Ue.childNodes[wt],an=Rt.className;an==="applet_screenshot"?Ge?(Rt.style.display="block",He="screenshot"):Rt.style.display="none":an!=="applet_scaler prerender"&&(Ue.removeChild(Rt),dn=an&&an.indexOf("appletParameters")!=-1?Rt.id:null,wt--)}var $t=he.id!==void 0?he.id:dn,Bt=window[$t];Bt&&typeof Bt.getBase64=="function"&&(Bt.remove(),window[$t]=null)},mn.refreshHitPoints=function(){if(We(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Ue=mn.getAppletObject();return Ue&&typeof Ue.recalculateEnvironments=="function"?(Ue.recalculateEnvironments(),!0):!1},mn.startAnimation=function(){var Ue=mn.getAppletObject();return Ue&&typeof Ue.startAnimation=="function"?(Ue.startAnimation(),!0):!1},mn.stopAnimation=function(){var Ue=mn.getAppletObject();return Ue&&typeof Ue.stopAnimation=="function"?(Ue.stopAnimation(),!0):!1},mn.getAppletObject=function(){var Ue=he.id!==void 0?he.id:"ggbApplet";return window[Ue]},mn.resize=function(){};var It=function(Ue,Ge,wt){var dn=document.createElement("param");dn.setAttribute("name",Ge),dn.setAttribute("value",wt),Ue.appendChild(dn)},at=function(Ue){return Ue&&Ue!=="false"},Ct=function(Ue,Ge,wt){We(mt)<=4.2&&(wt=!0);var dn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==mt||ggbHTML5LoadedCodebaseIsWebSimple&&!ot)&&(dn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Rt=document.createElement("div");Rt.classList.add("appletParameters","notranslate");var an=Ge.width,$t=Ge.height;if(Ge.disableAutoScale=Ge.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Ge.disableAutoScale,Ge.width!==void 0)if(We(mt)<=4.4)at(Ge.showToolBar)&&(Ge.height-=7),at(Ge.showAlgebraInput)&&(Ge.height-=37),Ge.width<605&&at(Ge.showToolBar)&&(Ge.width=605,an=605);else{var Bt=100;(at(Ge.showToolBar)||at(Ge.showMenuBar))&&(Ge.hasOwnProperty("customToolBar")&&(Ge.customToolbar=Ge.customToolBar),Bt=at(Ge.showMenuBar)?245:155),an<Bt&&(Ge.width=Bt,an=Bt)}Rt.style.border="none",Rt.style.display="inline-block";for(var Tt in Ge)Ge.hasOwnProperty(Tt)&&Tt!=="appletOnLoad"&&Rt.setAttribute("data-param-"+Tt,Ge[Tt]);Je&&Rt.setAttribute("data-param-fontscssurl",Je),mn.resize=function(){GGBAppletUtils.responsiveResize(Ue,Ge)},window.addEventListener("resize",function(hn){mn.resize()});var ge=typeof Ge.appletOnLoad=="function"?Ge.appletOnLoad:function(){};if(!wt&&Ge.width!==void 0){Ge.hasOwnProperty("showSplash")||Rt.setAttribute("data-param-showSplash","false");var se=Ue.querySelector(".applet_scaler.prerender"),oe=se!==null;if(oe)var fe=se.querySelector(".ggb_preview");else{var fe=Gt(an,$t,Ge.borderColor,!1);se=document.createElement("div"),se.className="applet_scaler",se.style.position="relative",se.style.display="block",se.style.width=an+"px",se.style.height=$t+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(se,"66%"),We(mt)>=5?(Ge.appletOnLoad=function(hn){var pn=Ue.querySelector(".ggb_preview");pn&&pn.parentNode.removeChild(pn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(se),window.GGBT_wsf_view&&$(window).trigger("resize"),ge(hn)},oe||se.appendChild(fe)):Rt.appendChild(fe),se.appendChild(Rt),oe||Ue.appendChild(se),setTimeout(function(){mn.resize()},1)}else{var ve=document.createElement("div");ve.className="applet_scaler",ve.style.position="relative",ve.style.display="block",ve.appendChild(Rt),Ue.appendChild(ve),Ge.appletOnLoad=function(hn){mn.resize(),ge(hn)}}function ce(hn,pn){pn&&typeof pn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(hn,pn.appletOnLoad):renderGGBElement(hn),qt("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",pn)}function $e(hn,pn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:hn,params:pn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(bn){ce(bn.article,bn.params)}),html5AppletsToProcess=null)},We(mt)<5&&(hn.className+=" geogebraweb")):ce(hn,pn)}if(dn){scriptLoadStarted=!0;for(var xt=0;xt<Rt.childNodes.length;xt++){var Ut=Rt.childNodes[xt].tagName;Ut==="TABLE"&&(Rt.removeChild(Rt.childNodes[xt]),xt--)}if(ggbHTML5LoadedScript!==null){var Ht=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Ht!=null&&Ht.parentNode.removeChild(Ht)}var Jt=document.createElement("script"),en=function(){$e(Rt,Ge)};Jt.src=ht+Ye,ggbHTML5LoadedCodebaseIsWebSimple=ot,ggbHTML5LoadedCodebaseVersion=mt,ggbHTML5LoadedScript=Jt.src,qt("GeoGebra HTML5 codebase loaded: '"+ht+"'.",Ge),!Oe&&(!Be||Be=="5.0")?(ot?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),en()):ht.requirejs?__webpack_require__.e(7206).then(function(){var hn=[__webpack_require__(97206)];en.apply(null,hn)}.bind(this)).catch(__webpack_require__.oe):(Jt.onload=en,Ue.appendChild(Jt))}else $e(Rt,Ge);Ge.height=$t,Ge.width=an},qe=function(Ue,Ge,wt){var dn=Gt(Ge.width,Ge.height,Ge.borderColor,wt),Rt=document.createElement("div");Rt.style.position="relative",Rt.style.display="block",Rt.style.width=Ge.width+"px",Rt.style.height=Ge.height+"px",Rt.className="applet_screenshot applet_scaler"+(wt?" applet_screenshot_play":""),Rt.appendChild(dn);var an=GGBAppletUtils.getScale(Ge,Ue,wt);wt?(Ue.appendChild(Vt()),window.GGBT_wsf_view||(Ue.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Rt,"66%"),Ue.appendChild(Rt),an!==1&&!isNaN(an)&&(GGBAppletUtils.scaleElement(Rt,an),Rt.style.width=Ge.width+"px",Rt.style.height=Ge.height+"px",Rt.parentNode.style.width=Ge.width*an+"px",Rt.parentNode.style.height=Ge.height*an+"px"),mn.resize=function(){Nt(Ue,dn,Rt,wt)},window.addEventListener("resize",function($t){mn.resize()}),mn.resize()};function Nt(Ue,Ge,wt,dn){if(Ue.contains(Ge)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ue.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Ue)}var Rt=GGBAppletUtils.getScale(he,Ue,dn);wt.parentNode!==null&&(!isNaN(Rt)&&Rt!==1?(GGBAppletUtils.scaleElement(wt,Rt),wt.parentNode.style.width=he.width*Rt+"px",wt.parentNode.style.height=he.height*Rt+"px"):(GGBAppletUtils.scaleElement(wt,1),wt.parentNode.style.width=he.width+"px",wt.parentNode.style.height=he.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Ue),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}mn.onExitFullscreen=function(Ue,Ge){Ge.appendChild(Ue)};var Qt=function(Ue,Ge,wt,dn){qe(Ue,Ge,!0);for(var Rt=function(){var Bt=[];for($t=0;$t<Ue.childNodes.length;$t++)Bt.push(Ue.childNodes[$t]);if(window.GGBT_wsf_view){var Tt=window.GGBT_wsf_view.renderFullScreen(Ue,Ge.id),ge=document.getElementById("fullscreencontainer"),se=jQuery(Ue).find(".fullscreencontent");se.length>0?(Tt.remove(),se.attr("id","fullscreencontent").show(),jQuery(ge).append(se),window.dispatchEvent(new Event("resize"))):Ct(Tt,Ge,!1),window.GGBT_wsf_view.launchFullScreen(ge)}else He=dn,Ct(Ue,Ge,!1);if(!window.GGBT_wsf_view)for($t=0;$t<Bt.length;$t++)Ue.removeChild(Bt[$t])},an=Ue.getElementsByClassName("ggb_preview_play"),$t=0;$t<an.length;$t++)an[$t].addEventListener("click",Rt,!1),an[$t].addEventListener("ontouchstart",Rt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Ue),Ve()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Vt=function(){var Ue=document.createElement("div");if(Ue.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Ge='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',wt=document.createElement("style");wt.styleSheet?wt.styleSheet.cssText=Ge:wt.appendChild(document.createTextNode(Ge)),document.getElementsByTagName("head")[0].appendChild(wt)}return Ue},Gt=function(Ue,Ge,wt,dn){var Rt=document.createElement("div");Rt.className="ggb_preview",Rt.style.position="absolute",Rt.style.zIndex="90",Rt.style.width=Ue-2+"px",Rt.style.height=Ge-2+"px",Rt.style.top="0px",Rt.style.left="0px",Rt.style.overflow="hidden",Rt.style.backgroundColor="white";var an="lightgrey";wt!==void 0&&(wt==="none"?an="transparent":an=wt),Rt.style.border="1px solid "+an;var $t=document.createElement("img");if($t.style.position="relative",$t.style.zIndex="1000",$t.style.top="-1px",$t.style.left="-1px",rt!==null&&$t.setAttribute("src",rt),$t.style.opacity=.7,Et!==null){var Bt,Tt,ge;if(!dn){Bt=document.createElement("img"),Bt.style.position="absolute",Bt.style.zIndex="1001",Bt.style.opacity=1,$t.style.opacity=.3,Tt=360,Tt>Ue/4*3&&(Tt=Ue/4*3),ge=Tt/5.8,Bt.setAttribute("src",Et),Bt.setAttribute("width",Tt),Bt.setAttribute("height",ge);var se=(Ue-Tt)/2,oe=(Ge-ge)/2;Bt.style.left=se+"px",Bt.style.top=oe+"px",Rt.appendChild(Bt)}}return Rt.appendChild($t),Rt},Ft=function(Ue){return Ue=Ue.toLowerCase(),Ue==="html5"||Ue==="screenshot"?Ue:"html5"},Fe=["web","webSimple","web3d","tablet","tablet3d","phone"],xe=function(Ue,Ge){if(mt=Ue,Ge){ft(mt,!0);return}var wt=!ct;if(wt){var dn=We(mt);!isNaN(dn)&&dn<4.4&&(wt=!1)}var Rt,an;window.location.protocol.substr(0,4)==="http"?Rt=window.location.protocol:Rt="http:";var $t=mt.indexOf("//");$t>0?an=mt:$t===0?an=Rt+mt:an="https://www.geogebra.org/apps/5.2.814.0/";for(var Bt in Fe)if(mt.slice(Fe[Bt].length*-1)===Fe[Bt]||mt.slice((Fe[Bt].length+1)*-1)===Fe[Bt]+"/"){ft(an,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&wt&&!we.is3D&&!we.AV&&!we.SV&&!we.CV&&!we.EV2&&!we.CP&&!we.PC&&!we.DA&&!we.FI&&!we.PV&&!at(he.showToolBar)&&!at(he.showMenuBar)&&!at(he.showAlgebraInput)&&!at(he.enableRightClick)&&(!he.appName||he.appName=="classic")?an+="webSimple/":an+="web3d/",ft(an,!1)},ft=function(Ue,Ge){if(Ue.requirejs){ht=Ue;return}Ue.slice(-1)!=="/"&&(Ue+="/"),ht=Ue,Ge===null&&(Ge=Ue.indexOf("http")===-1),Ie=Ge,Ye="web.nocache.js",ot=!1;var wt=ht.split("/");wt.length>1&&(!Ge&&wt[wt.length-2]==="webSimple"?(Ye="webSimple.nocache.js",ot=!0):Fe.indexOf(wt[wt.length-2])>=0&&(Ye=wt[wt.length-2]+".nocache.js")),wt=Ue.split("/"),mt=wt[wt.length-3],mt.substr(0,4)==="test"?mt=mt.substr(4,1)+"."+mt.substr(5,1):(mt.substr(0,3)==="war"||mt.substr(0,4)==="beta")&&(mt="5.0");var dn=parseFloat(mt);dn!==NaN&&dn<5&&Ue.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+dn+" is deprecated. Using version latest instead."),xe("5.0",Ge))},qt=function(Ue,Ge){window.console&&window.console.log&&(!Ge||typeof Ge.showLogging=="undefined"||Ge.showLogging&&Ge.showLogging!=="false")&&console.log(Ue)};he.material_id!==void 0?Xe(Ot):Ot();function Ot(){var Ue=rn;Be!==null?Ue=Be:parseFloat(Ue)<5&&(Ue="5.0"),xe(Ue,!1),Oe!==null&&ft(Oe,Ie),Se=!0}return mn},GGBAppletUtils=function(){"use strict";function mn(){return window.GGBT_wsf_edit!==void 0}function rn(Se,Be){Be!=1?(Se.style.transformOrigin="0% 0% 0px",Se.style.webkitTransformOrigin="0% 0% 0px",Se.style.transform="scale("+Be+","+Be+")",Se.style.webkitTransform="scale("+Be+","+Be+")",Se.style.maxWidth="initial",Se.querySelector(".ggb_preview")!==null&&(Se.querySelector(".ggb_preview").style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[0]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[1]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(Se.style.transform="none",Se.style.webkitTransform="none")}function he(Se,Be,Oe,Ce,Me,Ne){var ht=null;if(Ne!=null&&Ne!="")for(var Ie=Se.parentNode;Ie!=null;)if((" "+Ie.className+" ").indexOf(" "+Ne+" ")>-1){ht=Ie;break}else Ie=Ie.parentNode;var He=0,mt=0,Ye=0,ot=0,rt=0,Et=0,Zt=0;if(ht)He=ht.offsetWidth,mt=Math.max(Ce?ht.offsetWidth:0,ht.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(He=Math.min(window.innerWidth,document.documentElement.clientWidth),mt=Math.min(window.innerHeight,document.documentElement.clientHeight),Ye=He):(He=window.innerWidth,mt=window.innerHeight,Ye=window.innerWidth),Se){var Je=Se.getBoundingClientRect();Je.left>0&&Je.left<=He&&(Me===void 0||!Me)&&(document.dir==="rtl"?(rt=He-Je.width-Je.left,Et=Ye<=480?10:30):(Et=Je.left,rt=Ye<=480?10:30),ot=Et+rt)}if(Se&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var lt=Se.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ot=40,Zt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(ot=0,Zt=40)}}return Se&&((Oe===void 0||!Oe)&&Be>0&&Be+ot<He?He=Be:He-=ot,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Oe===void 0||!Oe)&&(mt-=Zt)),{width:He,height:mt}}function we(Se,Be,Oe,Ce,Me){if(Se.isScreenshoGenerator)return 1;var Ne=Ce!==void 0&&Ce,ht=Se.noScaleMargin!=null&&Se.noScaleMargin,Ie=function(lt){return lt&&lt!=="false"},He=Ie(Se.autoHeight),mt=he(Be,Se.width,Oe,He,Ne&&window.GGBT_wsf_view||ht,Me),Ye=parseInt(mt.width),ot=Se.width,rt=Se.height;if(ot===void 0){var Et=Be.querySelector(".appletParameters");Et&&(ot=Et.offsetWidth,rt=Et.offsetHeight)}var Zt=Ye/ot,Je=Ne?1:mt.height/rt;return Oe!==void 0&&!Oe&&(Zt=Math.min(1,Zt),Je=Math.min(1,Je)),Math.min(Zt,Je)}function ct(Se,Be,Oe){var Ce=1,Me,Ne=!1;if(Se.hasOwnProperty("allowUpscale")&&(Ne=Se.allowUpscale),Se.hasOwnProperty("scale")&&(Ce=parseFloat(Se.scale),(isNaN(Ce)||Ce===null||Ce===0)&&(Ce=1),Ce>1&&(Ne=!0)),Be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ne=!0),!(Se.hasOwnProperty("disableAutoScale")&&Se.disableAutoScale))Me=we(Se,Be,Ne,Oe,Se.scaleContainerClass);else return Ce;return Ne&&(!Se.hasOwnProperty("scale")||Ce===1)?Me:Math.min(Ce,Me)}function Re(Se){var Be=Math.min(window.innerWidth,document.documentElement.clientWidth),Oe=Math.min(window.innerHeight,document.documentElement.clientHeight),Ce=Se.getBoundingClientRect(),Me=(Be-Ce.width)/2,Ne=(Oe-Ce.height)/2;Ne<0&&(Ne=0),Se.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Me<40?Se.style.left="40px":Se.style.left=Me+"px",Se.style.top=Ne+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ne<40?Se.style.top="40px":Se.style.top=Ne+"px",Se.style.left=Me+"px")}function st(Se,Be){var Oe=Se.querySelector(".appletParameters");if(Oe){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Be.id!==Oe.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(Se)}if(Oe.parentElement&&/fullscreen/.test(Oe.parentElement.className))return;var Ce=ct(Be,Se);mn()&&Oe.setAttribute("data-param-scale",Ce);for(var Me=null,Ne=0;Ne<Se.childNodes.length;Ne++)if(Se.childNodes[Ne].className!==void 0&&Se.childNodes[Ne].className.match(/^applet_scaler/)){Me=Se.childNodes[Ne];break}if(Me!==null&&Me.querySelector(".noscale")!==null)return;var ht=Be.id!==void 0?Be.id:"ggbApplet",Ie=window[ht];(Ie==null||!Ie.recalculateEnvironments)&&Me!==null&&!Me.className.match(/fullscreen/)&&(Me.parentNode.style.transform="",!isNaN(Ce)&&Ce!==1?(Me.parentNode.style.width=Be.width*Ce+"px",Me.parentNode.style.height=Be.height*Ce+"px",rn(Me,Ce)):(rn(Me,1),Me.parentNode.style.width=Be.width+"px",Me.parentNode.style.height=Be.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Re(Se),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Oe).parents(".content-added-content"))}}return{responsiveResize:st,isFlexibleWorksheetEditor:mn,positionCenter:Re,getScale:ct,scaleElement:rn}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var mn=n.location.search;return mn.indexOf(J)!=-1||mn.indexOf(K)!=-1}function q(mn,rn){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(mn){var rn=s[L].bindings;s[L].bindings=function(){for(var he=rn?rn():{},we=mn[webModule.__softPermutationId],ct=O;ct<we.length;ct++){var Re=we[ct];he[Re[O]]=Re[P]}return he}};var t;function u(){return v(),t}function v(){if(!t){var mn=o.createElement(Q);if(mn.id=L,mn.style.cssText=R+S,mn.tabIndex=-1,o.body.appendChild(mn),t=mn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var rn=document.compatMode==U?V:W;t.write(rn+X),t.close()}}}function w(mn){function rn(we){function ct(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Re=ct();if(Re){we();return}function st(){if(!Re){if(!ct())return;Re=!0,we(),o.removeEventListener&&o.removeEventListener(Z,st,!1),Se&&clearInterval(Se)}}o.addEventListener&&o.addEventListener(Z,st,!1);var Se=setInterval(function(){st()},$)}function he(we){var ct=u(),Re=ct.body,st=ct.createElement(_);st.language=ab,st.crossOrigin=W,st.src=we,webModule.__errFn&&(st.onerror=function(){webModule.__errFn(L,new Error(bb+we))}),Re.appendChild(st)}rn(function(){he(mn)})}webModule.__startLoadingFragment=function(mn){return C(mn)},webModule.__installRunAsyncCode=function(mn){var rn=u(),he=rn.body,we=rn.createElement(_);we.language=ab,we.text=mn,he.appendChild(we),he.removeChild(we)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(mn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(mn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(mn){var rn=c[mn];return rn==null?null:rn},r=d,webModule.__errFn=e}function B(){function mn(Se){var Be=Se.lastIndexOf(rb);Be==-1&&(Be=Se.length);var Oe=Se.indexOf(sb);Oe==-1&&(Oe=Se.length);var Ce=Se.lastIndexOf(tb,Math.min(Oe,Be));return Ce>=O?Se.substring(O,Ce+P):W}function rn(Se){if(!Se.match(/^\w+:\/\//)){var Be=o.createElement(ub);Be.src=Se+vb,Se=mn(Be.src)}return Se}function he(){var Se=__gwt_getMetaProperty(wb);return Se!=null?Se:W}function we(){for(var Se=o.getElementsByTagName(_),Be=O;Be<Se.length;++Be)if(Se[Be].src.indexOf(xb)!=-1)return mn(Se[Be].src);return W}function ct(){var Se=o.getElementsByTagName(yb);return Se.length>O?Se[Se.length-P].href:W}function Re(){var Se=o.location;return Se.href==Se.protocol+zb+Se.host+Se.pathname+Se.search+Se.hash}var st=he();return st==W&&(st=we()),st==W&&(st=ct()),st==W&&Re()&&(st=mn(o.location.href)),st=rn(st),st}function C(mn){return mn.match(/^\//)||mn.match(/^[a-zA-Z]+:\/\//)?mn:webModule.__moduleBase+mn}function D(){var mn=[],rn=O,he=[],we=[];function ct(Se){var Be=we[Se](),Oe=he[Se];if(Be in Oe)return Be;var Ce=[];for(var Me in Oe)Ce[Oe[Me]]=Me;throw r&&r(Se,Ce,Be),null}if(__gwt_isKnownPropertyValue=function(Se,Be){return Be in he[Se]},webModule.__getPropMap=function(){var Se={};for(var Be in he)he.hasOwnProperty(Be)&&(Se[Be]=ct(Be));return Se},webModule.__computePropValue=ct,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Re;try{Re=Cb;var st=Re.indexOf(Db);st!=-1&&(rn=parseInt(Re.substring(st+P),$),Re=Re.substring(O,st))}catch(Se){}return webModule.__softPermutationId=rn,C(Re+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase=window.ENV==="build"?"/react/build/js/mathematicalGraphics/"+name+"/":"/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},79090:function(mn,rn,he){"use strict";he.d(rn,{Ax:function(){return st},Ds:function(){return Se},KI:function(){return Oe},SI:function(){return Re},f1:function(){return ct}});var we=he(6521);function ct(Ce){let Me=!0;if(Ce.length>0){for(let Ne=0;Ne<Ce.length;Ne++)if(Ce[Ne].compile_success==0||!Ce[Ne].compile_success){Me=!1;break}}else Me=!1;return Me}function Re(Ce,Me=""){let Ne=[];for(let ht=0;ht<Ce.length;ht++){let Ie=Ce[ht],He=Me?`${Me}/${Ie.name}`:`${Ie.name}`;Ne.push({title:Ie.name,type:Ie.type,isLeaf:Ie.type!=="tree",key:He})}return Ne}function st(Ce,Me,Ne){for(let ht=0;ht<Ce.length;ht++){let Ie=Ce[ht];if(Ie.key===Me){Ie.children=Ne;break}Ie.children&&st(Ie.children,Me,Ne)}return Ce}function Se(Ce,Me,Ne){let ht;return function(){let Ie=this,He=arguments,mt=function(){ht=null,Ne||Ce.apply(Ie,He)},Ye=Ne&&!ht;clearTimeout(ht),ht=setTimeout(mt,Me),Ye&&Ce.apply(Ie,He)}}const Be=!0,Oe=we.Z.API_SERVER},15868:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return ht}});var we=he(59301),ct={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Re=he(92310),st=he.n(Re),Se=he(71418),Be=he(2859),Oe=he(79769),Ce=he(25544),Me=(Ie,He,mt)=>new Promise((Ye,ot)=>{var rt=Je=>{try{Zt(mt.next(Je))}catch(lt){ot(lt)}},Et=Je=>{try{Zt(mt.throw(Je))}catch(lt){ot(lt)}},Zt=Je=>Je.done?Ye(Je.value):Promise.resolve(Je.value).then(rt,Et);Zt((mt=mt.apply(Ie,He)).next())}),ht=({data:Ie,className:He,fullWidth:mt,style:Ye={},onClose:ot,onOk:rt,showFullTools:Et,noAssociationId:Zt})=>{const Je=(0,we.useRef)(null),lt=(0,we.useRef)(null),We=(0,we.useRef)(null),Ee=(0,we.useRef)(null),[Ve,Xe]=(0,we.useState)(!1),[bt,je]=(0,we.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,we.useEffect)(()=>{We.current||(We.current=document.createElement("style"),document.head.appendChild(We.current)),Ie!=null&&Ie.visible?(document.body.setAttribute("data-custom","y-hidden"),We.current.innerHTML=" html { overflow-y: hidden; }",Ie!=null&&Ie.src&&It()):(document.body.removeAttribute("data-custom"),We.current&&(document.head.removeChild(We.current),We.current=null))},[Ie==null?void 0:Ie.visible]);const It=()=>Me(void 0,null,function*(){Xe(!0),je("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Qt=yield(0,Ce.ZJ)(Ie==null?void 0:Ie.src);Je.current.src="",Je.current.src=Qt,Je.current.onload=function(){Nt()},Xe(!1),je("")}),at=()=>{document.body.removeAttribute("data-custom"),We.current.innerHTML=" ",ot()},Ct=Qt=>Me(void 0,null,function*(){Xe(!0),je("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Vt=yield(0,Oe.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ie.title,file:Qt.dataUrl}});Vt!=null&&Vt.id&&!Zt?(yield(0,Oe.ZP)(`/api/attachments/${Ie.id}/add_subitem.json`,{method:"post",body:{subitem_id:Vt==null?void 0:Vt.id,settings:JSON.stringify(Qt.state)}})).status===0&&rt():Vt!=null&&Vt.id&&rt(Vt),document.body.removeAttribute("data-custom"),We.current.innerHTML=" ",Xe(!1),je("")}),qe=()=>{const Qt=document.querySelector('a[href="https://markerjs.com/"]');Qt&&Qt.parentNode&&(Qt.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(Gt=>{const Ft=document.querySelector(Gt.name);Ft&&Ft.setAttribute("title",Gt.title)})},Nt=()=>{lt.current=new Be.hP(Je.current),lt.current.targetRoot=Ee.current,lt.current.addEventListener("render",Ct),lt.current.addEventListener("beforeclose",at),Et&&(lt.current.availableMarkerTypes=lt.current.ALL_MARKER_TYPES,lt.current.uiStyleSettings.redoButtonVisible=!0,lt.current.uiStyleSettings.notesButtonVisible=!0,lt.current.uiStyleSettings.zoomButtonVisible=!0,lt.current.uiStyleSettings.zoomOutButtonVisible=!0,lt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=lt.current.uiStyleSettings,lt.current.show(),Ie!=null&&Ie.snapshotData&&lt.current.restoreState(Ie.snapshotData),setTimeout(()=>{window.scrollTo(0,0),qe()},300)};return we.createElement(we.Fragment,null,(Ie==null?void 0:Ie.visible)&&we.createElement(Se.Z,{spinning:Ve,tip:bt,style:{position:"absolute"}},we.createElement("div",{ref:Ee,className:st()(ct.imageDimensions,He,mt?ct.fullWidth:""),style:Ye},we.createElement("img",{className:ct.img,ref:Je}))))}},3315:function(mn,rn,he){"use strict";var we=he(59301),ct=he(95237),Re=he(43604),st=he(99313),Se=he(3113),Be=he(39655),Oe=he(18760),Ce=he(48136),Me=he(59301);const Ne=(0,we.forwardRef)(({callback:ht,showSaveButton:Ie,value:He=""},mt)=>{const Ye=(0,we.useRef)(),ot=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],rt=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],Et=lt=>{Ye.current.setValue(Ye.current.getValue()+" "+lt.value+" ")},Zt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Me.createElement(ct.Z,{className:Oe.Z.lists,gutter:[10,10]},ot.map((lt,We)=>Me.createElement(Re.Z,{flex:"110px",className:Oe.Z.item},Me.createElement("div",null,Me.createElement(Be.Z,{value:`$$${lt.value}$$`}),lt.name),Me.createElement("div",{className:Oe.Z.children},lt.children.map((Ee,Ve)=>Me.createElement("div",{key:Ve},Me.createElement("h1",null,Ee.name),Me.createElement(ct.Z,{gutter:[10,10]},Ee.data.map((Xe,bt)=>Me.createElement(Re.Z,{key:bt,onClick:()=>Et(Xe),className:Oe.Z.diamond},Me.createElement(Be.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Me.createElement(ct.Z,{className:Oe.Z.lists,gutter:[10,10]},rt.map((lt,We)=>Me.createElement(Re.Z,{flex:"110px",className:Oe.Z.item},Me.createElement("div",null,Me.createElement(Be.Z,{value:"`$$"+lt.value+"$$`"}),lt.name),Me.createElement("div",{className:Oe.Z.children},lt.children.map((Ee,Ve)=>Me.createElement("div",{key:Ve},Ee.name&&Me.createElement("h1",null,Ee.name),Me.createElement(ct.Z,{gutter:[10,10]},Ee.data.map((Xe,bt)=>Me.createElement(Re.Z,{key:bt,onClick:()=>Et(Xe),className:Oe.Z.diamond},Me.createElement(Be.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))}],Je=()=>{var lt=document.createElement("div");lt.innerHTML=Ye.current.getValue();var We=lt.innerText;return ht&&ht(We),We};return(0,we.useImperativeHandle)(mt,()=>({getData:Je})),Me.createElement("div",{className:Oe.Z.mathWrap},Me.createElement(st.default,{defaultActiveKey:"1",items:Zt}),Me.createElement("math-field",{locale:"zh_cn",className:Oe.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:Ye,style:{width:800,marginTop:30,fontSize:18}},He||""),Ie&&Me.createElement("div",{className:Oe.Z.button},Me.createElement(Se.ZP,{size:"large",onClick:Je,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});rn.Z=Ne},67831:function(mn,rn,he){"use strict";he.d(rn,{h:function(){return lt}});var we=he(59301),ct=he(57809),Re=he(78241),st=he(3113),Se=he(89780),Be=he.n(Se),Oe=he(14618),Ce=he(66552),Me=Object.defineProperty,Ne=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,Ye=(We,Ee,Ve)=>Ee in We?Me(We,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):We[Ee]=Ve,ot=(We,Ee)=>{for(var Ve in Ee||(Ee={}))He.call(Ee,Ve)&&Ye(We,Ve,Ee[Ve]);if(Ie)for(var Ve of Ie(Ee))mt.call(Ee,Ve)&&Ye(We,Ve,Ee[Ve]);return We},rt=(We,Ee)=>Ne(We,ht(Ee));const Et=ct.default.Option,Zt={labelCol:{span:4},wrapperCol:{span:20}},Je={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};rn.Z=({callback:We,onCancel:Ee})=>{const[Ve,Xe]=(0,we.useState)("python");function bt(It){Xe(Je[It][1])}function je(It){We(It)}return we.createElement(Re.default,rt(ot({},Zt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:je,style:{width:500}}),we.createElement(Re.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},we.createElement(ct.default,{getPopupContainer:It=>It.parentNode,onChange:bt},Object.keys(Je).map(It=>we.createElement(Et,{key:It,value:It},Je[It][0])))),we.createElement(Re.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},we.createElement(lt,{mode:Ve})),we.createElement("div",{className:"flex-container flex-end"},we.createElement(st.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),we.createElement(st.ZP,{type:"ghost",onClick:Ee},"\u53D6\u6D88")))};function lt({value:We,onChange:Ee,mode:Ve,options:Xe={}}){const bt=(0,we.useRef)(),[je,It]=(0,we.useState)();return(0,we.useEffect)(()=>{if(je){let at=function(Ct){const qe=Ct.getValue();Ee&&Ee(qe)};return je.on("change",at),()=>{je.off("change",at)}}},[je,Ee]),(0,we.useEffect)(()=>{je&&je.setOption("mode",Ve)},[je,Ve]),(0,we.useEffect)(()=>{je&&(We!==je.getValue()||We==="")&&setTimeout(()=>{je.setValue(We||"")},300)},[je,We]),(0,we.useEffect)(()=>{if(bt.current&&!je){const at=Be().fromTextArea(bt.current,ot({mode:Ve,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Xe));It(at)}},[bt.current,je]),we.createElement("div",{className:"my-codemirror-container"},we.createElement("textarea",{ref:bt}))}},40973:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return $i}});var we=he(59301),ct=he(89780),Re=he.n(ct),st=he(76374),Se=he(14618),Be=he(6313),Oe=he(25717),Ce=he(99498),Me=he(25419),Ne=he(67549),ht=he(39655),Ie=({value:si="",className:fi,showTextOnly:kn,showLines:Dn,style:mi={}})=>{const Qe=(0,we.useMemo)(()=>"",[si]);return we.createElement(we.Fragment,null,we.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},He=he(59301),mt=Object.defineProperty,Ye=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Je=(si,fi,kn)=>fi in si?mt(si,fi,{enumerable:!0,configurable:!0,writable:!0,value:kn}):si[fi]=kn,lt=(si,fi)=>{for(var kn in fi||(fi={}))Et.call(fi,kn)&&Je(si,kn,fi[kn]);if(rt)for(var kn of rt(fi))Zt.call(fi,kn)&&Je(si,kn,fi[kn]);return si},We=(si,fi)=>Ye(si,ot(fi));let Ee=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Ve({onActionCallback:si,title:fi,icon:kn,actionName:Dn,className:mi="",children:Qe}){function ke(){si(Dn)}return He.createElement("a",{title:fi,className:mi,onClick:ke},He.createElement("i",{className:`${kn}`}),Qe)}var Xe=({watch:si,showNullButton:fi,showNullProgramButton:kn,onActionCallback:Dn,fullScreen:mi,insertTemp:Qe,hidetoolBar:ke,extraUse:Pe})=>{const Le=[...Ee,{title:`${si?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${si?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return He.createElement("ul",{className:"markdown-toolbar-container"},!ke&&Le.map((De,Ke)=>He.createElement("li",{key:Ke},De.actionName?He.createElement(Ve,We(lt({},De),{onActionCallback:Dn})):He.createElement("span",{className:"v-line"}))),fi?He.createElement("li",null,He.createElement(Ve,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Dn},He.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,kn?He.createElement(He.Fragment,null,He.createElement("li",null,He.createElement(Ve,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Dn},He.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),He.createElement("li",null,He.createElement(Ve,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Dn},He.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Qe&&He.createElement("li",null,He.createElement(Ve,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Qe}`,onActionCallback:Dn},He.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Pe&&He.createElement("li",null,Pe),He.createElement("li",{className:"btn-full-screen"},He.createElement(Ve,{icon:`${mi?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:mi?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Dn})))},bt=he(53531),je=he(78241),It=he(92832),at=he(3113),Ct=Object.defineProperty,qe=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,Ft=(si,fi,kn)=>fi in si?Ct(si,fi,{enumerable:!0,configurable:!0,writable:!0,value:kn}):si[fi]=kn,Fe=(si,fi)=>{for(var kn in fi||(fi={}))Vt.call(fi,kn)&&Ft(si,kn,fi[kn]);if(Qt)for(var kn of Qt(fi))Gt.call(fi,kn)&&Ft(si,kn,fi[kn]);return si},xe=(si,fi)=>qe(si,Nt(fi));const ft={labelCol:{span:4},wrapperCol:{span:20}};var qt=({callback:si,onCancel:fi})=>{function kn(Dn){si(Dn)}return we.createElement(je.default,xe(Fe({},ft),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:kn,style:{width:500}}),we.createElement(je.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},we.createElement(It.default,null)),we.createElement(je.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},we.createElement(It.default,null)),we.createElement("div",{className:"flex-container flex-end"},we.createElement(at.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),we.createElement(at.ZP,{type:"ghost",onClick:fi},"\u53D6\u6D88")))},Ot=he(67831),Ue=he(58448),Ge=he(43418),wt=he(95237),dn=he(15868),Rt=he(59301),an=({callback:si,onCancel:fi})=>{const kn=document.createElement("canvas"),Dn=kn.getContext("2d");kn.width=1e3,kn.height=800,Dn.fillStyle="#ffffff",Dn.fillRect(0,0,kn.width,kn.height);const mi=kn.toDataURL("image/png");return Rt.createElement(Ge.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Rt.createElement(wt.Z,{style:{height:"100vh"}},Rt.createElement(dn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:mi,visible:!0,title:String(Date.now())},onOk:Qe=>{si({src:Qe.url})},onClose:fi})))},$t=he(8591),Bt=he(43428),Tt=he(43604),ge={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},se=he(59301),fe=(0,we.forwardRef)(({onCancel:si,editImgId:fi,callback:kn},Dn)=>{let mi=(0,we.useRef)(),Qe=(0,we.useRef)(),ke=(0,we.useRef)(),Pe=(0,we.useRef)(!1);const Le=(0,we.useRef)(!1);console.log("ref:",Dn);const[De,Ke]=(0,we.useState)(0),[it,kt]=(0,we.useState)("100vh");(0,we.useEffect)(()=>{Ke(1);try{indexedDB.databases().then(Xt=>{Xt.forEach(tn=>indexedDB.deleteDatabase(tn.name))})}catch(Xt){}},[]),(0,we.useEffect)(()=>(window.addEventListener("message",Dt),()=>{window.removeEventListener("message",Dt)}),[]),(0,we.useImperativeHandle)(Dn,()=>({setHeight:kt}));const yt=Xt=>{window.saveDrawData(tn=>{if(tn===null&&!Xt){$t.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}$t.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),kn({src:`/api/attachments/${tn}`,id:tn,disabledClose:!0})})},Dt=Xt=>{var tn;((tn=Xt==null?void 0:Xt.data)==null?void 0:tn.type)==="closePop"&&yt(!0)};return se.createElement("div",{ref:Le,className:"body-overflow-initial"},se.createElement(Bt.Z,{width:"100vw",height:it,footer:null,closable:!0,placement:"bottom",open:!!De,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ge.drawerWrap}`,onClose:()=>{window.saveDrawData(Xt=>{kn({src:`/api/attachments/${Xt}`,id:Xt})})},title:se.createElement(wt.Z,{align:"middle"},se.createElement(Tt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),se.createElement(Tt.Z,{onClick:()=>{kt(it==="60px"?"100vh":"60px")}},se.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),se.createElement(Tt.Z,{onClick:yt},se.createElement(at.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},se.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${fi||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Qe})))}),ve=he(6521),ce=he(5112),$e=he(5871);const xt=ce.ZP.Group,Ut={margin:"0 8px"};var Ht=({callback:si,onCancel:fi})=>{function kn(Dn){si(Dn)}return we.createElement(je.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:kn},we.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},we.createElement("span",{style:Ut},"\u5355\u5143\u683C\u6570\uFF1A"),we.createElement("span",{style:Ut},"\u884C\u6570"),we.createElement(je.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},we.createElement($e.Z,null)),we.createElement("span",{style:Ut},"\u5217\u6570"),we.createElement(je.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},we.createElement($e.Z,null))),we.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},we.createElement("span",{style:Ut},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),we.createElement(je.default.Item,{name:"align"},we.createElement(xt,null,we.createElement(ce.ZP,{value:"default"},we.createElement("i",{className:"fa fa-align-justify"})),we.createElement(ce.ZP,{value:"left"},we.createElement("i",{className:"fa fa-align-left"})),we.createElement(ce.ZP,{value:"center"},we.createElement("i",{className:"fa fa-align-center"})),we.createElement(ce.ZP,{value:"right"},we.createElement("i",{className:"fa fa-align-right"}))))),we.createElement("div",{className:"flex-container flex-end"},we.createElement(at.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),we.createElement(at.ZP,{type:"ghost",onClick:fi},"\u53D6\u6D88")))},Jt=he(78673),en=he(3352),hn=he.n(en),bn=(0,we.forwardRef)(({use3d:si,width:fi,height:kn,callback:Dn,showSaveButton:mi},Qe)=>{const ke=(0,we.useRef)(),Pe=(0,we.useRef)(),[Le,De]=(0,we.useState)(!1),Ke=(0,we.useRef)({id:ke,appName:"graphing",width:fi||1e3,height:kn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,we.useEffect)(()=>{Pe.current=new(hn())(Ke.current,!0),window.onload=function(){Pe.current.inject("applet_container")}},[]);const it=()=>{var kt=window.ggbApplet.getPNGBase64(1,!0,72);return Dn&&Dn(kt),kt};return(0,we.useEffect)(()=>{Ke.current.appName=Le?"3D":"graphing",Pe.current.inject("applet_container")},[Le]),(0,we.useEffect)(()=>{De(si)},[si]),(0,we.useImperativeHandle)(Qe,()=>({getImgData:it})),we.createElement(we.Fragment,null,we.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:ke}),we.createElement(wt.Z,{align:"middle"},we.createElement(Tt.Z,{flex:1},we.createElement(Jt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Le,onChange:kt=>De(kt)})),we.createElement(Tt.Z,null,we.createElement(at.ZP,{size:"large",onClick:it,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),pt=he(3315),sn=he(1012);const zn="link",tt="upload-image",vt="add-flowchart",Lt="draw-image",Ln="add-flowchart",Mn="code-block",_n="add-table",ti="------------",hi={default:ti,left:`:${ti}`,center:`:${ti}:`,right:`${ti}:`};var pi=he(57649),Bi=(si,fi,kn)=>new Promise((Dn,mi)=>{var Qe=Le=>{try{Pe(kn.next(Le))}catch(De){mi(De)}},ke=Le=>{try{Pe(kn.throw(Le))}catch(De){mi(De)}},Pe=Le=>Le.done?Dn(Le.value):Promise.resolve(Le.value).then(Qe,ke);Pe((kn=kn.apply(si,fi)).next())});function _i(){}let Zn=0;const Fi=1e4,Wi="\u2581",Gi="@\u2581\u2581@",nr="@\u2581@",Pi=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Yi=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function bi(si){return/^\d+$/.test(si)?`${si}px`:si}const Ji=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Vi={[Ji+"-B"]:"bold",[Ji+"-I"]:"italic"},ir={[zn]:"\u6DFB\u52A0\u94FE\u63A5",[Mn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[tt]:"\u6DFB\u52A0\u56FE\u7247",[Lt]:"\u6DFB\u52A0\u753B\u56FE",[vt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[_n]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var $i=({defaultValue:si="",onChange:fi,width:kn="100%",height:Dn=400,miniToolbar:mi=!1,isFocus:Qe=!1,watch:ke,insertTemp:Pe,mode:Le="markdown",id:De="markdown-editor-id",showResizeBar:Ke=!1,noStorage:it=!1,showNullButton:kt=!1,showNullProgramButton:yt=!1,hidetoolBar:Dt=!1,fullScreen:Xt=!1,onBlur:tn,onCMBeforeChange:un,onFullScreen:gt,className:jt="",disablePaste:Bn=!1,disabled:yn=!1,disabledFill:Tn=!1,placeholder:Cn="",values:Yn="",extraUse:ln,onAddBlank:Un})=>{const[Ze,St]=(0,we.useState)(null),[Mt,Kt]=(0,we.useState)(si),[_t,Pt]=(0,we.useState)(ke),[At,on]=(0,we.useState)(Xt),[cn,xn]=(0,we.useState)(""),[Vn,ni]=(0,we.useState)(0),[gi,ii]=(0,we.useState)(Dn),[Kn,vi]=(0,we.useState)(!1),ui=(0,we.useRef)((0,sn.Z)()),ci=(0,we.useRef)(!1),Fn=(0,we.useRef)(),[Jn,li]=(0,we.useState)(0),[Qn,Di]=(0,we.useState)(0),Hi=(0,we.useRef)(),ai=(0,we.useRef)(),wn=(0,we.useRef)(),fn=(0,we.useRef)(),ri=(0,we.useRef)(),jn=(0,we.useRef)(),yi=()=>Bi(void 0,null,function*(){var Rn;const In=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ui.current}});(Rn=In==null?void 0:In.attachments)!=null&&Rn.length&&(console.log("cm:",Ze,Hi),In.attachments.map(Pn=>{Pn.content_type.indexOf("image")>-1?Ze.replaceSelection(`![,](/api/attachments/${Pn.id}?type=${Pn.content_type})`):Pn.content_type.indexOf("video")>-1?Ze.replaceSelection(`<video width="100%" controls src="${ve.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Pn.content_type.indexOf("pdf")>-1?Ze.replaceSelection(`<a href="${ve.Z.API_SERVER}/api/attachments/${Pn.id}?type=${Pn.content_type}&disposition=inline" target="_blank">${Pn.name}</a>`):Ze.replaceSelection(`[${Pn.name}](${ve.Z.API_SERVER}/api/attachments/${Pn.id}?type=${Pn.content_type})`)}))});(0,we.useEffect)(()=>{const Rn=window.scrollY||window.pageYOffset;Kt(Yn),Ze==null||Ze.setValue(Yn),window.scrollTo(0,Rn)},[Yn]),(0,we.useEffect)(()=>{gt==null||gt(At)},[At]),(0,we.useEffect)(()=>{if(Hi.current){let Rn=function(Pn,Xn){var qi;if(Bn){Xn.preventDefault();return}const hr=Xn.clipboardData;if(hr){const br=hr.types.toString(),mr=hr.items;if(br==="Files"||hr.types.indexOf("Files")>-1){if(Xn.preventDefault(),Le=="stex")return;try{let ar=mr[1];((qi=mr[0])==null?void 0:qi.kind)==="file"&&(ar=mr[0]);const wr=ar.getAsFile(),Kr=wr.name.split(".").pop();(0,Ue.I)(wr,Br=>{var pa,ea,Or;Br.id?((pa=wr==null?void 0:wr.type)==null?void 0:pa.indexOf("image"))>-1?In.replaceSelection(`<img width="100%" src="/api/attachments/${Br.id}?type=${Br.content_type})" alt="" />`):((ea=wr==null?void 0:wr.type)==null?void 0:ea.indexOf("video"))>-1?In.replaceSelection(`<video width="100%" controls src="/api/attachments/${Br.id}"></video>`):((Or=wr==null?void 0:wr.type)==null?void 0:Or.indexOf("pdf"))>-1?In.replaceSelection(`<a href="/api/attachments/${Br.id}?type=${wr.type}&disposition=inline" target="_blank">${wr.name}</a>`):Yi.includes(Kr)?In.replaceSelection(`<a href="/api/attachments/${Br.id}?type=office&disposition=inline" target="_blank">${wr.name}</a>`):In.replaceSelection(`[${wr.name}](/api/attachments/${Br.id}?type=${Br.content_type})`):(Br==null?void 0:Br.status)===401&&($t.ZP.warning((Br==null?void 0:Br.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(ar){$t.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const In=Re().fromTextArea(Hi.current,{mode:Le,lineNumbers:!mi,lineWrapping:!0,value:si,autoCloseTags:!yt,autoCloseBrackets:!0});return In.on("keyup",function(Pn,Xn){Xn.keyCode===8&&(Pn.getValue()==""?In.setOption("placeholder",Cn):In.setOption("placeholder",null))}),In.on("keydown",function(Pn,Xn){if(Xn.keyCode===8){var qi=wi(Pn);qi&&Xn.preventDefault()}}),Qe&&In.focus(),In.on("paste",Rn),In.on("dragleave",function(Pn,Xn){ai.current.classList.remove("mouse-hover-md")}),yn&&In.on("beforeChange",function(Pn,Xn){(Xn.origin==="paste"||Xn.origin==="+input")&&Xn.cancel()}),St(In),()=>{In.off("paste",Rn)}}},[]);const Ti=(0,we.useCallback)(()=>{if(ai.current)try{}catch(Rn){console.log(Rn,"---- to set md editor body height")}},[gi,ai,At]);(0,we.useEffect)(()=>{function Rn(){let In=new st.Z(Pn=>{for(let Xn of Pn)(Xn.target.offsetHeight>0||Xn.target.offsetWidth>0)&&(Ti(),Ze.setSize("100%","100%"),Ze.refresh())});return In.observe(Hi.current.parentElement),In}if(Ze){const In=Rn();return()=>{var Pn,Xn;(Pn=Hi.current)!=null&&Pn.parentElement&&In.unobserve((Xn=Hi.current)==null?void 0:Xn.parentElement)}}},[Ze,Ti]),(0,we.useEffect)(()=>{if(Ze){let Rn=[];for(const[In,Pn]of Object.entries(Vi)){let Xn={[In]:()=>{Ui(Pn)}};Rn.push(Xn),Ze.addKeyMap(Xn)}return Fn.current=setInterval(()=>{ci.current&&yi()},4e3),()=>{clearInterval(Fn.current);for(let In of Rn)Ze.removeKeyMap(In)}}},[Ze]),(0,we.useEffect)(()=>{Xt!==At&&on(Xt)},[Xt]),(0,pi.Z)(()=>{if(!it&&Vn>0){let Rn=new Date().getTime(),In=window.sessionStorage.getItem(De);Rn>=Vn+Fi&&(!In||In!==Mt)&&(window.sessionStorage.setItem(De,Mt),vi(!0))}},Fi),(0,we.useEffect)(()=>{Pt(ke)},[Ze,ke]),(0,we.useEffect)(()=>{Ze&&Qe&&Ze.focus()},[Ze,Qe]),(0,we.useEffect)(()=>{if(_t&&Ze){let Rn=function(Pn){let Xn=Pn.target;if(fn.current){let qi=Xn.scrollTop/Xn.scrollHeight;fn.current.scrollTop=fn.current.scrollHeight*qi}};const In=Ze.getScrollerElement();return In.addEventListener("scroll",Rn),()=>{In.removeEventListener("scroll",Rn)}}},[Ze,_t]),(0,we.useEffect)(()=>{if(Ze&&un){let Rn=function(In,Pn){un(In,Pn)};return Ze.on("beforeChange",Rn),()=>{Ze.off("beforeChange",Rn)}}},[Ze,un]),(0,we.useEffect)(()=>{if(Ze&&tn){let Rn=function(){tn(Ze.getValue())};return Ze.on("blur",Rn),()=>{Ze.off("blur",Rn)}}},[Ze,tn]);function wi(Rn,In){var Pn=Rn.getDoc(),Xn=Pn.getCursor(),qi=Pn.getLine(Xn.line),hr=qi.charAt(Xn.ch-1),br=qi.lastIndexOf("@\u2581@",Xn.ch),mr=qi.lastIndexOf("@\u2581\u2581@",Xn.ch),ar=br>mr?br:mr,wr=br>mr?3:4;if(Gi.indexOf(hr)===-1)return null;if(console.log("change1:",In,Rn,qi,Xn,ar,br,mr,hr),ar>=0&&Xn.ch-ar<5){var Kr=ar+wr;return Pn.replaceRange("",{line:Xn.line,ch:ar},{line:Xn.line,ch:Kr}),{line:Xn.line,ch:Kr}}return null}(0,we.useEffect)(()=>{if(Ze){let Rn=function(In,Pn){const Xn=In.getValue();Kt(Xn),ni(new Date().getTime()),In.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),fi&&(yt?fi(Xn,qr(Xn)):fi(Xn))};return Ze.on("change",Rn),()=>{Ze.off("change",Rn)}}},[Ze,fi]),(0,we.useEffect)(()=>{if(Ze)if(si==null)Ze.setValue(""),Kt("");else{const Rn=window.scrollY||window.pageYOffset;si!==Ze.getValue()&&(Ze.setValue(si),Kt(si),Ze.setCursor(yn?1:Ze.lineCount(),0),window.scrollTo(0,Rn))}},[Ze,si]);const Ui=(0,we.useCallback)(Rn=>{const In=Ze.getCursor(),Pn=Ze.getSelection();let Xn=Pn.split(`
`);switch(Rn){case"bold":return Ze.replaceSelection("**"+Pn+"**"),Pn===""&&Ze.setCursor(In.line,In.ch+2),Ze.focus();case"italic":return Ze.replaceSelection("*"+Pn+"*"),Pn===""&&Ze.setCursor(In.line,In.ch+1),Ze.focus();case"code":return Ze.replaceSelection("`"+Pn+"`"),Pn===""&&Ze.setCursor(In.line,In.ch+1),Ze.focus();case"inline-latex":return xn("inline-latex"),Ze.focus();case"latex":return Ze.replaceSelection("```latex\n"+Pn+"\n```"),Ze.setCursor(In.line+1,Pn.length+1),Ze.focus();case"line-break":return Ze.replaceSelection(`<br/>
`),Ze.focus();case"list-ul":return Pn===""?Ze.replaceSelection("- "+Pn):Ze.replaceSelection(Xn.map(qi=>qi===""?"":`- ${qi}`).join(`
`)),Ze.focus();case"list-ol":return Pn===""?Ze.replaceSelection("1. "+Pn):Ze.replaceSelection(Xn.map((qi,hr)=>qi===""?"":`${hr+1}. ${qi}`).join(`
`)),Ze.focus();case"add-null-ch":Un==null||Un();return;case"add-signal":return Pn===""&&Ze.setCursor(In.line,In.ch),Ze.replaceSelection(nr),Ze.focus();case"add-multiple":return Pn===""&&Ze.setCursor(In.line,In.ch),Ze.replaceSelection(Gi),Ze.focus();case"inster-template-1":return Pn===""&&Ze.setCursor(In.line,In.ch),Ze.replaceSelection(Pi),Ze.focus();case"eraser":return Ze.setValue(""),Ze.focus();case"trigger-watch":return Pt(!_t),Ze.focus();case"trigger-full-screen":return on(!At),Ze.focus();case zn:xn(zn);return;case Mn:xn(Mn);return;case tt:xn(tt);return;case Lt:xn(Lt);return;case"maths-latex":xn("maths-latex");return;case vt:ri.current="",sessionStorage.removeItem("file_id"),xn(vt);return;case _n:xn(_n);return;default:throw new Error}},[Ze,_t,At]),Ii=(0,we.useCallback)((Rn,In)=>{var Pn,Xn,qi,hr,br,mr;xn("");const{src:ar,alt:wr,id:Kr}=Rn||{};switch(cn){case zn:const{title:Qa,link:Ma}=Rn;return Ze.replaceSelection(`[${Qa}](${Ma})`),Ze.focus();case Mn:const{language:ma,content:ta}=Rn;return Ze.replaceSelection(["```"+ma,ta,"```"].join(`
`)),Ze.focus();case"maths-latex":for(var Br=atob(Rn),pa=new Uint8Array(Br.length),ea=0;ea<Br.length;ea++)pa[ea]=Br.charCodeAt(ea);var Or=new Blob([pa],{type:"image/png"});(0,Ue.I)(Or,Qi=>{Qi.id?Ze.replaceSelection(`![,](/api/attachments/${Qi.id}?type=${Qi.content_type})`):(Qi==null?void 0:Qi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Ze.replaceSelection("`$$"+Rn+"$$`");break;case Ln:if(!Kr)return;Ze.focus(),Ze.getValue().indexOf(ar)===-1?Ze.replaceSelection(`<center><img id="${Kr}" width="80%" src="${ar}" class="draw-flowchart" alt="${wr||""}" /></center>`):document.getElementById(Kr).src=ve.Z.API_SERVER+ar+"?t="+Date.now();try{setTimeout(()=>{tn(Ze.getValue())},100)}catch(Qi){}break;case tt:case Lt:const Sr=In,ki=(qi=(Xn=(Pn=Sr==null?void 0:Sr.name)==null?void 0:Pn.split("."))==null?void 0:Xn.pop)==null?void 0:qi.call(Xn);return((hr=Sr==null?void 0:Sr.type)==null?void 0:hr.indexOf("image"))>-1||!(Sr!=null&&Sr.type)?Sr!=null&&Sr.align||Sr!=null&&Sr.width?Ze.replaceSelection(`<p style="text-align:${Sr.align||"initial"}"><img width="${Sr.width?Sr.width+"%":"initial"}" src="${ar}" alt="${wr||""}" /></p>`):Ze.replaceSelection(`<img width="100%" src="${ar}" alt="${wr||""}" />`):((br=Sr==null?void 0:Sr.type)==null?void 0:br.indexOf("video"))>-1?Ze.replaceSelection(`<video width="100%" controls src="${ar}"></video>`):((mr=Sr==null?void 0:Sr.type)==null?void 0:mr.indexOf("pdf"))>-1?Ze.replaceSelection(`<a href="${ar}?type=${Sr.type}&disposition=inline" target="_blank">${Sr.name}</a>`):Yi.includes(ki)?Ze.replaceSelection(`<a href="${ar}?type=office&disposition=inline" target="_blank">${Sr.name}</a>`):Ze.replaceSelection(`[${Sr.name}](${ar})`),Ze.focus();case _n:const{row:Zi,col:Ri,align:Si}=Rn;let tr=`
`;for(let Qi=0;Qi<Zi;Qi++){let Pr=[],Rr=[];for(let Nr=0;Nr<Ri;Nr++)Qi===1&&Rr.push(hi[Si]),Pr.push(" ");Qi===1&&(tr+=`| ${Rr.join(" | ")} |
`),tr+=`| ${Pr.join(Ri===1?"":" | ")} |
`}return Ze.replaceSelection(tr+`
`),Ze.focus();default:throw new Error}},[Ze,cn]),fr=(0,we.useMemo)(()=>{switch(cn){case zn:return we.createElement(qt,{callback:Ii,onCancel:Gn});case Mn:return we.createElement(Ot.Z,{callback:Ii,onCancel:Gn});case tt:return we.createElement(Ue.Z,{callback:Ii,onCancel:Gn});case vt:return we.createElement(fe,{editImgId:ri.current,callback:Ii,onCancel:Gn});case _n:return we.createElement(Ht,{callback:Ii,onCancel:Gn});case"maths-latex":return we.createElement(bn,{showSaveButton:!0,callback:Ii});case"inline-latex":return we.createElement(pt.Z,{showSaveButton:!0,callback:Ii});default:return null}},[cn]);function Gn(){xn("")}(0,we.useEffect)(()=>{if(wn.current){let Rn=function(br){qi=!0,hr=br.pageY},In=function(){qi=!1},Pn=function(br){if(qi){let mr=br.pageY-hr;mr<0&&(mr=0),mr>300&&(mr=300);let ar=Dn+mr+"px";ii(ar)}},Xn=wn.current,qi=!1,hr=0;return Xn.addEventListener("mousedown",Rn),document.addEventListener("mousemove",Pn),document.addEventListener("mouseup",In),()=>{Xn.removeEventListener("mousedown",Rn),document.removeEventListener("mousemove",Pn),document.removeEventListener("mouseup",In)}}},[Ze,wn]),(0,we.useEffect)(()=>{ii(Dn)},[Dn]);const Hn=bi(kn),Mi=bi(gi),Ai={width:Hn,height:Mi},sr=(0,we.useMemo)(()=>{if(Vn){let Rn=new Date(Vn),In=Rn.getHours(),Pn=Rn.getMinutes(),Xn=Rn.getSeconds();return In=In<10?"0"+In:In,Pn=Pn<10?"0"+Pn:Pn,Xn=Xn<10?"0"+Xn:Xn,`${In}:${Pn}:${Xn}`}return 0},[Vn]),qr=Rn=>{const In=[];if(yt){let Pn=-1;Rn=Rn.replace(/(@▁▁@|@▁@)/g,function(Xn,qi,hr){In.push({multiLine:Xn!==nr})})}return In};function Ar(){window.sessionStorage.removeItem(De),vi(!1),ni(0)}function Xi(){vi(!1),ni(0),Ze.setValue(window.sessionStorage.getItem(De))}(0,we.useEffect)(()=>{ir[cn]&&cn!==Lt&&cn!==vt&&setTimeout(()=>{const Rn=document.getElementsByClassName("markdown-popup-form")[0],In=window.innerWidth/2-Rn.offsetWidth/2,Pn=window.innerHeight/2-Rn.offsetHeight/2;li(In),Di(Pn)},0)},[cn]);const yr=Rn=>{Rn.preventDefault();const In=Rn.clientX-Jn,Pn=Rn.clientY-Qn;document.body.onmousemove=Xn=>{let qi=Xn.clientX-In,hr=Xn.clientY-Pn;const br=document.getElementsByClassName("markdown-popup-form")[0],mr=window.innerWidth-br.offsetWidth,ar=window.innerHeight-br.offsetHeight;qi=Math.max(0,Math.min(qi,mr)),hr=Math.max(0,Math.min(hr,ar)),pr(Xn.clientX,Xn.clientY,In,Pn)&&(li(qi),Di(hr))},document.body.onmouseup=function(){document.body.onmousemove=null}},pr=(Rn,In,Pn,Xn)=>{const qi=document.body.clientHeight,hr=document.body.clientWidth;return Rn<20&&Pn>Rn||Rn>hr-20&&Pn<Rn||In<20&&Xn>In||In>qi-20&&Xn<In?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return we.createElement(we.Fragment,null,we.createElement("div",{className:"markdown-editor-wrapper",ref:ai},we.createElement("div",{className:`markdown-editor-container ${jt} ${_t?"on-preview":""} ${mi?"mini":""} ${At?"full-screen":""}`,style:Ai},we.createElement(Xe,{insertTemp:Pe,watch:_t,fullScreen:At,showNullButton:kt,showNullProgramButton:yt,onActionCallback:Ui,hidetoolBar:Dt,extraUse:ln}),we.createElement("div",{className:"markdown-editor-body"},we.createElement("div",{className:"codemirror-container"},we.createElement("textarea",{ref:Hi,placeholder:Cn})),_t?we.createElement("div",{ref:fn,className:"preview-container"},Le==="stex"&&we.createElement(Ie,{value:Mt}),Le!=="stex"&&we.createElement(ht.Z,{edit:!0,disabledFill:Tn,showProgramFill:yt,value:Mt,openEditor:Rn=>{var In;ri.current=Rn,(In=jn.current)==null||In.setHeight("100vh"),setTimeout(()=>{xn("add-flowchart")},150)}})):null))),Ke?we.createElement("a",{ref:wn,className:"editor-resize"}):null,cn===Lt&&we.createElement(an,{callback:Ii,onCancel:Gn}),cn===vt&&we.createElement(fe,{ref:jn,editImgId:ri.current,callback:Ii,onCancel:Gn}),we.createElement(bt.Z,null,ir[cn]&&cn!==Lt&&cn!==vt?we.createElement(Ge.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Jn,top:Qn},title:we.createElement("div",{style:{cursor:"move"},onMouseDown:yr},ir[cn]),open:!0,onCancel:Gn,footer:null,destroyOnClose:!0,width:cn===vt?"1200px":null,height:cn===vt?"80vh":null,className:"markdown-popup-form"},fr):null))}},58448:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ve},I:function(){return bt}});var we=he(78241),ct=he(8591),Re=he(92832),st=he(81327),Se=he(5871),Be=he(5112),Oe=he(3113),Ce=he(79090),Me=he(59301),Ne=he(7544),ht=he(59301),Ie=Object.defineProperty,He=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,Et=(je,It,at)=>It in je?Ie(je,It,{enumerable:!0,configurable:!0,writable:!0,value:at}):je[It]=at,Zt=(je,It)=>{for(var at in It||(It={}))ot.call(It,at)&&Et(je,at,It[at]);if(Ye)for(var at of Ye(It))rt.call(It,at)&&Et(je,at,It[at]);return je},Je=(je,It)=>He(je,mt(It));const{useForm:lt}=we.default,We={width:280,marginRight:10},Ee={labelCol:{span:5},wrapperCol:{span:19}};var Ve=({callback:je,onCancel:It})=>{const[at]=lt();let Ct=(0,Me.useRef)();function qe(Vt){Ct.current.width=at.getFieldValue("width"),Ct.current.align=at.getFieldValue("align"),je(Vt,Ct.current)}function Nt(Vt,Gt){if(Vt.status===-1){ct.ZP.error(Vt.message);return}at.setFieldsValue({src:`/api/attachments/${Vt.id}`,type:Gt.type})}function Qt(Vt){let Gt=Vt.target.files[0];Ct.current=Gt,bt(Gt,Nt)}return ht.createElement(we.default,Je(Zt({form:at},Ee),{className:"upload-image-panel",onFinish:qe,style:{width:470,overflow:"hidden"}}),ht.createElement(we.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},ht.createElement("div",{className:"flex-container"},ht.createElement(we.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},ht.createElement(Re.default,{style:We})),ht.createElement(Xe,{onFileChange:Qt}))),ht.createElement(we.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},ht.createElement(Re.default,{style:{width:264}})),ht.createElement(we.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},ht.createElement(st.Z,null,ht.createElement(we.default.Item,{name:"width",style:{margin:0}},ht.createElement(Se.Z,{style:{width:264}})),ht.createElement("span",{className:"ml8"},"%"))),ht.createElement(we.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},ht.createElement(Be.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),ht.createElement("aside",null,ht.createElement(we.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},ht.createElement(Oe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ht.createElement(Oe.ZP,{type:"default",onClick:It},"\u53D6\u6D88"))))};function Xe({onFileChange:je}){return ht.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",ht.createElement("input",{type:"file",onChange:je}))}function bt(je,It){if(!je)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Ne.bg)())throw ct.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let at=new FormData;at.append("editormd-image-file",je),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var Ct=new window.XMLHttpRequest;Ct.withCredentials=!0,Ct.addEventListener("load",function(qe){It(JSON.parse(qe.target.responseText),je)},!1),Ct.addEventListener("error",function(qe){console.error(qe)},!1),Ct.open("POST",`${Ce.KI}/api/attachments.json`),Ct.send(at)}},53531:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Re}});var we=he(59301),ct=he(4676);class Re extends we.Component{constructor(Se){super(Se);const Be=window.document;this.node=Be.createElement("div"),Be.body.appendChild(this.node)}render(){const{children:Se}=this.props;return(0,ct.createPortal)(Se,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},57649:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return ct}});var we=he(59301);function ct(Re,st){const Se=(0,we.useRef)();(0,we.useEffect)(()=>{Se.current=Re}),(0,we.useEffect)(()=>{function Be(){Se.current()}if(st!==null){let Oe=setInterval(Be,st);return()=>clearInterval(Oe)}},[st])}},41405:function(mn,rn,he){"use strict";he.r(rn);var we=he(59301),ct=he(91482),Re=he(79769),st=he(78241),Se=he(8591),Be=he(95237),Oe=he(43604),Ce=he(92832),Me=he(57809),Ne=he(3113),ht=he(7544),Ie=he(40973),He=Object.defineProperty,mt=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Zt=(Xe,bt,je)=>bt in Xe?He(Xe,bt,{enumerable:!0,configurable:!0,writable:!0,value:je}):Xe[bt]=je,Je=(Xe,bt)=>{for(var je in bt||(bt={}))rt.call(bt,je)&&Zt(Xe,je,bt[je]);if(ot)for(var je of ot(bt))Et.call(bt,je)&&Zt(Xe,je,bt[je]);return Xe},lt=(Xe,bt)=>mt(Xe,Ye(bt)),We=(Xe,bt)=>{var je={};for(var It in Xe)rt.call(Xe,It)&&bt.indexOf(It)<0&&(je[It]=Xe[It]);if(Xe!=null&&ot)for(var It of ot(Xe))bt.indexOf(It)<0&&Et.call(Xe,It)&&(je[It]=Xe[It]);return je},Ee=(Xe,bt,je)=>new Promise((It,at)=>{var Ct=Qt=>{try{Nt(je.next(Qt))}catch(Vt){at(Vt)}},qe=Qt=>{try{Nt(je.throw(Qt))}catch(Vt){at(Vt)}},Nt=Qt=>Qt.done?It(Qt.value):Promise.resolve(Qt.value).then(Ct,qe);Nt((je=je.apply(Xe,bt)).next())});const Ve=Xe=>{var bt=Xe,{user:je,globalSetting:It,loading:at,dispatch:Ct,restful:qe}=bt,Nt=We(bt,["user","globalSetting","loading","dispatch","restful"]),Qt,Vt,Gt;const[Ft,Fe]=(0,we.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),[xe,ft]=(0,we.useState)(!0),{params:qt}=Nt.match,[Ot]=st.default.useForm(),[Ue,Ge]=(0,we.useState)(`
##### \u7B80\u8981\u63CF\u8FF0
- \u7528\u6237\u6CE8\u518C\u63A5\u53E3
##### \u8BF7\u6C42URL
- \` http://xx.com/api/user/register \`
##### \u8BF7\u6C42\u65B9\u5F0F
- POST
##### \u53C2\u6570
|\u53C2\u6570\u540D|\u5FC5\u9009|\u7C7B\u578B|\u8BF4\u660E|
|:---- |:---|:----- |----- |
|username |\u662F |string |\u7528\u6237\u540D |
|password |\u662F |string | \u5BC6\u7801 |
|name |\u5426 |string | \u6635\u79F0 |
##### \u8FD4\u56DE\u793A\u4F8B
\`\`\`
{
"error_code": 0,
"data": {
"uid": "1",
"username": "12154545",
"name": "\u5434\u7CFB\u6302",
"groupid": 2 ,
"reg_time": "1436864169",
"last_login_time": "0",
}
}
\`\`\`
##### \u8FD4\u56DE\u53C2\u6570\u8BF4\u660E
|\u53C2\u6570\u540D|\u7C7B\u578B|\u8BF4\u660E|
|:----- |:-----|----- |
|groupid |int |\u7528\u6237\u7EC4id\uFF0C1\uFF1A\u8D85\u7EA7\u7BA1\u7406\u5458\uFF1B2\uFF1A\u666E\u901A\u7528\u6237 |
##### \u5907\u6CE8
- \u66F4\u591A\u8FD4\u56DE\u9519\u8BEF\u4EE3\u7801\u8BF7\u770B\u9996\u9875\u7684\u9519\u8BEF\u4EE3\u7801\u63CF\u8FF0
\u6B22\u8FCE\u4F7F\u7528\uFF01`);(0,we.useEffect)(()=>{Ot.resetFields()},[qt.id]);const wt=Rt=>Ee(void 0,null,function*(){const an=yield Ot.getFieldsValue();let $t="/api/restfuls.json";qt.id!=0&&($t=`/api/restfuls/${qt.id}.json`);const Bt=yield(0,Re.ZP)($t,{method:qt.id!=0?"put":"post",body:lt(Je({file_type:0},an),{parent_id:an.parent_id||""})});Bt.status===0&&(Se.ZP.success("\u6DFB\u52A0\u6210\u529F"),Nt.history.push(`/ch/rest/${Bt.data.id}`))}),dn=()=>Ee(void 0,null,function*(){if(yield Ct({type:"restful/getRestful"}),qt.id!=0){const Rt=yield Ct({type:"restful/getRestfulDetail",payload:Je({},qt)});Ot.setFieldsValue({description:Rt==null?void 0:Rt.description,name:Rt==null?void 0:Rt.name}),(0,ht.ag)()||Nt.history.replace("/403")}});return(0,we.useEffect)(()=>{var Rt,an,$t;(Rt=qe.restful)!=null&&Rt.data&&Ot.setFieldsValue({parent_id:qt.categoryId*1}),(an=qe.restfulDetail)!=null&&an.description&&qt.id!=0&&Ge(($t=qe.restfulDetail)==null?void 0:$t.description)},[qe.restful,(Qt=qe.restfulDetail)==null?void 0:Qt.description]),(0,we.useEffect)(()=>{ft(!0),dn()},[qt.id]),we.createElement("section",null,we.createElement("aside",{className:"edu-container mt30"},we.createElement(st.default,{onFinish:wt,form:Ot,initialValues:{name:""}},we.createElement(Be.Z,{className:"mt30"},we.createElement(Oe.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),we.createElement(Oe.Z,{flex:"1"},we.createElement(st.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},we.createElement(Ce.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
`,maxLength:60})))),we.createElement(Be.Z,{className:""},we.createElement(Oe.Z,{flex:"80px",className:"font14"},"\u6240\u5C5E\u76EE\u5F55:"),we.createElement(Oe.Z,{flex:"1"},we.createElement(st.default.Item,{name:"parent_id",rules:[{required:!0,message:"\u6240\u5C5E\u76EE\u5F55"}]},we.createElement(Me.default,{showSearch:!0,style:{width:200},placeholder:"\u8BF7\u9009\u62E9\u76EE\u5F55",optionFilterProp:"children",filterOption:(Rt,an)=>an.children.toLowerCase().indexOf(Rt.toLowerCase())>=0},we.createElement(Me.default.Option,{value:0,key:9999},"\u6839\u76EE\u5F55"),(Gt=(Vt=qe==null?void 0:qe.restful)==null?void 0:Vt.data)==null?void 0:Gt.map((Rt,an)=>we.createElement(Me.default.Option,{value:Rt.id,key:an},Rt.title)))))),we.createElement(st.default.Item,{name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},we.createElement(Ie.Z,{defaultValue:Ue,watch:!0,height:600})),we.createElement(Be.Z,{align:"middle",justify:"center"},we.createElement(Oe.Z,null,we.createElement(Ne.ZP,{style:{width:130},size:"middle",type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))),we.createElement("div",{className:"mt40"}))))};rn.default=(0,ct.connect)(({user:Xe,loading:bt,globalSetting:je,restful:It})=>({user:Xe,globalSetting:je,restful:It,loading:bt.models.index}))(Ve)},19080:function(mn,rn,he){"use strict";he.d(rn,{F:function(){return Se},Z:function(){return st}});var we=he(92310),ct=he.n(we);const Re=null;function st(Be,Oe,Ce){return ct()({[`${Be}-status-success`]:Oe==="success",[`${Be}-status-warning`]:Oe==="warning",[`${Be}-status-error`]:Oe==="error",[`${Be}-status-validating`]:Oe==="validating",[`${Be}-has-feedback`]:Ce})}const Se=(Be,Oe)=>Oe||Be},93891:function(mn,rn,he){"use strict";var we=he(59301),ct=he(36355),Re=he(64165);const st=Se=>{const{componentName:Be}=Se,{getPrefixCls:Oe}=(0,we.useContext)(ct.E_),Ce=Oe("empty");switch(Be){case"Table":case"List":return we.createElement(Re.Z,{image:Re.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return we.createElement(Re.Z,{image:Re.Z.PRESENTED_IMAGE_SIMPLE,className:`${Ce}-small`});default:return we.createElement(Re.Z,null)}};rn.Z=st},43428:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return $t}});var we=he(92310),ct=he.n(we),Re=he(85899),st=he(72190),Se=he(43403),Be=he(34280),Oe=he(59301),Ce=Oe.createContext(null),Me=Oe.createContext({}),Ne=Ce,ht=he(18642),Ie=he(60499),He=he(77900),mt=he(10228),Ye=he(26112),ot=he(70425),rt=function(Tt){var ge=Tt.prefixCls,se=Tt.className,oe=Tt.style,fe=Tt.children,ve=Tt.containerRef,ce=Tt.id,$e=Tt.onMouseEnter,xt=Tt.onMouseOver,Ut=Tt.onMouseLeave,Ht=Tt.onClick,Jt=Tt.onKeyDown,en=Tt.onKeyUp,hn={onMouseEnter:$e,onMouseOver:xt,onMouseLeave:Ut,onClick:Ht,onKeyDown:Jt,onKeyUp:en},pn=Oe.useContext(Me),bn=pn.panel,pt=(0,ot.useComposeRef)(bn,ve);return Oe.createElement(Oe.Fragment,null,Oe.createElement("div",(0,Ie.Z)({id:ce,className:ct()("".concat(ge,"-content"),se),style:(0,Re.Z)({},oe),"aria-modal":"true",role:"dialog",ref:pt},hn),fe))},Et=rt,Zt=he(48736);function Je(Bt){return typeof Bt=="string"&&String(Number(Bt))===Bt?((0,Zt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Bt)):Bt}function lt(Bt){warning(!("wrapperClassName"in Bt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Bt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var We={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ee(Bt,Tt){var ge,se,oe,fe,ve=Bt.prefixCls,ce=Bt.open,$e=Bt.placement,xt=Bt.inline,Ut=Bt.push,Ht=Bt.forceRender,Jt=Bt.autoFocus,en=Bt.keyboard,hn=Bt.rootClassName,pn=Bt.rootStyle,bn=Bt.zIndex,pt=Bt.className,sn=Bt.id,zn=Bt.style,tt=Bt.motion,vt=Bt.width,Lt=Bt.height,Ln=Bt.children,Mn=Bt.contentWrapperStyle,_n=Bt.mask,ti=Bt.maskClosable,hi=Bt.maskMotion,pi=Bt.maskClassName,Bi=Bt.maskStyle,_i=Bt.afterOpenChange,Zn=Bt.onClose,Fi=Bt.onMouseEnter,Wi=Bt.onMouseOver,Gi=Bt.onMouseLeave,nr=Bt.onClick,Pi=Bt.onKeyDown,Yi=Bt.onKeyUp,bi=Oe.useRef(),ji=Oe.useRef(),Ji=Oe.useRef();Oe.useImperativeHandle(Tt,function(){return bi.current});var Vi=function(yt){var Dt=yt.keyCode,Xt=yt.shiftKey;switch(Dt){case mt.Z.TAB:{if(Dt===mt.Z.TAB){if(!Xt&&document.activeElement===Ji.current){var tn;(tn=ji.current)===null||tn===void 0||tn.focus({preventScroll:!0})}else if(Xt&&document.activeElement===ji.current){var un;(un=Ji.current)===null||un===void 0||un.focus({preventScroll:!0})}}break}case mt.Z.ESC:{Zn&&en&&(yt.stopPropagation(),Zn(yt));break}}};Oe.useEffect(function(){if(ce&&Jt){var kt;(kt=bi.current)===null||kt===void 0||kt.focus({preventScroll:!0})}},[ce]);var ir=Oe.useState(!1),$i=(0,st.Z)(ir,2),si=$i[0],fi=$i[1],kn=Oe.useContext(Ne),Dn;Ut===!1?Dn={distance:0}:Ut===!0?Dn={}:Dn=Ut||{};var mi=(ge=(se=(oe=Dn)===null||oe===void 0?void 0:oe.distance)!==null&&se!==void 0?se:kn==null?void 0:kn.pushDistance)!==null&&ge!==void 0?ge:180,Qe=Oe.useMemo(function(){return{pushDistance:mi,push:function(){fi(!0)},pull:function(){fi(!1)}}},[mi]);Oe.useEffect(function(){if(ce){var kt;kn==null||(kt=kn.push)===null||kt===void 0||kt.call(kn)}else{var yt;kn==null||(yt=kn.pull)===null||yt===void 0||yt.call(kn)}},[ce]),Oe.useEffect(function(){return function(){var kt;kn==null||(kt=kn.pull)===null||kt===void 0||kt.call(kn)}},[]);var ke=_n&&Oe.createElement(He.default,(0,Ie.Z)({key:"mask"},hi,{visible:ce}),function(kt,yt){var Dt=kt.className,Xt=kt.style;return Oe.createElement("div",{className:ct()("".concat(ve,"-mask"),Dt,pi),style:(0,Re.Z)((0,Re.Z)({},Xt),Bi),onClick:ti&&ce?Zn:void 0,ref:yt})}),Pe=typeof tt=="function"?tt($e):tt,Le={};if(si&&mi)switch($e){case"top":Le.transform="translateY(".concat(mi,"px)");break;case"bottom":Le.transform="translateY(".concat(-mi,"px)");break;case"left":Le.transform="translateX(".concat(mi,"px)");break;default:Le.transform="translateX(".concat(-mi,"px)");break}$e==="left"||$e==="right"?Le.width=Je(vt):Le.height=Je(Lt);var De={onMouseEnter:Fi,onMouseOver:Wi,onMouseLeave:Gi,onClick:nr,onKeyDown:Pi,onKeyUp:Yi},Ke=Oe.createElement(He.default,(0,Ie.Z)({key:"panel"},Pe,{visible:ce,forceRender:Ht,onVisibleChanged:function(yt){_i==null||_i(yt)},removeOnLeave:!1,leavedClassName:"".concat(ve,"-content-wrapper-hidden")}),function(kt,yt){var Dt=kt.className,Xt=kt.style;return Oe.createElement("div",(0,Ie.Z)({className:ct()("".concat(ve,"-content-wrapper"),Dt),style:(0,Re.Z)((0,Re.Z)((0,Re.Z)({},Le),Xt),Mn)},(0,Ye.Z)(Bt,{data:!0})),Oe.createElement(Et,(0,Ie.Z)({id:sn,containerRef:yt,prefixCls:ve,className:pt,style:zn},De),Ln))}),it=(0,Re.Z)({},pn);return bn&&(it.zIndex=bn),Oe.createElement(Ne.Provider,{value:Qe},Oe.createElement("div",{className:ct()(ve,"".concat(ve,"-").concat($e),hn,(fe={},(0,ht.Z)(fe,"".concat(ve,"-open"),ce),(0,ht.Z)(fe,"".concat(ve,"-inline"),xt),fe)),style:it,tabIndex:-1,ref:bi,onKeyDown:Vi},ke,Oe.createElement("div",{tabIndex:0,ref:ji,style:We,"aria-hidden":"true","data-sentinel":"start"}),Ke,Oe.createElement("div",{tabIndex:0,ref:Ji,style:We,"aria-hidden":"true","data-sentinel":"end"})))}var Ve=Oe.forwardRef(Ee),Xe=Ve,bt=function(Tt){var ge=Tt.open,se=ge===void 0?!1:ge,oe=Tt.prefixCls,fe=oe===void 0?"rc-drawer":oe,ve=Tt.placement,ce=ve===void 0?"right":ve,$e=Tt.autoFocus,xt=$e===void 0?!0:$e,Ut=Tt.keyboard,Ht=Ut===void 0?!0:Ut,Jt=Tt.width,en=Jt===void 0?378:Jt,hn=Tt.mask,pn=hn===void 0?!0:hn,bn=Tt.maskClosable,pt=bn===void 0?!0:bn,sn=Tt.getContainer,zn=Tt.forceRender,tt=Tt.afterOpenChange,vt=Tt.destroyOnClose,Lt=Tt.onMouseEnter,Ln=Tt.onMouseOver,Mn=Tt.onMouseLeave,_n=Tt.onClick,ti=Tt.onKeyDown,hi=Tt.onKeyUp,pi=Tt.panelRef,Bi=Oe.useState(!1),_i=(0,st.Z)(Bi,2),Zn=_i[0],Fi=_i[1],Wi=Oe.useState(!1),Gi=(0,st.Z)(Wi,2),nr=Gi[0],Pi=Gi[1];(0,Be.Z)(function(){Pi(!0)},[]);var Yi=nr?se:!1,bi=Oe.useRef(),ji=Oe.useRef();(0,Be.Z)(function(){Yi&&(ji.current=document.activeElement)},[Yi]);var Ji=function(fi){var kn;if(Fi(fi),tt==null||tt(fi),!fi&&ji.current&&!((kn=bi.current)!==null&&kn!==void 0&&kn.contains(ji.current))){var Dn;(Dn=ji.current)===null||Dn===void 0||Dn.focus({preventScroll:!0})}},Vi=Oe.useMemo(function(){return{panel:pi}},[pi]);if(!zn&&!Zn&&!Yi&&vt)return null;var ir={onMouseEnter:Lt,onMouseOver:Ln,onMouseLeave:Mn,onClick:_n,onKeyDown:ti,onKeyUp:hi},$i=(0,Re.Z)((0,Re.Z)({},Tt),{},{open:Yi,prefixCls:fe,placement:ce,autoFocus:xt,keyboard:Ht,width:en,mask:pn,maskClosable:pt,inline:sn===!1,afterOpenChange:Ji,ref:bi},ir);return Oe.createElement(Me.Provider,{value:Vi},Oe.createElement(Se.Z,{open:Yi||zn||Zn,autoDestroy:!1,getContainer:sn,autoLock:pn&&(Yi||Zn)},Oe.createElement(Xe,$i)))},je=bt,It=je,at=he(62892),Ct=he(36355),qe=he(32441),Nt=he(47729),Vt=Bt=>{const{prefixCls:Tt,title:ge,footer:se,extra:oe,closeIcon:fe,closable:ve,onClose:ce,headerStyle:$e,drawerStyle:xt,bodyStyle:Ut,footerStyle:Ht,children:Jt}=Bt,en=Oe.useCallback(sn=>Oe.createElement("button",{type:"button",onClick:ce,"aria-label":"Close",className:`${Tt}-close`},sn),[ce]),[hn,pn]=(0,Nt.Z)(ve,fe,en,void 0,!0),bn=Oe.useMemo(()=>!ge&&!hn?null:Oe.createElement("div",{style:$e,className:ct()(`${Tt}-header`,{[`${Tt}-header-close-only`]:hn&&!ge&&!oe})},Oe.createElement("div",{className:`${Tt}-header-title`},pn,ge&&Oe.createElement("div",{className:`${Tt}-title`},ge)),oe&&Oe.createElement("div",{className:`${Tt}-extra`},oe)),[hn,pn,oe,$e,Tt,ge]),pt=Oe.useMemo(()=>{if(!se)return null;const sn=`${Tt}-footer`;return Oe.createElement("div",{className:sn,style:Ht},se)},[se,Ht,Tt]);return Oe.createElement("div",{className:`${Tt}-wrapper-body`,style:xt},bn,Oe.createElement("div",{className:`${Tt}-body`,style:Ut},Jt),pt)},Gt=he(33234),Ft=he(83116),Fe=he(37613),ft=Bt=>{const{componentCls:Tt,motionDurationSlow:ge}=Bt,se={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ge}`}}};return{[Tt]:{[`${Tt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ge}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${Tt}-panel-motion`]:{"&-left":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const qt=Bt=>{const{componentCls:Tt,zIndexPopup:ge,colorBgMask:se,colorBgElevated:oe,motionDurationSlow:fe,motionDurationMid:ve,padding:ce,paddingLG:$e,fontSizeLG:xt,lineHeightLG:Ut,lineWidth:Ht,lineType:Jt,colorSplit:en,marginSM:hn,colorIcon:pn,colorIconHover:bn,colorText:pt,fontWeightStrong:sn,footerPaddingBlock:zn,footerPaddingInline:tt}=Bt,vt=`${Tt}-content-wrapper`;return{[Tt]:{position:"fixed",inset:0,zIndex:ge,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${Tt}-left`]:{boxShadow:Bt.boxShadowDrawerLeft},[`&${Tt}-right`]:{boxShadow:Bt.boxShadowDrawerRight},[`&${Tt}-top`]:{boxShadow:Bt.boxShadowDrawerUp},[`&${Tt}-bottom`]:{boxShadow:Bt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${Tt}-mask`]:{position:"absolute",inset:0,zIndex:ge,background:se,pointerEvents:"auto"},[vt]:{position:"absolute",zIndex:ge,maxWidth:"100vw",transition:`all ${fe}`,"&-hidden":{display:"none"}},[`&-left > ${vt}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Bt.boxShadowDrawerLeft},[`&-right > ${vt}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Bt.boxShadowDrawerRight},[`&-top > ${vt}`]:{top:0,insetInline:0,boxShadow:Bt.boxShadowDrawerUp},[`&-bottom > ${vt}`]:{bottom:0,insetInline:0,boxShadow:Bt.boxShadowDrawerDown},[`${Tt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:oe,pointerEvents:"auto"},[`${Tt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${Tt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${ce}px ${$e}px`,fontSize:xt,lineHeight:Ut,borderBottom:`${Ht}px ${Jt} ${en}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${Tt}-extra`]:{flex:"none"},[`${Tt}-close`]:{display:"inline-block",marginInlineEnd:hn,color:pn,fontWeight:sn,fontSize:xt,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${ve}`,textRendering:"auto","&:focus, &:hover":{color:bn,textDecoration:"none"}},[`${Tt}-title`]:{flex:1,margin:0,color:pt,fontWeight:Bt.fontWeightStrong,fontSize:xt,lineHeight:Ut},[`${Tt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:$e,overflow:"auto"},[`${Tt}-footer`]:{flexShrink:0,padding:`${zn}px ${tt}px`,borderTop:`${Ht}px ${Jt} ${en}`},"&-rtl":{direction:"rtl"}}}};var Ot=(0,Ft.Z)("Drawer",Bt=>{const Tt=(0,Fe.TS)(Bt,{});return[qt(Tt),ft(Tt)]},Bt=>({zIndexPopup:Bt.zIndexPopupBase,footerPaddingBlock:Bt.paddingXS,footerPaddingInline:Bt.padding})),Ue=he(11575),Ge=function(Bt,Tt){var ge={};for(var se in Bt)Object.prototype.hasOwnProperty.call(Bt,se)&&Tt.indexOf(se)<0&&(ge[se]=Bt[se]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,se=Object.getOwnPropertySymbols(Bt);oe<se.length;oe++)Tt.indexOf(se[oe])<0&&Object.prototype.propertyIsEnumerable.call(Bt,se[oe])&&(ge[se[oe]]=Bt[se[oe]]);return ge};const wt=null,dn={distance:180},Rt=Bt=>{var Tt;const{rootClassName:ge,width:se,height:oe,size:fe="default",mask:ve=!0,push:ce=dn,open:$e,afterOpenChange:xt,onClose:Ut,prefixCls:Ht,getContainer:Jt,style:en,className:hn,visible:pn,afterVisibleChange:bn}=Bt,pt=Ge(Bt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:sn,getPrefixCls:zn,direction:tt,drawer:vt}=Oe.useContext(Ct.E_),Lt=zn("drawer",Ht),[Ln,Mn]=Ot(Lt),_n=Jt===void 0&&sn?()=>sn(document.body):Jt,ti=ct()({"no-mask":!ve,[`${Lt}-rtl`]:tt==="rtl"},ge,Mn),hi=Oe.useMemo(()=>se!=null?se:fe==="large"?736:378,[se,fe]),pi=Oe.useMemo(()=>oe!=null?oe:fe==="large"?736:378,[oe,fe]),Bi={motionName:(0,at.m)(Lt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},_i=Fi=>({motionName:(0,at.m)(Lt,`panel-motion-${Fi}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Zn=(0,Ue.H)();return Ln(Oe.createElement(Gt.BR,null,Oe.createElement(qe.Ux,{status:!0,override:!0},Oe.createElement(It,Object.assign({prefixCls:Lt,onClose:Ut,maskMotion:Bi,motion:_i},pt,{open:$e!=null?$e:pn,mask:ve,push:ce,width:hi,height:pi,style:Object.assign(Object.assign({},vt==null?void 0:vt.style),en),className:ct()(vt==null?void 0:vt.className,hn),rootClassName:ti,getContainer:_n,afterOpenChange:xt!=null?xt:bn,panelRef:Zn}),Oe.createElement(Vt,Object.assign({prefixCls:Lt},pt,{onClose:Ut}))))))},an=Bt=>{const{prefixCls:Tt,style:ge,className:se,placement:oe="right"}=Bt,fe=Ge(Bt,["prefixCls","style","className","placement"]),{getPrefixCls:ve}=Oe.useContext(Ct.E_),ce=ve("drawer",Tt),[$e,xt]=Ot(ce),Ut=ct()(ce,`${ce}-pure`,`${ce}-${oe}`,xt,se);return $e(Oe.createElement("div",{className:Ut,style:ge},Oe.createElement(Vt,Object.assign({prefixCls:ce},fe))))};Rt._InternalPanelDoNotUseOrYouWillBeFired=an;var $t=Rt},64165:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Je}});var we=he(92310),ct=he.n(we),Re=he(59301),st=he(36355),Se=he(9763),Be=he(64993),Oe=he(88088),Me=()=>{const[,lt]=(0,Oe.Z)(),Ee=new Be.C(lt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Re.createElement("svg",{style:Ee,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("g",{fill:"none",fillRule:"evenodd"},Re.createElement("g",{transform:"translate(24 31.67)"},Re.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Re.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),Re.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),Re.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),Re.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),Re.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),Re.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Re.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Re.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},ht=()=>{const[,lt]=(0,Oe.Z)(),{colorFill:We,colorFillTertiary:Ee,colorFillQuaternary:Ve,colorBgContainer:Xe}=lt,{borderColor:bt,shadowColor:je,contentColor:It}=(0,Re.useMemo)(()=>({borderColor:new Be.C(We).onBackground(Xe).toHexShortString(),shadowColor:new Be.C(Ee).onBackground(Xe).toHexShortString(),contentColor:new Be.C(Ve).onBackground(Xe).toHexShortString()}),[We,Ee,Ve,Xe]);return Re.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Re.createElement("ellipse",{fill:je,cx:"32",cy:"33",rx:"32",ry:"7"}),Re.createElement("g",{fillRule:"nonzero",stroke:bt},Re.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),Re.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:It}))))},Ie=he(83116),He=he(37613);const mt=lt=>{const{componentCls:We,margin:Ee,marginXS:Ve,marginXL:Xe,fontSize:bt,lineHeight:je}=lt;return{[We]:{marginInline:Ve,fontSize:bt,lineHeight:je,textAlign:"center",[`${We}-image`]:{height:lt.emptyImgHeight,marginBottom:Ve,opacity:lt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${We}-description`]:{color:lt.colorText},[`${We}-footer`]:{marginTop:Ee},"&-normal":{marginBlock:Xe,color:lt.colorTextDisabled,[`${We}-description`]:{color:lt.colorTextDisabled},[`${We}-image`]:{height:lt.emptyImgHeightMD}},"&-small":{marginBlock:Ve,color:lt.colorTextDisabled,[`${We}-image`]:{height:lt.emptyImgHeightSM}}}}};var Ye=(0,Ie.Z)("Empty",lt=>{const{componentCls:We,controlHeightLG:Ee}=lt,Ve=(0,He.TS)(lt,{emptyImgCls:`${We}-img`,emptyImgHeight:Ee*2.5,emptyImgHeightMD:Ee,emptyImgHeightSM:Ee*.875});return[mt(Ve)]}),ot=function(lt,We){var Ee={};for(var Ve in lt)Object.prototype.hasOwnProperty.call(lt,Ve)&&We.indexOf(Ve)<0&&(Ee[Ve]=lt[Ve]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ve=Object.getOwnPropertySymbols(lt);Xe<Ve.length;Xe++)We.indexOf(Ve[Xe])<0&&Object.prototype.propertyIsEnumerable.call(lt,Ve[Xe])&&(Ee[Ve[Xe]]=lt[Ve[Xe]]);return Ee};const rt=Re.createElement(Me,null),Et=Re.createElement(ht,null),Zt=lt=>{var{className:We,rootClassName:Ee,prefixCls:Ve,image:Xe=rt,description:bt,children:je,imageStyle:It,style:at}=lt,Ct=ot(lt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:qe,direction:Nt,empty:Qt}=Re.useContext(st.E_),Vt=qe("empty",Ve),[Gt,Ft]=Ye(Vt),[Fe]=(0,Se.Z)("Empty"),xe=typeof bt!="undefined"?bt:Fe==null?void 0:Fe.description,ft=typeof xe=="string"?xe:"empty";let qt=null;return typeof Xe=="string"?qt=Re.createElement("img",{alt:ft,src:Xe}):qt=Xe,Gt(Re.createElement("div",Object.assign({className:ct()(Ft,Vt,Qt==null?void 0:Qt.className,{[`${Vt}-normal`]:Xe===Et,[`${Vt}-rtl`]:Nt==="rtl"},We,Ee),style:Object.assign(Object.assign({},Qt==null?void 0:Qt.style),at)},Ct),Re.createElement("div",{className:`${Vt}-image`,style:It},qt),xe&&Re.createElement("div",{className:`${Vt}-description`},xe),je&&Re.createElement("div",{className:`${Vt}-footer`},je)))};Zt.PRESENTED_IMAGE_DEFAULT=rt,Zt.PRESENTED_IMAGE_SIMPLE=Et;var Je=Zt},78241:function(mn,rn,he){"use strict";he.d(rn,{default:function(){return mi}});var we=he(77654),ct=he(92310),Re=he.n(ct),st=he(77900),Se=he(59301),Be=he(62892),Oe=he(32441);function Ce(Qe){const[ke,Pe]=Se.useState(Qe);return Se.useEffect(()=>{const Le=setTimeout(()=>{Pe(Qe)},Qe.length?0:10);return()=>{clearTimeout(Le)}},[Qe]),ke}var Me=he(17313),Ne=he(29878),ht=he(8378),Ie=he(37613),He=he(83116),Ye=Qe=>{const{componentCls:ke}=Qe,Pe=`${ke}-show-help`,Le=`${ke}-show-help-item`;return{[Pe]:{transition:`opacity ${Qe.motionDurationSlow} ${Qe.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Le]:{overflow:"hidden",transition:`height ${Qe.motionDurationSlow} ${Qe.motionEaseInOut},
opacity ${Qe.motionDurationSlow} ${Qe.motionEaseInOut},
transform ${Qe.motionDurationSlow} ${Qe.motionEaseInOut} !important`,[`&${Le}-appear, &${Le}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Le}-leave-active`]:{transform:"translateY(-5px)"}}}}};const ot=Qe=>({legend:{display:"block",width:"100%",marginBottom:Qe.marginLG,padding:0,color:Qe.colorTextDescription,fontSize:Qe.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Qe.lineWidth}px ${Qe.lineType} ${Qe.colorBorder}`},label:{fontSize:Qe.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Qe.controlOutlineWidth}px ${Qe.controlOutline}`},output:{display:"block",paddingTop:15,color:Qe.colorText,fontSize:Qe.fontSize,lineHeight:Qe.lineHeight}}),rt=(Qe,ke)=>{const{formItemCls:Pe}=Qe;return{[Pe]:{[`${Pe}-label > label`]:{height:ke},[`${Pe}-control-input`]:{minHeight:ke}}}},Et=Qe=>{const{componentCls:ke}=Qe;return{[Qe.componentCls]:Object.assign(Object.assign(Object.assign({},(0,Me.Wf)(Qe)),ot(Qe)),{[`${ke}-text`]:{display:"inline-block",paddingInlineEnd:Qe.paddingSM},"&-small":Object.assign({},rt(Qe,Qe.controlHeightSM)),"&-large":Object.assign({},rt(Qe,Qe.controlHeightLG))})}},Zt=Qe=>{const{formItemCls:ke,iconCls:Pe,componentCls:Le,rootPrefixCls:De,labelRequiredMarkColor:Ke,labelColor:it,labelFontSize:kt,labelHeight:yt,labelColonMarginInlineStart:Dt,labelColonMarginInlineEnd:Xt,itemMarginBottom:tn}=Qe;return{[ke]:Object.assign(Object.assign({},(0,Me.Wf)(Qe)),{marginBottom:tn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${De}-row`]:{display:"none"},"&-has-warning":{[`${ke}-split`]:{color:Qe.colorError}},"&-has-error":{[`${ke}-split`]:{color:Qe.colorWarning}},[`${ke}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${Qe.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:yt,color:it,fontSize:kt,[`> ${Pe}`]:{fontSize:Qe.fontSize,verticalAlign:"top"},[`&${ke}-required:not(${ke}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:Qe.marginXXS,color:Ke,fontSize:Qe.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Le}-hide-required-mark &`]:{display:"none"}},[`${ke}-optional`]:{display:"inline-block",marginInlineStart:Qe.marginXXS,color:Qe.colorTextDescription,[`${Le}-hide-required-mark &`]:{display:"none"}},[`${ke}-tooltip`]:{color:Qe.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:Qe.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:Dt,marginInlineEnd:Xt},[`&${ke}-no-colon::after`]:{content:'"\\a0"'}}},[`${ke}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${De}-col-'"]):not([class*="' ${De}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:Qe.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[ke]:{"&-explain, &-extra":{clear:"both",color:Qe.colorTextDescription,fontSize:Qe.fontSize,lineHeight:Qe.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:Qe.controlHeightSM,transition:`color ${Qe.motionDurationMid} ${Qe.motionEaseOut}`},"&-explain":{"&-error":{color:Qe.colorError},"&-warning":{color:Qe.colorWarning}}},[`&-with-help ${ke}-explain`]:{height:"auto",opacity:1},[`${ke}-feedback-icon`]:{fontSize:Qe.fontSize,textAlign:"center",visibility:"visible",animationName:Ne.kr,animationDuration:Qe.motionDurationMid,animationTimingFunction:Qe.motionEaseOutBack,pointerEvents:"none","&-success":{color:Qe.colorSuccess},"&-error":{color:Qe.colorError},"&-warning":{color:Qe.colorWarning},"&-validating":{color:Qe.colorPrimary}}})}},Je=Qe=>{const{componentCls:ke,formItemCls:Pe}=Qe;return{[`${ke}-horizontal`]:{[`${Pe}-label`]:{flexGrow:0},[`${Pe}-control`]:{flex:"1 1 0",minWidth:0},[`${Pe}-label[class$='-24'], ${Pe}-label[class*='-24 ']`]:{[`& + ${Pe}-control`]:{minWidth:"unset"}}}}},lt=Qe=>{const{componentCls:ke,formItemCls:Pe}=Qe;return{[`${ke}-inline`]:{display:"flex",flexWrap:"wrap",[Pe]:{flex:"none",marginInlineEnd:Qe.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Pe}-label,
> ${Pe}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Pe}-label`]:{flex:"none"},[`${ke}-text`]:{display:"inline-block"},[`${Pe}-has-feedback`]:{display:"inline-block"}}}}},We=Qe=>({padding:Qe.verticalLabelPadding,margin:Qe.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Ee=Qe=>{const{componentCls:ke,formItemCls:Pe,rootPrefixCls:Le}=Qe;return{[`${Pe} ${Pe}-label`]:We(Qe),[ke]:{[Pe]:{flexWrap:"wrap",[`${Pe}-label, ${Pe}-control`]:{[`&:not([class*=" ${Le}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ve=Qe=>{const{componentCls:ke,formItemCls:Pe,rootPrefixCls:Le}=Qe;return{[`${ke}-vertical`]:{[Pe]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${ke}-item-control`]:{width:"100%"}}},[`${ke}-vertical ${Pe}-label,
.${Le}-col-24${Pe}-label,
.${Le}-col-xl-24${Pe}-label`]:We(Qe),[`@media (max-width: ${Qe.screenXSMax}px)`]:[Ee(Qe),{[ke]:{[`.${Le}-col-xs-24${Pe}-label`]:We(Qe)}}],[`@media (max-width: ${Qe.screenSMMax}px)`]:{[ke]:{[`.${Le}-col-sm-24${Pe}-label`]:We(Qe)}},[`@media (max-width: ${Qe.screenMDMax}px)`]:{[ke]:{[`.${Le}-col-md-24${Pe}-label`]:We(Qe)}},[`@media (max-width: ${Qe.screenLGMax}px)`]:{[ke]:{[`.${Le}-col-lg-24${Pe}-label`]:We(Qe)}}}},Xe=(Qe,ke)=>(0,Ie.TS)(Qe,{formItemCls:`${Qe.componentCls}-item`,rootPrefixCls:ke});var bt=(0,He.Z)("Form",(Qe,ke)=>{let{rootPrefixCls:Pe}=ke;const Le=Xe(Qe,Pe);return[Et(Le),Zt(Le),Ye(Le),Je(Le),lt(Le),Ve(Le),(0,ht.Z)(Le),Ne.kr]},Qe=>({labelRequiredMarkColor:Qe.colorError,labelColor:Qe.colorTextHeading,labelFontSize:Qe.fontSize,labelHeight:Qe.controlHeight,labelColonMarginInlineStart:Qe.marginXXS/2,labelColonMarginInlineEnd:Qe.marginXS,itemMarginBottom:Qe.marginLG,verticalLabelPadding:`0 0 ${Qe.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const je=[];function It(Qe,ke,Pe){let Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof Qe=="string"?Qe:`${ke}-${Le}`,error:Qe,errorStatus:Pe}}var Ct=Qe=>{let{help:ke,helpStatus:Pe,errors:Le=je,warnings:De=je,className:Ke,fieldId:it,onVisibleChanged:kt}=Qe;const{prefixCls:yt}=Se.useContext(Oe.Rk),Dt=`${yt}-item-explain`,[,Xt]=bt(yt),tn=(0,Se.useMemo)(()=>(0,Be.Z)(yt),[yt]),un=Ce(Le),gt=Ce(De),jt=Se.useMemo(()=>ke!=null?[It(ke,"help",Pe)]:[].concat((0,we.Z)(un.map((yn,Tn)=>It(yn,"error","error",Tn))),(0,we.Z)(gt.map((yn,Tn)=>It(yn,"warning","warning",Tn)))),[ke,Pe,un,gt]),Bn={};return it&&(Bn.id=`${it}_help`),Se.createElement(st.default,{motionDeadline:tn.motionDeadline,motionName:`${yt}-show-help`,visible:!!jt.length,onVisibleChanged:kt},yn=>{const{className:Tn,style:Cn}=yn;return Se.createElement("div",Object.assign({},Bn,{className:Re()(Dt,Tn,Ke,Xt),style:Cn,role:"alert"}),Se.createElement(st.CSSMotionList,Object.assign({keys:jt},(0,Be.Z)(yt),{motionName:`${yt}-show-help-item`,component:!1}),Yn=>{const{key:ln,error:Un,errorStatus:Ze,className:St,style:Mt}=Yn;return Se.createElement("div",{key:ln,className:Re()(St,{[`${Dt}-${Ze}`]:Ze}),style:Mt},Un)}))})},qe=he(95013),Nt=he(36355),Qt=he(1684),Vt=he(52946),Gt=he(19716),Ft=he(16722);const Fe=["parentNode"],xe="form_item";function ft(Qe){return Qe===void 0||Qe===!1?[]:Array.isArray(Qe)?Qe:[Qe]}function qt(Qe,ke){if(!Qe.length)return;const Pe=Qe.join("_");return ke?`${ke}_${Pe}`:Fe.includes(Pe)?`${xe}_${Pe}`:Pe}function Ot(Qe,ke,Pe,Le,De,Ke){let it=Le;return Ke!==void 0?it=Ke:Pe.validating?it="validating":Qe.length?it="error":ke.length?it="warning":(Pe.touched||De&&Pe.validated)&&(it="success"),it}function Ue(Qe){return ft(Qe).join("_")}function Ge(Qe){const[ke]=(0,qe.useForm)(),Pe=Se.useRef({}),Le=Se.useMemo(()=>Qe!=null?Qe:Object.assign(Object.assign({},ke),{__INTERNAL__:{itemRef:De=>Ke=>{const it=Ue(De);Ke?Pe.current[it]=Ke:delete Pe.current[it]}},scrollToField:function(De){let Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const it=ft(De),kt=qt(it,Le.__INTERNAL__.name),yt=kt?document.getElementById(kt):null;yt&&(0,Ft.Z)(yt,Object.assign({scrollMode:"if-needed",block:"nearest"},Ke))},getFieldInstance:De=>{const Ke=Ue(De);return Pe.current[Ke]}}),[Qe,ke]);return[Le]}var wt=he(28726),dn=function(Qe,ke){var Pe={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&ke.indexOf(Le)<0&&(Pe[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)ke.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Pe[Le[De]]=Qe[Le[De]]);return Pe};const Rt=(Qe,ke)=>{const Pe=Se.useContext(Qt.Z),{getPrefixCls:Le,direction:De,form:Ke}=Se.useContext(Nt.E_),{prefixCls:it,className:kt,rootClassName:yt,size:Dt,disabled:Xt=Pe,form:tn,colon:un,labelAlign:gt,labelWrap:jt,labelCol:Bn,wrapperCol:yn,hideRequiredMark:Tn,layout:Cn="horizontal",scrollToFirstError:Yn,requiredMark:ln,onFinishFailed:Un,name:Ze,style:St,feedbackIcons:Mt}=Qe,Kt=dn(Qe,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),_t=(0,Gt.Z)(Dt),Pt=Se.useContext(wt.Z),At=(0,Se.useMemo)(()=>ln!==void 0?ln:Ke&&Ke.requiredMark!==void 0?Ke.requiredMark:!Tn,[Tn,ln,Ke]),on=un!=null?un:Ke==null?void 0:Ke.colon,cn=Le("form",it),[xn,Vn]=bt(cn),ni=Re()(cn,`${cn}-${Cn}`,{[`${cn}-hide-required-mark`]:At===!1,[`${cn}-rtl`]:De==="rtl",[`${cn}-${_t}`]:_t},Vn,Ke==null?void 0:Ke.className,kt,yt),[gi]=Ge(tn),{__INTERNAL__:ii}=gi;ii.name=Ze;const Kn=(0,Se.useMemo)(()=>({name:Ze,labelAlign:gt,labelCol:Bn,labelWrap:jt,wrapperCol:yn,vertical:Cn==="vertical",colon:on,requiredMark:At,itemRef:ii.itemRef,form:gi,feedbackIcons:Mt}),[Ze,gt,Bn,yn,Cn,on,At,gi,Mt]);Se.useImperativeHandle(ke,()=>gi);const vi=(ci,Fn)=>{if(ci){let Jn={block:"nearest"};typeof ci=="object"&&(Jn=ci),gi.scrollToField(Fn,Jn)}},ui=ci=>{if(Un==null||Un(ci),ci.errorFields.length){const Fn=ci.errorFields[0].name;if(Yn!==void 0){vi(Yn,Fn);return}Ke&&Ke.scrollToFirstError!==void 0&&vi(Ke.scrollToFirstError,Fn)}};return xn(Se.createElement(Qt.n,{disabled:Xt},Se.createElement(Vt.q,{size:_t},Se.createElement(Oe.RV,Object.assign({},{validateMessages:Pt}),Se.createElement(Oe.q3.Provider,{value:Kn},Se.createElement(qe.default,Object.assign({id:Ze},Kt,{name:Ze,onFinishFailed:ui,form:gi,style:Object.assign(Object.assign({},Ke==null?void 0:Ke.style),St),className:ni})))))))};var $t=Se.forwardRef(Rt),Bt=he(41799),Tt=he(8654),ge=he(92343),se=he(11592);function oe(Qe){if(typeof Qe=="function")return Qe;const ke=(0,se.Z)(Qe);return ke.length<=1?ke[0]:ke}const fe=()=>{const{status:Qe,errors:ke=[],warnings:Pe=[]}=(0,Se.useContext)(Oe.aM);return{status:Qe,errors:ke,warnings:Pe}};fe.Context=Oe.aM;var ve=fe,ce=he(16089);function $e(Qe){const[ke,Pe]=Se.useState(Qe),Le=(0,Se.useRef)(null),De=(0,Se.useRef)([]),Ke=(0,Se.useRef)(!1);Se.useEffect(()=>(Ke.current=!1,()=>{Ke.current=!0,ce.Z.cancel(Le.current),Le.current=null}),[]);function it(kt){Ke.current||(Le.current===null&&(De.current=[],Le.current=(0,ce.Z)(()=>{Le.current=null,Pe(yt=>{let Dt=yt;return De.current.forEach(Xt=>{Dt=Xt(Dt)}),Dt})})),De.current.push(kt))}return[ke,it]}function xt(){const{itemRef:Qe}=Se.useContext(Oe.q3),ke=Se.useRef({});function Pe(Le,De){const Ke=De&&typeof De=="object"&&De.ref,it=Le.join("_");return(ke.current.name!==it||ke.current.originRef!==Ke)&&(ke.current.name=it,ke.current.originRef=Ke,ke.current.ref=(0,Tt.sQ)(Qe(Le),Ke)),ke.current.ref}return Pe}var Ut=he(29194),Ht=he(34280),Jt=he(2738),en=he(27382),hn=he(37028);const pn=Qe=>{const{formItemCls:ke}=Qe;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${ke}-control`]:{display:"flex"}}}};var bn=(0,He.b)(["Form","item-item"],(Qe,ke)=>{let{rootPrefixCls:Pe}=ke;const Le=Xe(Qe,Pe);return[pn(Le)]}),sn=Qe=>{const{prefixCls:ke,status:Pe,wrapperCol:Le,children:De,errors:Ke,warnings:it,_internalItemRender:kt,extra:yt,help:Dt,fieldId:Xt,marginBottom:tn,onErrorVisibleChanged:un}=Qe,gt=`${ke}-item`,jt=Se.useContext(Oe.q3),Bn=Le||jt.wrapperCol||{},yn=Re()(`${gt}-control`,Bn.className),Tn=Se.useMemo(()=>Object.assign({},jt),[jt]);delete Tn.labelCol,delete Tn.wrapperCol;const Cn=Se.createElement("div",{className:`${gt}-control-input`},Se.createElement("div",{className:`${gt}-control-input-content`},De)),Yn=Se.useMemo(()=>({prefixCls:ke,status:Pe}),[ke,Pe]),ln=tn!==null||Ke.length||it.length?Se.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},Se.createElement(Oe.Rk.Provider,{value:Yn},Se.createElement(Ct,{fieldId:Xt,errors:Ke,warnings:it,help:Dt,helpStatus:Pe,className:`${gt}-explain-connected`,onVisibleChanged:un})),!!tn&&Se.createElement("div",{style:{width:0,height:tn}})):null,Un={};Xt&&(Un.id=`${Xt}_extra`);const Ze=yt?Se.createElement("div",Object.assign({},Un,{className:`${gt}-extra`}),yt):null,St=kt&&kt.mark==="pro_table_render"&&kt.render?kt.render(Qe,{input:Cn,errorList:ln,extra:Ze}):Se.createElement(Se.Fragment,null,Cn,ln,Ze);return Se.createElement(Oe.q3.Provider,{value:Tn},Se.createElement(hn.Z,Object.assign({},Bn,{className:yn}),St),Se.createElement(bn,{prefixCls:ke}))},zn=he(61485),tt=he(31724),vt=he(9763),Lt=he(6848),Ln=function(Qe,ke){var Pe={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&ke.indexOf(Le)<0&&(Pe[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)ke.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Pe[Le[De]]=Qe[Le[De]]);return Pe};function Mn(Qe){return Qe?typeof Qe=="object"&&!Se.isValidElement(Qe)?Qe:{title:Qe}:null}var ti=Qe=>{let{prefixCls:ke,label:Pe,htmlFor:Le,labelCol:De,labelAlign:Ke,colon:it,required:kt,requiredMark:yt,tooltip:Dt}=Qe;var Xt;const[tn]=(0,vt.Z)("Form"),{vertical:un,labelAlign:gt,labelCol:jt,labelWrap:Bn,colon:yn}=Se.useContext(Oe.q3);if(!Pe)return null;const Tn=De||jt||{},Cn=Ke||gt,Yn=`${ke}-item-label`,ln=Re()(Yn,Cn==="left"&&`${Yn}-left`,Tn.className,{[`${Yn}-wrap`]:!!Bn});let Un=Pe;const Ze=it===!0||yn!==!1&&it!==!1;Ze&&!un&&typeof Pe=="string"&&Pe.trim()!==""&&(Un=Pe.replace(/[:|]\s*$/,""));const Mt=Mn(Dt);if(Mt){const{icon:At=Se.createElement(zn.Z,null)}=Mt,on=Ln(Mt,["icon"]),cn=Se.createElement(Lt.Z,Object.assign({},on),Se.cloneElement(At,{className:`${ke}-item-tooltip`,title:""}));Un=Se.createElement(Se.Fragment,null,Un,cn)}const Kt=yt==="optional",_t=typeof yt=="function";_t?Un=yt(Un,{required:!!kt}):Kt&&!kt&&(Un=Se.createElement(Se.Fragment,null,Un,Se.createElement("span",{className:`${ke}-item-optional`,title:""},(tn==null?void 0:tn.optional)||((Xt=tt.Z.Form)===null||Xt===void 0?void 0:Xt.optional))));const Pt=Re()({[`${ke}-item-required`]:kt,[`${ke}-item-required-mark-optional`]:Kt||_t,[`${ke}-item-no-colon`]:!Ze});return Se.createElement(hn.Z,Object.assign({},Tn,{className:ln}),Se.createElement("label",{htmlFor:Le,className:Pt,title:typeof Pe=="string"?Pe:""},Un))},hi=he(29679),pi=he(19248),Bi=he(96512),_i=he(58617);const Zn={success:hi.Z,warning:Bi.Z,error:pi.Z,validating:_i.Z};function Fi(Qe){let{children:ke,errors:Pe,warnings:Le,hasFeedback:De,validateStatus:Ke,prefixCls:it,meta:kt,noStyle:yt}=Qe;const Dt=`${it}-item`,{feedbackIcons:Xt}=Se.useContext(Oe.q3),tn=Ot(Pe,Le,kt,null,!!De,Ke),{isFormItemInput:un,status:gt}=Se.useContext(Oe.aM),jt=Se.useMemo(()=>{var Bn;let yn;if(De){const Yn=De!==!0&&De.icons||Xt,ln=tn&&((Bn=Yn==null?void 0:Yn({status:tn,errors:Pe,warnings:Le}))===null||Bn===void 0?void 0:Bn[tn]),Un=tn&&Zn[tn];yn=ln!==!1&&Un?Se.createElement("span",{className:Re()(`${Dt}-feedback-icon`,`${Dt}-feedback-icon-${tn}`)},ln||Se.createElement(Un,null)):null}let Tn=!0,Cn=tn||"";return yt&&(Tn=un,Cn=(tn!=null?tn:gt)||""),{status:Cn,errors:Pe,warnings:Le,hasFeedback:!!De,feedbackIcon:yn,isFormItemInput:Tn}},[tn,De,yt,un,gt]);return Se.createElement(Oe.aM.Provider,{value:jt},ke)}var Wi=function(Qe,ke){var Pe={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&ke.indexOf(Le)<0&&(Pe[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)ke.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Pe[Le[De]]=Qe[Le[De]]);return Pe};function Gi(Qe){const{prefixCls:ke,className:Pe,rootClassName:Le,style:De,help:Ke,errors:it,warnings:kt,validateStatus:yt,meta:Dt,hasFeedback:Xt,hidden:tn,children:un,fieldId:gt,required:jt,isRequired:Bn,onSubItemMetaChange:yn}=Qe,Tn=Wi(Qe,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Cn=`${ke}-item`,{requiredMark:Yn}=Se.useContext(Oe.q3),ln=Se.useRef(null),Un=Ce(it),Ze=Ce(kt),St=Ke!=null,Mt=!!(St||it.length||kt.length),Kt=!!ln.current&&(0,Ut.Z)(ln.current),[_t,Pt]=Se.useState(null);(0,Ht.Z)(()=>{if(Mt&&ln.current){const Vn=getComputedStyle(ln.current);Pt(parseInt(Vn.marginBottom,10))}},[Mt,Kt]);const At=Vn=>{Vn||Pt(null)},cn=function(){let Vn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const ni=Vn?Un:Dt.errors,gi=Vn?Ze:Dt.warnings;return Ot(ni,gi,Dt,"",!!Xt,yt)}(),xn=Re()(Cn,Pe,Le,{[`${Cn}-with-help`]:St||Un.length||Ze.length,[`${Cn}-has-feedback`]:cn&&Xt,[`${Cn}-has-success`]:cn==="success",[`${Cn}-has-warning`]:cn==="warning",[`${Cn}-has-error`]:cn==="error",[`${Cn}-is-validating`]:cn==="validating",[`${Cn}-hidden`]:tn});return Se.createElement("div",{className:xn,style:De,ref:ln},Se.createElement(en.Z,Object.assign({className:`${Cn}-row`},(0,Jt.Z)(Tn,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),Se.createElement(ti,Object.assign({htmlFor:gt},Qe,{requiredMark:Yn,required:jt!=null?jt:Bn,prefixCls:ke})),Se.createElement(sn,Object.assign({},Qe,Dt,{errors:Un,warnings:Ze,prefixCls:ke,status:cn,help:Ke,marginBottom:_t,onErrorVisibleChanged:At}),Se.createElement(Oe.qI.Provider,{value:yn},Se.createElement(Fi,{prefixCls:ke,meta:Dt,errors:Dt.errors,warnings:Dt.warnings,hasFeedback:Xt,validateStatus:cn},un)))),!!_t&&Se.createElement("div",{className:`${Cn}-margin-offset`,style:{marginBottom:-_t}}))}const nr="__SPLIT__",Pi=null,Yi=Se.memo(Qe=>{let{children:ke}=Qe;return ke},(Qe,ke)=>Qe.value===ke.value&&Qe.update===ke.update&&Qe.childProps.length===ke.childProps.length&&Qe.childProps.every((Pe,Le)=>Pe===ke.childProps[Le]));function bi(Qe){return Qe!=null}function ji(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Ji(Qe){const{name:ke,noStyle:Pe,className:Le,dependencies:De,prefixCls:Ke,shouldUpdate:it,rules:kt,children:yt,required:Dt,label:Xt,messageVariables:tn,trigger:un="onChange",validateTrigger:gt,hidden:jt,help:Bn}=Qe,{getPrefixCls:yn}=Se.useContext(Nt.E_),{name:Tn}=Se.useContext(Oe.q3),Cn=oe(yt),Yn=typeof Cn=="function",ln=Se.useContext(Oe.qI),{validateTrigger:Un}=Se.useContext(qe.FieldContext),Ze=gt!==void 0?gt:Un,St=bi(ke),Mt=yn("form",Ke),[Kt,_t]=bt(Mt),Pt=Se.useContext(qe.ListContext),At=Se.useRef(),[on,cn]=$e({}),[xn,Vn]=(0,Bt.Z)(()=>ji()),ni=Fn=>{const Jn=Pt==null?void 0:Pt.getKey(Fn.name);if(Vn(Fn.destroy?ji():Fn,!0),Pe&&Bn!==!1&&ln){let li=Fn.name;if(Fn.destroy)li=At.current||li;else if(Jn!==void 0){const[Qn,Di]=Jn;li=[Qn].concat((0,we.Z)(Di)),At.current=li}ln(Fn,li)}},gi=(Fn,Jn)=>{cn(li=>{const Qn=Object.assign({},li),Hi=[].concat((0,we.Z)(Fn.name.slice(0,-1)),(0,we.Z)(Jn)).join(nr);return Fn.destroy?delete Qn[Hi]:Qn[Hi]=Fn,Qn})},[ii,Kn]=Se.useMemo(()=>{const Fn=(0,we.Z)(xn.errors),Jn=(0,we.Z)(xn.warnings);return Object.values(on).forEach(li=>{Fn.push.apply(Fn,(0,we.Z)(li.errors||[])),Jn.push.apply(Jn,(0,we.Z)(li.warnings||[]))}),[Fn,Jn]},[on,xn.errors,xn.warnings]),vi=xt();function ui(Fn,Jn,li){return Pe&&!jt?Se.createElement(Fi,{prefixCls:Mt,hasFeedback:Qe.hasFeedback,validateStatus:Qe.validateStatus,meta:xn,errors:ii,warnings:Kn,noStyle:!0},Fn):Se.createElement(Gi,Object.assign({key:"row"},Qe,{className:Re()(Le,_t),prefixCls:Mt,fieldId:Jn,isRequired:li,errors:ii,warnings:Kn,meta:xn,onSubItemMetaChange:gi}),Fn)}if(!St&&!Yn&&!De)return Kt(ui(Cn));let ci={};return typeof Xt=="string"?ci.label=Xt:ke&&(ci.label=String(ke)),tn&&(ci=Object.assign(Object.assign({},ci),tn)),Kt(Se.createElement(qe.Field,Object.assign({},Qe,{messageVariables:ci,trigger:un,validateTrigger:Ze,onMetaChange:ni}),(Fn,Jn,li)=>{const Qn=ft(ke).length&&Jn?Jn.name:[],Di=qt(Qn,Tn),Hi=Dt!==void 0?Dt:!!(kt&&kt.some(fn=>{if(fn&&typeof fn=="object"&&fn.required&&!fn.warningOnly)return!0;if(typeof fn=="function"){const ri=fn(li);return ri&&ri.required&&!ri.warningOnly}return!1})),ai=Object.assign({},Fn);let wn=null;if(Array.isArray(Cn)&&St)wn=Cn;else if(!(Yn&&(!(it||De)||St))){if(!(De&&!Yn&&!St))if((0,ge.l$)(Cn)){const fn=Object.assign(Object.assign({},Cn.props),ai);if(fn.id||(fn.id=Di),Bn||ii.length>0||Kn.length>0||Qe.extra){const yi=[];(Bn||ii.length>0)&&yi.push(`${Di}_help`),Qe.extra&&yi.push(`${Di}_extra`),fn["aria-describedby"]=yi.join(" ")}ii.length>0&&(fn["aria-invalid"]="true"),Hi&&(fn["aria-required"]="true"),(0,Tt.Yr)(Cn)&&(fn.ref=vi(Qn,Cn)),new Set([].concat((0,we.Z)(ft(un)),(0,we.Z)(ft(Ze)))).forEach(yi=>{fn[yi]=function(){for(var Ti,wi,Ui,Ii,fr,Gn=arguments.length,Hn=new Array(Gn),Mi=0;Mi<Gn;Mi++)Hn[Mi]=arguments[Mi];(Ui=ai[yi])===null||Ui===void 0||(Ti=Ui).call.apply(Ti,[ai].concat(Hn)),(fr=(Ii=Cn.props)[yi])===null||fr===void 0||(wi=fr).call.apply(wi,[Ii].concat(Hn))}});const jn=[fn["aria-required"],fn["aria-invalid"],fn["aria-describedby"]];wn=Se.createElement(Yi,{value:ai[Qe.valuePropName||"value"],update:Cn,childProps:jn},(0,ge.Tm)(Cn,fn))}else Yn&&(it||De)&&!St?wn=Cn(li):wn=Cn}return ui(wn,Di,Hi)}))}const Vi=Ji;Vi.useStatus=ve;var ir=Vi,$i=function(Qe,ke){var Pe={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&ke.indexOf(Le)<0&&(Pe[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)ke.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Pe[Le[De]]=Qe[Le[De]]);return Pe},fi=Qe=>{var{prefixCls:ke,children:Pe}=Qe,Le=$i(Qe,["prefixCls","children"]);const{getPrefixCls:De}=Se.useContext(Nt.E_),Ke=De("form",ke),it=Se.useMemo(()=>({prefixCls:Ke,status:"error"}),[Ke]);return Se.createElement(qe.List,Object.assign({},Le),(kt,yt,Dt)=>Se.createElement(Oe.Rk.Provider,{value:it},Pe(kt.map(Xt=>Object.assign(Object.assign({},Xt),{fieldKey:Xt.key})),yt,{errors:Dt.errors,warnings:Dt.warnings})))};function kn(){const{form:Qe}=(0,Se.useContext)(Oe.q3);return Qe}const Dn=$t;Dn.Item=ir,Dn.List=fi,Dn.ErrorList=Ct,Dn.useForm=Ge,Dn.useFormInstance=kn,Dn.useWatch=qe.useWatch,Dn.Provider=Oe.RV,Dn.create=()=>{};var mi=Dn},5871:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return zn}});var we=he(84105),ct=he(87395),Re=he(92310),st=he.n(Re),Se=he(60499),Be=he(18642),Oe=he(43749),Ce=he(72190),Me=he(42244),Ne=he(38705),ht=he(17212);function Ie(){return typeof BigInt=="function"}function He(tt){return!tt&&tt!==0&&!Number.isNaN(tt)||!String(tt).trim()}function mt(tt){var vt=tt.trim(),Lt=vt.startsWith("-");Lt&&(vt=vt.slice(1)),vt=vt.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),vt.startsWith(".")&&(vt="0".concat(vt));var Ln=vt||"0",Mn=Ln.split("."),_n=Mn[0]||"0",ti=Mn[1]||"0";_n==="0"&&ti==="0"&&(Lt=!1);var hi=Lt?"-":"";return{negative:Lt,negativeStr:hi,trimStr:Ln,integerStr:_n,decimalStr:ti,fullStr:"".concat(hi).concat(Ln)}}function Ye(tt){var vt=String(tt);return!Number.isNaN(Number(vt))&&vt.includes("e")}function ot(tt){var vt=String(tt);if(Ye(tt)){var Lt=Number(vt.slice(vt.indexOf("e-")+2)),Ln=vt.match(/\.(\d+)/);return Ln!=null&&Ln[1]&&(Lt+=Ln[1].length),Lt}return vt.includes(".")&&Et(vt)?vt.length-vt.indexOf(".")-1:0}function rt(tt){var vt=String(tt);if(Ye(tt)){if(tt>Number.MAX_SAFE_INTEGER)return String(Ie()?BigInt(tt).toString():Number.MAX_SAFE_INTEGER);if(tt<Number.MIN_SAFE_INTEGER)return String(Ie()?BigInt(tt).toString():Number.MIN_SAFE_INTEGER);vt=tt.toFixed(ot(vt))}return mt(vt).fullStr}function Et(tt){return typeof tt=="number"?!Number.isNaN(tt):tt?/^\s*-?\d+(\.\d+)?\s*$/.test(tt)||/^\s*-?\d+\.\s*$/.test(tt)||/^\s*-?\.\d+\s*$/.test(tt):!1}var Zt=function(){function tt(vt){if((0,Ne.Z)(this,tt),(0,Be.Z)(this,"origin",""),(0,Be.Z)(this,"negative",void 0),(0,Be.Z)(this,"integer",void 0),(0,Be.Z)(this,"decimal",void 0),(0,Be.Z)(this,"decimalLen",void 0),(0,Be.Z)(this,"empty",void 0),(0,Be.Z)(this,"nan",void 0),He(vt)){this.empty=!0;return}if(this.origin=String(vt),vt==="-"||Number.isNaN(vt)){this.nan=!0;return}var Lt=vt;if(Ye(Lt)&&(Lt=Number(Lt)),Lt=typeof Lt=="string"?Lt:rt(Lt),Et(Lt)){var Ln=mt(Lt);this.negative=Ln.negative;var Mn=Ln.trimStr.split(".");this.integer=BigInt(Mn[0]);var _n=Mn[1]||"0";this.decimal=BigInt(_n),this.decimalLen=_n.length}else this.nan=!0}return(0,ht.Z)(tt,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(Lt){var Ln="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Lt,"0"));return BigInt(Ln)}},{key:"negate",value:function(){var Lt=new tt(this.toString());return Lt.negative=!Lt.negative,Lt}},{key:"cal",value:function(Lt,Ln,Mn){var _n=Math.max(this.getDecimalStr().length,Lt.getDecimalStr().length),ti=this.alignDecimal(_n),hi=Lt.alignDecimal(_n),pi=Ln(ti,hi).toString(),Bi=Mn(_n),_i=mt(pi),Zn=_i.negativeStr,Fi=_i.trimStr,Wi="".concat(Zn).concat(Fi.padStart(Bi+1,"0"));return new tt("".concat(Wi.slice(0,-Bi),".").concat(Wi.slice(-Bi)))}},{key:"add",value:function(Lt){if(this.isInvalidate())return new tt(Lt);var Ln=new tt(Lt);return Ln.isInvalidate()?this:this.cal(Ln,function(Mn,_n){return Mn+_n},function(Mn){return Mn})}},{key:"multi",value:function(Lt){var Ln=new tt(Lt);return this.isInvalidate()||Ln.isInvalidate()?new tt(NaN):this.cal(Ln,function(Mn,_n){return Mn*_n},function(Mn){return Mn*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Lt){return this.toString()===(Lt==null?void 0:Lt.toString())}},{key:"lessEquals",value:function(Lt){return this.add(Lt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Lt?this.isInvalidate()?"":mt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),tt}(),Je=function(){function tt(vt){if((0,Ne.Z)(this,tt),(0,Be.Z)(this,"origin",""),(0,Be.Z)(this,"number",void 0),(0,Be.Z)(this,"empty",void 0),He(vt)){this.empty=!0;return}this.origin=String(vt),this.number=Number(vt)}return(0,ht.Z)(tt,[{key:"negate",value:function(){return new tt(-this.toNumber())}},{key:"add",value:function(Lt){if(this.isInvalidate())return new tt(Lt);var Ln=Number(Lt);if(Number.isNaN(Ln))return this;var Mn=this.number+Ln;if(Mn>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(Mn<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var _n=Math.max(ot(this.number),ot(Ln));return new tt(Mn.toFixed(_n))}},{key:"multi",value:function(Lt){var Ln=Number(Lt);if(this.isInvalidate()||Number.isNaN(Ln))return new tt(NaN);var Mn=this.number*Ln;if(Mn>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(Mn<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var _n=Math.max(ot(this.number),ot(Ln));return new tt(Mn.toFixed(_n))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Lt){return this.toNumber()===(Lt==null?void 0:Lt.toNumber())}},{key:"lessEquals",value:function(Lt){return this.add(Lt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Lt?this.isInvalidate()?"":rt(this.number):this.origin}}]),tt}();function lt(tt){return Ie()?new Zt(tt):new Je(tt)}function We(tt,vt,Lt){var Ln=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(tt==="")return"";var Mn=mt(tt),_n=Mn.negativeStr,ti=Mn.integerStr,hi=Mn.decimalStr,pi="".concat(vt).concat(hi),Bi="".concat(_n).concat(ti);if(Lt>=0){var _i=Number(hi[Lt]);if(_i>=5&&!Ln){var Zn=lt(tt).add("".concat(_n,"0.").concat("0".repeat(Lt)).concat(10-_i));return We(Zn.toString(),vt,Lt,Ln)}return Lt===0?Bi:"".concat(Bi).concat(vt).concat(hi.padEnd(Lt,"0").slice(0,Lt))}return pi===".0"?Bi:"".concat(Bi).concat(pi)}var Ee=lt,Ve=he(93681),Xe=he(34280),bt=he(8654),je=he(59301),It=he(48736);function at(tt,vt){var Lt=(0,je.useRef)(null);function Ln(){try{var _n=tt.selectionStart,ti=tt.selectionEnd,hi=tt.value,pi=hi.substring(0,_n),Bi=hi.substring(ti);Lt.current={start:_n,end:ti,value:hi,beforeTxt:pi,afterTxt:Bi}}catch(_i){}}function Mn(){if(tt&&Lt.current&&vt)try{var _n=tt.value,ti=Lt.current,hi=ti.beforeTxt,pi=ti.afterTxt,Bi=ti.start,_i=_n.length;if(_n.endsWith(pi))_i=_n.length-Lt.current.afterTxt.length;else if(_n.startsWith(hi))_i=hi.length;else{var Zn=hi[Bi-1],Fi=_n.indexOf(Zn,Bi-1);Fi!==-1&&(_i=Fi+1)}tt.setSelectionRange(_i,_i)}catch(Wi){(0,It.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Wi.message))}}return[Ln,Mn]}var Ct=he(49658),qe=function(){var vt=(0,je.useState)(!1),Lt=(0,Ce.Z)(vt,2),Ln=Lt[0],Mn=Lt[1];return(0,Xe.Z)(function(){Mn((0,Ct.Z)())},[]),Ln},Nt=qe,Qt=he(16089),Vt=200,Gt=600;function Ft(tt){var vt=tt.prefixCls,Lt=tt.upNode,Ln=tt.downNode,Mn=tt.upDisabled,_n=tt.downDisabled,ti=tt.onStep,hi=je.useRef(),pi=je.useRef([]),Bi=je.useRef();Bi.current=ti;var _i=function(){clearTimeout(hi.current)},Zn=function(ji,Ji){ji.preventDefault(),_i(),Bi.current(Ji);function Vi(){Bi.current(Ji),hi.current=setTimeout(Vi,Vt)}hi.current=setTimeout(Vi,Gt)};je.useEffect(function(){return function(){_i(),pi.current.forEach(function(bi){return Qt.Z.cancel(bi)})}},[]);var Fi=Nt();if(Fi)return null;var Wi="".concat(vt,"-handler"),Gi=st()(Wi,"".concat(Wi,"-up"),(0,Be.Z)({},"".concat(Wi,"-up-disabled"),Mn)),nr=st()(Wi,"".concat(Wi,"-down"),(0,Be.Z)({},"".concat(Wi,"-down-disabled"),_n)),Pi=function(){return pi.current.push((0,Qt.Z)(_i))},Yi={unselectable:"on",role:"button",onMouseUp:Pi,onMouseLeave:Pi};return je.createElement("div",{className:"".concat(Wi,"-wrap")},je.createElement("span",(0,Se.Z)({},Yi,{onMouseDown:function(ji){Zn(ji,!0)},"aria-label":"Increase Value","aria-disabled":Mn,className:Gi}),Lt||je.createElement("span",{unselectable:"on",className:"".concat(vt,"-handler-up-inner")})),je.createElement("span",(0,Se.Z)({},Yi,{onMouseDown:function(ji){Zn(ji,!1)},"aria-label":"Decrease Value","aria-disabled":_n,className:nr}),Ln||je.createElement("span",{unselectable:"on",className:"".concat(vt,"-handler-down-inner")})))}function Fe(tt){var vt=typeof tt=="number"?rt(tt):mt(tt).fullStr,Lt=vt.includes(".");return Lt?mt(vt.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:tt+"0"}var xe=he(5643),ft=function(){var tt=(0,je.useRef)(0),vt=function(){Qt.Z.cancel(tt.current)};return(0,je.useEffect)(function(){return vt},[]),function(Lt){vt(),tt.current=(0,Qt.Z)(function(){Lt()})}},qt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Ot=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Ue=function(vt,Lt){return vt||Lt.isEmpty()?Lt.toString():Lt.toNumber()},Ge=function(vt){var Lt=Ee(vt);return Lt.isInvalidate()?null:Lt},wt=je.forwardRef(function(tt,vt){var Lt,Ln=tt.prefixCls,Mn=Ln===void 0?"rc-input-number":Ln,_n=tt.className,ti=tt.style,hi=tt.min,pi=tt.max,Bi=tt.step,_i=Bi===void 0?1:Bi,Zn=tt.defaultValue,Fi=tt.value,Wi=tt.disabled,Gi=tt.readOnly,nr=tt.upHandler,Pi=tt.downHandler,Yi=tt.keyboard,bi=tt.controls,ji=bi===void 0?!0:bi,Ji=tt.classNames,Vi=tt.stringMode,ir=tt.parser,$i=tt.formatter,si=tt.precision,fi=tt.decimalSeparator,kn=tt.onChange,Dn=tt.onInput,mi=tt.onPressEnter,Qe=tt.onStep,ke=(0,Me.Z)(tt,qt),Pe="".concat(Mn,"-input"),Le=je.useRef(null),De=je.useState(!1),Ke=(0,Ce.Z)(De,2),it=Ke[0],kt=Ke[1],yt=je.useRef(!1),Dt=je.useRef(!1),Xt=je.useRef(!1),tn=je.useState(function(){return Ee(Fi!=null?Fi:Zn)}),un=(0,Ce.Z)(tn,2),gt=un[0],jt=un[1];function Bn(wn){Fi===void 0&&jt(wn)}var yn=je.useCallback(function(wn,fn){if(!fn)return si>=0?si:Math.max(ot(wn),ot(_i))},[si,_i]),Tn=je.useCallback(function(wn){var fn=String(wn);if(ir)return ir(fn);var ri=fn;return fi&&(ri=ri.replace(fi,".")),ri.replace(/[^\w.-]+/g,"")},[ir,fi]),Cn=je.useRef(""),Yn=je.useCallback(function(wn,fn){if($i)return $i(wn,{userTyping:fn,input:String(Cn.current)});var ri=typeof wn=="number"?rt(wn):wn;if(!fn){var jn=yn(ri,fn);if(Et(ri)&&(fi||jn>=0)){var yi=fi||".";ri=We(ri,yi,jn)}}return ri},[$i,yn,fi]),ln=je.useState(function(){var wn=Zn!=null?Zn:Fi;return gt.isInvalidate()&&["string","number"].includes((0,Oe.Z)(wn))?Number.isNaN(wn)?"":wn:Yn(gt.toString(),!1)}),Un=(0,Ce.Z)(ln,2),Ze=Un[0],St=Un[1];Cn.current=Ze;function Mt(wn,fn){St(Yn(wn.isInvalidate()?wn.toString(!1):wn.toString(!fn),fn))}var Kt=je.useMemo(function(){return Ge(pi)},[pi,si]),_t=je.useMemo(function(){return Ge(hi)},[hi,si]),Pt=je.useMemo(function(){return!Kt||!gt||gt.isInvalidate()?!1:Kt.lessEquals(gt)},[Kt,gt]),At=je.useMemo(function(){return!_t||!gt||gt.isInvalidate()?!1:gt.lessEquals(_t)},[_t,gt]),on=at(Le.current,it),cn=(0,Ce.Z)(on,2),xn=cn[0],Vn=cn[1],ni=function(fn){return Kt&&!fn.lessEquals(Kt)?Kt:_t&&!_t.lessEquals(fn)?_t:null},gi=function(fn){return!ni(fn)},ii=function(fn,ri){var jn=fn,yi=gi(jn)||jn.isEmpty();if(!jn.isEmpty()&&!ri&&(jn=ni(jn)||jn,yi=!0),!Gi&&!Wi&&yi){var Ti=jn.toString(),wi=yn(Ti,ri);return wi>=0&&(jn=Ee(We(Ti,".",wi)),gi(jn)||(jn=Ee(We(Ti,".",wi,!0)))),jn.equals(gt)||(Bn(jn),kn==null||kn(jn.isEmpty()?null:Ue(Vi,jn)),Fi===void 0&&Mt(jn,ri)),jn}return gt},Kn=ft(),vi=function wn(fn){if(xn(),Cn.current=fn,St(fn),!Dt.current){var ri=Tn(fn),jn=Ee(ri);jn.isNaN()||ii(jn,!0)}Dn==null||Dn(fn),Kn(function(){var yi=fn;ir||(yi=fn.replace(/。/g,".")),yi!==fn&&wn(yi)})},ui=function(){Dt.current=!0},ci=function(){Dt.current=!1,vi(Le.current.value)},Fn=function(fn){vi(fn.target.value)},Jn=function(fn){var ri;if(!(fn&&Pt||!fn&&At)){yt.current=!1;var jn=Ee(Xt.current?Fe(_i):_i);fn||(jn=jn.negate());var yi=(gt||Ee(0)).add(jn.toString()),Ti=ii(yi,!1);Qe==null||Qe(Ue(Vi,Ti),{offset:Xt.current?Fe(_i):_i,type:fn?"up":"down"}),(ri=Le.current)===null||ri===void 0||ri.focus()}},li=function(fn){var ri=Ee(Tn(Ze)),jn=ri;ri.isNaN()?jn=ii(gt,fn):jn=ii(ri,fn),Fi!==void 0?Mt(gt,!1):jn.isNaN()||Mt(jn,!1)},Qn=function(){yt.current=!0},Di=function(fn){var ri=fn.key,jn=fn.shiftKey;yt.current=!0,Xt.current=jn,ri==="Enter"&&(Dt.current||(yt.current=!1),li(!1),mi==null||mi(fn)),Yi!==!1&&!Dt.current&&["Up","ArrowUp","Down","ArrowDown"].includes(ri)&&(Jn(ri==="Up"||ri==="ArrowUp"),fn.preventDefault())},Hi=function(){yt.current=!1,Xt.current=!1},ai=function(){li(!1),kt(!1),yt.current=!1};return(0,Xe.o)(function(){gt.isInvalidate()||Mt(gt,!1)},[si]),(0,Xe.o)(function(){var wn=Ee(Fi);jt(wn);var fn=Ee(Tn(Ze));(!wn.equals(fn)||!yt.current||$i)&&Mt(wn,yt.current)},[Fi]),(0,Xe.o)(function(){$i&&Vn()},[Ze]),je.createElement("div",{className:st()(Mn,Ji==null?void 0:Ji.input,_n,(Lt={},(0,Be.Z)(Lt,"".concat(Mn,"-focused"),it),(0,Be.Z)(Lt,"".concat(Mn,"-disabled"),Wi),(0,Be.Z)(Lt,"".concat(Mn,"-readonly"),Gi),(0,Be.Z)(Lt,"".concat(Mn,"-not-a-number"),gt.isNaN()),(0,Be.Z)(Lt,"".concat(Mn,"-out-of-range"),!gt.isInvalidate()&&!gi(gt)),Lt)),style:ti,onFocus:function(){kt(!0)},onBlur:ai,onKeyDown:Di,onKeyUp:Hi,onCompositionStart:ui,onCompositionEnd:ci,onBeforeInput:Qn},ji&&je.createElement(Ft,{prefixCls:Mn,upNode:nr,downNode:Pi,upDisabled:Pt,downDisabled:At,onStep:Jn}),je.createElement("div",{className:"".concat(Pe,"-wrap")},je.createElement("input",(0,Se.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":hi,"aria-valuemax":pi,"aria-valuenow":gt.isInvalidate()?null:gt.toString(),step:_i},ke,{ref:(0,bt.sQ)(Le,vt),className:Pe,value:Ze,onChange:Fn,disabled:Wi,readOnly:Gi}))))}),dn=je.forwardRef(function(tt,vt){var Lt=tt.disabled,Ln=tt.style,Mn=tt.prefixCls,_n=tt.value,ti=tt.prefix,hi=tt.suffix,pi=tt.addonBefore,Bi=tt.addonAfter,_i=tt.classes,Zn=tt.className,Fi=tt.classNames,Wi=(0,Me.Z)(tt,Ot),Gi=je.useRef(null),nr=function(Yi){Gi.current&&(0,xe.nH)(Gi.current,Yi)};return je.createElement(Ve.BaseInput,{inputElement:je.createElement(wt,(0,Se.Z)({prefixCls:Mn,disabled:Lt,classNames:Fi,ref:(0,bt.sQ)(Gi,vt)},Wi)),className:Zn,triggerFocus:nr,prefixCls:Mn,value:_n,disabled:Lt,style:Ln,prefix:ti,suffix:hi,addonAfter:Bi,addonBefore:pi,classes:_i,classNames:Fi,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});dn.displayName="InputNumber";var Rt=dn,an=Rt,$t=he(19080),Bt=he(36355),Tt=he(92736),ge=he(1684),se=he(19716),oe=he(32441),fe=he(33234),ve=he(9937),ce=he(17313),$e=he(74207),xt=he(83116),Ut=he(37613);const Ht=(tt,vt)=>{let{componentCls:Lt,borderRadiusSM:Ln,borderRadiusLG:Mn}=tt;const _n=vt==="lg"?Mn:Ln;return{[`&-${vt}`]:{[`${Lt}-handler-wrap`]:{borderStartEndRadius:_n,borderEndEndRadius:_n},[`${Lt}-handler-up`]:{borderStartEndRadius:_n},[`${Lt}-handler-down`]:{borderEndEndRadius:_n}}}},Jt=tt=>{const{componentCls:vt,lineWidth:Lt,lineType:Ln,colorBorder:Mn,borderRadius:_n,fontSizeLG:ti,controlHeightLG:hi,controlHeightSM:pi,colorError:Bi,paddingInlineSM:_i,colorTextDescription:Zn,motionDurationMid:Fi,handleHoverColor:Wi,paddingInline:Gi,paddingBlock:nr,handleBg:Pi,handleActiveBg:Yi,colorTextDisabled:bi,borderRadiusSM:ji,borderRadiusLG:Ji,controlWidth:Vi,handleVisible:ir,handleBorderColor:$i}=tt;return[{[vt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),(0,ve.ik)(tt)),(0,ve.bi)(tt,vt)),{display:"inline-block",width:Vi,margin:0,padding:0,border:`${Lt}px ${Ln} ${Mn}`,borderRadius:_n,"&-rtl":{direction:"rtl",[`${vt}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:ti,borderRadius:Ji,[`input${vt}-input`]:{height:hi-2*Lt}},"&-sm":{padding:0,borderRadius:ji,[`input${vt}-input`]:{height:pi-2*Lt,padding:`0 ${_i}px`}},"&:hover":Object.assign({},(0,ve.pU)(tt)),"&-focused":Object.assign({},(0,ve.M1)(tt)),"&-out-of-range":{[`${vt}-input-wrap`]:{input:{color:Bi}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),(0,ve.s7)(tt)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${vt}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${vt}-group-addon`]:{borderRadius:Ji,fontSize:tt.fontSizeLG}},"&-sm":{[`${vt}-group-addon`]:{borderRadius:ji}},[`${vt}-wrapper-disabled > ${vt}-group-addon`]:Object.assign({},(0,ve.Xy)(tt))}}),[`&-disabled ${vt}-input`]:{cursor:"not-allowed"},[vt]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),{width:"100%",padding:`${nr}px ${Gi}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:_n,outline:0,transition:`all ${Fi} linear`,appearance:"textfield",fontSize:"inherit"}),(0,ve.nz)(tt.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[vt]:Object.assign(Object.assign(Object.assign({[`&:hover ${vt}-handler-wrap, &-focused ${vt}-handler-wrap`]:{opacity:1},[`${vt}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:tt.handleWidth,height:"100%",background:Pi,borderStartStartRadius:0,borderStartEndRadius:_n,borderEndEndRadius:_n,borderEndStartRadius:0,opacity:ir===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Fi} linear ${Fi}`,[`${vt}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${vt}-handler-up-inner,
${vt}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:tt.handleFontSize}}},[`${vt}-handler`]:{height:"50%",overflow:"hidden",color:Zn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Lt}px ${Ln} ${$i}`,transition:`all ${Fi} linear`,"&:active":{background:Yi},"&:hover":{height:"60%",[`
${vt}-handler-up-inner,
${vt}-handler-down-inner
`]:{color:Wi}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ce.Ro)()),{color:Zn,transition:`all ${Fi} linear`,userSelect:"none"})},[`${vt}-handler-up`]:{borderStartEndRadius:_n},[`${vt}-handler-down`]:{borderBlockStart:`${Lt}px ${Ln} ${$i}`,borderEndEndRadius:_n}},Ht(tt,"lg")),Ht(tt,"sm")),{"&-disabled, &-readonly":{[`${vt}-handler-wrap`]:{display:"none"},[`${vt}-input`]:{color:"inherit"}},[`
${vt}-handler-up-disabled,
${vt}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${vt}-handler-up-disabled:hover &-handler-up-inner,
${vt}-handler-down-disabled:hover &-handler-down-inner
`]:{color:bi}})},{[`${vt}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${vt}-handler-down`]:{borderBlockStartWidth:0}}}]},en=tt=>{const{componentCls:vt,paddingBlock:Lt,paddingInline:Ln,inputAffixPadding:Mn,controlWidth:_n,borderRadiusLG:ti,borderRadiusSM:hi}=tt;return{[`${vt}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,ve.ik)(tt)),(0,ve.bi)(tt,`${vt}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:_n,padding:0,paddingInlineStart:Ln,"&-lg":{borderRadius:ti},"&-sm":{borderRadius:hi},[`&:not(${vt}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,ve.pU)(tt)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${vt}-disabled`]:{background:"transparent"},[`> div${vt}`]:{width:"100%",border:"none",outline:"none",[`&${vt}-focused`]:{boxShadow:"none !important"}},[`input${vt}-input`]:{padding:`${Lt}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${vt}-handler-wrap`]:{zIndex:2},[vt]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Mn},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Ln,marginInlineStart:Mn}}})}};var hn=(0,xt.Z)("InputNumber",tt=>{const vt=(0,Ut.TS)(tt,(0,ve.e5)(tt));return[Jt(vt),en(vt),(0,$e.c)(vt)]},tt=>Object.assign(Object.assign({},(0,ve.TM)(tt)),{controlWidth:90,handleWidth:tt.controlHeightSM-tt.lineWidth*2,handleFontSize:tt.fontSize/2,handleVisible:"auto",handleActiveBg:tt.colorFillAlter,handleBg:tt.colorBgContainer,handleHoverColor:tt.colorPrimary,handleBorderColor:tt.colorBorder})),pn=function(tt,vt){var Lt={};for(var Ln in tt)Object.prototype.hasOwnProperty.call(tt,Ln)&&vt.indexOf(Ln)<0&&(Lt[Ln]=tt[Ln]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mn=0,Ln=Object.getOwnPropertySymbols(tt);Mn<Ln.length;Mn++)vt.indexOf(Ln[Mn])<0&&Object.prototype.propertyIsEnumerable.call(tt,Ln[Mn])&&(Lt[Ln[Mn]]=tt[Ln[Mn]]);return Lt};const bn=je.forwardRef((tt,vt)=>{const{getPrefixCls:Lt,direction:Ln}=je.useContext(Bt.E_),Mn=je.useRef(null);je.useImperativeHandle(vt,()=>Mn.current);const{className:_n,rootClassName:ti,size:hi,disabled:pi,prefixCls:Bi,addonBefore:_i,addonAfter:Zn,prefix:Fi,bordered:Wi=!0,readOnly:Gi,status:nr,controls:Pi}=tt,Yi=pn(tt,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),bi=Lt("input-number",Bi),[ji,Ji]=hn(bi),{compactSize:Vi,compactItemClassnames:ir}=(0,fe.ri)(bi,Ln);let $i=je.createElement(ct.Z,{className:`${bi}-handler-up-inner`}),si=je.createElement(we.Z,{className:`${bi}-handler-down-inner`});const fi=typeof Pi=="boolean"?Pi:void 0;typeof Pi=="object"&&($i=typeof Pi.upIcon=="undefined"?$i:je.createElement("span",{className:`${bi}-handler-up-inner`},Pi.upIcon),si=typeof Pi.downIcon=="undefined"?si:je.createElement("span",{className:`${bi}-handler-down-inner`},Pi.downIcon));const{hasFeedback:kn,status:Dn,isFormItemInput:mi,feedbackIcon:Qe}=je.useContext(oe.aM),ke=(0,$t.F)(Dn,nr),Pe=(0,se.Z)(yt=>{var Dt;return(Dt=hi!=null?hi:Vi)!==null&&Dt!==void 0?Dt:yt}),Le=je.useContext(ge.Z),De=pi!=null?pi:Le,Ke=st()({[`${bi}-lg`]:Pe==="large",[`${bi}-sm`]:Pe==="small",[`${bi}-rtl`]:Ln==="rtl",[`${bi}-borderless`]:!Wi,[`${bi}-in-form-item`]:mi},(0,$t.Z)(bi,ke),ir,Ji),it=`${bi}-group`,kt=je.createElement(an,Object.assign({ref:Mn,disabled:De,className:st()(_n,ti),upHandler:$i,downHandler:si,prefixCls:bi,readOnly:Gi,controls:fi,prefix:Fi,suffix:kn&&Qe,addonAfter:Zn&&je.createElement(fe.BR,null,je.createElement(oe.Ux,{override:!0,status:!0},Zn)),addonBefore:_i&&je.createElement(fe.BR,null,je.createElement(oe.Ux,{override:!0,status:!0},_i)),classNames:{input:Ke},classes:{affixWrapper:st()((0,$t.Z)(`${bi}-affix-wrapper`,ke,kn),{[`${bi}-affix-wrapper-sm`]:Pe==="small",[`${bi}-affix-wrapper-lg`]:Pe==="large",[`${bi}-affix-wrapper-rtl`]:Ln==="rtl",[`${bi}-affix-wrapper-borderless`]:!Wi},Ji),wrapper:st()({[`${it}-rtl`]:Ln==="rtl",[`${bi}-wrapper-disabled`]:De},Ji),group:st()({[`${bi}-group-wrapper-sm`]:Pe==="small",[`${bi}-group-wrapper-lg`]:Pe==="large",[`${bi}-group-wrapper-rtl`]:Ln==="rtl"},(0,$t.Z)(`${bi}-group-wrapper`,ke,kn),Ji)}},Yi));return ji(kt)}),pt=bn,sn=tt=>je.createElement(Tt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},je.createElement(bn,Object.assign({},tt)));pt._InternalPanelDoNotUseOrYouWillBeFired=sn;var zn=pt},9432:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Zt},n:function(){return rt}});var we=he(19248),ct=he(92310),Re=he.n(ct),st=he(93681),Se=he(8654),Be=he(59301),Oe=he(19080),Ce=he(36355),Me=he(1684),Ne=he(19716),ht=he(32441),Ie=he(33234),He=he(59412),mt=he(9937);function Ye(Je){return!!(Je.prefix||Je.suffix||Je.allowClear)}var ot=function(Je,lt){var We={};for(var Ee in Je)Object.prototype.hasOwnProperty.call(Je,Ee)&&lt.indexOf(Ee)<0&&(We[Ee]=Je[Ee]);if(Je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ve=0,Ee=Object.getOwnPropertySymbols(Je);Ve<Ee.length;Ve++)lt.indexOf(Ee[Ve])<0&&Object.prototype.propertyIsEnumerable.call(Je,Ee[Ve])&&(We[Ee[Ve]]=Je[Ee[Ve]]);return We};function rt(Je,lt){if(!Je)return;Je.focus(lt);const{cursor:We}=lt||{};if(We){const Ee=Je.value.length;switch(We){case"start":Je.setSelectionRange(0,0);break;case"end":Je.setSelectionRange(Ee,Ee);break;default:Je.setSelectionRange(0,Ee);break}}}var Zt=(0,Be.forwardRef)((Je,lt)=>{var We;const{prefixCls:Ee,bordered:Ve=!0,status:Xe,size:bt,disabled:je,onBlur:It,onFocus:at,suffix:Ct,allowClear:qe,addonAfter:Nt,addonBefore:Qt,className:Vt,style:Gt,styles:Ft,rootClassName:Fe,onChange:xe,classNames:ft}=Je,qt=ot(Je,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ot,direction:Ue,input:Ge}=Be.useContext(Ce.E_),wt=Ot("input",Ee),dn=(0,Be.useRef)(null),[Rt,an]=(0,mt.ZP)(wt),{compactSize:$t,compactItemClassnames:Bt}=(0,Ie.ri)(wt,Ue),Tt=(0,Ne.Z)(bn=>{var pt;return(pt=bt!=null?bt:$t)!==null&&pt!==void 0?pt:bn}),ge=Be.useContext(Me.Z),se=je!=null?je:ge,{status:oe,hasFeedback:fe,feedbackIcon:ve}=(0,Be.useContext)(ht.aM),ce=(0,Oe.F)(oe,Xe),$e=Ye(Je)||!!fe,xt=(0,Be.useRef)($e);(0,Be.useEffect)(()=>{var bn;$e&&xt.current,xt.current=$e},[$e]);const Ut=(0,He.Z)(dn,!0),Ht=bn=>{Ut(),It==null||It(bn)},Jt=bn=>{Ut(),at==null||at(bn)},en=bn=>{Ut(),xe==null||xe(bn)},hn=(fe||Ct)&&Be.createElement(Be.Fragment,null,Ct,fe&&ve);let pn;return typeof qe=="object"&&(qe!=null&&qe.clearIcon)?pn=qe:qe&&(pn={clearIcon:Be.createElement(we.Z,null)}),Rt(Be.createElement(st.default,Object.assign({ref:(0,Se.sQ)(lt,dn),prefixCls:wt,autoComplete:Ge==null?void 0:Ge.autoComplete},qt,{disabled:se,onBlur:Ht,onFocus:Jt,style:Object.assign(Object.assign({},Ge==null?void 0:Ge.style),Gt),styles:Object.assign(Object.assign({},Ge==null?void 0:Ge.styles),Ft),suffix:hn,allowClear:pn,className:Re()(Vt,Fe,Bt,Ge==null?void 0:Ge.className),onChange:en,addonAfter:Nt&&Be.createElement(Ie.BR,null,Be.createElement(ht.Ux,{override:!0,status:!0},Nt)),addonBefore:Qt&&Be.createElement(Ie.BR,null,Be.createElement(ht.Ux,{override:!0,status:!0},Qt)),classNames:Object.assign(Object.assign(Object.assign({},ft),Ge==null?void 0:Ge.classNames),{input:Re()({[`${wt}-sm`]:Tt==="small",[`${wt}-lg`]:Tt==="large",[`${wt}-rtl`]:Ue==="rtl",[`${wt}-borderless`]:!Ve},!$e&&(0,Oe.Z)(wt,ce),ft==null?void 0:ft.input,(We=Ge==null?void 0:Ge.classNames)===null||We===void 0?void 0:We.input,an)}),classes:{affixWrapper:Re()({[`${wt}-affix-wrapper-sm`]:Tt==="small",[`${wt}-affix-wrapper-lg`]:Tt==="large",[`${wt}-affix-wrapper-rtl`]:Ue==="rtl",[`${wt}-affix-wrapper-borderless`]:!Ve},(0,Oe.Z)(`${wt}-affix-wrapper`,ce,fe),an),wrapper:Re()({[`${wt}-group-rtl`]:Ue==="rtl"},an),group:Re()({[`${wt}-group-wrapper-sm`]:Tt==="small",[`${wt}-group-wrapper-lg`]:Tt==="large",[`${wt}-group-wrapper-rtl`]:Ue==="rtl",[`${wt}-group-wrapper-disabled`]:se},(0,Oe.Z)(`${wt}-group-wrapper`,ce,fe),an)}})))})},1643:function(mn,rn,he){"use strict";var we=he(19248),ct=he(92310),Re=he.n(ct),st=he(9296),Se=he(59301),Be=he(19080),Oe=he(36355),Ce=he(1684),Me=he(19716),Ne=he(32441),ht=he(9432),Ie=he(9937),He=function(Ye,ot){var rt={};for(var Et in Ye)Object.prototype.hasOwnProperty.call(Ye,Et)&&ot.indexOf(Et)<0&&(rt[Et]=Ye[Et]);if(Ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Zt=0,Et=Object.getOwnPropertySymbols(Ye);Zt<Et.length;Zt++)ot.indexOf(Et[Zt])<0&&Object.prototype.propertyIsEnumerable.call(Ye,Et[Zt])&&(rt[Et[Zt]]=Ye[Et[Zt]]);return rt};const mt=(0,Se.forwardRef)((Ye,ot)=>{const{prefixCls:rt,bordered:Et=!0,size:Zt,disabled:Je,status:lt,allowClear:We,showCount:Ee,classNames:Ve,rootClassName:Xe,className:bt}=Ye,je=He(Ye,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:It,direction:at}=Se.useContext(Oe.E_),Ct=(0,Me.Z)(Zt),qe=Se.useContext(Ce.Z),Nt=Je!=null?Je:qe,{status:Qt,hasFeedback:Vt,feedbackIcon:Gt}=Se.useContext(Ne.aM),Ft=(0,Be.F)(Qt,lt),Fe=Se.useRef(null);Se.useImperativeHandle(ot,()=>{var Ue;return{resizableTextArea:(Ue=Fe.current)===null||Ue===void 0?void 0:Ue.resizableTextArea,focus:Ge=>{var wt,dn;(0,ht.n)((dn=(wt=Fe.current)===null||wt===void 0?void 0:wt.resizableTextArea)===null||dn===void 0?void 0:dn.textArea,Ge)},blur:()=>{var Ge;return(Ge=Fe.current)===null||Ge===void 0?void 0:Ge.blur()}}});const xe=It("input",rt);let ft;typeof We=="object"&&(We!=null&&We.clearIcon)?ft=We:We&&(ft={clearIcon:Se.createElement(we.Z,null)});const[qt,Ot]=(0,Ie.ZP)(xe);return qt(Se.createElement(st.default,Object.assign({},je,{disabled:Nt,allowClear:ft,className:Re()(bt,Xe),classes:{affixWrapper:Re()(`${xe}-textarea-affix-wrapper`,{[`${xe}-affix-wrapper-rtl`]:at==="rtl",[`${xe}-affix-wrapper-borderless`]:!Et,[`${xe}-affix-wrapper-sm`]:Ct==="small",[`${xe}-affix-wrapper-lg`]:Ct==="large",[`${xe}-textarea-show-count`]:Ee},(0,Be.Z)(`${xe}-affix-wrapper`,Ft),Ot)},classNames:Object.assign(Object.assign({},Ve),{textarea:Re()({[`${xe}-borderless`]:!Et,[`${xe}-sm`]:Ct==="small",[`${xe}-lg`]:Ct==="large"},(0,Be.Z)(xe,Ft),Ot,Ve==null?void 0:Ve.textarea)}),prefixCls:xe,suffix:Vt&&Se.createElement("span",{className:`${xe}-textarea-suffix`},Gt),showCount:Ee,ref:Fe})))});rn.Z=mt},59412:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return ct}});var we=he(59301);function ct(Re,st){const Se=(0,we.useRef)([]),Be=()=>{Se.current.push(setTimeout(()=>{var Oe,Ce,Me,Ne;!((Oe=Re.current)===null||Oe===void 0)&&Oe.input&&((Ce=Re.current)===null||Ce===void 0?void 0:Ce.input.getAttribute("type"))==="password"&&(!((Me=Re.current)===null||Me===void 0)&&Me.input.hasAttribute("value"))&&((Ne=Re.current)===null||Ne===void 0||Ne.input.removeAttribute("value"))}))};return(0,we.useEffect)(()=>(st&&Be(),()=>Se.current.forEach(Oe=>{Oe&&clearTimeout(Oe)})),[]),Be}},92832:function(mn,rn,he){"use strict";he.d(rn,{default:function(){return Ct}});var we=he(92310),ct=he.n(we),Re=he(59301),st=he(36355),Se=he(32441),Be=he(9937),Ce=qe=>{const{getPrefixCls:Nt,direction:Qt}=(0,Re.useContext)(st.E_),{prefixCls:Vt,className:Gt}=qe,Ft=Nt("input-group",Vt),Fe=Nt("input"),[xe,ft]=(0,Be.ZP)(Fe),qt=ct()(Ft,{[`${Ft}-lg`]:qe.size==="large",[`${Ft}-sm`]:qe.size==="small",[`${Ft}-compact`]:qe.compact,[`${Ft}-rtl`]:Qt==="rtl"},ft,Gt),Ot=(0,Re.useContext)(Se.aM),Ue=(0,Re.useMemo)(()=>Object.assign(Object.assign({},Ot),{isFormItemInput:!1}),[Ot]);return xe(Re.createElement("span",{className:qt,style:qe.style,onMouseEnter:qe.onMouseEnter,onMouseLeave:qe.onMouseLeave,onFocus:qe.onFocus,onBlur:qe.onBlur},Re.createElement(Se.aM.Provider,{value:Ue},qe.children)))},Me=he(9432),Ne=he(73331),ht=he(15277),Ie=he(2738),He=he(8654),mt=he(59412),Ye=function(qe,Nt){var Qt={};for(var Vt in qe)Object.prototype.hasOwnProperty.call(qe,Vt)&&Nt.indexOf(Vt)<0&&(Qt[Vt]=qe[Vt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Gt=0,Vt=Object.getOwnPropertySymbols(qe);Gt<Vt.length;Gt++)Nt.indexOf(Vt[Gt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Vt[Gt])&&(Qt[Vt[Gt]]=qe[Vt[Gt]]);return Qt};const ot=qe=>qe?Re.createElement(ht.Z,null):Re.createElement(Ne.Z,null),rt={click:"onClick",hover:"onMouseOver"};var Zt=Re.forwardRef((qe,Nt)=>{const{visibilityToggle:Qt=!0}=qe,Vt=typeof Qt=="object"&&Qt.visible!==void 0,[Gt,Ft]=(0,Re.useState)(()=>Vt?Qt.visible:!1),Fe=(0,Re.useRef)(null);Re.useEffect(()=>{Vt&&Ft(Qt.visible)},[Vt,Qt]);const xe=(0,mt.Z)(Fe),ft=()=>{const{disabled:se}=qe;se||(Gt&&xe(),Ft(oe=>{var fe;const ve=!oe;return typeof Qt=="object"&&((fe=Qt.onVisibleChange)===null||fe===void 0||fe.call(Qt,ve)),ve}))},qt=se=>{const{action:oe="click",iconRender:fe=ot}=qe,ve=rt[oe]||"",ce=fe(Gt),$e={[ve]:ft,className:`${se}-icon`,key:"passwordIcon",onMouseDown:xt=>{xt.preventDefault()},onMouseUp:xt=>{xt.preventDefault()}};return Re.cloneElement(Re.isValidElement(ce)?ce:Re.createElement("span",null,ce),$e)},{className:Ot,prefixCls:Ue,inputPrefixCls:Ge,size:wt}=qe,dn=Ye(qe,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Rt}=Re.useContext(st.E_),an=Rt("input",Ge),$t=Rt("input-password",Ue),Bt=Qt&&qt($t),Tt=ct()($t,Ot,{[`${$t}-${wt}`]:!!wt}),ge=Object.assign(Object.assign({},(0,Ie.Z)(dn,["suffix","iconRender","visibilityToggle"])),{type:Gt?"text":"password",className:Tt,prefixCls:an,suffix:Bt});return wt&&(ge.size=wt),Re.createElement(Me.Z,Object.assign({ref:(0,He.sQ)(Nt,Fe)},ge))}),Je=he(47472),lt=he(92343),We=he(3113),Ee=he(19716),Ve=he(33234),Xe=function(qe,Nt){var Qt={};for(var Vt in qe)Object.prototype.hasOwnProperty.call(qe,Vt)&&Nt.indexOf(Vt)<0&&(Qt[Vt]=qe[Vt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Gt=0,Vt=Object.getOwnPropertySymbols(qe);Gt<Vt.length;Gt++)Nt.indexOf(Vt[Gt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Vt[Gt])&&(Qt[Vt[Gt]]=qe[Vt[Gt]]);return Qt},je=Re.forwardRef((qe,Nt)=>{const{prefixCls:Qt,inputPrefixCls:Vt,className:Gt,size:Ft,suffix:Fe,enterButton:xe=!1,addonAfter:ft,loading:qt,disabled:Ot,onSearch:Ue,onChange:Ge,onCompositionStart:wt,onCompositionEnd:dn}=qe,Rt=Xe(qe,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:an,direction:$t}=Re.useContext(st.E_),Bt=Re.useRef(!1),Tt=an("input-search",Qt),ge=an("input",Vt),{compactSize:se}=(0,Ve.ri)(Tt,$t),oe=(0,Ee.Z)(sn=>{var zn;return(zn=Ft!=null?Ft:se)!==null&&zn!==void 0?zn:sn}),fe=Re.useRef(null),ve=sn=>{sn&&sn.target&&sn.type==="click"&&Ue&&Ue(sn.target.value,sn,{source:"clear"}),Ge&&Ge(sn)},ce=sn=>{var zn;document.activeElement===((zn=fe.current)===null||zn===void 0?void 0:zn.input)&&sn.preventDefault()},$e=sn=>{var zn,tt;Ue&&Ue((tt=(zn=fe.current)===null||zn===void 0?void 0:zn.input)===null||tt===void 0?void 0:tt.value,sn,{source:"input"})},xt=sn=>{Bt.current||qt||$e(sn)},Ut=typeof xe=="boolean"?Re.createElement(Je.Z,null):null,Ht=`${Tt}-button`;let Jt;const en=xe||{},hn=en.type&&en.type.__ANT_BUTTON===!0;hn||en.type==="button"?Jt=(0,lt.Tm)(en,Object.assign({onMouseDown:ce,onClick:sn=>{var zn,tt;(tt=(zn=en==null?void 0:en.props)===null||zn===void 0?void 0:zn.onClick)===null||tt===void 0||tt.call(zn,sn),$e(sn)},key:"enterButton"},hn?{className:Ht,size:oe}:{})):Jt=Re.createElement(We.ZP,{className:Ht,type:xe?"primary":void 0,size:oe,disabled:Ot,key:"enterButton",onMouseDown:ce,onClick:$e,loading:qt,icon:Ut},xe),ft&&(Jt=[Jt,(0,lt.Tm)(ft,{key:"addonAfter"})]);const pn=ct()(Tt,{[`${Tt}-rtl`]:$t==="rtl",[`${Tt}-${oe}`]:!!oe,[`${Tt}-with-button`]:!!xe},Gt),bn=sn=>{Bt.current=!0,wt==null||wt(sn)},pt=sn=>{Bt.current=!1,dn==null||dn(sn)};return Re.createElement(Me.Z,Object.assign({ref:(0,He.sQ)(fe,Nt),onPressEnter:xt},Rt,{size:oe,onCompositionStart:bn,onCompositionEnd:pt,prefixCls:ge,addonAfter:Jt,suffix:Fe,onChange:ve,className:pn,disabled:Ot}))}),It=he(1643);const at=Me.Z;at.Group=Ce,at.Search=je,at.TextArea=It.Z,at.Password=Zt;var Ct=at},9937:function(mn,rn,he){"use strict";he.d(rn,{M1:function(){return Oe},TM:function(){return lt},Xy:function(){return Ce},bi:function(){return ht},e5:function(){return Je},ik:function(){return Ie},nz:function(){return Se},pU:function(){return Be},s7:function(){return He},x0:function(){return Ne}});var we=he(17313),ct=he(74207),Re=he(37613),st=he(83116);const Se=We=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:We,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Be=We=>({borderColor:We.hoverBorderColor}),Oe=We=>({borderColor:We.activeBorderColor,boxShadow:We.activeShadow,outline:0}),Ce=We=>({color:We.colorTextDisabled,backgroundColor:We.colorBgContainerDisabled,borderColor:We.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Be((0,Re.TS)(We,{hoverBorderColor:We.colorBorder})))}),Me=We=>{const{paddingBlockLG:Ee,fontSizeLG:Ve,lineHeightLG:Xe,borderRadiusLG:bt,paddingInlineLG:je}=We;return{padding:`${Ee}px ${je}px`,fontSize:Ve,lineHeight:Xe,borderRadius:bt}},Ne=We=>({padding:`${We.paddingBlockSM}px ${We.paddingInlineSM}px`,borderRadius:We.borderRadiusSM}),ht=(We,Ee)=>{const{componentCls:Ve,colorError:Xe,colorWarning:bt,errorActiveShadow:je,warningActiveShadow:It,colorErrorBorderHover:at,colorWarningBorderHover:Ct}=We;return{[`&-status-error:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:Xe,"&:hover":{borderColor:at},"&:focus, &-focused":Object.assign({},Oe((0,Re.TS)(We,{activeBorderColor:Xe,activeShadow:je}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:Xe}},[`&-status-warning:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:bt,"&:hover":{borderColor:Ct},"&:focus, &-focused":Object.assign({},Oe((0,Re.TS)(We,{activeBorderColor:bt,activeShadow:It}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:bt}}}},Ie=We=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${We.paddingBlock}px ${We.paddingInline}px`,color:We.colorText,fontSize:We.fontSize,lineHeight:We.lineHeight,backgroundColor:We.colorBgContainer,backgroundImage:"none",borderWidth:We.lineWidth,borderStyle:We.lineType,borderColor:We.colorBorder,borderRadius:We.borderRadius,transition:`all ${We.motionDurationMid}`},Se(We.colorTextPlaceholder)),{"&:hover":Object.assign({},Be(We)),"&:focus, &-focused":Object.assign({},Oe(We)),"&-disabled, &[disabled]":Object.assign({},Ce(We)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:We.controlHeight,lineHeight:We.lineHeight,verticalAlign:"bottom",transition:`all ${We.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},Me(We)),"&-sm":Object.assign({},Ne(We)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),He=We=>{const{componentCls:Ee,antCls:Ve}=We;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:We.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${Ee}, &-lg > ${Ee}-group-addon`]:Object.assign({},Me(We)),[`&-sm ${Ee}, &-sm > ${Ee}-group-addon`]:Object.assign({},Ne(We)),[`&-lg ${Ve}-select-single ${Ve}-select-selector`]:{height:We.controlHeightLG},[`&-sm ${Ve}-select-single ${Ve}-select-selector`]:{height:We.controlHeightSM},[`> ${Ee}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${Ee}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${We.paddingInline}px`,color:We.colorText,fontWeight:"normal",fontSize:We.fontSize,textAlign:"center",backgroundColor:We.colorFillAlter,border:`${We.lineWidth}px ${We.lineType} ${We.colorBorder}`,borderRadius:We.borderRadius,transition:`all ${We.motionDurationSlow}`,lineHeight:1,[`${Ve}-select`]:{margin:`-${We.paddingBlock+1}px -${We.paddingInline}px`,[`&${Ve}-select-single:not(${Ve}-select-customize-input)`]:{[`${Ve}-select-selector`]:{backgroundColor:"inherit",border:`${We.lineWidth}px ${We.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ve}-select-selector`]:{color:We.colorPrimary}}},[`${Ve}-cascader-picker`]:{margin:`-9px -${We.paddingInline}px`,backgroundColor:"transparent",[`${Ve}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${Ee}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${Ee}-search-with-button &`]:{zIndex:0}}},[`> ${Ee}:first-child, ${Ee}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ve}-select ${Ve}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Ee}-affix-wrapper`]:{[`&:not(:first-child) ${Ee}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${Ee}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Ee}:last-child, ${Ee}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ve}-select ${Ve}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${Ee}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ee}-search &`]:{borderStartStartRadius:We.borderRadius,borderEndStartRadius:We.borderRadius}},[`&:not(:first-child), ${Ee}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${Ee}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,we.dF)()),{[`${Ee}-group-addon, ${Ee}-group-wrap, > ${Ee}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:We.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${Ee}-affix-wrapper,
& > ${Ee}-number-affix-wrapper,
& > ${Ve}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-We.lineWidth,borderInlineEndWidth:We.lineWidth},[`${Ee}`]:{float:"none"},[`& > ${Ve}-select > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete ${Ee},
& > ${Ve}-cascader-picker ${Ee},
& > ${Ee}-group-wrapper ${Ee}`]:{borderInlineEndWidth:We.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ve}-select-focused`]:{zIndex:1},[`& > ${Ve}-select > ${Ve}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ve}-select:first-child > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete:first-child ${Ee},
& > ${Ve}-cascader-picker:first-child ${Ee}`]:{borderStartStartRadius:We.borderRadius,borderEndStartRadius:We.borderRadius},[`& > *:last-child,
& > ${Ve}-select:last-child > ${Ve}-select-selector,
& > ${Ve}-cascader-picker:last-child ${Ee},
& > ${Ve}-cascader-picker-focused:last-child ${Ee}`]:{borderInlineEndWidth:We.lineWidth,borderStartEndRadius:We.borderRadius,borderEndEndRadius:We.borderRadius},[`& > ${Ve}-select-auto-complete ${Ee}`]:{verticalAlign:"top"},[`${Ee}-group-wrapper + ${Ee}-group-wrapper`]:{marginInlineStart:-We.lineWidth,[`${Ee}-affix-wrapper`]:{borderRadius:0}},[`${Ee}-group-wrapper:not(:last-child)`]:{[`&${Ee}-search > ${Ee}-group`]:{[`& > ${Ee}-group-addon > ${Ee}-search-button`]:{borderRadius:0},[`& > ${Ee}`]:{borderStartStartRadius:We.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:We.borderRadius}}}})}},mt=We=>{const{componentCls:Ee,controlHeightSM:Ve,lineWidth:Xe}=We,je=(Ve-Xe*2-16)/2;return{[Ee]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,we.Wf)(We)),Ie(We)),ht(We,Ee)),{'&[type="color"]':{height:We.controlHeight,[`&${Ee}-lg`]:{height:We.controlHeightLG},[`&${Ee}-sm`]:{height:Ve,paddingTop:je,paddingBottom:je}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Ye=We=>{const{componentCls:Ee}=We;return{[`${Ee}-clear-icon`]:{margin:0,color:We.colorTextQuaternary,fontSize:We.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${We.motionDurationSlow}`,"&:hover":{color:We.colorTextTertiary},"&:active":{color:We.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${We.inputAffixPadding}px`}}}},ot=We=>{const{componentCls:Ee,inputAffixPadding:Ve,colorTextDescription:Xe,motionDurationSlow:bt,colorIcon:je,colorIconHover:It,iconCls:at}=We;return{[`${Ee}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ie(We)),{display:"inline-flex",[`&:not(${Ee}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Be(We)),{zIndex:1,[`${Ee}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${Ee}[disabled]`]:{background:"transparent"}},[`> input${Ee}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Ee}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:We.paddingXS}},"&-show-count-suffix":{color:Xe},"&-show-count-has-suffix":{marginInlineEnd:We.paddingXXS},"&-prefix":{marginInlineEnd:Ve},"&-suffix":{marginInlineStart:Ve}}}),Ye(We)),{[`${at}${Ee}-password-icon`]:{color:je,cursor:"pointer",transition:`all ${bt}`,"&:hover":{color:It}}}),ht(We,`${Ee}-affix-wrapper`))}},rt=We=>{const{componentCls:Ee,colorError:Ve,colorWarning:Xe,borderRadiusLG:bt,borderRadiusSM:je}=We;return{[`${Ee}-group`]:Object.assign(Object.assign(Object.assign({},(0,we.Wf)(We)),He(We)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${Ee}-group-addon`]:{borderRadius:bt,fontSize:We.fontSizeLG}},"&-sm":{[`${Ee}-group-addon`]:{borderRadius:je}},"&-status-error":{[`${Ee}-group-addon`]:{color:Ve,borderColor:Ve}},"&-status-warning":{[`${Ee}-group-addon`]:{color:Xe,borderColor:Xe}},"&-disabled":{[`${Ee}-group-addon`]:Object.assign({},Ce(We))},[`&:not(${Ee}-compact-first-item):not(${Ee}-compact-last-item)${Ee}-compact-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderRadius:0}},[`&:not(${Ee}-compact-last-item)${Ee}-compact-first-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${Ee}-compact-first-item)${Ee}-compact-last-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Et=We=>{const{componentCls:Ee,antCls:Ve}=We,Xe=`${Ee}-search`;return{[Xe]:{[`${Ee}`]:{"&:hover, &:focus":{borderColor:We.colorPrimaryHover,[`+ ${Ee}-group-addon ${Xe}-button:not(${Ve}-btn-primary)`]:{borderInlineStartColor:We.colorPrimaryHover}}},[`${Ee}-affix-wrapper`]:{borderRadius:0},[`${Ee}-lg`]:{lineHeight:We.lineHeightLG-2e-4},[`> ${Ee}-group`]:{[`> ${Ee}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Xe}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:We.borderRadius,borderEndEndRadius:We.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Xe}-button:not(${Ve}-btn-primary)`]:{color:We.colorTextDescription,"&:hover":{color:We.colorPrimaryHover},"&:active":{color:We.colorPrimaryActive},[`&${Ve}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Xe}-button`]:{height:We.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Xe}-button`]:{height:We.controlHeightLG},[`&-small ${Xe}-button`]:{height:We.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${Ee}-compact-item`]:{[`&:not(${Ee}-compact-last-item)`]:{[`${Ee}-group-addon`]:{[`${Ee}-search-button`]:{marginInlineEnd:-We.lineWidth,borderRadius:0}}},[`&:not(${Ee}-compact-first-item)`]:{[`${Ee},${Ee}-affix-wrapper`]:{borderRadius:0}},[`> ${Ee}-group-addon ${Ee}-search-button,
> ${Ee},
${Ee}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${Ee}-affix-wrapper-focused`]:{zIndex:2}}}}},Zt=We=>{const{componentCls:Ee,paddingLG:Ve}=We,Xe=`${Ee}-textarea`;return{[Xe]:{position:"relative","&-show-count":{[`> ${Ee}`]:{height:"100%"},[`${Ee}-data-count`]:{position:"absolute",bottom:-We.fontSize*We.lineHeight,insetInlineEnd:0,color:We.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${Ee}`]:{paddingInlineEnd:Ve}},[`&-affix-wrapper${Xe}-has-feedback`]:{[`${Ee}`]:{paddingInlineEnd:Ve}},[`&-affix-wrapper${Ee}-affix-wrapper`]:{padding:0,[`> textarea${Ee}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${Ee}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${Ee}-clear-icon`]:{position:"absolute",insetInlineEnd:We.paddingXS,insetBlockStart:We.paddingXS},[`${Xe}-suffix`]:{position:"absolute",top:0,insetInlineEnd:We.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Je(We){return(0,Re.TS)(We,{inputAffixPadding:We.paddingXXS})}const lt=We=>{const{controlHeight:Ee,fontSize:Ve,lineHeight:Xe,lineWidth:bt,controlHeightSM:je,controlHeightLG:It,fontSizeLG:at,lineHeightLG:Ct,paddingSM:qe,controlPaddingHorizontalSM:Nt,controlPaddingHorizontal:Qt,colorFillAlter:Vt,colorPrimaryHover:Gt,controlOutlineWidth:Ft,controlOutline:Fe,colorErrorOutline:xe,colorWarningOutline:ft}=We;return{paddingBlock:Math.max(Math.round((Ee-Ve*Xe)/2*10)/10-bt,3),paddingBlockSM:Math.max(Math.round((je-Ve*Xe)/2*10)/10-bt,0),paddingBlockLG:Math.ceil((It-at*Ct)/2*10)/10-bt,paddingInline:qe-bt,paddingInlineSM:Nt-bt,paddingInlineLG:Qt-bt,addonBg:Vt,activeBorderColor:Gt,hoverBorderColor:Gt,activeShadow:`0 0 0 ${Ft}px ${Fe}`,errorActiveShadow:`0 0 0 ${Ft}px ${xe}`,warningActiveShadow:`0 0 0 ${Ft}px ${ft}`}};rn.ZP=(0,st.Z)("Input",We=>{const Ee=(0,Re.TS)(We,Je(We));return[mt(Ee),Zt(Ee),ot(Ee),rt(Ee),Et(Ee),(0,ct.c)(Ee)]},lt)},5112:function(mn,rn,he){"use strict";he.d(rn,{ZP:function(){return Fe}});var we=he(92310),ct=he.n(we),Re=he(18929),st=he(26112),Se=he(59301),Be=he(36355),Oe=he(19716);const Ce=Se.createContext(null),Me=Ce.Provider;var Ne=Ce;const ht=Se.createContext(null),Ie=ht.Provider;var He=he(5630),mt=he(8654),Ye=he(1684),ot=he(32441),rt=he(17313),Et=he(83116),Zt=he(37613);const Je=xe=>{const{componentCls:ft,antCls:qt}=xe,Ot=`${ft}-group`;return{[Ot]:Object.assign(Object.assign({},(0,rt.Wf)(xe)),{display:"inline-block",fontSize:0,[`&${Ot}-rtl`]:{direction:"rtl"},[`${qt}-badge ${qt}-badge-count`]:{zIndex:1},[`> ${qt}-badge:not(:first-child) > ${qt}-button-wrapper`]:{borderInlineStart:"none"}})}},lt=xe=>{const{componentCls:ft,wrapperMarginInlineEnd:qt,colorPrimary:Ot,radioSize:Ue,motionDurationSlow:Ge,motionDurationMid:wt,motionEaseInOutCirc:dn,colorBgContainer:Rt,colorBorder:an,lineWidth:$t,dotSize:Bt,colorBgContainerDisabled:Tt,colorTextDisabled:ge,paddingXS:se,dotColorDisabled:oe,lineType:fe,radioDotDisabledSize:ve,wireframe:ce,colorWhite:$e}=xe,xt=`${ft}-inner`;return{[`${ft}-wrapper`]:Object.assign(Object.assign({},(0,rt.Wf)(xe)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:qt,cursor:"pointer",[`&${ft}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:xe.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${ft}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${$t}px ${fe} ${Ot}`,borderRadius:"50%",visibility:"hidden",content:'""'},[ft]:Object.assign(Object.assign({},(0,rt.Wf)(xe)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${ft}-wrapper:hover &,
&:hover ${xt}`]:{borderColor:Ot},[`${ft}-input:focus-visible + ${xt}`]:Object.assign({},(0,rt.oN)(xe)),[`${ft}:hover::after, ${ft}-wrapper:hover &::after`]:{visibility:"visible"},[`${ft}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Ue,height:Ue,marginBlockStart:Ue/-2,marginInlineStart:Ue/-2,backgroundColor:ce?Ot:$e,borderBlockStart:0,borderInlineStart:0,borderRadius:Ue,transform:"scale(0)",opacity:0,transition:`all ${Ge} ${dn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Ue,height:Ue,backgroundColor:Rt,borderColor:an,borderStyle:"solid",borderWidth:$t,borderRadius:"50%",transition:`all ${wt}`},[`${ft}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${ft}-checked`]:{[xt]:{borderColor:Ot,backgroundColor:ce?Rt:Ot,"&::after":{transform:`scale(${Bt/Ue})`,opacity:1,transition:`all ${Ge} ${dn}`}}},[`${ft}-disabled`]:{cursor:"not-allowed",[xt]:{backgroundColor:Tt,borderColor:an,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${ft}-input`]:{cursor:"not-allowed"},[`${ft}-disabled + span`]:{color:ge,cursor:"not-allowed"},[`&${ft}-checked`]:{[xt]:{"&::after":{transform:`scale(${ve/Ue})`}}}},[`span${ft} + *`]:{paddingInlineStart:se,paddingInlineEnd:se}})}},We=xe=>{const{buttonColor:ft,controlHeight:qt,componentCls:Ot,lineWidth:Ue,lineType:Ge,colorBorder:wt,motionDurationSlow:dn,motionDurationMid:Rt,buttonPaddingInline:an,fontSize:$t,buttonBg:Bt,fontSizeLG:Tt,controlHeightLG:ge,controlHeightSM:se,paddingXS:oe,borderRadius:fe,borderRadiusSM:ve,borderRadiusLG:ce,buttonCheckedBg:$e,buttonSolidCheckedColor:xt,colorTextDisabled:Ut,colorBgContainerDisabled:Ht,buttonCheckedBgDisabled:Jt,buttonCheckedColorDisabled:en,colorPrimary:hn,colorPrimaryHover:pn,colorPrimaryActive:bn,buttonSolidCheckedBg:pt,buttonSolidCheckedHoverBg:sn,buttonSolidCheckedActiveBg:zn}=xe;return{[`${Ot}-button-wrapper`]:{position:"relative",display:"inline-block",height:qt,margin:0,paddingInline:an,paddingBlock:0,color:ft,fontSize:$t,lineHeight:`${qt-Ue*2}px`,background:Bt,border:`${Ue}px ${Ge} ${wt}`,borderBlockStartWidth:Ue+.02,borderInlineStartWidth:0,borderInlineEndWidth:Ue,cursor:"pointer",transition:[`color ${Rt}`,`background ${Rt}`,`box-shadow ${Rt}`].join(","),a:{color:ft},[`> ${Ot}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Ue,insetInlineStart:-Ue,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Ue,paddingInline:0,backgroundColor:wt,transition:`background-color ${dn}`,content:'""'}},"&:first-child":{borderInlineStart:`${Ue}px ${Ge} ${wt}`,borderStartStartRadius:fe,borderEndStartRadius:fe},"&:last-child":{borderStartEndRadius:fe,borderEndEndRadius:fe},"&:first-child:last-child":{borderRadius:fe},[`${Ot}-group-large &`]:{height:ge,fontSize:Tt,lineHeight:`${ge-Ue*2}px`,"&:first-child":{borderStartStartRadius:ce,borderEndStartRadius:ce},"&:last-child":{borderStartEndRadius:ce,borderEndEndRadius:ce}},[`${Ot}-group-small &`]:{height:se,paddingInline:oe-Ue,paddingBlock:0,lineHeight:`${se-Ue*2}px`,"&:first-child":{borderStartStartRadius:ve,borderEndStartRadius:ve},"&:last-child":{borderStartEndRadius:ve,borderEndEndRadius:ve}},"&:hover":{position:"relative",color:hn},"&:has(:focus-visible)":Object.assign({},(0,rt.oN)(xe)),[`${Ot}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ot}-button-wrapper-disabled)`]:{zIndex:1,color:hn,background:$e,borderColor:hn,"&::before":{backgroundColor:hn},"&:first-child":{borderColor:hn},"&:hover":{color:pn,borderColor:pn,"&::before":{backgroundColor:pn}},"&:active":{color:bn,borderColor:bn,"&::before":{backgroundColor:bn}}},[`${Ot}-group-solid &-checked:not(${Ot}-button-wrapper-disabled)`]:{color:xt,background:pt,borderColor:pt,"&:hover":{color:xt,background:sn,borderColor:sn},"&:active":{color:xt,background:zn,borderColor:zn}},"&-disabled":{color:Ut,backgroundColor:Ht,borderColor:wt,cursor:"not-allowed","&:first-child, &:hover":{color:Ut,backgroundColor:Ht,borderColor:wt}},[`&-disabled${Ot}-button-wrapper-checked`]:{color:en,backgroundColor:Jt,borderColor:wt,boxShadow:"none"}}}},Ee=xe=>xe-4*2;var Ve=(0,Et.Z)("Radio",xe=>{const{controlOutline:ft,controlOutlineWidth:qt,radioSize:Ot}=xe,Ue=`0 0 0 ${qt}px ${ft}`,Ge=Ue,wt=Ee(Ot),dn=(0,Zt.TS)(xe,{radioDotDisabledSize:wt,radioFocusShadow:Ue,radioButtonFocusShadow:Ge});return[Je(dn),lt(dn),We(dn)]},xe=>{const{wireframe:ft,padding:qt,marginXS:Ot,lineWidth:Ue,fontSizeLG:Ge,colorText:wt,colorBgContainer:dn,colorTextDisabled:Rt,controlItemBgActiveDisabled:an,colorTextLightSolid:$t,colorPrimary:Bt,colorPrimaryHover:Tt,colorPrimaryActive:ge}=xe,se=4,oe=Ge,fe=ft?Ee(oe):oe-(se+Ue)*2;return{radioSize:oe,dotSize:fe,dotColorDisabled:Rt,buttonSolidCheckedColor:$t,buttonSolidCheckedBg:Bt,buttonSolidCheckedHoverBg:Tt,buttonSolidCheckedActiveBg:ge,buttonBg:dn,buttonCheckedBg:dn,buttonColor:wt,buttonCheckedBgDisabled:an,buttonCheckedColorDisabled:Rt,buttonPaddingInline:qt-Ue,wrapperMarginInlineEnd:Ot}}),Xe=he(14088),bt=he(4572),je=function(xe,ft){var qt={};for(var Ot in xe)Object.prototype.hasOwnProperty.call(xe,Ot)&&ft.indexOf(Ot)<0&&(qt[Ot]=xe[Ot]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ue=0,Ot=Object.getOwnPropertySymbols(xe);Ue<Ot.length;Ue++)ft.indexOf(Ot[Ue])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ot[Ue])&&(qt[Ot[Ue]]=xe[Ot[Ue]]);return qt};const It=(xe,ft)=>{var qt,Ot;const Ue=Se.useContext(Ne),Ge=Se.useContext(ht),{getPrefixCls:wt,direction:dn,radio:Rt}=Se.useContext(Be.E_),an=Se.useRef(null),$t=(0,mt.sQ)(ft,an),{isFormItemInput:Bt}=Se.useContext(ot.aM),Tt=bn=>{var pt,sn;(pt=xe.onChange)===null||pt===void 0||pt.call(xe,bn),(sn=Ue==null?void 0:Ue.onChange)===null||sn===void 0||sn.call(Ue,bn)},{prefixCls:ge,className:se,rootClassName:oe,children:fe,style:ve}=xe,ce=je(xe,["prefixCls","className","rootClassName","children","style"]),$e=wt("radio",ge),xt=((Ue==null?void 0:Ue.optionType)||Ge)==="button",Ut=xt?`${$e}-button`:$e,[Ht,Jt]=Ve($e),en=Object.assign({},ce),hn=Se.useContext(Ye.Z);Ue&&(en.name=Ue.name,en.onChange=Tt,en.checked=xe.value===Ue.value,en.disabled=(qt=en.disabled)!==null&&qt!==void 0?qt:Ue.disabled),en.disabled=(Ot=en.disabled)!==null&&Ot!==void 0?Ot:hn;const pn=ct()(`${Ut}-wrapper`,{[`${Ut}-wrapper-checked`]:en.checked,[`${Ut}-wrapper-disabled`]:en.disabled,[`${Ut}-wrapper-rtl`]:dn==="rtl",[`${Ut}-wrapper-in-form-item`]:Bt},Rt==null?void 0:Rt.className,se,oe,Jt);return Ht(Se.createElement(Xe.Z,{component:"Radio",disabled:en.disabled},Se.createElement("label",{className:pn,style:Object.assign(Object.assign({},Rt==null?void 0:Rt.style),ve),onMouseEnter:xe.onMouseEnter,onMouseLeave:xe.onMouseLeave},Se.createElement(He.Z,Object.assign({},en,{className:ct()(en.className,!xt&&bt.A),type:"radio",prefixCls:Ut,ref:$t})),fe!==void 0?Se.createElement("span",null,fe):null)))};var Ct=Se.forwardRef(It);const qe=Se.forwardRef((xe,ft)=>{const{getPrefixCls:qt,direction:Ot}=Se.useContext(Be.E_),[Ue,Ge]=(0,Re.Z)(xe.defaultValue,{value:xe.value}),wt=pt=>{const sn=Ue,zn=pt.target.value;"value"in xe||Ge(zn);const{onChange:tt}=xe;tt&&zn!==sn&&tt(pt)},{prefixCls:dn,className:Rt,rootClassName:an,options:$t,buttonStyle:Bt="outline",disabled:Tt,children:ge,size:se,style:oe,id:fe,onMouseEnter:ve,onMouseLeave:ce,onFocus:$e,onBlur:xt}=xe,Ut=qt("radio",dn),Ht=`${Ut}-group`,[Jt,en]=Ve(Ut);let hn=ge;$t&&$t.length>0&&(hn=$t.map(pt=>typeof pt=="string"||typeof pt=="number"?Se.createElement(Ct,{key:pt.toString(),prefixCls:Ut,disabled:Tt,value:pt,checked:Ue===pt},pt):Se.createElement(Ct,{key:`radio-group-value-options-${pt.value}`,prefixCls:Ut,disabled:pt.disabled||Tt,value:pt.value,checked:Ue===pt.value,title:pt.title,style:pt.style},pt.label)));const pn=(0,Oe.Z)(se),bn=ct()(Ht,`${Ht}-${Bt}`,{[`${Ht}-${pn}`]:pn,[`${Ht}-rtl`]:Ot==="rtl"},Rt,an,en);return Jt(Se.createElement("div",Object.assign({},(0,st.Z)(xe,{aria:!0,data:!0}),{className:bn,style:oe,onMouseEnter:ve,onMouseLeave:ce,onFocus:$e,onBlur:xt,id:fe,ref:ft}),Se.createElement(Me,{value:{onChange:wt,value:Ue,disabled:xe.disabled,name:xe.name,optionType:xe.optionType}},hn)))});var Nt=Se.memo(qe),Qt=function(xe,ft){var qt={};for(var Ot in xe)Object.prototype.hasOwnProperty.call(xe,Ot)&&ft.indexOf(Ot)<0&&(qt[Ot]=xe[Ot]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ue=0,Ot=Object.getOwnPropertySymbols(xe);Ue<Ot.length;Ue++)ft.indexOf(Ot[Ue])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ot[Ue])&&(qt[Ot[Ue]]=xe[Ot[Ue]]);return qt};const Vt=(xe,ft)=>{const{getPrefixCls:qt}=Se.useContext(Be.E_),{prefixCls:Ot}=xe,Ue=Qt(xe,["prefixCls"]),Ge=qt("radio",Ot);return Se.createElement(Ie,{value:"button"},Se.createElement(Ct,Object.assign({prefixCls:Ge},Ue,{type:"radio",ref:ft})))};var Gt=Se.forwardRef(Vt);const Ft=Ct;Ft.Button=Gt,Ft.Group=Nt,Ft.__ANT_RADIO=!0;var Fe=Ft},57809:function(mn,rn,he){"use strict";var we=he(92310),ct=he.n(we),Re=he(77861),st=he(2738),Se=he(59301),Be=he(53487),Oe=he(62892),Ce=he(19080),Me=he(36355),Ne=he(1684),ht=he(93891),Ie=he(19716),He=he(32441),mt=he(33234),Ye=he(14154),ot=he(58582),rt=he(84443),Et=he(66339),Zt=function(Ve,Xe){var bt={};for(var je in Ve)Object.prototype.hasOwnProperty.call(Ve,je)&&Xe.indexOf(je)<0&&(bt[je]=Ve[je]);if(Ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var It=0,je=Object.getOwnPropertySymbols(Ve);It<je.length;It++)Xe.indexOf(je[It])<0&&Object.prototype.propertyIsEnumerable.call(Ve,je[It])&&(bt[je[It]]=Ve[je[It]]);return bt};const Je="SECRET_COMBOBOX_MODE_DO_NOT_USE",lt=(Ve,Xe)=>{var bt,{prefixCls:je,bordered:It=!0,className:at,rootClassName:Ct,getPopupContainer:qe,popupClassName:Nt,dropdownClassName:Qt,listHeight:Vt=256,placement:Gt,listItemHeight:Ft=24,size:Fe,disabled:xe,notFoundContent:ft,status:qt,builtinPlacements:Ot,dropdownMatchSelectWidth:Ue,popupMatchSelectWidth:Ge,direction:wt,style:dn,allowClear:Rt}=Ve,an=Zt(Ve,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:$t,getPrefixCls:Bt,renderEmpty:Tt,direction:ge,virtual:se,popupMatchSelectWidth:oe,popupOverflow:fe,select:ve}=Se.useContext(Me.E_),ce=Bt("select",je),$e=Bt(),xt=wt!=null?wt:ge,{compactSize:Ut,compactItemClassnames:Ht}=(0,mt.ri)(ce,xt),[Jt,en]=(0,Ye.Z)(ce),hn=Se.useMemo(()=>{const{mode:Yi}=an;if(Yi!=="combobox")return Yi===Je?"combobox":Yi},[an.mode]),pn=hn==="multiple"||hn==="tags",bn=(0,rt.Z)(an.suffixIcon,an.showArrow),pt=(bt=Ge!=null?Ge:Ue)!==null&&bt!==void 0?bt:oe,{status:sn,hasFeedback:zn,isFormItemInput:tt,feedbackIcon:vt}=Se.useContext(He.aM),Lt=(0,Ce.F)(sn,qt);let Ln;ft!==void 0?Ln=ft:hn==="combobox"?Ln=null:Ln=(Tt==null?void 0:Tt("Select"))||Se.createElement(ht.Z,{componentName:"Select"});const{suffixIcon:Mn,itemIcon:_n,removeIcon:ti,clearIcon:hi}=(0,Et.Z)(Object.assign(Object.assign({},an),{multiple:pn,hasFeedback:zn,feedbackIcon:vt,showSuffixIcon:bn,prefixCls:ce,showArrow:an.showArrow,componentName:"Select"})),pi=Rt===!0?{clearIcon:hi}:Rt,Bi=(0,st.Z)(an,["suffixIcon","itemIcon"]),_i=ct()(Nt||Qt,{[`${ce}-dropdown-${xt}`]:xt==="rtl"},Ct,en),Zn=(0,Ie.Z)(Yi=>{var bi;return(bi=Fe!=null?Fe:Ut)!==null&&bi!==void 0?bi:Yi}),Fi=Se.useContext(Ne.Z),Wi=xe!=null?xe:Fi,Gi=ct()({[`${ce}-lg`]:Zn==="large",[`${ce}-sm`]:Zn==="small",[`${ce}-rtl`]:xt==="rtl",[`${ce}-borderless`]:!It,[`${ce}-in-form-item`]:tt},(0,Ce.Z)(ce,Lt,zn),Ht,ve==null?void 0:ve.className,at,Ct,en),nr=Se.useMemo(()=>Gt!==void 0?Gt:xt==="rtl"?"bottomRight":"bottomLeft",[Gt,xt]),Pi=(0,ot.Z)(Ot,fe);return Jt(Se.createElement(Re.ZP,Object.assign({ref:Xe,virtual:se,showSearch:ve==null?void 0:ve.showSearch},Bi,{style:Object.assign(Object.assign({},ve==null?void 0:ve.style),dn),dropdownMatchSelectWidth:pt,builtinPlacements:Pi,transitionName:(0,Oe.m)($e,"slide-up",an.transitionName),listHeight:Vt,listItemHeight:Ft,mode:hn,prefixCls:ce,placement:nr,direction:xt,suffixIcon:Mn,menuItemSelectedIcon:_n,removeIcon:ti,allowClear:pi,notFoundContent:Ln,className:Gi,getPopupContainer:qe||$t,dropdownClassName:_i,disabled:Wi})))},We=Se.forwardRef(lt),Ee=(0,Be.Z)(We);We.SECRET_COMBOBOX_MODE_DO_NOT_USE=Je,We.Option=Re.Wx,We.OptGroup=Re.Xo,We._InternalPanelDoNotUseOrYouWillBeFired=Ee,rn.default=We},14154:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return We}});var we=he(17313),ct=he(74207),Re=he(37613),st=he(83116),Se=he(13826),Be=he(92899);const Oe=Ee=>{const{optionHeight:Ve,optionFontSize:Xe,optionLineHeight:bt,optionPadding:je}=Ee;return{position:"relative",display:"block",minHeight:Ve,padding:je,color:Ee.colorText,fontWeight:"normal",fontSize:Xe,lineHeight:bt,boxSizing:"border-box"}};var Me=Ee=>{const{antCls:Ve,componentCls:Xe}=Ee,bt=`${Xe}-item`,je=`&${Ve}-slide-up-enter${Ve}-slide-up-enter-active`,It=`&${Ve}-slide-up-appear${Ve}-slide-up-appear-active`,at=`&${Ve}-slide-up-leave${Ve}-slide-up-leave-active`,Ct=`${Xe}-dropdown-placement-`;return[{[`${Xe}-dropdown`]:Object.assign(Object.assign({},(0,we.Wf)(Ee)),{position:"absolute",top:-9999,zIndex:Ee.zIndexPopup,boxSizing:"border-box",padding:Ee.paddingXXS,overflow:"hidden",fontSize:Ee.fontSize,fontVariant:"initial",backgroundColor:Ee.colorBgElevated,borderRadius:Ee.borderRadiusLG,outline:"none",boxShadow:Ee.boxShadowSecondary,[`
${je}${Ct}bottomLeft,
${It}${Ct}bottomLeft
`]:{animationName:Se.fJ},[`
${je}${Ct}topLeft,
${It}${Ct}topLeft,
${je}${Ct}topRight,
${It}${Ct}topRight
`]:{animationName:Se.Qt},[`${at}${Ct}bottomLeft`]:{animationName:Se.Uw},[`
${at}${Ct}topLeft,
${at}${Ct}topRight
`]:{animationName:Se.ly},"&-hidden":{display:"none"},[`${bt}`]:Object.assign(Object.assign({},Oe(Ee)),{cursor:"pointer",transition:`background ${Ee.motionDurationSlow} ease`,borderRadius:Ee.borderRadiusSM,"&-group":{color:Ee.colorTextDescription,fontSize:Ee.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},we.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${bt}-option-disabled)`]:{backgroundColor:Ee.optionActiveBg},[`&-selected:not(${bt}-option-disabled)`]:{color:Ee.optionSelectedColor,fontWeight:Ee.optionSelectedFontWeight,backgroundColor:Ee.optionSelectedBg,[`${bt}-option-state`]:{color:Ee.colorPrimary}},"&-disabled":{[`&${bt}-option-selected`]:{backgroundColor:Ee.colorBgContainerDisabled},color:Ee.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:Ee.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,Se.oN)(Ee,"slide-up"),(0,Se.oN)(Ee,"slide-down"),(0,Be.Fm)(Ee,"move-up"),(0,Be.Fm)(Ee,"move-down")]};const Ne=2,ht=Ee=>{let{controlHeightSM:Ve,controlHeight:Xe,lineWidth:bt}=Ee;const je=(Xe-Ve)/2-bt,It=Math.ceil(je/2);return[je,It]};function Ie(Ee,Ve){const{componentCls:Xe,iconCls:bt}=Ee,je=`${Xe}-selection-overflow`,It=Ee.multipleSelectItemHeight,[at]=ht(Ee),Ct=Ve?`${Xe}-${Ve}`:"";return{[`${Xe}-multiple${Ct}`]:{fontSize:Ee.fontSize,[je]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Xe}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${at-Ne}px ${Ne*2}px`,borderRadius:Ee.borderRadius,[`${Xe}-show-search&`]:{cursor:"text"},[`${Xe}-disabled&`]:{background:Ee.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Ne}px 0`,lineHeight:`${It}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${Xe}-show-arrow ${Xe}-selector,
&${Xe}-allow-clear ${Xe}-selector
`]:{paddingInlineEnd:Ee.fontSizeIcon+Ee.controlPaddingHorizontal},[`${Xe}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:It,marginTop:Ne,marginBottom:Ne,lineHeight:`${It-Ee.lineWidth*2}px`,background:Ee.multipleItemBg,border:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.multipleItemBorderColor}`,borderRadius:Ee.borderRadiusSM,cursor:"default",transition:`font-size ${Ee.motionDurationSlow}, line-height ${Ee.motionDurationSlow}, height ${Ee.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Ne*2,paddingInlineStart:Ee.paddingXS,paddingInlineEnd:Ee.paddingXS/2,[`${Xe}-disabled&`]:{color:Ee.multipleItemColorDisabled,borderColor:Ee.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:Ee.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,we.Ro)()),{display:"inline-flex",alignItems:"center",color:Ee.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${bt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:Ee.colorIconHover}})},[`${je}-item + ${je}-item`]:{[`${Xe}-selection-search`]:{marginInlineStart:0}},[`${Xe}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:Ee.inputPaddingHorizontalBase-at,"\n &-input,\n &-mirror\n ":{height:It,fontFamily:Ee.fontFamily,lineHeight:`${It}px`,transition:`all ${Ee.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Xe}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:Ee.inputPaddingHorizontalBase,insetInlineEnd:Ee.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${Ee.motionDurationSlow}`}}}}var mt=Ee=>{const{componentCls:Ve}=Ee,Xe=(0,Re.TS)(Ee,{controlHeight:Ee.controlHeightSM,multipleSelectItemHeight:Ee.controlHeightXS,borderRadius:Ee.borderRadiusSM,borderRadiusSM:Ee.borderRadiusXS}),bt=(0,Re.TS)(Ee,{fontSize:Ee.fontSizeLG,controlHeight:Ee.controlHeightLG,multipleSelectItemHeight:Ee.multipleItemHeightLG,borderRadius:Ee.borderRadiusLG,borderRadiusSM:Ee.borderRadius}),[,je]=ht(Ee);return[Ie(Ee),Ie(Xe,"sm"),{[`${Ve}-multiple${Ve}-sm`]:{[`${Ve}-selection-placeholder`]:{insetInline:Ee.controlPaddingHorizontalSM-Ee.lineWidth},[`${Ve}-selection-search`]:{marginInlineStart:je}}},Ie(bt,"lg")]};function Ye(Ee,Ve){const{componentCls:Xe,inputPaddingHorizontalBase:bt,borderRadius:je}=Ee,It=Ee.controlHeight-Ee.lineWidth*2,at=Math.ceil(Ee.fontSize*1.25),Ct=Ve?`${Xe}-${Ve}`:"";return{[`${Xe}-single${Ct}`]:{fontSize:Ee.fontSize,[`${Xe}-selector`]:Object.assign(Object.assign({},(0,we.Wf)(Ee)),{display:"flex",borderRadius:je,[`${Xe}-selection-search`]:{position:"absolute",top:0,insetInlineStart:bt,insetInlineEnd:bt,bottom:0,"&-input":{width:"100%"}},[`
${Xe}-selection-item,
${Xe}-selection-placeholder
`]:{padding:0,lineHeight:`${It}px`,transition:`all ${Ee.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${It}px`}},[`${Xe}-selection-item`]:{position:"relative",userSelect:"none"},[`${Xe}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Xe}-selection-item:after`,`${Xe}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${Xe}-show-arrow ${Xe}-selection-item,
&${Xe}-show-arrow ${Xe}-selection-placeholder
`]:{paddingInlineEnd:at},[`&${Xe}-open ${Xe}-selection-item`]:{color:Ee.colorTextPlaceholder},[`&:not(${Xe}-customize-input)`]:{[`${Xe}-selector`]:{width:"100%",height:Ee.controlHeight,padding:`0 ${bt}px`,[`${Xe}-selection-search-input`]:{height:It},"&:after":{lineHeight:`${It}px`}}},[`&${Xe}-customize-input`]:{[`${Xe}-selector`]:{"&:after":{display:"none"},[`${Xe}-selection-search`]:{position:"static",width:"100%"},[`${Xe}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${bt}px`,"&:after":{display:"none"}}}}}}}function ot(Ee){const{componentCls:Ve}=Ee,Xe=Ee.controlPaddingHorizontalSM-Ee.lineWidth;return[Ye(Ee),Ye((0,Re.TS)(Ee,{controlHeight:Ee.controlHeightSM,borderRadius:Ee.borderRadiusSM}),"sm"),{[`${Ve}-single${Ve}-sm`]:{[`&:not(${Ve}-customize-input)`]:{[`${Ve}-selection-search`]:{insetInlineStart:Xe,insetInlineEnd:Xe},[`${Ve}-selector`]:{padding:`0 ${Xe}px`},[`&${Ve}-show-arrow ${Ve}-selection-search`]:{insetInlineEnd:Xe+Ee.fontSize*1.5},[`
&${Ve}-show-arrow ${Ve}-selection-item,
&${Ve}-show-arrow ${Ve}-selection-placeholder
`]:{paddingInlineEnd:Ee.fontSize*1.5}}}},Ye((0,Re.TS)(Ee,{controlHeight:Ee.singleItemHeightLG,fontSize:Ee.fontSizeLG,borderRadius:Ee.borderRadiusLG}),"lg")]}const rt=Ee=>{const{componentCls:Ve,selectorBg:Xe}=Ee;return{position:"relative",backgroundColor:Xe,border:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.colorBorder}`,transition:`all ${Ee.motionDurationMid} ${Ee.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ve}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ve}-disabled&`]:{color:Ee.colorTextDisabled,background:Ee.colorBgContainerDisabled,cursor:"not-allowed",[`${Ve}-multiple&`]:{background:Ee.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Et=function(Ee,Ve){let Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:bt,borderHoverColor:je,outlineColor:It,antCls:at}=Ve,Ct=Xe?{[`${bt}-selector`]:{borderColor:je}}:{};return{[Ee]:{[`&:not(${bt}-disabled):not(${bt}-customize-input):not(${at}-pagination-size-changer)`]:Object.assign(Object.assign({},Ct),{[`${bt}-focused& ${bt}-selector`]:{borderColor:je,boxShadow:`0 0 0 ${Ve.controlOutlineWidth}px ${It}`,outline:0},[`&:hover ${bt}-selector`]:{borderColor:je}})}}},Zt=Ee=>{const{componentCls:Ve}=Ee;return{[`${Ve}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},Je=Ee=>{const{componentCls:Ve,inputPaddingHorizontalBase:Xe,iconCls:bt}=Ee;return{[Ve]:Object.assign(Object.assign({},(0,we.Wf)(Ee)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ve}-customize-input) ${Ve}-selector`]:Object.assign(Object.assign({},rt(Ee)),Zt(Ee)),[`${Ve}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},we.vS),[`${Ve}-selection-placeholder`]:Object.assign(Object.assign({},we.vS),{flex:1,color:Ee.colorTextPlaceholder,pointerEvents:"none"}),[`${Ve}-arrow`]:Object.assign(Object.assign({},(0,we.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,height:Ee.fontSizeIcon,marginTop:-Ee.fontSizeIcon/2,color:Ee.colorTextQuaternary,fontSize:Ee.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[bt]:{verticalAlign:"top",transition:`transform ${Ee.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ve}-suffix)`]:{pointerEvents:"auto"}},[`${Ve}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ve}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,zIndex:1,display:"inline-block",width:Ee.fontSizeIcon,height:Ee.fontSizeIcon,marginTop:-Ee.fontSizeIcon/2,color:Ee.colorTextQuaternary,fontSize:Ee.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:Ee.clearBg,cursor:"pointer",opacity:0,transition:`color ${Ee.motionDurationMid} ease, opacity ${Ee.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:Ee.colorTextTertiary}},"&:hover":{[`${Ve}-clear`]:{opacity:1}}}),[`${Ve}-has-feedback`]:{[`${Ve}-clear`]:{insetInlineEnd:Xe+Ee.fontSize+Ee.paddingXS}}}},lt=Ee=>{const{componentCls:Ve}=Ee;return[{[Ve]:{[`&-borderless ${Ve}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ve}-in-form-item`]:{width:"100%"}}},Je(Ee),ot(Ee),mt(Ee),Me(Ee),{[`${Ve}-rtl`]:{direction:"rtl"}},Et(Ve,(0,Re.TS)(Ee,{borderHoverColor:Ee.colorPrimaryHover,outlineColor:Ee.controlOutline})),Et(`${Ve}-status-error`,(0,Re.TS)(Ee,{borderHoverColor:Ee.colorErrorHover,outlineColor:Ee.colorErrorOutline}),!0),Et(`${Ve}-status-warning`,(0,Re.TS)(Ee,{borderHoverColor:Ee.colorWarningHover,outlineColor:Ee.colorWarningOutline}),!0),(0,ct.c)(Ee,{borderElCls:`${Ve}-selector`,focusElCls:`${Ve}-focused`})]};var We=(0,st.Z)("Select",(Ee,Ve)=>{let{rootPrefixCls:Xe}=Ve;const bt=(0,Re.TS)(Ee,{rootPrefixCls:Xe,inputPaddingHorizontalBase:Ee.paddingSM-1,multipleSelectItemHeight:Ee.multipleItemHeight});return[lt(bt)]},Ee=>{const{fontSize:Ve,lineHeight:Xe,controlHeight:bt,controlPaddingHorizontal:je,zIndexPopupBase:It,colorText:at,fontWeightStrong:Ct,controlItemBgActive:qe,controlItemBgHover:Nt,colorBgContainer:Qt,colorFillSecondary:Vt,controlHeightLG:Gt,controlHeightSM:Ft,colorBgContainerDisabled:Fe,colorTextDisabled:xe}=Ee;return{zIndexPopup:It+50,optionSelectedColor:at,optionSelectedFontWeight:Ct,optionSelectedBg:qe,optionActiveBg:Nt,optionPadding:`${(bt-Ve*Xe)/2}px ${je}px`,optionFontSize:Ve,optionLineHeight:Xe,optionHeight:bt,selectorBg:Qt,clearBg:Qt,singleItemHeightLG:Gt,multipleItemBg:Vt,multipleItemBorderColor:"transparent",multipleItemHeight:Ft,multipleItemHeightLG:bt,multipleSelectorBgDisabled:Fe,multipleItemColorDisabled:xe,multipleItemBorderColorDisabled:"transparent"}})},58582:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return ct}});const we=Re=>{const Se={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Re==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},Se),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},Se),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},Se),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},Se),{points:["br","tr"],offset:[0,-4]})}};function ct(Re,st){return Re||we(st)}},84443:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return we}});function we(ct,Re){return Re!==void 0?Re:ct!==null}},66339:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});var we=he(40001),ct=he(19248),Re=he(99267),st=he(84105),Se=he(58617),Be=he(47472),Oe=he(59301);function Ce(Me){let{suffixIcon:Ne,clearIcon:ht,menuItemSelectedIcon:Ie,removeIcon:He,loading:mt,multiple:Ye,hasFeedback:ot,prefixCls:rt,showSuffixIcon:Et,feedbackIcon:Zt,showArrow:Je,componentName:lt}=Me;const We=ht!=null?ht:Oe.createElement(ct.Z,null),Ee=je=>Ne===null&&!ot&&!Je?null:Oe.createElement(Oe.Fragment,null,Et!==!1&&je,ot&&Zt);let Ve=null;if(Ne!==void 0)Ve=Ee(Ne);else if(mt)Ve=Ee(Oe.createElement(Se.Z,{spin:!0}));else{const je=`${rt}-suffix`;Ve=It=>{let{open:at,showSearch:Ct}=It;return Ee(at&&Ct?Oe.createElement(Be.Z,{className:je}):Oe.createElement(st.Z,{className:je}))}}let Xe=null;Ie!==void 0?Xe=Ie:Ye?Xe=Oe.createElement(we.Z,null):Xe=null;let bt=null;return He!==void 0?bt=He:bt=Oe.createElement(Re.Z,null),{clearIcon:We,suffixIcon:Ve,itemIcon:Xe,removeIcon:bt}}},8378:function(mn,rn){"use strict";const he=we=>({[we.componentCls]:{[`${we.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${we.motionDurationMid} ${we.motionEaseInOut},
opacity ${we.motionDurationMid} ${we.motionEaseInOut} !important`}},[`${we.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${we.motionDurationMid} ${we.motionEaseInOut},
opacity ${we.motionDurationMid} ${we.motionEaseInOut} !important`}}});rn.Z=he},92899:function(mn,rn,he){"use strict";he.d(rn,{Fm:function(){return Ie}});var we=he(36237),ct=he(95406);const Re=new we.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),st=new we.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),Se=new we.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Be=new we.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Oe=new we.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ce=new we.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Me=new we.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ne=new we.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ht={"move-up":{inKeyframes:Me,outKeyframes:Ne},"move-down":{inKeyframes:Re,outKeyframes:st},"move-left":{inKeyframes:Se,outKeyframes:Be},"move-right":{inKeyframes:Oe,outKeyframes:Ce}},Ie=(He,mt)=>{const{antCls:Ye}=He,ot=`${Ye}-${mt}`,{inKeyframes:rt,outKeyframes:Et}=ht[mt];return[(0,ct.R)(ot,rt,Et,He.motionDurationMid),{[`
${ot}-enter,
${ot}-appear
`]:{opacity:0,animationTimingFunction:He.motionEaseOutCirc},[`${ot}-leave`]:{animationTimingFunction:He.motionEaseInOutCirc}}]}},13826:function(mn,rn,he){"use strict";he.d(rn,{Qt:function(){return Se},Uw:function(){return st},fJ:function(){return Re},ly:function(){return Be},oN:function(){return Ie}});var we=he(36237),ct=he(95406);const Re=new we.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),st=new we.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Se=new we.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Be=new we.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Oe=new we.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Ce=new we.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Me=new we.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Ne=new we.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),ht={"slide-up":{inKeyframes:Re,outKeyframes:st},"slide-down":{inKeyframes:Se,outKeyframes:Be},"slide-left":{inKeyframes:Oe,outKeyframes:Ce},"slide-right":{inKeyframes:Me,outKeyframes:Ne}},Ie=(He,mt)=>{const{antCls:Ye}=He,ot=`${Ye}-${mt}`,{inKeyframes:rt,outKeyframes:Et}=ht[mt];return[(0,ct.R)(ot,rt,Et,He.motionDurationMid),{[`
${ot}-enter,
${ot}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:He.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${ot}-leave`]:{animationTimingFunction:He.motionEaseInQuint}}]}},78673:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ct}});var we=he(58617),ct=he(92310),Re=he.n(ct),st=he(60499),Se=he(18642),Be=he(72190),Oe=he(42244),Ce=he(59301),Me=he(18929),Ne=he(10228),ht=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ie=Ce.forwardRef(function(qe,Nt){var Qt,Vt=qe.prefixCls,Gt=Vt===void 0?"rc-switch":Vt,Ft=qe.className,Fe=qe.checked,xe=qe.defaultChecked,ft=qe.disabled,qt=qe.loadingIcon,Ot=qe.checkedChildren,Ue=qe.unCheckedChildren,Ge=qe.onClick,wt=qe.onChange,dn=qe.onKeyDown,Rt=(0,Oe.Z)(qe,ht),an=(0,Me.Z)(!1,{value:Fe,defaultValue:xe}),$t=(0,Be.Z)(an,2),Bt=$t[0],Tt=$t[1];function ge(ve,ce){var $e=Bt;return ft||($e=ve,Tt($e),wt==null||wt($e,ce)),$e}function se(ve){ve.which===Ne.Z.LEFT?ge(!1,ve):ve.which===Ne.Z.RIGHT&&ge(!0,ve),dn==null||dn(ve)}function oe(ve){var ce=ge(!Bt,ve);Ge==null||Ge(ce,ve)}var fe=Re()(Gt,Ft,(Qt={},(0,Se.Z)(Qt,"".concat(Gt,"-checked"),Bt),(0,Se.Z)(Qt,"".concat(Gt,"-disabled"),ft),Qt));return Ce.createElement("button",(0,st.Z)({},Rt,{type:"button",role:"switch","aria-checked":Bt,disabled:ft,className:fe,ref:Nt,onKeyDown:se,onClick:oe}),qt,Ce.createElement("span",{className:"".concat(Gt,"-inner")},Ce.createElement("span",{className:"".concat(Gt,"-inner-checked")},Ot),Ce.createElement("span",{className:"".concat(Gt,"-inner-unchecked")},Ue)))});Ie.displayName="Switch";var He=Ie,mt=he(14088),Ye=he(36355),ot=he(1684),rt=he(19716),Et=he(64993),Zt=he(17313),Je=he(83116),lt=he(37613);const We=qe=>{const{componentCls:Nt,trackHeightSM:Qt,trackPadding:Vt,trackMinWidthSM:Gt,innerMinMarginSM:Ft,innerMaxMarginSM:Fe,handleSizeSM:xe}=qe,ft=`${Nt}-inner`;return{[Nt]:{[`&${Nt}-small`]:{minWidth:Gt,height:Qt,lineHeight:`${Qt}px`,[`${Nt}-inner`]:{paddingInlineStart:Fe,paddingInlineEnd:Ft,[`${ft}-checked`]:{marginInlineStart:`calc(-100% + ${xe+Vt*2}px - ${Fe*2}px)`,marginInlineEnd:`calc(100% - ${xe+Vt*2}px + ${Fe*2}px)`},[`${ft}-unchecked`]:{marginTop:-Qt,marginInlineStart:0,marginInlineEnd:0}},[`${Nt}-handle`]:{width:xe,height:xe},[`${Nt}-loading-icon`]:{top:(xe-qe.switchLoadingIconSize)/2,fontSize:qe.switchLoadingIconSize},[`&${Nt}-checked`]:{[`${Nt}-inner`]:{paddingInlineStart:Ft,paddingInlineEnd:Fe,[`${ft}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${ft}-unchecked`]:{marginInlineStart:`calc(100% - ${xe+Vt*2}px + ${Fe*2}px)`,marginInlineEnd:`calc(-100% + ${xe+Vt*2}px - ${Fe*2}px)`}},[`${Nt}-handle`]:{insetInlineStart:`calc(100% - ${xe+Vt}px)`}},[`&:not(${Nt}-disabled):active`]:{[`&:not(${Nt}-checked) ${ft}`]:{[`${ft}-unchecked`]:{marginInlineStart:qe.marginXXS/2,marginInlineEnd:-qe.marginXXS/2}},[`&${Nt}-checked ${ft}`]:{[`${ft}-checked`]:{marginInlineStart:-qe.marginXXS/2,marginInlineEnd:qe.marginXXS/2}}}}}}},Ee=qe=>{const{componentCls:Nt,handleSize:Qt}=qe;return{[Nt]:{[`${Nt}-loading-icon${qe.iconCls}`]:{position:"relative",top:(Qt-qe.fontSize)/2,color:qe.switchLoadingIconColor,verticalAlign:"top"},[`&${Nt}-checked ${Nt}-loading-icon`]:{color:qe.switchColor}}}},Ve=qe=>{const{componentCls:Nt,motion:Qt,trackPadding:Vt,handleBg:Gt,handleShadow:Ft,handleSize:Fe}=qe,xe=`${Nt}-handle`;return{[Nt]:{[xe]:{position:"absolute",top:Vt,insetInlineStart:Vt,width:Fe,height:Fe,transition:`all ${qe.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Gt,borderRadius:Fe/2,boxShadow:Ft,transition:`all ${qe.switchDuration} ease-in-out`,content:'""'}},[`&${Nt}-checked ${xe}`]:{insetInlineStart:`calc(100% - ${Fe+Vt}px)`},[`&:not(${Nt}-disabled):active`]:Qt?{[`${xe}::before`]:{insetInlineEnd:qe.switchHandleActiveInset,insetInlineStart:0},[`&${Nt}-checked ${xe}::before`]:{insetInlineEnd:0,insetInlineStart:qe.switchHandleActiveInset}}:{}}}},Xe=qe=>{const{componentCls:Nt,trackHeight:Qt,trackPadding:Vt,innerMinMargin:Gt,innerMaxMargin:Ft,handleSize:Fe}=qe,xe=`${Nt}-inner`;return{[Nt]:{[xe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:Ft,paddingInlineEnd:Gt,transition:`padding-inline-start ${qe.switchDuration} ease-in-out, padding-inline-end ${qe.switchDuration} ease-in-out`,[`${xe}-checked, ${xe}-unchecked`]:{display:"block",color:qe.colorTextLightSolid,fontSize:qe.fontSizeSM,transition:`margin-inline-start ${qe.switchDuration} ease-in-out, margin-inline-end ${qe.switchDuration} ease-in-out`,pointerEvents:"none"},[`${xe}-checked`]:{marginInlineStart:`calc(-100% + ${Fe+Vt*2}px - ${Ft*2}px)`,marginInlineEnd:`calc(100% - ${Fe+Vt*2}px + ${Ft*2}px)`},[`${xe}-unchecked`]:{marginTop:-Qt,marginInlineStart:0,marginInlineEnd:0}},[`&${Nt}-checked ${xe}`]:{paddingInlineStart:Gt,paddingInlineEnd:Ft,[`${xe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xe}-unchecked`]:{marginInlineStart:`calc(100% - ${Fe+Vt*2}px + ${Ft*2}px)`,marginInlineEnd:`calc(-100% + ${Fe+Vt*2}px - ${Ft*2}px)`}},[`&:not(${Nt}-disabled):active`]:{[`&:not(${Nt}-checked) ${xe}`]:{[`${xe}-unchecked`]:{marginInlineStart:Vt*2,marginInlineEnd:-Vt*2}},[`&${Nt}-checked ${xe}`]:{[`${xe}-checked`]:{marginInlineStart:-Vt*2,marginInlineEnd:Vt*2}}}}}},bt=qe=>{const{componentCls:Nt,trackHeight:Qt,trackMinWidth:Vt}=qe;return{[Nt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Zt.Wf)(qe)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Vt,height:Qt,lineHeight:`${Qt}px`,verticalAlign:"middle",background:qe.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${qe.motionDurationMid}`,userSelect:"none",[`&:hover:not(${Nt}-disabled)`]:{background:qe.colorTextTertiary}}),(0,Zt.Qy)(qe)),{[`&${Nt}-checked`]:{background:qe.switchColor,[`&:hover:not(${Nt}-disabled)`]:{background:qe.colorPrimaryHover}},[`&${Nt}-loading, &${Nt}-disabled`]:{cursor:"not-allowed",opacity:qe.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${Nt}-rtl`]:{direction:"rtl"}})}};var je=(0,Je.Z)("Switch",qe=>{const Nt=(0,lt.TS)(qe,{switchDuration:qe.motionDurationMid,switchColor:qe.colorPrimary,switchDisabledOpacity:qe.opacityLoading,switchLoadingIconSize:qe.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${qe.opacityLoading})`,switchHandleActiveInset:"-30%"});return[bt(Nt),Xe(Nt),Ve(Nt),Ee(Nt),We(Nt)]},qe=>{const{fontSize:Nt,lineHeight:Qt,controlHeight:Vt,colorWhite:Gt}=qe,Ft=Nt*Qt,Fe=Vt/2,xe=2,ft=Ft-xe*2,qt=Fe-xe*2;return{trackHeight:Ft,trackHeightSM:Fe,trackMinWidth:ft*2+xe*4,trackMinWidthSM:qt*2+xe*2,trackPadding:xe,handleBg:Gt,handleSize:ft,handleSizeSM:qt,handleShadow:`0 2px 4px 0 ${new Et.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:ft/2,innerMaxMargin:ft+xe+xe*2,innerMinMarginSM:qt/2,innerMaxMarginSM:qt+xe+xe*2}}),It=function(qe,Nt){var Qt={};for(var Vt in qe)Object.prototype.hasOwnProperty.call(qe,Vt)&&Nt.indexOf(Vt)<0&&(Qt[Vt]=qe[Vt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Gt=0,Vt=Object.getOwnPropertySymbols(qe);Gt<Vt.length;Gt++)Nt.indexOf(Vt[Gt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Vt[Gt])&&(Qt[Vt[Gt]]=qe[Vt[Gt]]);return Qt};const at=Ce.forwardRef((qe,Nt)=>{const{prefixCls:Qt,size:Vt,disabled:Gt,loading:Ft,className:Fe,rootClassName:xe,style:ft}=qe,qt=It(qe,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Ot,direction:Ue,switch:Ge}=Ce.useContext(Ye.E_),wt=Ce.useContext(ot.Z),dn=(Gt!=null?Gt:wt)||Ft,Rt=Ot("switch",Qt),an=Ce.createElement("div",{className:`${Rt}-handle`},Ft&&Ce.createElement(we.Z,{className:`${Rt}-loading-icon`})),[$t,Bt]=je(Rt),Tt=(0,rt.Z)(Vt),ge=Re()(Ge==null?void 0:Ge.className,{[`${Rt}-small`]:Tt==="small",[`${Rt}-loading`]:Ft,[`${Rt}-rtl`]:Ue==="rtl"},Fe,xe,Bt),se=Object.assign(Object.assign({},Ge==null?void 0:Ge.style),ft);return $t(Ce.createElement(mt.Z,{component:"Switch"},Ce.createElement(He,Object.assign({},qt,{prefixCls:Rt,className:ge,style:se,disabled:dn,ref:Nt,loadingIcon:an}))))});at.__ANT_SWITCH=!0;var Ct=at},99313:function(mn,rn,he){"use strict";he.d(rn,{default:function(){return Qe}});var we=he(99267),ct=he(18785),Re=he(62772),st=he(92310),Se=he.n(st),Be=he(60499),Oe=he(18642),Ce=he(85899),Me=he(72190),Ne=he(43749),ht=he(42244),Ie=he(59301),He=he(49658),mt=he(18929),Ye=he(77900),ot=(0,Ie.createContext)(null),rt=Ie.forwardRef(function(ke,Pe){var Le=ke.prefixCls,De=ke.className,Ke=ke.style,it=ke.id,kt=ke.active,yt=ke.tabKey,Dt=ke.children;return Ie.createElement("div",{id:it&&"".concat(it,"-panel-").concat(yt),role:"tabpanel",tabIndex:kt?0:-1,"aria-labelledby":it&&"".concat(it,"-tab-").concat(yt),"aria-hidden":!kt,style:Ke,className:Se()(Le,kt&&"".concat(Le,"-active"),De),ref:Pe},Dt)}),Et=rt,Zt=["key","forceRender","style","className"];function Je(ke){var Pe=ke.id,Le=ke.activeKey,De=ke.animated,Ke=ke.tabPosition,it=ke.destroyInactiveTabPane,kt=Ie.useContext(ot),yt=kt.prefixCls,Dt=kt.tabs,Xt=De.tabPane,tn="".concat(yt,"-tabpane");return Ie.createElement("div",{className:Se()("".concat(yt,"-content-holder"))},Ie.createElement("div",{className:Se()("".concat(yt,"-content"),"".concat(yt,"-content-").concat(Ke),(0,Oe.Z)({},"".concat(yt,"-content-animated"),Xt))},Dt.map(function(un){var gt=un.key,jt=un.forceRender,Bn=un.style,yn=un.className,Tn=(0,ht.Z)(un,Zt),Cn=gt===Le;return Ie.createElement(Ye.default,(0,Be.Z)({key:gt,visible:Cn,forceRender:jt,removeOnLeave:!!it,leavedClassName:"".concat(tn,"-hidden")},De.tabPaneMotion),function(Yn,ln){var Un=Yn.style,Ze=Yn.className;return Ie.createElement(Et,(0,Be.Z)({},Tn,{prefixCls:tn,id:Pe,tabKey:gt,animated:Xt,active:Cn,style:(0,Ce.Z)((0,Ce.Z)({},Bn),Un),className:Se()(yn,Ze),ref:ln}))})})))}var lt=he(77654),We=he(29301),Ee=he(6089),Ve=he(8654),Xe={width:0,height:0,left:0,top:0};function bt(ke,Pe,Le){return(0,Ie.useMemo)(function(){for(var De,Ke=new Map,it=Pe.get((De=ke[0])===null||De===void 0?void 0:De.key)||Xe,kt=it.left+it.width,yt=0;yt<ke.length;yt+=1){var Dt=ke[yt].key,Xt=Pe.get(Dt);if(!Xt){var tn;Xt=Pe.get((tn=ke[yt-1])===null||tn===void 0?void 0:tn.key)||Xe}var un=Ke.get(Dt)||(0,Ce.Z)({},Xt);un.right=kt-un.left-un.width,Ke.set(Dt,un)}return Ke},[ke.map(function(De){return De.key}).join("_"),Pe,Le])}function je(ke,Pe){var Le=Ie.useRef(ke),De=Ie.useState({}),Ke=(0,Me.Z)(De,2),it=Ke[1];function kt(yt){var Dt=typeof yt=="function"?yt(Le.current):yt;Dt!==Le.current&&Pe(Dt,Le.current),Le.current=Dt,it({})}return[Le.current,kt]}var It=.1,at=.01,Ct=20,qe=Math.pow(.995,Ct);function Nt(ke,Pe){var Le=(0,Ie.useState)(),De=(0,Me.Z)(Le,2),Ke=De[0],it=De[1],kt=(0,Ie.useState)(0),yt=(0,Me.Z)(kt,2),Dt=yt[0],Xt=yt[1],tn=(0,Ie.useState)(0),un=(0,Me.Z)(tn,2),gt=un[0],jt=un[1],Bn=(0,Ie.useState)(),yn=(0,Me.Z)(Bn,2),Tn=yn[0],Cn=yn[1],Yn=(0,Ie.useRef)();function ln(_t){var Pt=_t.touches[0],At=Pt.screenX,on=Pt.screenY;it({x:At,y:on}),window.clearInterval(Yn.current)}function Un(_t){if(Ke){_t.preventDefault();var Pt=_t.touches[0],At=Pt.screenX,on=Pt.screenY;it({x:At,y:on});var cn=At-Ke.x,xn=on-Ke.y;Pe(cn,xn);var Vn=Date.now();Xt(Vn),jt(Vn-Dt),Cn({x:cn,y:xn})}}function Ze(){if(Ke&&(it(null),Cn(null),Tn)){var _t=Tn.x/gt,Pt=Tn.y/gt,At=Math.abs(_t),on=Math.abs(Pt);if(Math.max(At,on)<It)return;var cn=_t,xn=Pt;Yn.current=window.setInterval(function(){if(Math.abs(cn)<at&&Math.abs(xn)<at){window.clearInterval(Yn.current);return}cn*=qe,xn*=qe,Pe(cn*Ct,xn*Ct)},Ct)}}var St=(0,Ie.useRef)();function Mt(_t){var Pt=_t.deltaX,At=_t.deltaY,on=0,cn=Math.abs(Pt),xn=Math.abs(At);cn===xn?on=St.current==="x"?Pt:At:cn>xn?(on=Pt,St.current="x"):(on=At,St.current="y"),Pe(-on,-on)&&_t.preventDefault()}var Kt=(0,Ie.useRef)(null);Kt.current={onTouchStart:ln,onTouchMove:Un,onTouchEnd:Ze,onWheel:Mt},Ie.useEffect(function(){function _t(cn){Kt.current.onTouchStart(cn)}function Pt(cn){Kt.current.onTouchMove(cn)}function At(cn){Kt.current.onTouchEnd(cn)}function on(cn){Kt.current.onWheel(cn)}return document.addEventListener("touchmove",Pt,{passive:!1}),document.addEventListener("touchend",At,{passive:!1}),ke.current.addEventListener("touchstart",_t,{passive:!1}),ke.current.addEventListener("wheel",on),function(){document.removeEventListener("touchmove",Pt),document.removeEventListener("touchend",At)}},[])}var Qt=he(34280);function Vt(ke){var Pe=(0,Ie.useState)(0),Le=(0,Me.Z)(Pe,2),De=Le[0],Ke=Le[1],it=(0,Ie.useRef)(0),kt=(0,Ie.useRef)();return kt.current=ke,(0,Qt.o)(function(){var yt;(yt=kt.current)===null||yt===void 0||yt.call(kt)},[De]),function(){it.current===De&&(it.current+=1,Ke(it.current))}}function Gt(ke){var Pe=(0,Ie.useRef)([]),Le=(0,Ie.useState)({}),De=(0,Me.Z)(Le,2),Ke=De[1],it=(0,Ie.useRef)(typeof ke=="function"?ke():ke),kt=Vt(function(){var Dt=it.current;Pe.current.forEach(function(Xt){Dt=Xt(Dt)}),Pe.current=[],it.current=Dt,Ke({})});function yt(Dt){Pe.current.push(Dt),kt()}return[it.current,yt]}var Ft={width:0,height:0,left:0,top:0,right:0};function Fe(ke,Pe,Le,De,Ke,it,kt){var yt=kt.tabs,Dt=kt.tabPosition,Xt=kt.rtl,tn,un,gt;return["top","bottom"].includes(Dt)?(tn="width",un=Xt?"right":"left",gt=Math.abs(Le)):(tn="height",un="top",gt=-Le),(0,Ie.useMemo)(function(){if(!yt.length)return[0,0];for(var jt=yt.length,Bn=jt,yn=0;yn<jt;yn+=1){var Tn=ke.get(yt[yn].key)||Ft;if(Tn[un]+Tn[tn]>gt+Pe){Bn=yn-1;break}}for(var Cn=0,Yn=jt-1;Yn>=0;Yn-=1){var ln=ke.get(yt[Yn].key)||Ft;if(ln[un]<gt){Cn=Yn+1;break}}return Cn>=Bn?[0,0]:[Cn,Bn]},[ke,Pe,De,Ke,it,gt,Dt,yt.map(function(jt){return jt.key}).join("_"),Xt])}function xe(ke){var Pe;return ke instanceof Map?(Pe={},ke.forEach(function(Le,De){Pe[De]=Le})):Pe=ke,JSON.stringify(Pe)}var ft="TABS_DQ";function qt(ke){return String(ke).replace(/"/g,ft)}function Ot(ke,Pe,Le,De){return!(!Le||De||ke===!1||ke===void 0&&(Pe===!1||Pe===null))}function Ue(ke,Pe){var Le=ke.prefixCls,De=ke.editable,Ke=ke.locale,it=ke.style;return!De||De.showAdd===!1?null:Ie.createElement("button",{ref:Pe,type:"button",className:"".concat(Le,"-nav-add"),style:it,"aria-label":(Ke==null?void 0:Ke.addAriaLabel)||"Add tab",onClick:function(yt){De.onEdit("add",{event:yt})}},De.addIcon||"+")}var Ge=Ie.forwardRef(Ue),wt=Ie.forwardRef(function(ke,Pe){var Le=ke.position,De=ke.prefixCls,Ke=ke.extra;if(!Ke)return null;var it,kt={};return(0,Ne.Z)(Ke)==="object"&&!Ie.isValidElement(Ke)?kt=Ke:kt.right=Ke,Le==="right"&&(it=kt.right),Le==="left"&&(it=kt.left),it?Ie.createElement("div",{className:"".concat(De,"-extra-content"),ref:Pe},it):null}),dn=wt,Rt=he(31561),an=he(15285),$t=he(10228);function Bt(ke,Pe){var Le=ke.prefixCls,De=ke.id,Ke=ke.tabs,it=ke.locale,kt=ke.mobile,yt=ke.moreIcon,Dt=yt===void 0?"More":yt,Xt=ke.moreTransitionName,tn=ke.style,un=ke.className,gt=ke.editable,jt=ke.tabBarGutter,Bn=ke.rtl,yn=ke.removeAriaLabel,Tn=ke.onTabClick,Cn=ke.getPopupContainer,Yn=ke.popupClassName,ln=(0,Ie.useState)(!1),Un=(0,Me.Z)(ln,2),Ze=Un[0],St=Un[1],Mt=(0,Ie.useState)(null),Kt=(0,Me.Z)(Mt,2),_t=Kt[0],Pt=Kt[1],At="".concat(De,"-more-popup"),on="".concat(Le,"-dropdown"),cn=_t!==null?"".concat(At,"-").concat(_t):null,xn=it==null?void 0:it.dropdownAriaLabel;function Vn(ci,Fn){ci.preventDefault(),ci.stopPropagation(),gt.onEdit("remove",{key:Fn,event:ci})}var ni=Ie.createElement(an.ZP,{onClick:function(Fn){var Jn=Fn.key,li=Fn.domEvent;Tn(Jn,li),St(!1)},prefixCls:"".concat(on,"-menu"),id:At,tabIndex:-1,role:"listbox","aria-activedescendant":cn,selectedKeys:[_t],"aria-label":xn!==void 0?xn:"expanded dropdown"},Ke.map(function(ci){var Fn=ci.closable,Jn=ci.disabled,li=ci.closeIcon,Qn=ci.key,Di=ci.label,Hi=Ot(Fn,li,gt,Jn);return Ie.createElement(an.sN,{key:Qn,id:"".concat(At,"-").concat(Qn),role:"option","aria-controls":De&&"".concat(De,"-panel-").concat(Qn),disabled:Jn},Ie.createElement("span",null,Di),Hi&&Ie.createElement("button",{type:"button","aria-label":yn||"remove",tabIndex:0,className:"".concat(on,"-menu-item-remove"),onClick:function(wn){wn.stopPropagation(),Vn(wn,Qn)}},li||gt.removeIcon||"\xD7"))}));function gi(ci){for(var Fn=Ke.filter(function(Hi){return!Hi.disabled}),Jn=Fn.findIndex(function(Hi){return Hi.key===_t})||0,li=Fn.length,Qn=0;Qn<li;Qn+=1){Jn=(Jn+ci+li)%li;var Di=Fn[Jn];if(!Di.disabled){Pt(Di.key);return}}}function ii(ci){var Fn=ci.which;if(!Ze){[$t.Z.DOWN,$t.Z.SPACE,$t.Z.ENTER].includes(Fn)&&(St(!0),ci.preventDefault());return}switch(Fn){case $t.Z.UP:gi(-1),ci.preventDefault();break;case $t.Z.DOWN:gi(1),ci.preventDefault();break;case $t.Z.ESC:St(!1);break;case $t.Z.SPACE:case $t.Z.ENTER:_t!==null&&Tn(_t,ci);break}}(0,Ie.useEffect)(function(){var ci=document.getElementById(cn);ci&&ci.scrollIntoView&&ci.scrollIntoView(!1)},[_t]),(0,Ie.useEffect)(function(){Ze||Pt(null)},[Ze]);var Kn=(0,Oe.Z)({},Bn?"marginRight":"marginLeft",jt);Ke.length||(Kn.visibility="hidden",Kn.order=1);var vi=Se()((0,Oe.Z)({},"".concat(on,"-rtl"),Bn)),ui=kt?null:Ie.createElement(Rt.Z,{prefixCls:on,overlay:ni,trigger:["hover"],visible:Ke.length?Ze:!1,transitionName:Xt,onVisibleChange:St,overlayClassName:Se()(vi,Yn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Cn},Ie.createElement("button",{type:"button",className:"".concat(Le,"-nav-more"),style:Kn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":At,id:"".concat(De,"-more"),"aria-expanded":Ze,onKeyDown:ii},Dt));return Ie.createElement("div",{className:Se()("".concat(Le,"-nav-operations"),un),style:tn,ref:Pe},ui,Ie.createElement(Ge,{prefixCls:Le,locale:it,editable:gt}))}var Tt=Ie.memo(Ie.forwardRef(Bt),function(ke,Pe){return Pe.tabMoving});function ge(ke){var Pe,Le=ke.prefixCls,De=ke.id,Ke=ke.active,it=ke.tab,kt=it.key,yt=it.label,Dt=it.disabled,Xt=it.closeIcon,tn=ke.closable,un=ke.renderWrapper,gt=ke.removeAriaLabel,jt=ke.editable,Bn=ke.onClick,yn=ke.onFocus,Tn=ke.style,Cn="".concat(Le,"-tab"),Yn=Ot(tn,Xt,jt,Dt);function ln(St){Dt||Bn(St)}function Un(St){St.preventDefault(),St.stopPropagation(),jt.onEdit("remove",{key:kt,event:St})}var Ze=Ie.createElement("div",{key:kt,"data-node-key":qt(kt),className:Se()(Cn,(Pe={},(0,Oe.Z)(Pe,"".concat(Cn,"-with-remove"),Yn),(0,Oe.Z)(Pe,"".concat(Cn,"-active"),Ke),(0,Oe.Z)(Pe,"".concat(Cn,"-disabled"),Dt),Pe)),style:Tn,onClick:ln},Ie.createElement("div",{role:"tab","aria-selected":Ke,id:De&&"".concat(De,"-tab-").concat(kt),className:"".concat(Cn,"-btn"),"aria-controls":De&&"".concat(De,"-panel-").concat(kt),"aria-disabled":Dt,tabIndex:Dt?null:0,onClick:function(Mt){Mt.stopPropagation(),ln(Mt)},onKeyDown:function(Mt){[$t.Z.SPACE,$t.Z.ENTER].includes(Mt.which)&&(Mt.preventDefault(),ln(Mt))},onFocus:yn},yt),Yn&&Ie.createElement("button",{type:"button","aria-label":gt||"remove",tabIndex:0,className:"".concat(Cn,"-remove"),onClick:function(Mt){Mt.stopPropagation(),Un(Mt)}},Xt||jt.removeIcon||"\xD7"));return un?un(Ze):Ze}var se=ge,oe=he(16089),fe=function(Pe){var Le=Pe.activeTabOffset,De=Pe.horizontal,Ke=Pe.rtl,it=Pe.indicatorSize,kt=(0,Ie.useState)(),yt=(0,Me.Z)(kt,2),Dt=yt[0],Xt=yt[1],tn=(0,Ie.useRef)(),un=function(Bn){return typeof it=="function"?it(Bn):typeof it=="number"?it:Bn};function gt(){oe.Z.cancel(tn.current)}return(0,Ie.useEffect)(function(){var jt={};return Le&&(De?(Ke?(jt.right=Le.right+Le.width/2,jt.transform="translateX(50%)"):(jt.left=Le.left+Le.width/2,jt.transform="translateX(-50%)"),jt.width=un(Le.width)):(jt.top=Le.top+Le.height/2,jt.transform="translateY(-50%)",jt.height=un(Le.height))),gt(),tn.current=(0,oe.Z)(function(){Xt(jt)}),gt},[Le,De,Ke,it]),{style:Dt}},ve=fe,ce=function(Pe){var Le=Pe.current||{},De=Le.offsetWidth,Ke=De===void 0?0:De,it=Le.offsetHeight,kt=it===void 0?0:it;return[Ke,kt]},$e=function(Pe,Le){return Pe[Le?0:1]};function xt(ke,Pe){var Le,De=Ie.useContext(ot),Ke=De.prefixCls,it=De.tabs,kt=ke.className,yt=ke.style,Dt=ke.id,Xt=ke.animated,tn=ke.activeKey,un=ke.rtl,gt=ke.extra,jt=ke.editable,Bn=ke.locale,yn=ke.tabPosition,Tn=ke.tabBarGutter,Cn=ke.children,Yn=ke.onTabClick,ln=ke.onTabScroll,Un=ke.indicatorSize,Ze=(0,Ie.useRef)(),St=(0,Ie.useRef)(),Mt=(0,Ie.useRef)(),Kt=(0,Ie.useRef)(),_t=(0,Ie.useRef)(),Pt=(0,Ie.useRef)(),At=(0,Ie.useRef)(),on=yn==="top"||yn==="bottom",cn=je(0,function(ur,lr){on&&ln&&ln({direction:ur>lr?"left":"right"})}),xn=(0,Me.Z)(cn,2),Vn=xn[0],ni=xn[1],gi=je(0,function(ur,lr){!on&&ln&&ln({direction:ur>lr?"top":"bottom"})}),ii=(0,Me.Z)(gi,2),Kn=ii[0],vi=ii[1],ui=(0,Ie.useState)([0,0]),ci=(0,Me.Z)(ui,2),Fn=ci[0],Jn=ci[1],li=(0,Ie.useState)([0,0]),Qn=(0,Me.Z)(li,2),Di=Qn[0],Hi=Qn[1],ai=(0,Ie.useState)([0,0]),wn=(0,Me.Z)(ai,2),fn=wn[0],ri=wn[1],jn=(0,Ie.useState)([0,0]),yi=(0,Me.Z)(jn,2),Ti=yi[0],wi=yi[1],Ui=Gt(new Map),Ii=(0,Me.Z)(Ui,2),fr=Ii[0],Gn=Ii[1],Hn=bt(it,fr,Di[0]),Mi=$e(Fn,on),Ai=$e(Di,on),sr=$e(fn,on),qr=$e(Ti,on),Ar=Mi<Ai+sr,Xi=Ar?Mi-qr:Mi-sr,yr="".concat(Ke,"-nav-operations-hidden"),pr=0,Rn=0;on&&un?(pr=0,Rn=Math.max(0,Ai-Xi)):(pr=Math.min(0,Xi-Ai),Rn=0);function In(ur){return ur<pr?pr:ur>Rn?Rn:ur}var Pn=(0,Ie.useRef)(),Xn=(0,Ie.useState)(),qi=(0,Me.Z)(Xn,2),hr=qi[0],br=qi[1];function mr(){br(Date.now())}function ar(){window.clearTimeout(Pn.current)}Nt(Kt,function(ur,lr){function Hr(aa,ia){aa(function(Xr){var ts=In(Xr+ia);return ts})}return Ar?(on?Hr(ni,ur):Hr(vi,lr),ar(),mr(),!0):!1}),(0,Ie.useEffect)(function(){return ar(),hr&&(Pn.current=window.setTimeout(function(){br(0)},100)),ar},[hr]);var wr=Fe(Hn,Xi,on?Vn:Kn,Ai,sr,qr,(0,Ce.Z)((0,Ce.Z)({},ke),{},{tabs:it})),Kr=(0,Me.Z)(wr,2),Br=Kr[0],pa=Kr[1],ea=(0,Ee.Z)(function(){var ur=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tn,lr=Hn.get(ur)||{width:0,height:0,left:0,right:0,top:0};if(on){var Hr=Vn;un?lr.right<Vn?Hr=lr.right:lr.right+lr.width>Vn+Xi&&(Hr=lr.right+lr.width-Xi):lr.left<-Vn?Hr=-lr.left:lr.left+lr.width>-Vn+Xi&&(Hr=-(lr.left+lr.width-Xi)),vi(0),ni(In(Hr))}else{var aa=Kn;lr.top<-Kn?aa=-lr.top:lr.top+lr.height>-Kn+Xi&&(aa=-(lr.top+lr.height-Xi)),ni(0),vi(In(aa))}}),Or={};yn==="top"||yn==="bottom"?Or[un?"marginRight":"marginLeft"]=Tn:Or.marginTop=Tn;var Qa=it.map(function(ur,lr){var Hr=ur.key;return Ie.createElement(se,{id:Dt,prefixCls:Ke,key:Hr,tab:ur,style:lr===0?void 0:Or,closable:ur.closable,editable:jt,active:Hr===tn,renderWrapper:Cn,removeAriaLabel:Bn==null?void 0:Bn.removeAriaLabel,onClick:function(ia){Yn(Hr,ia)},onFocus:function(){ea(Hr),mr(),Kt.current&&(un||(Kt.current.scrollLeft=0),Kt.current.scrollTop=0)}})}),Ma=function(){return Gn(function(){var lr=new Map;return it.forEach(function(Hr){var aa,ia=Hr.key,Xr=(aa=_t.current)===null||aa===void 0?void 0:aa.querySelector('[data-node-key="'.concat(qt(ia),'"]'));Xr&&lr.set(ia,{width:Xr.offsetWidth,height:Xr.offsetHeight,left:Xr.offsetLeft,top:Xr.offsetTop})}),lr})};(0,Ie.useEffect)(function(){Ma()},[it.map(function(ur){return ur.key}).join("_")]);var ma=Vt(function(){var ur=ce(Ze),lr=ce(St),Hr=ce(Mt);Jn([ur[0]-lr[0]-Hr[0],ur[1]-lr[1]-Hr[1]]);var aa=ce(At);ri(aa);var ia=ce(Pt);wi(ia);var Xr=ce(_t);Hi([Xr[0]-aa[0],Xr[1]-aa[1]]),Ma()}),ta=it.slice(0,Br),Sr=it.slice(pa+1),ki=[].concat((0,lt.Z)(ta),(0,lt.Z)(Sr)),Zi=Hn.get(tn),Ri=ve({activeTabOffset:Zi,horizontal:on,rtl:un,indicatorSize:Un}),Si=Ri.style;(0,Ie.useEffect)(function(){ea()},[tn,pr,Rn,xe(Zi),xe(Hn),on]),(0,Ie.useEffect)(function(){ma()},[un]);var tr=!!ki.length,Qi="".concat(Ke,"-nav-wrap"),Pr,Rr,Nr,Yr;return on?un?(Rr=Vn>0,Pr=Vn!==Rn):(Pr=Vn<0,Rr=Vn!==pr):(Nr=Kn<0,Yr=Kn!==pr),Ie.createElement(We.Z,{onResize:ma},Ie.createElement("div",{ref:(0,Ve.x1)(Pe,Ze),role:"tablist",className:Se()("".concat(Ke,"-nav"),kt),style:yt,onKeyDown:function(){mr()}},Ie.createElement(dn,{ref:St,position:"left",extra:gt,prefixCls:Ke}),Ie.createElement(We.Z,{onResize:ma},Ie.createElement("div",{className:Se()(Qi,(Le={},(0,Oe.Z)(Le,"".concat(Qi,"-ping-left"),Pr),(0,Oe.Z)(Le,"".concat(Qi,"-ping-right"),Rr),(0,Oe.Z)(Le,"".concat(Qi,"-ping-top"),Nr),(0,Oe.Z)(Le,"".concat(Qi,"-ping-bottom"),Yr),Le)),ref:Kt},Ie.createElement(We.Z,{onResize:ma},Ie.createElement("div",{ref:_t,className:"".concat(Ke,"-nav-list"),style:{transform:"translate(".concat(Vn,"px, ").concat(Kn,"px)"),transition:hr?"none":void 0}},Qa,Ie.createElement(Ge,{ref:At,prefixCls:Ke,locale:Bn,editable:jt,style:(0,Ce.Z)((0,Ce.Z)({},Qa.length===0?void 0:Or),{},{visibility:tr?"hidden":null})}),Ie.createElement("div",{className:Se()("".concat(Ke,"-ink-bar"),(0,Oe.Z)({},"".concat(Ke,"-ink-bar-animated"),Xt.inkBar)),style:Si}))))),Ie.createElement(Tt,(0,Be.Z)({},ke,{removeAriaLabel:Bn==null?void 0:Bn.removeAriaLabel,ref:Pt,prefixCls:Ke,tabs:ki,className:!tr&&yr,tabMoving:!!hr})),Ie.createElement(dn,{ref:Mt,position:"right",extra:gt,prefixCls:Ke})))}var Ut=Ie.forwardRef(xt),Ht=["renderTabBar"],Jt=["label","key"];function en(ke){var Pe=ke.renderTabBar,Le=(0,ht.Z)(ke,Ht),De=Ie.useContext(ot),Ke=De.tabs;if(Pe){var it=(0,Ce.Z)((0,Ce.Z)({},Le),{},{panes:Ke.map(function(kt){var yt=kt.label,Dt=kt.key,Xt=(0,ht.Z)(kt,Jt);return Ie.createElement(Et,(0,Be.Z)({tab:yt,key:Dt,tabKey:Dt},Xt))})});return Pe(it,Ut)}return Ie.createElement(Ut,Le)}var hn=he(48736);function pn(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Pe;return ke===!1?Pe={inkBar:!1,tabPane:!1}:ke===!0?Pe={inkBar:!0,tabPane:!1}:Pe=(0,Ce.Z)({inkBar:!0},(0,Ne.Z)(ke)==="object"?ke:{}),Pe.tabPaneMotion&&Pe.tabPane===void 0&&(Pe.tabPane=!0),!Pe.tabPaneMotion&&Pe.tabPane&&(Pe.tabPane=!1),Pe}var bn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],pt=0;function sn(ke,Pe){var Le,De=ke.id,Ke=ke.prefixCls,it=Ke===void 0?"rc-tabs":Ke,kt=ke.className,yt=ke.items,Dt=ke.direction,Xt=ke.activeKey,tn=ke.defaultActiveKey,un=ke.editable,gt=ke.animated,jt=ke.tabPosition,Bn=jt===void 0?"top":jt,yn=ke.tabBarGutter,Tn=ke.tabBarStyle,Cn=ke.tabBarExtraContent,Yn=ke.locale,ln=ke.moreIcon,Un=ke.moreTransitionName,Ze=ke.destroyInactiveTabPane,St=ke.renderTabBar,Mt=ke.onChange,Kt=ke.onTabClick,_t=ke.onTabScroll,Pt=ke.getPopupContainer,At=ke.popupClassName,on=ke.indicatorSize,cn=(0,ht.Z)(ke,bn),xn=Ie.useMemo(function(){return(yt||[]).filter(function(wi){return wi&&(0,Ne.Z)(wi)==="object"&&"key"in wi})},[yt]),Vn=Dt==="rtl",ni=pn(gt),gi=(0,Ie.useState)(!1),ii=(0,Me.Z)(gi,2),Kn=ii[0],vi=ii[1];(0,Ie.useEffect)(function(){vi((0,He.Z)())},[]);var ui=(0,mt.Z)(function(){var wi;return(wi=xn[0])===null||wi===void 0?void 0:wi.key},{value:Xt,defaultValue:tn}),ci=(0,Me.Z)(ui,2),Fn=ci[0],Jn=ci[1],li=(0,Ie.useState)(function(){return xn.findIndex(function(wi){return wi.key===Fn})}),Qn=(0,Me.Z)(li,2),Di=Qn[0],Hi=Qn[1];(0,Ie.useEffect)(function(){var wi=xn.findIndex(function(Ii){return Ii.key===Fn});if(wi===-1){var Ui;wi=Math.max(0,Math.min(Di,xn.length-1)),Jn((Ui=xn[wi])===null||Ui===void 0?void 0:Ui.key)}Hi(wi)},[xn.map(function(wi){return wi.key}).join("_"),Fn,Di]);var ai=(0,mt.Z)(null,{value:De}),wn=(0,Me.Z)(ai,2),fn=wn[0],ri=wn[1];(0,Ie.useEffect)(function(){De||(ri("rc-tabs-".concat(pt)),pt+=1)},[]);function jn(wi,Ui){Kt==null||Kt(wi,Ui);var Ii=wi!==Fn;Jn(wi),Ii&&(Mt==null||Mt(wi))}var yi={id:fn,activeKey:Fn,animated:ni,tabPosition:Bn,rtl:Vn,mobile:Kn},Ti=(0,Ce.Z)((0,Ce.Z)({},yi),{},{editable:un,locale:Yn,moreIcon:ln,moreTransitionName:Un,tabBarGutter:yn,onTabClick:jn,onTabScroll:_t,extra:Cn,style:Tn,panes:null,getPopupContainer:Pt,popupClassName:At,indicatorSize:on});return Ie.createElement(ot.Provider,{value:{tabs:xn,prefixCls:it}},Ie.createElement("div",(0,Be.Z)({ref:Pe,id:De,className:Se()(it,"".concat(it,"-").concat(Bn),(Le={},(0,Oe.Z)(Le,"".concat(it,"-mobile"),Kn),(0,Oe.Z)(Le,"".concat(it,"-editable"),un),(0,Oe.Z)(Le,"".concat(it,"-rtl"),Vn),Le),kt)},cn),Ie.createElement(en,(0,Be.Z)({},Ti,{renderTabBar:St})),Ie.createElement(Je,(0,Be.Z)({destroyInactiveTabPane:Ze},yi,{animated:ni}))))}var zn=Ie.forwardRef(sn),tt=zn,vt=tt,Lt=he(36355),Ln=he(19716),_n=()=>null,ti=he(62892);const hi={motionAppear:!1,motionEnter:!0,motionLeave:!0};function pi(ke){let Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Le;return Pe===!1?Le={inkBar:!1,tabPane:!1}:Pe===!0?Le={inkBar:!0,tabPane:!0}:Le=Object.assign({inkBar:!0},typeof Pe=="object"?Pe:{}),Le.tabPane&&(Le.tabPaneMotion=Object.assign(Object.assign({},hi),{motionName:(0,ti.m)(ke,"switch")})),Le}var Bi=he(11592),_i=function(ke,Pe){var Le={};for(var De in ke)Object.prototype.hasOwnProperty.call(ke,De)&&Pe.indexOf(De)<0&&(Le[De]=ke[De]);if(ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ke=0,De=Object.getOwnPropertySymbols(ke);Ke<De.length;Ke++)Pe.indexOf(De[Ke])<0&&Object.prototype.propertyIsEnumerable.call(ke,De[Ke])&&(Le[De[Ke]]=ke[De[Ke]]);return Le};function Zn(ke){return ke.filter(Pe=>Pe)}function Fi(ke,Pe){if(ke)return ke;const Le=(0,Bi.Z)(Pe).map(De=>{if(Ie.isValidElement(De)){const{key:Ke,props:it}=De,kt=it||{},{tab:yt}=kt,Dt=_i(kt,["tab"]);return Object.assign(Object.assign({key:String(Ke)},Dt),{label:yt})}return null});return Zn(Le)}var Wi=he(17313),Gi=he(83116),nr=he(37613),Pi=he(13826),bi=ke=>{const{componentCls:Pe,motionDurationSlow:Le}=ke;return[{[Pe]:{[`${Pe}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Le}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Le}`}}}}},[(0,Pi.oN)(ke,"slide-up"),(0,Pi.oN)(ke,"slide-down")]]};const ji=ke=>{const{componentCls:Pe,tabsCardPadding:Le,cardBg:De,cardGutter:Ke,colorBorderSecondary:it,itemSelectedColor:kt}=ke;return{[`${Pe}-card`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{margin:0,padding:Le,background:De,border:`${ke.lineWidth}px ${ke.lineType} ${it}`,transition:`all ${ke.motionDurationSlow} ${ke.motionEaseInOut}`},[`${Pe}-tab-active`]:{color:kt,background:ke.colorBgContainer},[`${Pe}-ink-bar`]:{visibility:"hidden"}},[`&${Pe}-top, &${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Ke}px`}}}},[`&${Pe}-top`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:`${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0 0`},[`${Pe}-tab-active`]:{borderBottomColor:ke.colorBgContainer}}},[`&${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:`0 0 ${ke.borderRadiusLG}px ${ke.borderRadiusLG}px`},[`${Pe}-tab-active`]:{borderTopColor:ke.colorBgContainer}}},[`&${Pe}-left, &${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginTop:`${Ke}px`}}},[`&${Pe}-left`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${ke.borderRadiusLG}px 0 0 ${ke.borderRadiusLG}px`}},[`${Pe}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:ke.colorBgContainer}}}},[`&${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0`}},[`${Pe}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:ke.colorBgContainer}}}}}}},Ji=ke=>{const{componentCls:Pe,itemHoverColor:Le,dropdownEdgeChildVerticalPadding:De}=ke;return{[`${Pe}-dropdown`]:Object.assign(Object.assign({},(0,Wi.Wf)(ke)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:ke.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Pe}-dropdown-menu`]:{maxHeight:ke.tabsDropdownHeight,margin:0,padding:`${De}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:ke.colorBgContainer,backgroundClip:"padding-box",borderRadius:ke.borderRadiusLG,outline:"none",boxShadow:ke.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Wi.vS),{display:"flex",alignItems:"center",minWidth:ke.tabsDropdownWidth,margin:0,padding:`${ke.paddingXXS}px ${ke.paddingSM}px`,color:ke.colorText,fontWeight:"normal",fontSize:ke.fontSize,lineHeight:ke.lineHeight,cursor:"pointer",transition:`all ${ke.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:ke.marginSM},color:ke.colorTextDescription,fontSize:ke.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Le}},"&:hover":{background:ke.controlItemBgHover},"&-disabled":{"&, &:hover":{color:ke.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Vi=ke=>{const{componentCls:Pe,margin:Le,colorBorderSecondary:De,horizontalMargin:Ke,verticalItemPadding:it,verticalItemMargin:kt}=ke;return{[`${Pe}-top, ${Pe}-bottom`]:{flexDirection:"column",[`> ${Pe}-nav, > div > ${Pe}-nav`]:{margin:Ke,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${ke.lineWidth}px ${ke.lineType} ${De}`,content:"''"},[`${Pe}-ink-bar`]:{height:ke.lineWidthBold,"&-animated":{transition:`width ${ke.motionDurationSlow}, left ${ke.motionDurationSlow},
right ${ke.motionDurationSlow}`}},[`${Pe}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:ke.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:ke.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:ke.boxShadowTabsOverflowRight},[`&${Pe}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Pe}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Pe}-top`]:{[`> ${Pe}-nav,
> div > ${Pe}-nav`]:{"&::before":{bottom:0},[`${Pe}-ink-bar`]:{bottom:0}}},[`${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{order:1,marginTop:`${Le}px`,marginBottom:0,"&::before":{top:0},[`${Pe}-ink-bar`]:{top:0}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{order:0}},[`${Pe}-left, ${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{flexDirection:"column",minWidth:ke.controlHeight*1.25,[`${Pe}-tab`]:{padding:it,textAlign:"center"},[`${Pe}-tab + ${Pe}-tab`]:{margin:kt},[`${Pe}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:ke.controlHeight},"&::before":{top:0,boxShadow:ke.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:ke.boxShadowTabsOverflowBottom},[`&${Pe}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Pe}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Pe}-ink-bar`]:{width:ke.lineWidthBold,"&-animated":{transition:`height ${ke.motionDurationSlow}, top ${ke.motionDurationSlow}`}},[`${Pe}-nav-list, ${Pe}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Pe}-left`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${ke.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`},[`> ${Pe}-content > ${Pe}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:ke.paddingLG}}}},[`${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{order:1,[`${Pe}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-ke.lineWidth},borderRight:{_skip_check_:!0,value:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`},[`> ${Pe}-content > ${Pe}-tabpane`]:{paddingRight:{_skip_check_:!0,value:ke.paddingLG}}}}}},ir=ke=>{const{componentCls:Pe,cardPaddingSM:Le,cardPaddingLG:De,horizontalItemPaddingSM:Ke,horizontalItemPaddingLG:it}=ke;return{[Pe]:{"&-small":{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:Ke,fontSize:ke.titleFontSizeSM}}},"&-large":{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:it,fontSize:ke.titleFontSizeLG}}}},[`${Pe}-card`]:{[`&${Pe}-small`]:{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:Le}},[`&${Pe}-bottom`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:`0 0 ${ke.borderRadius}px ${ke.borderRadius}px`}},[`&${Pe}-top`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:`${ke.borderRadius}px ${ke.borderRadius}px 0 0`}},[`&${Pe}-right`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${ke.borderRadius}px ${ke.borderRadius}px 0`}}},[`&${Pe}-left`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${ke.borderRadius}px 0 0 ${ke.borderRadius}px`}}}},[`&${Pe}-large`]:{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:De}}}}}},$i=ke=>{const{componentCls:Pe,itemActiveColor:Le,itemHoverColor:De,iconCls:Ke,tabsHorizontalItemMargin:it,horizontalItemPadding:kt,itemSelectedColor:yt,itemColor:Dt}=ke,Xt=`${Pe}-tab`;return{[Xt]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:kt,fontSize:ke.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Dt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Le}},(0,Wi.Qy)(ke)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-ke.marginXXS},marginLeft:{_skip_check_:!0,value:ke.marginXS},color:ke.colorTextDescription,fontSize:ke.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${ke.motionDurationSlow}`,"&:hover":{color:ke.colorTextHeading}},"&:hover":{color:De},[`&${Xt}-active ${Xt}-btn`]:{color:yt,textShadow:ke.tabsActiveTextShadow},[`&${Xt}-disabled`]:{color:ke.colorTextDisabled,cursor:"not-allowed"},[`&${Xt}-disabled ${Xt}-btn, &${Xt}-disabled ${Pe}-remove`]:{"&:focus, &:active":{color:ke.colorTextDisabled}},[`& ${Xt}-remove ${Ke}`]:{margin:0},[Ke]:{marginRight:{_skip_check_:!0,value:ke.marginSM}}},[`${Xt} + ${Xt}`]:{margin:{_skip_check_:!0,value:it}}}},si=ke=>{const{componentCls:Pe,tabsHorizontalItemMarginRTL:Le,iconCls:De,cardGutter:Ke}=ke;return{[`${Pe}-rtl`]:{direction:"rtl",[`${Pe}-nav`]:{[`${Pe}-tab`]:{margin:{_skip_check_:!0,value:Le},[`${Pe}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[De]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${ke.marginSM}px`}},[`${Pe}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${ke.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${ke.marginXXS}px`},[De]:{margin:0}}}},[`&${Pe}-left`]:{[`> ${Pe}-nav`]:{order:1},[`> ${Pe}-content-holder`]:{order:0}},[`&${Pe}-right`]:{[`> ${Pe}-nav`]:{order:0},[`> ${Pe}-content-holder`]:{order:1}},[`&${Pe}-card${Pe}-top, &${Pe}-card${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginRight:{_skip_check_:!0,value:Ke},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Pe}-dropdown-rtl`]:{direction:"rtl"},[`${Pe}-menu-item`]:{[`${Pe}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},fi=ke=>{const{componentCls:Pe,tabsCardPadding:Le,cardHeight:De,cardGutter:Ke,itemHoverColor:it,itemActiveColor:kt,colorBorderSecondary:yt}=ke;return{[Pe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Wi.Wf)(ke)),{display:"flex",[`> ${Pe}-nav, > div > ${Pe}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Pe}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${ke.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Pe}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${ke.motionDurationSlow}`},[`${Pe}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Pe}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Pe}-nav-more`]:{position:"relative",padding:Le,background:"transparent",border:0,color:ke.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:ke.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Pe}-nav-add`]:Object.assign({minWidth:De,marginLeft:{_skip_check_:!0,value:Ke},padding:`0 ${ke.paddingXS}px`,background:"transparent",border:`${ke.lineWidth}px ${ke.lineType} ${yt}`,borderRadius:`${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:ke.colorText,transition:`all ${ke.motionDurationSlow} ${ke.motionEaseInOut}`,"&:hover":{color:it},"&:active, &:focus:not(:focus-visible)":{color:kt}},(0,Wi.Qy)(ke))},[`${Pe}-extra-content`]:{flex:"none"},[`${Pe}-ink-bar`]:{position:"absolute",background:ke.inkBarColor,pointerEvents:"none"}}),$i(ke)),{[`${Pe}-content`]:{position:"relative",width:"100%"},[`${Pe}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Pe}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Pe}-centered`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-nav-wrap`]:{[`&:not([class*='${Pe}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var kn=(0,Gi.Z)("Tabs",ke=>{const Pe=(0,nr.TS)(ke,{tabsCardPadding:ke.cardPadding||`${(ke.cardHeight-Math.round(ke.fontSize*ke.lineHeight))/2-ke.lineWidth}px ${ke.padding}px`,dropdownEdgeChildVerticalPadding:ke.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${ke.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${ke.horizontalItemGutter}px`});return[ir(Pe),si(Pe),Vi(Pe),Ji(Pe),ji(Pe),fi(Pe),bi(Pe)]},ke=>{const Pe=ke.controlHeightLG;return{zIndexPopup:ke.zIndexPopupBase+50,cardBg:ke.colorFillAlter,cardHeight:Pe,cardPadding:"",cardPaddingSM:`${ke.paddingXXS*1.5}px ${ke.padding}px`,cardPaddingLG:`${ke.paddingXS}px ${ke.padding}px ${ke.paddingXXS*1.5}px`,titleFontSize:ke.fontSize,titleFontSizeLG:ke.fontSizeLG,titleFontSizeSM:ke.fontSize,inkBarColor:ke.colorPrimary,horizontalMargin:`0 0 ${ke.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${ke.paddingSM}px 0`,horizontalItemPaddingSM:`${ke.paddingXS}px 0`,horizontalItemPaddingLG:`${ke.padding}px 0`,verticalItemPadding:`${ke.paddingXS}px ${ke.paddingLG}px`,verticalItemMargin:`${ke.margin}px 0 0 0`,itemColor:ke.colorText,itemSelectedColor:ke.colorPrimary,itemHoverColor:ke.colorPrimaryHover,itemActiveColor:ke.colorPrimaryActive,cardGutter:ke.marginXXS/2}}),Dn=function(ke,Pe){var Le={};for(var De in ke)Object.prototype.hasOwnProperty.call(ke,De)&&Pe.indexOf(De)<0&&(Le[De]=ke[De]);if(ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ke=0,De=Object.getOwnPropertySymbols(ke);Ke<De.length;Ke++)Pe.indexOf(De[Ke])<0&&Object.prototype.propertyIsEnumerable.call(ke,De[Ke])&&(Le[De[Ke]]=ke[De[Ke]]);return Le};const mi=ke=>{const{type:Pe,className:Le,rootClassName:De,size:Ke,onEdit:it,hideAdd:kt,centered:yt,addIcon:Dt,popupClassName:Xt,children:tn,items:un,animated:gt,style:jt,indicatorSize:Bn}=ke,yn=Dn(ke,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Tn,moreIcon:Cn=Ie.createElement(ct.Z,null)}=yn,{direction:Yn,tabs:ln,getPrefixCls:Un,getPopupContainer:Ze}=Ie.useContext(Lt.E_),St=Un("tabs",Tn),[Mt,Kt]=kn(St);let _t;Pe==="editable-card"&&(_t={onEdit:(Vn,ni)=>{let{key:gi,event:ii}=ni;it==null||it(Vn==="add"?ii:gi,Vn)},removeIcon:Ie.createElement(we.Z,null),addIcon:Dt||Ie.createElement(Re.Z,null),showAdd:kt!==!0});const Pt=Un(),At=Fi(un,tn),on=pi(St,gt),cn=(0,Ln.Z)(Ke),xn=Object.assign(Object.assign({},ln==null?void 0:ln.style),jt);return Mt(Ie.createElement(vt,Object.assign({direction:Yn,getPopupContainer:Ze,moreTransitionName:`${Pt}-slide-up`},yn,{items:At,className:Se()({[`${St}-${cn}`]:cn,[`${St}-card`]:["card","editable-card"].includes(Pe),[`${St}-editable-card`]:Pe==="editable-card",[`${St}-centered`]:yt},ln==null?void 0:ln.className,Le,De,Kt),popupClassName:Se()(Xt,Kt),style:xn,editable:_t,moreIcon:Cn,prefixCls:St,animated:on,indicatorSize:Bn!=null?Bn:ln==null?void 0:ln.indicatorSize})))};mi.TabPane=_n;var Qe=mi},99498:function(mn,rn,he){(function(we){we(he(89780))})(function(we){we.defineOption("placeholder","",function(Ce,Me,Ne){var ht=Ne&&Ne!=we.Init;if(Me&&!ht)Ce.on("blur",Se),Ce.on("change",Be),Ce.on("swapDoc",Be),we.on(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose=function(){st(Ce)}),Be(Ce);else if(!Me&&ht){Ce.off("blur",Se),Ce.off("change",Be),Ce.off("swapDoc",Be),we.off(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose),ct(Ce);var Ie=Ce.getWrapperElement();Ie.className=Ie.className.replace(" CodeMirror-empty","")}Me&&!Ce.hasFocus()&&Se(Ce)});function ct(Ce){Ce.state.placeholder&&(Ce.state.placeholder.parentNode.removeChild(Ce.state.placeholder),Ce.state.placeholder=null)}function Re(Ce){ct(Ce);var Me=Ce.state.placeholder=document.createElement("pre");Me.style.cssText="height: 0; overflow: visible",Me.style.direction=Ce.getOption("direction"),Me.className="CodeMirror-placeholder CodeMirror-line-like";var Ne=Ce.getOption("placeholder");typeof Ne=="string"&&(Ne=document.createTextNode(Ne)),Me.appendChild(Ne),Ce.display.lineSpace.insertBefore(Me,Ce.display.lineSpace.firstChild)}function st(Ce){setTimeout(function(){var Me=!1,Ne=Ce.getInputField();Ne.nodeName=="TEXTAREA"?Me=!Ne.value:Ce.lineCount()==1&&(Me=!/[^\u200b]/.test(Ne.querySelector(".CodeMirror-line").textContent)),Me?Re(Ce):ct(Ce)},20)}function Se(Ce){Oe(Ce)&&Re(Ce)}function Be(Ce){var Me=Ce.getWrapperElement(),Ne=Oe(Ce);Me.className=Me.className.replace(" CodeMirror-empty","")+(Ne?" CodeMirror-empty":""),Ne?Re(Ce):ct(Ce)}function Oe(Ce){return Ce.lineCount()===1&&Ce.getLine(0)===""}})},25717:function(mn,rn,he){(function(we){we(he(89780))})(function(we){var ct={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Re=we.Pos;we.defineOption("autoCloseBrackets",!1,function(Ye,ot,rt){rt&&rt!=we.Init&&(Ye.removeKeyMap(Se),Ye.state.closeBrackets=null),ot&&(Be(st(ot,"pairs")),Ye.state.closeBrackets=ot,Ye.addKeyMap(Se))});function st(Ye,ot){return ot=="pairs"&&typeof Ye=="string"?Ye:typeof Ye=="object"&&Ye[ot]!=null?Ye[ot]:ct[ot]}var Se={Backspace:Me,Enter:Ne};function Be(Ye){for(var ot=0;ot<Ye.length;ot++){var rt=Ye.charAt(ot),Et="'"+rt+"'";Se[Et]||(Se[Et]=Oe(rt))}}Be(ct.pairs+"`");function Oe(Ye){return function(ot){return Ie(ot,Ye)}}function Ce(Ye){var ot=Ye.state.closeBrackets;if(!ot||ot.override)return ot;var rt=Ye.getModeAt(Ye.getCursor());return rt.closeBrackets||ot}function Me(Ye){var ot=Ce(Ye);if(!ot||Ye.getOption("disableInput"))return we.Pass;for(var rt=st(ot,"pairs"),Et=Ye.listSelections(),Zt=0;Zt<Et.length;Zt++){if(!Et[Zt].empty())return we.Pass;var Je=He(Ye,Et[Zt].head);if(!Je||rt.indexOf(Je)%2!=0)return we.Pass}for(var Zt=Et.length-1;Zt>=0;Zt--){var lt=Et[Zt].head;Ye.replaceRange("",Re(lt.line,lt.ch-1),Re(lt.line,lt.ch+1),"+delete")}}function Ne(Ye){var ot=Ce(Ye),rt=ot&&st(ot,"explode");if(!rt||Ye.getOption("disableInput"))return we.Pass;for(var Et=Ye.listSelections(),Zt=0;Zt<Et.length;Zt++){if(!Et[Zt].empty())return we.Pass;var Je=He(Ye,Et[Zt].head);if(!Je||rt.indexOf(Je)%2!=0)return we.Pass}Ye.operation(function(){var lt=Ye.lineSeparator()||`
`;Ye.replaceSelection(lt+lt,null),Ye.execCommand("goCharLeft"),Et=Ye.listSelections();for(var We=0;We<Et.length;We++){var Ee=Et[We].head.line;Ye.indentLine(Ee,null,!0),Ye.indentLine(Ee+1,null,!0)}})}function ht(Ye){var ot=we.cmpPos(Ye.anchor,Ye.head)>0;return{anchor:new Re(Ye.anchor.line,Ye.anchor.ch+(ot?-1:1)),head:new Re(Ye.head.line,Ye.head.ch+(ot?1:-1))}}function Ie(Ye,ot){var rt=Ce(Ye);if(!rt||Ye.getOption("disableInput"))return we.Pass;var Et=st(rt,"pairs"),Zt=Et.indexOf(ot);if(Zt==-1)return we.Pass;for(var Je=st(rt,"closeBefore"),lt=st(rt,"triples"),We=Et.charAt(Zt+1)==ot,Ee=Ye.listSelections(),Ve=Zt%2==0,Xe,bt=0;bt<Ee.length;bt++){var je=Ee[bt],It=je.head,at,Ct=Ye.getRange(It,Re(It.line,It.ch+1));if(Ve&&!je.empty())at="surround";else if((We||!Ve)&&Ct==ot)We&&mt(Ye,It)?at="both":lt.indexOf(ot)>=0&&Ye.getRange(It,Re(It.line,It.ch+3))==ot+ot+ot?at="skipThree":at="skip";else if(We&&It.ch>1&&lt.indexOf(ot)>=0&&Ye.getRange(Re(It.line,It.ch-2),It)==ot+ot){if(It.ch>2&&/\bstring/.test(Ye.getTokenTypeAt(Re(It.line,It.ch-2))))return we.Pass;at="addFour"}else if(We){var qe=It.ch==0?" ":Ye.getRange(Re(It.line,It.ch-1),It);if(!we.isWordChar(Ct)&&qe!=ot&&!we.isWordChar(qe))at="both";else return we.Pass}else if(Ve&&(Ct.length===0||/\s/.test(Ct)||Je.indexOf(Ct)>-1))at="both";else return we.Pass;if(!Xe)Xe=at;else if(Xe!=at)return we.Pass}var Nt=Zt%2?Et.charAt(Zt-1):ot,Qt=Zt%2?ot:Et.charAt(Zt+1);Ye.operation(function(){if(Xe=="skip")Ye.execCommand("goCharRight");else if(Xe=="skipThree")for(var Vt=0;Vt<3;Vt++)Ye.execCommand("goCharRight");else if(Xe=="surround"){for(var Gt=Ye.getSelections(),Vt=0;Vt<Gt.length;Vt++)Gt[Vt]=Nt+Gt[Vt]+Qt;Ye.replaceSelections(Gt,"around"),Gt=Ye.listSelections().slice();for(var Vt=0;Vt<Gt.length;Vt++)Gt[Vt]=ht(Gt[Vt]);Ye.setSelections(Gt)}else Xe=="both"?(Ye.replaceSelection(Nt+Qt,null),Ye.triggerElectric(Nt+Qt),Ye.execCommand("goCharLeft")):Xe=="addFour"&&(Ye.replaceSelection(Nt+Nt+Nt+Nt,"before"),Ye.execCommand("goCharRight"))})}function He(Ye,ot){var rt=Ye.getRange(Re(ot.line,ot.ch-1),Re(ot.line,ot.ch+1));return rt.length==2?rt:null}function mt(Ye,ot){var rt=Ye.getTokenAt(Re(ot.line,ot.ch+1));return/\bstring/.test(rt.type)&&rt.start==ot.ch&&(ot.ch==0||!/\bstring/.test(Ye.getTokenTypeAt(ot)))}})},6313:function(mn,rn,he){(function(we){we(he(89780),he(32855))})(function(we){we.defineOption("autoCloseTags",!1,function(Me,Ne,ht){if(ht!=we.Init&&ht&&Me.removeKeyMap("autoCloseTags"),!!Ne){var Ie={name:"autoCloseTags"};(typeof Ne!="object"||Ne.whenClosing!==!1)&&(Ie["'/'"]=function(He){return Be(He)}),(typeof Ne!="object"||Ne.whenOpening!==!1)&&(Ie["'>'"]=function(He){return st(He)}),Me.addKeyMap(Ie)}});var ct=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Re=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function st(Me){if(Me.getOption("disableInput"))return we.Pass;for(var Ne=Me.listSelections(),ht=[],Ie=Me.getOption("autoCloseTags"),He=0;He<Ne.length;He++){if(!Ne[He].empty())return we.Pass;var mt=Ne[He].head,Ye=Me.getTokenAt(mt),ot=we.innerMode(Me.getMode(),Ye.state),rt=ot.state,Et=ot.mode.xmlCurrentTag&&ot.mode.xmlCurrentTag(rt),Zt=Et&&Et.name;if(!Zt)return we.Pass;var Je=ot.mode.configuration=="html",lt=typeof Ie=="object"&&Ie.dontCloseTags||Je&&ct,We=typeof Ie=="object"&&Ie.indentTags||Je&&Re;Ye.end>mt.ch&&(Zt=Zt.slice(0,Zt.length-Ye.end+mt.ch));var Ee=Zt.toLowerCase();if(!Zt||Ye.type=="string"&&(Ye.end!=mt.ch||!/[\"\']/.test(Ye.string.charAt(Ye.string.length-1))||Ye.string.length==1)||Ye.type=="tag"&&Et.close||Ye.string.indexOf("/")==mt.ch-Ye.start-1||lt&&Oe(lt,Ee)>-1||Ce(Me,ot.mode.xmlCurrentContext&&ot.mode.xmlCurrentContext(rt)||[],Zt,mt,!0))return we.Pass;var Ve=typeof Ie=="object"&&Ie.emptyTags;if(Ve&&Oe(Ve,Zt)>-1){ht[He]={text:"/>",newPos:we.Pos(mt.line,mt.ch+2)};continue}var Xe=We&&Oe(We,Ee)>-1;ht[He]={indent:Xe,text:">"+(Xe?`
`:"")+"</"+Zt+">",newPos:Xe?we.Pos(mt.line+1,0):we.Pos(mt.line,mt.ch+1)}}for(var bt=typeof Ie=="object"&&Ie.dontIndentOnAutoClose,He=Ne.length-1;He>=0;He--){var je=ht[He];Me.replaceRange(je.text,Ne[He].head,Ne[He].anchor,"+insert");var It=Me.listSelections().slice(0);It[He]={head:je.newPos,anchor:je.newPos},Me.setSelections(It),!bt&&je.indent&&(Me.indentLine(je.newPos.line,null,!0),Me.indentLine(je.newPos.line+1,null,!0))}}function Se(Me,Ne){for(var ht=Me.listSelections(),Ie=[],He=Ne?"/":"</",mt=Me.getOption("autoCloseTags"),Ye=typeof mt=="object"&&mt.dontIndentOnSlash,ot=0;ot<ht.length;ot++){if(!ht[ot].empty())return we.Pass;var rt=ht[ot].head,Et=Me.getTokenAt(rt),Zt=we.innerMode(Me.getMode(),Et.state),Je=Zt.state;if(Ne&&(Et.type=="string"||Et.string.charAt(0)!="<"||Et.start!=rt.ch-1))return we.Pass;var lt,We=Zt.mode.name!="xml"&&Me.getMode().name=="htmlmixed";if(We&&Zt.mode.name=="javascript")lt=He+"script";else if(We&&Zt.mode.name=="css")lt=He+"style";else{var Ee=Zt.mode.xmlCurrentContext&&Zt.mode.xmlCurrentContext(Je);if(!Ee||Ee.length&&Ce(Me,Ee,Ee[Ee.length-1],rt))return we.Pass;lt=He+Ee[Ee.length-1]}Me.getLine(rt.line).charAt(Et.end)!=">"&&(lt+=">"),Ie[ot]=lt}if(Me.replaceSelections(Ie),ht=Me.listSelections(),!Ye)for(var ot=0;ot<ht.length;ot++)(ot==ht.length-1||ht[ot].head.line<ht[ot+1].head.line)&&Me.indentLine(ht[ot].head.line)}function Be(Me){return Me.getOption("disableInput")?we.Pass:Se(Me,!0)}we.commands.closeTag=function(Me){return Se(Me)};function Oe(Me,Ne){if(Me.indexOf)return Me.indexOf(Ne);for(var ht=0,Ie=Me.length;ht<Ie;++ht)if(Me[ht]==Ne)return ht;return-1}function Ce(Me,Ne,ht,Ie,He){if(!we.scanForClosingTag)return!1;var mt=Math.min(Me.lastLine()+1,Ie.line+500),Ye=we.scanForClosingTag(Me,Ie,null,mt);if(!Ye||Ye.tag!=ht)return!1;for(var ot=He?1:0,rt=Ne.length-1;rt>=0&&Ne[rt]==ht;rt--)++ot;Ie=Ye.to;for(var rt=1;rt<ot;rt++){var Et=we.scanForClosingTag(Me,Ie,null,mt);if(!Et||Et.tag!=ht)return!1;Ie=Et.to}return!0}})},32855:function(mn,rn,he){(function(we){we(he(89780))})(function(we){"use strict";var ct=we.Pos;function Re(rt,Et){return rt.line-Et.line||rt.ch-Et.ch}var st="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Se=st+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Be=new RegExp("<(/?)(["+st+"]["+Se+"]*)","g");function Oe(rt,Et,Zt,Je){this.line=Et,this.ch=Zt,this.cm=rt,this.text=rt.getLine(Et),this.min=Je?Math.max(Je.from,rt.firstLine()):rt.firstLine(),this.max=Je?Math.min(Je.to-1,rt.lastLine()):rt.lastLine()}function Ce(rt,Et){var Zt=rt.cm.getTokenTypeAt(ct(rt.line,Et));return Zt&&/\btag\b/.test(Zt)}function Me(rt){if(!(rt.line>=rt.max))return rt.ch=0,rt.text=rt.cm.getLine(++rt.line),!0}function Ne(rt){if(!(rt.line<=rt.min))return rt.text=rt.cm.getLine(--rt.line),rt.ch=rt.text.length,!0}function ht(rt){for(;;){var Et=rt.text.indexOf(">",rt.ch);if(Et==-1){if(Me(rt))continue;return}if(!Ce(rt,Et+1)){rt.ch=Et+1;continue}var Zt=rt.text.lastIndexOf("/",Et),Je=Zt>-1&&!/\S/.test(rt.text.slice(Zt+1,Et));return rt.ch=Et+1,Je?"selfClose":"regular"}}function Ie(rt){for(;;){var Et=rt.ch?rt.text.lastIndexOf("<",rt.ch-1):-1;if(Et==-1){if(Ne(rt))continue;return}if(!Ce(rt,Et+1)){rt.ch=Et;continue}Be.lastIndex=Et,rt.ch=Et;var Zt=Be.exec(rt.text);if(Zt&&Zt.index==Et)return Zt}}function He(rt){for(;;){Be.lastIndex=rt.ch;var Et=Be.exec(rt.text);if(!Et){if(Me(rt))continue;return}if(!Ce(rt,Et.index+1)){rt.ch=Et.index+1;continue}return rt.ch=Et.index+Et[0].length,Et}}function mt(rt){for(;;){var Et=rt.ch?rt.text.lastIndexOf(">",rt.ch-1):-1;if(Et==-1){if(Ne(rt))continue;return}if(!Ce(rt,Et+1)){rt.ch=Et;continue}var Zt=rt.text.lastIndexOf("/",Et),Je=Zt>-1&&!/\S/.test(rt.text.slice(Zt+1,Et));return rt.ch=Et+1,Je?"selfClose":"regular"}}function Ye(rt,Et){for(var Zt=[];;){var Je=He(rt),lt,We=rt.line,Ee=rt.ch-(Je?Je[0].length:0);if(!Je||!(lt=ht(rt)))return;if(lt!="selfClose")if(Je[1]){for(var Ve=Zt.length-1;Ve>=0;--Ve)if(Zt[Ve]==Je[2]){Zt.length=Ve;break}if(Ve<0&&(!Et||Et==Je[2]))return{tag:Je[2],from:ct(We,Ee),to:ct(rt.line,rt.ch)}}else Zt.push(Je[2])}}function ot(rt,Et){for(var Zt=[];;){var Je=mt(rt);if(!Je)return;if(Je=="selfClose"){Ie(rt);continue}var lt=rt.line,We=rt.ch,Ee=Ie(rt);if(!Ee)return;if(Ee[1])Zt.push(Ee[2]);else{for(var Ve=Zt.length-1;Ve>=0;--Ve)if(Zt[Ve]==Ee[2]){Zt.length=Ve;break}if(Ve<0&&(!Et||Et==Ee[2]))return{tag:Ee[2],from:ct(rt.line,rt.ch),to:ct(lt,We)}}}}we.registerHelper("fold","xml",function(rt,Et){for(var Zt=new Oe(rt,Et.line,0);;){var Je=He(Zt);if(!Je||Zt.line!=Et.line)return;var lt=ht(Zt);if(!lt)return;if(!Je[1]&&lt!="selfClose"){var We=ct(Zt.line,Zt.ch),Ee=Ye(Zt,Je[2]);return Ee&&Re(Ee.from,We)>0?{from:We,to:Ee.from}:null}}}),we.findMatchingTag=function(rt,Et,Zt){var Je=new Oe(rt,Et.line,Et.ch,Zt);if(!(Je.text.indexOf(">")==-1&&Je.text.indexOf("<")==-1)){var lt=ht(Je),We=lt&&ct(Je.line,Je.ch),Ee=lt&&Ie(Je);if(!(!lt||!Ee||Re(Je,Et)>0)){var Ve={from:ct(Je.line,Je.ch),to:We,tag:Ee[2]};return lt=="selfClose"?{open:Ve,close:null,at:"open"}:Ee[1]?{open:ot(Je,Ee[2]),close:Ve,at:"close"}:(Je=new Oe(rt,We.line,We.ch,Zt),{open:Ve,close:Ye(Je,Ee[2]),at:"open"})}}},we.findEnclosingTag=function(rt,Et,Zt,Je){for(var lt=new Oe(rt,Et.line,Et.ch,Zt);;){var We=ot(lt,Je);if(!We)break;var Ee=new Oe(rt,Et.line,Et.ch,Zt),Ve=Ye(Ee,We.tag);if(Ve)return{open:We,close:Ve}}},we.scanForClosingTag=function(rt,Et,Zt,Je){var lt=new Oe(rt,Et.line,Et.ch,Je?{from:0,to:Je}:null);return Ye(lt,Zt)}})},89780:function(mn){(function(rn,he){mn.exports=he()})(this,function(){"use strict";var rn=navigator.userAgent,he=navigator.platform,we=/gecko\/\d/i.test(rn),ct=/MSIE \d/.test(rn),Re=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn),st=/Edge\/(\d+)/.exec(rn),Se=ct||Re||st,Be=Se&&(ct?document.documentMode||6:+(st||Re)[1]),Oe=!st&&/WebKit\//.test(rn),Ce=Oe&&/Qt\/\d+\.\d+/.test(rn),Me=!st&&/Chrome\//.test(rn),Ne=/Opera\//.test(rn),ht=/Apple Computer/.test(navigator.vendor),Ie=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(rn),He=/PhantomJS/.test(rn),mt=!st&&/AppleWebKit/.test(rn)&&/Mobile\/\w+/.test(rn),Ye=/Android/.test(rn),ot=mt||Ye||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(rn),rt=mt||/Mac/.test(he),Et=/\bCrOS\b/.test(rn),Zt=/win/i.test(he),Je=Ne&&rn.match(/Version\/(\d*\.\d*)/);Je&&(Je=Number(Je[1])),Je&&Je>=15&&(Ne=!1,Oe=!0);var lt=rt&&(Ce||Ne&&(Je==null||Je<12.11)),We=we||Se&&Be>=9;function Ee(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ve=function(x,z){var ne=x.className,te=Ee(z).exec(ne);if(te){var re=ne.slice(te.index+te[0].length);x.className=ne.slice(0,te.index)+(re?te[1]+re:"")}};function Xe(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function bt(x,z){return Xe(x).appendChild(z)}function je(x,z,ne,te){var re=document.createElement(x);if(ne&&(re.className=ne),te&&(re.style.cssText=te),typeof z=="string")re.appendChild(document.createTextNode(z));else if(z)for(var le=0;le<z.length;++le)re.appendChild(z[le]);return re}function It(x,z,ne,te){var re=je(x,z,ne,te);return re.setAttribute("role","presentation"),re}var at;document.createRange?at=function(x,z,ne,te){var re=document.createRange();return re.setEnd(te||x,ne),re.setStart(x,z),re}:at=function(x,z,ne){var te=document.body.createTextRange();try{te.moveToElementText(x.parentNode)}catch(re){return te}return te.collapse(!0),te.moveEnd("character",ne),te.moveStart("character",z),te};function Ct(x,z){if(z.nodeType==3&&(z=z.parentNode),x.contains)return x.contains(z);do if(z.nodeType==11&&(z=z.host),z==x)return!0;while(z=z.parentNode)}function qe(){var x;try{x=document.activeElement}catch(z){x=document.body||null}for(;x&&x.shadowRoot&&x.shadowRoot.activeElement;)x=x.shadowRoot.activeElement;return x}function Nt(x,z){var ne=x.className;Ee(z).test(ne)||(x.className+=(ne?" ":"")+z)}function Qt(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!Ee(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var Vt=function(x){x.select()};mt?Vt=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:Se&&(Vt=function(x){try{x.select()}catch(z){}});function Gt(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function Ft(x,z,ne){z||(z={});for(var te in x)x.hasOwnProperty(te)&&(ne!==!1||!z.hasOwnProperty(te))&&(z[te]=x[te]);return z}function Fe(x,z,ne,te,re){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var le=te||0,pe=re||0;;){var be=x.indexOf(" ",le);if(be<0||be>=z)return pe+(z-le);pe+=be-le,pe+=ne-pe%ne,le=be+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=Gt(this.onTimeout,this)};xe.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},xe.prototype.set=function(x,z){this.f=z;var ne=+new Date+x;(!this.id||ne<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,x),this.time=ne)};function ft(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var qt=50,Ot={toString:function(){return"CodeMirror.Pass"}},Ue={scroll:!1},Ge={origin:"*mouse"},wt={origin:"+move"};function dn(x,z,ne){for(var te=0,re=0;;){var le=x.indexOf(" ",te);le==-1&&(le=x.length);var pe=le-te;if(le==x.length||re+pe>=z)return te+Math.min(pe,z-re);if(re+=le-te,re+=ne-re%ne,te=le+1,re>=z)return te}}var Rt=[""];function an(x){for(;Rt.length<=x;)Rt.push($t(Rt)+" ");return Rt[x]}function $t(x){return x[x.length-1]}function Bt(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function Tt(x,z,ne){for(var te=0,re=ne(z);te<x.length&&ne(x[te])<=re;)te++;x.splice(te,0,z)}function ge(){}function se(x,z){var ne;return Object.create?ne=Object.create(x):(ge.prototype=x,ne=new ge),z&&Ft(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function fe(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function ve(x,z){return z?z.source.indexOf("\\w")>-1&&fe(x)?!0:z.test(x):fe(x)}function ce(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var $e=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xt(x){return x.charCodeAt(0)>=768&&$e.test(x)}function Ut(x,z,ne){for(;(ne<0?z>0:z<x.length)&&xt(x.charAt(z));)z+=ne;return z}function Ht(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var re=(z+ne)/2,le=te<0?Math.ceil(re):Math.floor(re);if(le==z)return x(le)?z:ne;x(le)?ne=le:z=le+te}}function Jt(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var re=!1,le=0;le<x.length;++le){var pe=x[le];(pe.from<ne&&pe.to>z||z==ne&&pe.to==z)&&(te(Math.max(pe.from,z),Math.min(pe.to,ne),pe.level==1?"rtl":"ltr",le),re=!0)}re||te(z,ne,"ltr")}var en=null;function hn(x,z,ne){var te;en=null;for(var re=0;re<x.length;++re){var le=x[re];if(le.from<z&&le.to>z)return re;le.to==z&&(le.from!=le.to&&ne=="before"?te=re:en=re),le.from==z&&(le.from!=le.to&&ne!="before"?te=re:en=re)}return te!=null?te:en}var pn=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Ae){return Ae<=247?x.charAt(Ae):1424<=Ae&&Ae<=1524?"R":1536<=Ae&&Ae<=1785?z.charAt(Ae-1536):1774<=Ae&&Ae<=2220?"r":8192<=Ae&&Ae<=8203?"w":Ae==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,re=/[stwN]/,le=/[LRr]/,pe=/[Lb1n]/,be=/[1n]/;function _e(Ae,et,dt){this.level=Ae,this.from=et,this.to=dt}return function(Ae,et){var dt=et=="ltr"?"L":"R";if(Ae.length==0||et=="ltr"&&!te.test(Ae))return!1;for(var Wt=Ae.length,zt=[],vn=0;vn<Wt;++vn)zt.push(ne(Ae.charCodeAt(vn)));for(var An=0,qn=dt;An<Wt;++An){var di=zt[An];di=="m"?zt[An]=qn:qn=di}for(var xi=0,oi=dt;xi<Wt;++xi){var Ci=zt[xi];Ci=="1"&&oi=="r"?zt[xi]="n":le.test(Ci)&&(oi=Ci,Ci=="r"&&(zt[xi]="R"))}for(var zi=1,Ki=zt[0];zi<Wt-1;++zi){var dr=zt[zi];dr=="+"&&Ki=="1"&&zt[zi+1]=="1"?zt[zi]="1":dr==","&&Ki==zt[zi+1]&&(Ki=="1"||Ki=="n")&&(zt[zi]=Ki),Ki=dr}for(var jr=0;jr<Wt;++jr){var Na=zt[jr];if(Na==",")zt[jr]="N";else if(Na=="%"){var sa=void 0;for(sa=jr+1;sa<Wt&&zt[sa]=="%";++sa);for(var uo=jr&&zt[jr-1]=="!"||sa<Wt&&zt[sa]=="1"?"1":"N",co=jr;co<sa;++co)zt[co]=uo;jr=sa-1}}for(var Ca=0,ho=dt;Ca<Wt;++Ca){var rr=zt[Ca];ho=="L"&&rr=="1"?zt[Ca]="L":le.test(rr)&&(ho=rr)}for(var da=0;da<Wt;++da)if(re.test(zt[da])){var la=void 0;for(la=da+1;la<Wt&&re.test(zt[la]);++la);for(var ha=(da?zt[da-1]:dt)=="L",va=(la<Wt?zt[la]:dt)=="L",fl=ha==va?ha?"L":"R":dt,vo=da;vo<la;++vo)zt[vo]=fl;da=la-1}for(var Wa=[],Lr,Ba=0;Ba<Wt;)if(pe.test(zt[Ba])){var ac=Ba;for(++Ba;Ba<Wt&&pe.test(zt[Ba]);++Ba);Wa.push(new _e(0,ac,Ba))}else{var bs=Ba,Fs=Wa.length,qo=et=="rtl"?1:0;for(++Ba;Ba<Wt&&zt[Ba]!="L";++Ba);for(var _a=bs;_a<Ba;)if(be.test(zt[_a])){bs<_a&&(Wa.splice(Fs,0,new _e(1,bs,_a)),Fs+=qo);var pl=_a;for(++_a;_a<Ba&&be.test(zt[_a]);++_a);Wa.splice(Fs,0,new _e(2,pl,_a)),Fs+=qo,bs=_a}else++_a;bs<Ba&&Wa.splice(Fs,0,new _e(1,bs,Ba))}return et=="ltr"&&(Wa[0].level==1&&(Lr=Ae.match(/^\s+/))&&(Wa[0].from=Lr[0].length,Wa.unshift(new _e(0,0,Lr[0].length))),$t(Wa).level==1&&(Lr=Ae.match(/\s+$/))&&($t(Wa).to-=Lr[0].length,Wa.push(new _e(0,Wt-Lr[0].length,Wt)))),et=="rtl"?Wa.reverse():Wa}}();function bn(x,z){var ne=x.order;return ne==null&&(ne=x.order=pn(x.text,z)),ne}var pt=[],sn=function(x,z,ne){if(x.addEventListener)x.addEventListener(z,ne,!1);else if(x.attachEvent)x.attachEvent("on"+z,ne);else{var te=x._handlers||(x._handlers={});te[z]=(te[z]||pt).concat(ne)}};function zn(x,z){return x._handlers&&x._handlers[z]||pt}function tt(x,z,ne){if(x.removeEventListener)x.removeEventListener(z,ne,!1);else if(x.detachEvent)x.detachEvent("on"+z,ne);else{var te=x._handlers,re=te&&te[z];if(re){var le=ft(re,ne);le>-1&&(te[z]=re.slice(0,le).concat(re.slice(le+1)))}}}function vt(x,z){var ne=zn(x,z);if(ne.length)for(var te=Array.prototype.slice.call(arguments,2),re=0;re<ne.length;++re)ne[re].apply(null,te)}function Lt(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),vt(x,ne||z.type,x,z),pi(z)||z.codemirrorIgnore}function Ln(x){var z=x._handlers&&x._handlers.cursorActivity;if(z)for(var ne=x.curOp.cursorActivityHandlers||(x.curOp.cursorActivityHandlers=[]),te=0;te<z.length;++te)ft(ne,z[te])==-1&&ne.push(z[te])}function Mn(x,z){return zn(x,z).length>0}function _n(x){x.prototype.on=function(z,ne){sn(this,z,ne)},x.prototype.off=function(z,ne){tt(this,z,ne)}}function ti(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function hi(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function pi(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Bi(x){ti(x),hi(x)}function _i(x){return x.target||x.srcElement}function Zn(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),rt&&x.ctrlKey&&z==1&&(z=3),z}var Fi=function(){if(Se&&Be<9)return!1;var x=je("div");return"draggable"in x||"dragDrop"in x}(),Wi;function Gi(x){if(Wi==null){var z=je("span","\u200B");bt(x,je("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(Wi=z.offsetWidth<=1&&z.offsetHeight>2&&!(Se&&Be<8))}var ne=Wi?je("span","\u200B"):je("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var nr;function Pi(x){if(nr!=null)return nr;var z=bt(x,document.createTextNode("A\u062EA")),ne=at(z,0,1).getBoundingClientRect(),te=at(z,1,2).getBoundingClientRect();return Xe(x),!ne||ne.left==ne.right?!1:nr=te.right-ne.right<3}var Yi=`
b`.split(/\n/).length!=3?function(x){for(var z=0,ne=[],te=x.length;z<=te;){var re=x.indexOf(`
`,z);re==-1&&(re=x.length);var le=x.slice(z,x.charAt(re-1)=="\r"?re-1:re),pe=le.indexOf("\r");pe!=-1?(ne.push(le.slice(0,pe)),z+=pe+1):(ne.push(le),z=re+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},bi=window.getSelection?function(x){try{return x.selectionStart!=x.selectionEnd}catch(z){return!1}}:function(x){var z;try{z=x.ownerDocument.selection.createRange()}catch(ne){}return!z||z.parentElement()!=x?!1:z.compareEndPoints("StartToEnd",z)!=0},ji=function(){var x=je("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Ji=null;function Vi(x){if(Ji!=null)return Ji;var z=bt(x,je("span","x")),ne=z.getBoundingClientRect(),te=at(z,0,1).getBoundingClientRect();return Ji=Math.abs(ne.left-te.left)>1}var ir={},$i={};function si(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),ir[x]=z}function fi(x,z){$i[x]=z}function kn(x){if(typeof x=="string"&&$i.hasOwnProperty(x))x=$i[x];else if(x&&typeof x.name=="string"&&$i.hasOwnProperty(x.name)){var z=$i[x.name];typeof z=="string"&&(z={name:z}),x=se(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return kn("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return kn("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function Dn(x,z){z=kn(z);var ne=ir[z.name];if(!ne)return Dn(x,"text/plain");var te=ne(x,z);if(mi.hasOwnProperty(z.name)){var re=mi[z.name];for(var le in re)re.hasOwnProperty(le)&&(te.hasOwnProperty(le)&&(te["_"+le]=te[le]),te[le]=re[le])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var pe in z.modeProps)te[pe]=z.modeProps[pe];return te}var mi={};function Qe(x,z){var ne=mi.hasOwnProperty(x)?mi[x]:mi[x]={};Ft(z,ne)}function ke(x,z){if(z===!0)return z;if(x.copyState)return x.copyState(z);var ne={};for(var te in z){var re=z[te];re instanceof Array&&(re=re.concat([])),ne[te]=re}return ne}function Pe(x,z){for(var ne;x.innerMode&&(ne=x.innerMode(z),!(!ne||ne.mode==x));)z=ne.state,x=ne.mode;return ne||{mode:x,state:z}}function Le(x,z,ne){return x.startState?x.startState(z,ne):!0}var De=function(x,z,ne){this.pos=this.start=0,this.string=x,this.tabSize=z||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ne};De.prototype.eol=function(){return this.pos>=this.string.length},De.prototype.sol=function(){return this.pos==this.lineStart},De.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},De.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},De.prototype.eat=function(x){var z=this.string.charAt(this.pos),ne;if(typeof x=="string"?ne=z==x:ne=z&&(x.test?x.test(z):x(z)),ne)return++this.pos,z},De.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},De.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},De.prototype.skipToEnd=function(){this.pos=this.string.length},De.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},De.prototype.backUp=function(x){this.pos-=x},De.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},De.prototype.indentation=function(){return Fe(this.string,null,this.tabSize)-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},De.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(pe){return ne?pe.toLowerCase():pe},re=this.string.substr(this.pos,x.length);if(te(re)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var le=this.string.slice(this.pos).match(x);return le&&le.index>0?null:(le&&z!==!1&&(this.pos+=le[0].length),le)}},De.prototype.current=function(){return this.string.slice(this.start,this.pos)},De.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},De.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},De.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Ke(x,z){if(z-=x.first,z<0||z>=x.size)throw new Error("There is no line "+(z+x.first)+" in the document.");for(var ne=x;!ne.lines;)for(var te=0;;++te){var re=ne.children[te],le=re.chunkSize();if(z<le){ne=re;break}z-=le}return ne.lines[z]}function it(x,z,ne){var te=[],re=z.line;return x.iter(z.line,ne.line+1,function(le){var pe=le.text;re==ne.line&&(pe=pe.slice(0,ne.ch)),re==z.line&&(pe=pe.slice(z.ch)),te.push(pe),++re}),te}function kt(x,z,ne){var te=[];return x.iter(z,ne,function(re){te.push(re.text)}),te}function yt(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function Dt(x){if(x.parent==null)return null;for(var z=x.parent,ne=ft(z.lines,x),te=z.parent;te;z=te,te=te.parent)for(var re=0;te.children[re]!=z;++re)ne+=te.children[re].chunkSize();return ne+z.first}function Xt(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var re=x.children[te],le=re.height;if(z<le){x=re;continue e}z-=le,ne+=re.chunkSize()}return ne}while(!x.lines);for(var pe=0;pe<x.lines.length;++pe){var be=x.lines[pe],_e=be.height;if(z<_e)break;z-=_e}return ne+pe}function tn(x,z){return z>=x.first&&z<x.first+x.size}function un(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function gt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof gt))return new gt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function jt(x,z){return x.line-z.line||x.ch-z.ch}function Bn(x,z){return x.sticky==z.sticky&&jt(x,z)==0}function yn(x){return gt(x.line,x.ch)}function Tn(x,z){return jt(x,z)<0?z:x}function Cn(x,z){return jt(x,z)<0?x:z}function Yn(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function ln(x,z){if(z.line<x.first)return gt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?gt(ne,Ke(x,ne).text.length):Un(z,Ke(x,z.line).text.length)}function Un(x,z){var ne=x.ch;return ne==null||ne>z?gt(x.line,z):ne<0?gt(x.line,0):x}function Ze(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=ln(x,z[te]);return ne}var St=function(x,z){this.state=x,this.lookAhead=z},Mt=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Mt.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Mt.prototype.baseToken=function(x){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=x;)this.baseTokenPos+=2;var z=this.baseTokens[this.baseTokenPos+1];return{type:z&&z.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-x}},Mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Mt.fromSaved=function(x,z,ne){return z instanceof St?new Mt(x,ke(x.mode,z.state),ne,z.lookAhead):new Mt(x,ke(x.mode,z),ne)},Mt.prototype.save=function(x){var z=x!==!1?ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new St(z,this.maxLookAhead):z};function Kt(x,z,ne,te){var re=[x.state.modeGen],le={};gi(x,z.text,x.doc.mode,ne,function(Ae,et){return re.push(Ae,et)},le,te);for(var pe=ne.state,be=function(Ae){ne.baseTokens=re;var et=x.state.overlays[Ae],dt=1,Wt=0;ne.state=!0,gi(x,z.text,et.mode,ne,function(zt,vn){for(var An=dt;Wt<zt;){var qn=re[dt];qn>zt&&re.splice(dt,1,zt,re[dt+1],qn),dt+=2,Wt=Math.min(zt,qn)}if(vn)if(et.opaque)re.splice(An,dt-An,zt,"overlay "+vn),dt=An+2;else for(;An<dt;An+=2){var di=re[An+1];re[An+1]=(di?di+" ":"")+"overlay "+vn}},le),ne.state=pe,ne.baseTokens=null,ne.baseTokenPos=1},_e=0;_e<x.state.overlays.length;++_e)be(_e);return{styles:re,classes:le.bgClass||le.textClass?le:null}}function _t(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Pt(x,Dt(z)),re=z.text.length>x.options.maxHighlightLength&&ke(x.doc.mode,te.state),le=Kt(x,z,te);re&&(te.state=re),z.stateAfter=te.save(!re),z.styles=le.styles,le.classes?z.styleClasses=le.classes:z.styleClasses&&(z.styleClasses=null),ne===x.doc.highlightFrontier&&(x.doc.modeFrontier=Math.max(x.doc.modeFrontier,++x.doc.highlightFrontier))}return z.styles}function Pt(x,z,ne){var te=x.doc,re=x.display;if(!te.mode.startState)return new Mt(te,!0,z);var le=ii(x,z,ne),pe=le>te.first&&Ke(te,le-1).stateAfter,be=pe?Mt.fromSaved(te,pe,le):new Mt(te,Le(te.mode),le);return te.iter(le,z,function(_e){At(x,_e.text,be);var Ae=be.line;_e.stateAfter=Ae==z-1||Ae%5==0||Ae>=re.viewFrom&&Ae<re.viewTo?be.save():null,be.nextLine()}),ne&&(te.modeFrontier=be.line),be}function At(x,z,ne,te){var re=x.doc.mode,le=new De(z,x.options.tabSize,ne);for(le.start=le.pos=te||0,z==""&&on(re,ne.state);!le.eol();)cn(re,le,ne.state),le.start=le.pos}function on(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Pe(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function cn(x,z,ne,te){for(var re=0;re<10;re++){te&&(te[0]=Pe(x,ne).mode);var le=x.token(z,ne);if(z.pos>z.start)return le}throw new Error("Mode "+x.name+" failed to advance stream.")}var xn=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function Vn(x,z,ne,te){var re=x.doc,le=re.mode,pe;z=ln(re,z);var be=Ke(re,z.line),_e=Pt(x,z.line,ne),Ae=new De(be.text,x.options.tabSize,_e),et;for(te&&(et=[]);(te||Ae.pos<z.ch)&&!Ae.eol();)Ae.start=Ae.pos,pe=cn(le,Ae,_e.state),te&&et.push(new xn(Ae,pe,ke(re.mode,_e.state)));return te?et:new xn(Ae,pe,_e.state)}function ni(x,z){if(x)for(;;){var ne=x.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ne)break;x=x.slice(0,ne.index)+x.slice(ne.index+ne[0].length);var te=ne[1]?"bgClass":"textClass";z[te]==null?z[te]=ne[2]:new RegExp("(?:^|\\s)"+ne[2]+"(?:$|\\s)").test(z[te])||(z[te]+=" "+ne[2])}return x}function gi(x,z,ne,te,re,le,pe){var be=ne.flattenSpans;be==null&&(be=x.options.flattenSpans);var _e=0,Ae=null,et=new De(z,x.options.tabSize,te),dt,Wt=x.options.addModeClass&&[null];for(z==""&&ni(on(ne,te.state),le);!et.eol();){if(et.pos>x.options.maxHighlightLength?(be=!1,pe&&At(x,z,te,et.pos),et.pos=z.length,dt=null):dt=ni(cn(ne,et,te.state,Wt),le),Wt){var zt=Wt[0].name;zt&&(dt="m-"+(dt?zt+" "+dt:zt))}if(!be||Ae!=dt){for(;_e<et.start;)_e=Math.min(et.start,_e+5e3),re(_e,Ae);Ae=dt}et.start=et.pos}for(;_e<et.pos;){var vn=Math.min(et.pos,_e+5e3);re(vn,Ae),_e=vn}}function ii(x,z,ne){for(var te,re,le=x.doc,pe=ne?-1:z-(x.doc.mode.innerMode?1e3:100),be=z;be>pe;--be){if(be<=le.first)return le.first;var _e=Ke(le,be-1),Ae=_e.stateAfter;if(Ae&&(!ne||be+(Ae instanceof St?Ae.lookAhead:0)<=le.modeFrontier))return be;var et=Fe(_e.text,null,x.options.tabSize);(re==null||te>et)&&(re=be-1,te=et)}return re}function Kn(x,z){if(x.modeFrontier=Math.min(x.modeFrontier,z),!(x.highlightFrontier<z-10)){for(var ne=x.first,te=z-1;te>ne;te--){var re=Ke(x,te).stateAfter;if(re&&(!(re instanceof St)||te+re.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var vi=!1,ui=!1;function ci(){vi=!0}function Fn(){ui=!0}function Jn(x,z,ne){this.marker=x,this.from=z,this.to=ne}function li(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function Qn(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function Di(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Hi(x,z,ne){var te;if(x)for(var re=0;re<x.length;++re){var le=x[re],pe=le.marker,be=le.from==null||(pe.inclusiveLeft?le.from<=z:le.from<z);if(be||le.from==z&&pe.type=="bookmark"&&(!ne||!le.marker.insertLeft)){var _e=le.to==null||(pe.inclusiveRight?le.to>=z:le.to>z);(te||(te=[])).push(new Jn(pe,le.from,_e?null:le.to))}}return te}function ai(x,z,ne){var te;if(x)for(var re=0;re<x.length;++re){var le=x[re],pe=le.marker,be=le.to==null||(pe.inclusiveRight?le.to>=z:le.to>z);if(be||le.from==z&&pe.type=="bookmark"&&(!ne||le.marker.insertLeft)){var _e=le.from==null||(pe.inclusiveLeft?le.from<=z:le.from<z);(te||(te=[])).push(new Jn(pe,_e?null:le.from-z,le.to==null?null:le.to-z))}}return te}function wn(x,z){if(z.full)return null;var ne=tn(x,z.from.line)&&Ke(x,z.from.line).markedSpans,te=tn(x,z.to.line)&&Ke(x,z.to.line).markedSpans;if(!ne&&!te)return null;var re=z.from.ch,le=z.to.ch,pe=jt(z.from,z.to)==0,be=Hi(ne,re,pe),_e=ai(te,le,pe),Ae=z.text.length==1,et=$t(z.text).length+(Ae?re:0);if(be)for(var dt=0;dt<be.length;++dt){var Wt=be[dt];if(Wt.to==null){var zt=li(_e,Wt.marker);zt?Ae&&(Wt.to=zt.to==null?null:zt.to+et):Wt.to=re}}if(_e)for(var vn=0;vn<_e.length;++vn){var An=_e[vn];if(An.to!=null&&(An.to+=et),An.from==null){var qn=li(be,An.marker);qn||(An.from=et,Ae&&(be||(be=[])).push(An))}else An.from+=et,Ae&&(be||(be=[])).push(An)}be&&(be=fn(be)),_e&&_e!=be&&(_e=fn(_e));var di=[be];if(!Ae){var xi=z.text.length-2,oi;if(xi>0&&be)for(var Ci=0;Ci<be.length;++Ci)be[Ci].to==null&&(oi||(oi=[])).push(new Jn(be[Ci].marker,null,null));for(var zi=0;zi<xi;++zi)di.push(oi);di.push(_e)}return di}function fn(x){for(var z=0;z<x.length;++z){var ne=x[z];ne.from!=null&&ne.from==ne.to&&ne.marker.clearWhenEmpty!==!1&&x.splice(z--,1)}return x.length?x:null}function ri(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(zt){if(zt.markedSpans)for(var vn=0;vn<zt.markedSpans.length;++vn){var An=zt.markedSpans[vn].marker;An.readOnly&&(!te||ft(te,An)==-1)&&(te||(te=[])).push(An)}}),!te)return null;for(var re=[{from:z,to:ne}],le=0;le<te.length;++le)for(var pe=te[le],be=pe.find(0),_e=0;_e<re.length;++_e){var Ae=re[_e];if(!(jt(Ae.to,be.from)<0||jt(Ae.from,be.to)>0)){var et=[_e,1],dt=jt(Ae.from,be.from),Wt=jt(Ae.to,be.to);(dt<0||!pe.inclusiveLeft&&!dt)&&et.push({from:Ae.from,to:be.from}),(Wt>0||!pe.inclusiveRight&&!Wt)&&et.push({from:be.to,to:Ae.to}),re.splice.apply(re,et),_e+=et.length-3}}return re}function jn(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function yi(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function Ti(x){return x.inclusiveLeft?-1:0}function wi(x){return x.inclusiveRight?1:0}function Ui(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),re=z.find(),le=jt(te.from,re.from)||Ti(x)-Ti(z);if(le)return-le;var pe=jt(te.to,re.to)||wi(x)-wi(z);return pe||z.id-x.id}function Ii(x,z){var ne=ui&&x.markedSpans,te;if(ne)for(var re=void 0,le=0;le<ne.length;++le)re=ne[le],re.marker.collapsed&&(z?re.from:re.to)==null&&(!te||Ui(te,re.marker)<0)&&(te=re.marker);return te}function fr(x){return Ii(x,!0)}function Gn(x){return Ii(x,!1)}function Hn(x,z){var ne=ui&&x.markedSpans,te;if(ne)for(var re=0;re<ne.length;++re){var le=ne[re];le.marker.collapsed&&(le.from==null||le.from<z)&&(le.to==null||le.to>z)&&(!te||Ui(te,le.marker)<0)&&(te=le.marker)}return te}function Mi(x,z,ne,te,re){var le=Ke(x,z),pe=ui&&le.markedSpans;if(pe)for(var be=0;be<pe.length;++be){var _e=pe[be];if(_e.marker.collapsed){var Ae=_e.marker.find(0),et=jt(Ae.from,ne)||Ti(_e.marker)-Ti(re),dt=jt(Ae.to,te)||wi(_e.marker)-wi(re);if(!(et>=0&&dt<=0||et<=0&&dt>=0)&&(et<=0&&(_e.marker.inclusiveRight&&re.inclusiveLeft?jt(Ae.to,ne)>=0:jt(Ae.to,ne)>0)||et>=0&&(_e.marker.inclusiveRight&&re.inclusiveLeft?jt(Ae.from,te)<=0:jt(Ae.from,te)<0)))return!0}}}function Ai(x){for(var z;z=fr(x);)x=z.find(-1,!0).line;return x}function sr(x){for(var z;z=Gn(x);)x=z.find(1,!0).line;return x}function qr(x){for(var z,ne;z=Gn(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function Ar(x,z){var ne=Ke(x,z),te=Ai(ne);return ne==te?z:Dt(te)}function Xi(x,z){if(z>x.lastLine())return z;var ne=Ke(x,z),te;if(!yr(x,ne))return z;for(;te=Gn(ne);)ne=te.find(1,!0).line;return Dt(ne)+1}function yr(x,z){var ne=ui&&z.markedSpans;if(ne){for(var te=void 0,re=0;re<ne.length;++re)if(te=ne[re],!!te.marker.collapsed){if(te.from==null)return!0;if(!te.marker.widgetNode&&te.from==0&&te.marker.inclusiveLeft&&pr(x,z,te))return!0}}}function pr(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return pr(x,te.line,li(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var re=void 0,le=0;le<z.markedSpans.length;++le)if(re=z.markedSpans[le],re.marker.collapsed&&!re.marker.widgetNode&&re.from==ne.to&&(re.to==null||re.to!=ne.from)&&(re.marker.inclusiveLeft||ne.marker.inclusiveRight)&&pr(x,z,re))return!0}function Rn(x){x=Ai(x);for(var z=0,ne=x.parent,te=0;te<ne.lines.length;++te){var re=ne.lines[te];if(re==x)break;z+=re.height}for(var le=ne.parent;le;ne=le,le=ne.parent)for(var pe=0;pe<le.children.length;++pe){var be=le.children[pe];if(be==ne)break;z+=be.height}return z}function In(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=fr(te);){var re=ne.find(0,!0);te=re.from.line,z+=re.from.ch-re.to.ch}for(te=x;ne=Gn(te);){var le=ne.find(0,!0);z-=te.text.length-le.from.ch,te=le.to.line,z+=te.text.length-le.to.ch}return z}function Pn(x){var z=x.display,ne=x.doc;z.maxLine=Ke(ne,ne.first),z.maxLineLength=In(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var re=In(te);re>z.maxLineLength&&(z.maxLineLength=re,z.maxLine=te)})}var Xn=function(x,z,ne){this.text=x,yi(this,z),this.height=ne?ne(this):1};Xn.prototype.lineNo=function(){return Dt(this)},_n(Xn);function qi(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),jn(x),yi(x,ne);var re=te?te(x):1;re!=x.height&&yt(x,re)}function hr(x){x.parent=null,jn(x)}var br={},mr={};function ar(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?mr:br;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function wr(x,z){var ne=It("span",null,null,Oe?"padding-right: .1px":null),te={pre:It("pre",[ne],"CodeMirror-line"),content:ne,col:0,pos:0,cm:x,trailingSpace:!1,splitSpaces:x.getOption("lineWrapping")};z.measure={};for(var re=0;re<=(z.rest?z.rest.length:0);re++){var le=re?z.rest[re-1]:z.line,pe=void 0;te.pos=0,te.addToken=Br,Pi(x.display.measure)&&(pe=bn(le,x.doc.direction))&&(te.addToken=ea(te.addToken,pe)),te.map=[];var be=z!=x.display.externalMeasured&&Dt(le);Qa(le,te,_t(x,le,be)),le.styleClasses&&(le.styleClasses.bgClass&&(te.bgClass=Qt(le.styleClasses.bgClass,te.bgClass||"")),le.styleClasses.textClass&&(te.textClass=Qt(le.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Gi(x.display.measure))),re==0?(z.measure.map=te.map,z.measure.cache={}):((z.measure.maps||(z.measure.maps=[])).push(te.map),(z.measure.caches||(z.measure.caches=[])).push({}))}if(Oe){var _e=te.content.lastChild;(/\bcm-tab\b/.test(_e.className)||_e.querySelector&&_e.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return vt(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=Qt(te.pre.className,te.textClass||"")),te}function Kr(x){var z=je("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Br(x,z,ne,te,re,le,pe){if(z){var be=x.splitSpaces?pa(z,x.trailingSpace):z,_e=x.cm.state.specialChars,Ae=!1,et;if(!_e.test(z))x.col+=z.length,et=document.createTextNode(be),x.map.push(x.pos,x.pos+z.length,et),Se&&Be<9&&(Ae=!0),x.pos+=z.length;else{et=document.createDocumentFragment();for(var dt=0;;){_e.lastIndex=dt;var Wt=_e.exec(z),zt=Wt?Wt.index-dt:z.length-dt;if(zt){var vn=document.createTextNode(be.slice(dt,dt+zt));Se&&Be<9?et.appendChild(je("span",[vn])):et.appendChild(vn),x.map.push(x.pos,x.pos+zt,vn),x.col+=zt,x.pos+=zt}if(!Wt)break;dt+=zt+1;var An=void 0;if(Wt[0]==" "){var qn=x.cm.options.tabSize,di=qn-x.col%qn;An=et.appendChild(je("span",an(di),"cm-tab")),An.setAttribute("role","presentation"),An.setAttribute("cm-text"," "),x.col+=di}else Wt[0]=="\r"||Wt[0]==`
`?(An=et.appendChild(je("span",Wt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),An.setAttribute("cm-text",Wt[0]),x.col+=1):(An=x.cm.options.specialCharPlaceholder(Wt[0]),An.setAttribute("cm-text",Wt[0]),Se&&Be<9?et.appendChild(je("span",[An])):et.appendChild(An),x.col+=1);x.map.push(x.pos,x.pos+1,An),x.pos++}}if(x.trailingSpace=be.charCodeAt(z.length-1)==32,ne||te||re||Ae||le||pe){var xi=ne||"";te&&(xi+=te),re&&(xi+=re);var oi=je("span",[et],xi,le);if(pe)for(var Ci in pe)pe.hasOwnProperty(Ci)&&Ci!="style"&&Ci!="class"&&oi.setAttribute(Ci,pe[Ci]);return x.content.appendChild(oi)}x.content.appendChild(et)}}function pa(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",re=0;re<x.length;re++){var le=x.charAt(re);le==" "&&ne&&(re==x.length-1||x.charCodeAt(re+1)==32)&&(le="\xA0"),te+=le,ne=le==" "}return te}function ea(x,z){return function(ne,te,re,le,pe,be,_e){re=re?re+" cm-force-border":"cm-force-border";for(var Ae=ne.pos,et=Ae+te.length;;){for(var dt=void 0,Wt=0;Wt<z.length&&(dt=z[Wt],!(dt.to>Ae&&dt.from<=Ae));Wt++);if(dt.to>=et)return x(ne,te,re,le,pe,be,_e);x(ne,te.slice(0,dt.to-Ae),re,le,null,be,_e),le=null,te=te.slice(dt.to-Ae),Ae=dt.to}}}function Or(x,z,ne,te){var re=!te&&ne.widgetNode;re&&x.map.push(x.pos,x.pos+z,re),!te&&x.cm.display.input.needsContentAttribute&&(re||(re=x.content.appendChild(document.createElement("span"))),re.setAttribute("cm-marker",ne.id)),re&&(x.cm.display.input.setUneditable(re),x.content.appendChild(re)),x.pos+=z,x.trailingSpace=!1}function Qa(x,z,ne){var te=x.markedSpans,re=x.text,le=0;if(!te){for(var pe=1;pe<ne.length;pe+=2)z.addToken(z,re.slice(le,le=ne[pe]),ar(ne[pe+1],z.cm.options));return}for(var be=re.length,_e=0,Ae=1,et="",dt,Wt,zt=0,vn,An,qn,di,xi;;){if(zt==_e){vn=An=qn=Wt="",xi=null,di=null,zt=1/0;for(var oi=[],Ci=void 0,zi=0;zi<te.length;++zi){var Ki=te[zi],dr=Ki.marker;if(dr.type=="bookmark"&&Ki.from==_e&&dr.widgetNode)oi.push(dr);else if(Ki.from<=_e&&(Ki.to==null||Ki.to>_e||dr.collapsed&&Ki.to==_e&&Ki.from==_e)){if(Ki.to!=null&&Ki.to!=_e&&zt>Ki.to&&(zt=Ki.to,An=""),dr.className&&(vn+=" "+dr.className),dr.css&&(Wt=(Wt?Wt+";":"")+dr.css),dr.startStyle&&Ki.from==_e&&(qn+=" "+dr.startStyle),dr.endStyle&&Ki.to==zt&&(Ci||(Ci=[])).push(dr.endStyle,Ki.to),dr.title&&((xi||(xi={})).title=dr.title),dr.attributes)for(var jr in dr.attributes)(xi||(xi={}))[jr]=dr.attributes[jr];dr.collapsed&&(!di||Ui(di.marker,dr)<0)&&(di=Ki)}else Ki.from>_e&&zt>Ki.from&&(zt=Ki.from)}if(Ci)for(var Na=0;Na<Ci.length;Na+=2)Ci[Na+1]==zt&&(An+=" "+Ci[Na]);if(!di||di.from==_e)for(var sa=0;sa<oi.length;++sa)Or(z,0,oi[sa]);if(di&&(di.from||0)==_e){if(Or(z,(di.to==null?be+1:di.to)-_e,di.marker,di.from==null),di.to==null)return;di.to==_e&&(di=!1)}}if(_e>=be)break;for(var uo=Math.min(be,zt);;){if(et){var co=_e+et.length;if(!di){var Ca=co>uo?et.slice(0,uo-_e):et;z.addToken(z,Ca,dt?dt+vn:vn,qn,_e+Ca.length==zt?An:"",Wt,xi)}if(co>=uo){et=et.slice(uo-_e),_e=uo;break}_e=co,qn=""}et=re.slice(le,le=ne[Ae++]),dt=ar(ne[Ae++],z.cm.options)}}}function Ma(x,z,ne){this.line=z,this.rest=qr(z),this.size=this.rest?Dt($t(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=yr(x,z)}function ma(x,z,ne){for(var te=[],re,le=z;le<ne;le=re){var pe=new Ma(x.doc,Ke(x.doc,le),le);re=le+pe.size,te.push(pe)}return te}var ta=null;function Sr(x){ta?ta.ops.push(x):x.ownsGroup=ta={ops:[x],delayedCallbacks:[]}}function ki(x){var z=x.delayedCallbacks,ne=0;do{for(;ne<z.length;ne++)z[ne].call(null);for(var te=0;te<x.ops.length;te++){var re=x.ops[te];if(re.cursorActivityHandlers)for(;re.cursorActivityCalled<re.cursorActivityHandlers.length;)re.cursorActivityHandlers[re.cursorActivityCalled++].call(null,re.cm)}}while(ne<z.length)}function Zi(x,z){var ne=x.ownsGroup;if(ne)try{ki(ne)}finally{ta=null,z(ne)}}var Ri=null;function Si(x,z){var ne=zn(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),re;ta?re=ta.delayedCallbacks:Ri?re=Ri:(re=Ri=[],setTimeout(tr,0));for(var le=function(be){re.push(function(){return ne[be].apply(null,te)})},pe=0;pe<ne.length;++pe)le(pe)}}function tr(){var x=Ri;Ri=null;for(var z=0;z<x.length;++z)x[z]()}function Qi(x,z,ne,te){for(var re=0;re<z.changes.length;re++){var le=z.changes[re];le=="text"?Yr(x,z):le=="gutter"?lr(x,z,ne,te):le=="class"?ur(x,z):le=="widget"&&Hr(x,z,te)}z.changes=null}function Pr(x){return x.node==x.text&&(x.node=je("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),Se&&Be<8&&(x.node.style.zIndex=2)),x.node}function Rr(x,z){var ne=z.bgClass?z.bgClass+" "+(z.line.bgClass||""):z.line.bgClass;if(ne&&(ne+=" CodeMirror-linebackground"),z.background)ne?z.background.className=ne:(z.background.parentNode.removeChild(z.background),z.background=null);else if(ne){var te=Pr(z);z.background=te.insertBefore(je("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Nr(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):wr(x,z)}function Yr(x,z){var ne=z.text.className,te=Nr(x,z);z.text==z.node&&(z.node=te.pre),z.text.parentNode.replaceChild(te.pre,z.text),z.text=te.pre,te.bgClass!=z.bgClass||te.textClass!=z.textClass?(z.bgClass=te.bgClass,z.textClass=te.textClass,ur(x,z)):ne&&(z.text.className=ne)}function ur(x,z){Rr(x,z),z.line.wrapClass?Pr(z).className=z.line.wrapClass:z.node!=z.text&&(z.node.className="");var ne=z.textClass?z.textClass+" "+(z.line.textClass||""):z.line.textClass;z.text.className=ne||""}function lr(x,z,ne,te){if(z.gutter&&(z.node.removeChild(z.gutter),z.gutter=null),z.gutterBackground&&(z.node.removeChild(z.gutterBackground),z.gutterBackground=null),z.line.gutterClass){var re=Pr(z);z.gutterBackground=je("div",null,"CodeMirror-gutter-background "+z.line.gutterClass,"left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px; width: "+te.gutterTotalWidth+"px"),x.display.input.setUneditable(z.gutterBackground),re.insertBefore(z.gutterBackground,z.text)}var le=z.line.gutterMarkers;if(x.options.lineNumbers||le){var pe=Pr(z),be=z.gutter=je("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(be),pe.insertBefore(be,z.text),z.line.gutterClass&&(be.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!le||!le["CodeMirror-linenumbers"])&&(z.lineNumber=be.appendChild(je("div",un(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),le)for(var _e=0;_e<x.display.gutterSpecs.length;++_e){var Ae=x.display.gutterSpecs[_e].className,et=le.hasOwnProperty(Ae)&&le[Ae];et&&be.appendChild(je("div",[et],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Ae]+"px; width: "+te.gutterWidth[Ae]+"px"))}}}function Hr(x,z,ne){z.alignable&&(z.alignable=null);for(var te=Ee("CodeMirror-linewidget"),re=z.node.firstChild,le=void 0;re;re=le)le=re.nextSibling,te.test(re.className)&&z.node.removeChild(re);ia(x,z,ne)}function aa(x,z,ne,te){var re=Nr(x,z);return z.text=z.node=re.pre,re.bgClass&&(z.bgClass=re.bgClass),re.textClass&&(z.textClass=re.textClass),ur(x,z),lr(x,z,ne,te),ia(x,z,te),z.node}function ia(x,z,ne){if(Xr(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)Xr(x,z.rest[te],z,ne,!1)}function Xr(x,z,ne,te,re){if(z.widgets)for(var le=Pr(ne),pe=0,be=z.widgets;pe<be.length;++pe){var _e=be[pe],Ae=je("div",[_e.node],"CodeMirror-linewidget"+(_e.className?" "+_e.className:""));_e.handleMouseEvents||Ae.setAttribute("cm-ignore-events","true"),ts(_e,Ae,ne,te),x.display.input.setUneditable(Ae),re&&_e.above?le.insertBefore(Ae,ne.gutter||ne.text):le.appendChild(Ae),Si(_e,"redraw")}}function ts(x,z,ne,te){if(x.noHScroll){(ne.alignable||(ne.alignable=[])).push(z);var re=te.wrapperWidth;z.style.left=te.fixedPos+"px",x.coverGutter||(re-=te.gutterTotalWidth,z.style.paddingLeft=te.gutterTotalWidth+"px"),z.style.width=re+"px"}x.coverGutter&&(z.style.zIndex=5,z.style.position="relative",x.noHScroll||(z.style.marginLeft=-te.gutterTotalWidth+"px"))}function ao(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Ct(document.body,x.node)){var ne="position: relative;";x.coverGutter&&(ne+="margin-left: -"+z.display.gutters.offsetWidth+"px;"),x.noHScroll&&(ne+="width: "+z.display.wrapper.clientWidth+"px;"),bt(z.display.measure,je("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function oo(x,z){for(var ne=_i(z);ne!=x.wrapper;ne=ne.parentNode)if(!ne||ne.nodeType==1&&ne.getAttribute("cm-ignore-events")=="true"||ne.parentNode==x.sizer&&ne!=x.mover)return!0}function eo(x){return x.lineSpace.offsetTop}function Ss(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function fo(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=bt(x.measure,je("pre","x","CodeMirror-line-like")),ne=window.getComputedStyle?window.getComputedStyle(z):z.currentStyle,te={left:parseInt(ne.paddingLeft),right:parseInt(ne.paddingRight)};return!isNaN(te.left)&&!isNaN(te.right)&&(x.cachedPaddingH=te),te}function ka(x){return qt-x.display.nativeBarWidth}function ua(x){return x.display.scroller.clientWidth-ka(x)-x.display.barWidth}function bo(x){return x.display.scroller.clientHeight-ka(x)-x.display.barHeight}function ko(x,z,ne){var te=x.options.lineWrapping,re=te&&ua(x);if(!z.measure.heights||te&&z.measure.width!=re){var le=z.measure.heights=[];if(te){z.measure.width=re;for(var pe=z.text.firstChild.getClientRects(),be=0;be<pe.length-1;be++){var _e=pe[be],Ae=pe[be+1];Math.abs(_e.bottom-Ae.bottom)>2&&le.push((_e.bottom+Ae.top)/2-ne.top)}}le.push(ne.bottom-ne.top)}}function Eo(x,z,ne){if(x.line==z)return{map:x.measure.map,cache:x.measure.cache};for(var te=0;te<x.rest.length;te++)if(x.rest[te]==z)return{map:x.measure.maps[te],cache:x.measure.caches[te]};for(var re=0;re<x.rest.length;re++)if(Dt(x.rest[re])>ne)return{map:x.measure.maps[re],cache:x.measure.caches[re],before:!0}}function ns(x,z){z=Ai(z);var ne=Dt(z),te=x.display.externalMeasured=new Ma(x.doc,z,ne);te.lineN=ne;var re=te.built=wr(x,te);return te.text=re.pre,bt(x.display.lineMeasure,re.pre),te}function Ro(x,z,ne,te){return Er(x,Ia(x,z),ne,te)}function Ua(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[po(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Ia(x,z){var ne=Dt(z),te=Ua(x,ne);te&&!te.text?te=null:te&&te.changes&&(Qi(x,te,ne,kr(x)),x.curOp.forceUpdate=!0),te||(te=ns(x,z));var re=Eo(te,z,ne);return{line:z,view:te,rect:null,map:re.map,cache:re.cache,before:re.before,hasHeights:!1}}function Er(x,z,ne,te,re){z.before&&(ne=-1);var le=ne+(te||""),pe;return z.cache.hasOwnProperty(le)?pe=z.cache[le]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ko(x,z.view,z.rect),z.hasHeights=!0),pe=gr(x,z,ne,te),pe.bogus||(z.cache[le]=pe)),{left:pe.left,right:pe.right,top:re?pe.rtop:pe.top,bottom:re?pe.rbottom:pe.bottom}}var Lo={left:0,right:0,top:0,bottom:0};function is(x,z,ne){for(var te,re,le,pe,be,_e,Ae=0;Ae<x.length;Ae+=3)if(be=x[Ae],_e=x[Ae+1],z<be?(re=0,le=1,pe="left"):z<_e?(re=z-be,le=re+1):(Ae==x.length-3||z==_e&&x[Ae+3]>z)&&(le=_e-be,re=le-1,z>=_e&&(pe="right")),re!=null){if(te=x[Ae+2],be==_e&&ne==(te.insertLeft?"left":"right")&&(pe=ne),ne=="left"&&re==0)for(;Ae&&x[Ae-2]==x[Ae-3]&&x[Ae-1].insertLeft;)te=x[(Ae-=3)+2],pe="left";if(ne=="right"&&re==_e-be)for(;Ae<x.length-3&&x[Ae+3]==x[Ae+4]&&!x[Ae+5].insertLeft;)te=x[(Ae+=3)+2],pe="right";break}return{node:te,start:re,end:le,collapse:pe,coverStart:be,coverEnd:_e}}function Do(x,z){var ne=Lo;if(z=="left")for(var te=0;te<x.length&&(ne=x[te]).left==ne.right;te++);else for(var re=x.length-1;re>=0&&(ne=x[re]).left==ne.right;re--);return ne}function gr(x,z,ne,te){var re=is(z.map,ne,te),le=re.node,pe=re.start,be=re.end,_e=re.collapse,Ae;if(le.nodeType==3){for(var et=0;et<4;et++){for(;pe&&xt(z.line.text.charAt(re.coverStart+pe));)--pe;for(;re.coverStart+be<re.coverEnd&&xt(z.line.text.charAt(re.coverStart+be));)++be;if(Se&&Be<9&&pe==0&&be==re.coverEnd-re.coverStart?Ae=le.parentNode.getBoundingClientRect():Ae=Do(at(le,pe,be).getClientRects(),te),Ae.left||Ae.right||pe==0)break;be=pe,pe=pe-1,_e="right"}Se&&Be<11&&(Ae=or(x.display.measure,Ae))}else{pe>0&&(_e=te="right");var dt;x.options.lineWrapping&&(dt=le.getClientRects()).length>1?Ae=dt[te=="right"?dt.length-1:0]:Ae=le.getBoundingClientRect()}if(Se&&Be<9&&!pe&&(!Ae||!Ae.left&&!Ae.right)){var Wt=le.parentNode.getClientRects()[0];Wt?Ae={left:Wt.left,right:Wt.left+_r(x.display),top:Wt.top,bottom:Wt.bottom}:Ae=Lo}for(var zt=Ae.top-z.rect.top,vn=Ae.bottom-z.rect.top,An=(zt+vn)/2,qn=z.view.measure.heights,di=0;di<qn.length-1&&!(An<qn[di]);di++);var xi=di?qn[di-1]:0,oi=qn[di],Ci={left:(_e=="right"?Ae.right:Ae.left)-z.rect.left,right:(_e=="left"?Ae.left:Ae.right)-z.rect.left,top:xi,bottom:oi};return!Ae.left&&!Ae.right&&(Ci.bogus=!0),x.options.singleCursorHeightPerLine||(Ci.rtop=zt,Ci.rbottom=vn),Ci}function or(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vi(x))return z;var ne=screen.logicalXDPI/screen.deviceXDPI,te=screen.logicalYDPI/screen.deviceYDPI;return{left:z.left*ne,right:z.right*ne,top:z.top*te,bottom:z.bottom*te}}function Ir(x){if(x.measure&&(x.measure.cache={},x.measure.heights=null,x.rest))for(var z=0;z<x.rest.length;z++)x.measure.caches[z]={}}function Ea(x){x.display.externalMeasure=null,Xe(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Ir(x.display.view[z])}function Wr(x){Ea(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function Oa(){return Me&&Ye?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fa(){return Me&&Ye?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function to(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=ao(x.widgets[ne]));return z}function Ra(x,z,ne,te,re){if(!re){var le=to(z);ne.top+=le,ne.bottom+=le}if(te=="line")return ne;te||(te="local");var pe=Rn(z);if(te=="local"?pe+=eo(x.display):pe-=x.display.viewOffset,te=="page"||te=="window"){var be=x.display.lineSpace.getBoundingClientRect();pe+=be.top+(te=="window"?0:Fa());var _e=be.left+(te=="window"?0:Oa());ne.left+=_e,ne.right+=_e}return ne.top+=pe,ne.bottom+=pe,ne}function so(x,z,ne){if(ne=="div")return z;var te=z.left,re=z.top;if(ne=="page")te-=Oa(),re-=Fa();else if(ne=="local"||!ne){var le=x.display.sizer.getBoundingClientRect();te+=le.left,re+=le.top}var pe=x.display.lineSpace.getBoundingClientRect();return{left:te-pe.left,top:re-pe.top}}function lo(x,z,ne,te,re){return te||(te=Ke(x.doc,z.line)),Ra(x,te,Ro(x,te,z.ch,re),ne)}function La(x,z,ne,te,re,le){te=te||Ke(x.doc,z.line),re||(re=Ia(x,te));function pe(vn,An){var qn=Er(x,re,vn,An?"right":"left",le);return An?qn.left=qn.right:qn.right=qn.left,Ra(x,te,qn,ne)}var be=bn(te,x.doc.direction),_e=z.ch,Ae=z.sticky;if(_e>=te.text.length?(_e=te.text.length,Ae="before"):_e<=0&&(_e=0,Ae="after"),!be)return pe(Ae=="before"?_e-1:_e,Ae=="before");function et(vn,An,qn){var di=be[An],xi=di.level==1;return pe(qn?vn-1:vn,xi!=qn)}var dt=hn(be,_e,Ae),Wt=en,zt=et(_e,dt,Ae=="before");return Wt!=null&&(zt.other=et(_e,Wt,Ae!="before")),zt}function bl(x,z){var ne=0;z=ln(x.doc,z),x.options.lineWrapping||(ne=_r(x.display)*z.ch);var te=Ke(x.doc,z.line),re=Rn(te)+eo(x.display);return{left:ne,right:ne,top:re,bottom:re+te.height}}function Vo(x,z,ne,te,re){var le=gt(x,z,ne);return le.xRel=re,te&&(le.outside=te),le}function Ys(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Vo(te.first,0,null,-1,-1);var re=Xt(te,ne),le=te.first+te.size-1;if(re>le)return Vo(te.first+te.size-1,Ke(te,le).text.length,null,1,1);z<0&&(z=0);for(var pe=Ke(te,re);;){var be=Mu(x,pe,re,z,ne),_e=Hn(pe,be.ch+(be.xRel>0||be.outside>0?1:0));if(!_e)return be;var Ae=_e.find(1);if(Ae.line==re)return Ae;pe=Ke(te,re=Ae.line)}}function Kl(x,z,ne,te){te-=to(z);var re=z.text.length,le=Ht(function(pe){return Er(x,ne,pe-1).bottom<=te},re,0);return re=Ht(function(pe){return Er(x,ne,pe).top>te},le,re),{begin:le,end:re}}function Hl(x,z,ne,te){ne||(ne=Ia(x,z));var re=Ra(x,z,Er(x,ne,te),"line").top;return Kl(x,z,ne,re)}function Cs(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function Mu(x,z,ne,te,re){re-=Rn(z);var le=Ia(x,z),pe=to(z),be=0,_e=z.text.length,Ae=!0,et=bn(z,x.doc.direction);if(et){var dt=(x.options.lineWrapping?xl:rs)(x,z,ne,le,et,te,re);Ae=dt.level!=1,be=Ae?dt.from:dt.to-1,_e=Ae?dt.to:dt.from-1}var Wt=null,zt=null,vn=Ht(function(zi){var Ki=Er(x,le,zi);return Ki.top+=pe,Ki.bottom+=pe,Cs(Ki,te,re,!1)?(Ki.top<=re&&Ki.left<=te&&(Wt=zi,zt=Ki),!0):!1},be,_e),An,qn,di=!1;if(zt){var xi=te-zt.left<zt.right-te,oi=xi==Ae;vn=Wt+(oi?0:1),qn=oi?"after":"before",An=xi?zt.left:zt.right}else{!Ae&&(vn==_e||vn==be)&&vn++,qn=vn==0?"after":vn==z.text.length?"before":Er(x,le,vn-(Ae?1:0)).bottom+pe<=re==Ae?"after":"before";var Ci=La(x,gt(ne,vn,qn),"line",z,le);An=Ci.left,di=re<Ci.top?-1:re>=Ci.bottom?1:0}return vn=Ut(z.text,vn,1),Vo(ne,vn,qn,di,te-An)}function rs(x,z,ne,te,re,le,pe){var be=Ht(function(dt){var Wt=re[dt],zt=Wt.level!=1;return Cs(La(x,gt(ne,zt?Wt.to:Wt.from,zt?"before":"after"),"line",z,te),le,pe,!0)},0,re.length-1),_e=re[be];if(be>0){var Ae=_e.level!=1,et=La(x,gt(ne,Ae?_e.from:_e.to,Ae?"after":"before"),"line",z,te);Cs(et,le,pe,!0)&&et.top>pe&&(_e=re[be-1])}return _e}function xl(x,z,ne,te,re,le,pe){var be=Kl(x,z,te,pe),_e=be.begin,Ae=be.end;/\s/.test(z.text.charAt(Ae-1))&&Ae--;for(var et=null,dt=null,Wt=0;Wt<re.length;Wt++){var zt=re[Wt];if(!(zt.from>=Ae||zt.to<=_e)){var vn=zt.level!=1,An=Er(x,te,vn?Math.min(Ae,zt.to)-1:Math.max(_e,zt.from)).right,qn=An<le?le-An+1e9:An-le;(!et||dt>qn)&&(et=zt,dt=qn)}}return et||(et=re[re.length-1]),et.from<_e&&(et={from:_e,to:et.to,level:et.level}),et.to>Ae&&(et={from:et.from,to:Ae,level:et.level}),et}var jo;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(jo==null){jo=je("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)jo.appendChild(document.createTextNode("x")),jo.appendChild(je("br"));jo.appendChild(document.createTextNode("x"))}bt(x.measure,jo);var ne=jo.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Xe(x.measure),ne||1}function _r(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=je("span","xxxxxxxxxx"),ne=je("pre",[z],"CodeMirror-line-like");bt(x.measure,ne);var te=z.getBoundingClientRect(),re=(te.right-te.left)/10;return re>2&&(x.cachedCharWidth=re),re||10}function kr(x){for(var z=x.display,ne={},te={},re=z.gutters.clientLeft,le=z.gutters.firstChild,pe=0;le;le=le.nextSibling,++pe){var be=x.display.gutterSpecs[pe].className;ne[be]=le.offsetLeft+le.clientLeft+re,te[be]=le.clientWidth}return{fixedPos:Fr(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Fr(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Xa(x){var z=as(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/_r(x.display)-3);return function(re){if(yr(x.doc,re))return 0;var le=0;if(re.widgets)for(var pe=0;pe<re.widgets.length;pe++)re.widgets[pe].height&&(le+=re.widgets[pe].height);return ne?le+(Math.ceil(re.text.length/te)||1)*z:le+z}}function Da(x){var z=x.doc,ne=Xa(x);z.iter(function(te){var re=ne(te);re!=te.height&&yt(te,re)})}function xo(x,z,ne,te){var re=x.display;if(!ne&&_i(z).getAttribute("cm-not-content")=="true")return null;var le,pe,be=re.lineSpace.getBoundingClientRect();try{le=z.clientX-be.left,pe=z.clientY-be.top}catch(dt){return null}var _e=Ys(x,le,pe),Ae;if(te&&_e.xRel>0&&(Ae=Ke(x.doc,_e.line).text).length==_e.ch){var et=Fe(Ae,Ae.length,x.options.tabSize)-Ae.length;_e=gt(_e.line,Math.max(0,Math.round((le-fo(x.display).left)/_r(x.display))-et))}return _e}function po(x,z){if(z>=x.display.viewTo||(z-=x.display.viewFrom,z<0))return null;for(var ne=x.display.view,te=0;te<ne.length;te++)if(z-=ne[te].size,z<0)return te}function $a(x,z,ne,te){z==null&&(z=x.doc.first),ne==null&&(ne=x.doc.first+x.doc.size),te||(te=0);var re=x.display;if(te&&ne<re.viewTo&&(re.updateLineNumbers==null||re.updateLineNumbers>z)&&(re.updateLineNumbers=z),x.curOp.viewChanged=!0,z>=re.viewTo)ui&&Ar(x.doc,z)<re.viewTo&&To(x);else if(ne<=re.viewFrom)ui&&Xi(x.doc,ne+te)>re.viewFrom?To(x):(re.viewFrom+=te,re.viewTo+=te);else if(z<=re.viewFrom&&ne>=re.viewTo)To(x);else if(z<=re.viewFrom){var le=wo(x,ne,ne+te,1);le?(re.view=re.view.slice(le.index),re.viewFrom=le.lineN,re.viewTo+=te):To(x)}else if(ne>=re.viewTo){var pe=wo(x,z,z,-1);pe?(re.view=re.view.slice(0,pe.index),re.viewTo=pe.lineN):To(x)}else{var be=wo(x,z,z,-1),_e=wo(x,ne,ne+te,1);be&&_e?(re.view=re.view.slice(0,be.index).concat(ma(x,be.lineN,_e.lineN)).concat(re.view.slice(_e.index)),re.viewTo+=te):To(x)}var Ae=re.externalMeasured;Ae&&(ne<Ae.lineN?Ae.lineN+=te:z<Ae.lineN+Ae.size&&(re.externalMeasured=null))}function Ao(x,z,ne){x.curOp.viewChanged=!0;var te=x.display,re=x.display.externalMeasured;if(re&&z>=re.lineN&&z<re.lineN+re.size&&(te.externalMeasured=null),!(z<te.viewFrom||z>=te.viewTo)){var le=te.view[po(x,z)];if(le.node!=null){var pe=le.changes||(le.changes=[]);ft(pe,ne)==-1&&pe.push(ne)}}}function To(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function wo(x,z,ne,te){var re=po(x,z),le,pe=x.display.view;if(!ui||ne==x.doc.first+x.doc.size)return{index:re,lineN:ne};for(var be=x.display.viewFrom,_e=0;_e<re;_e++)be+=pe[_e].size;if(be!=z){if(te>0){if(re==pe.length-1)return null;le=be+pe[re].size-z,re++}else le=be-z;z+=le,ne+=le}for(;Ar(x.doc,ne)!=ne;){if(re==(te<0?0:pe.length-1))return null;ne+=te*pe[re-(te<0?1:0)].size,re+=te}return{index:re,lineN:ne}}function os(x,z,ne){var te=x.display,re=te.view;re.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=ma(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=ma(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(po(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(ma(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,po(x,ne)))),te.viewTo=ne}function Wl(x){for(var z=x.display.view,ne=0,te=0;te<z.length;te++){var re=z[te];!re.hidden&&(!re.node||re.changes)&&++ne}return ne}function wl(x){x.display.input.showSelection(x.display.input.prepareSelection())}function Mc(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},re=te.cursors=document.createDocumentFragment(),le=te.selection=document.createDocumentFragment(),pe=0;pe<ne.sel.ranges.length;pe++)if(!(!z&&pe==ne.sel.primIndex)){var be=ne.sel.ranges[pe];if(!(be.from().line>=x.display.viewTo||be.to().line<x.display.viewFrom)){var _e=be.empty();(_e||x.options.showCursorWhenSelecting)&&kc(x,be.head,re),_e||Od(x,be,le)}}return te}function kc(x,z,ne){var te=La(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),re=ne.appendChild(je("div","\xA0","CodeMirror-cursor"));if(re.style.left=te.left+"px",re.style.top=te.top+"px",re.style.height=Math.max(0,te.bottom-te.top)*x.options.cursorHeight+"px",te.other){var le=ne.appendChild(je("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));le.style.display="",le.style.left=te.other.left+"px",le.style.top=te.other.top+"px",le.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Zl(x,z){return x.top-z.top||x.left-z.left}function Od(x,z,ne){var te=x.display,re=x.doc,le=document.createDocumentFragment(),pe=fo(x.display),be=pe.left,_e=Math.max(te.sizerWidth,ua(x)-te.sizer.offsetLeft)-pe.right,Ae=re.direction=="ltr";function et(oi,Ci,zi,Ki){Ci<0&&(Ci=0),Ci=Math.round(Ci),Ki=Math.round(Ki),le.appendChild(je("div",null,"CodeMirror-selected","position: absolute; left: "+oi+`px;
top: `+Ci+"px; width: "+(zi==null?_e-oi:zi)+`px;
height: `+(Ki-Ci)+"px"))}function dt(oi,Ci,zi){var Ki=Ke(re,oi),dr=Ki.text.length,jr,Na;function sa(Ca,ho){return lo(x,gt(oi,Ca),"div",Ki,ho)}function uo(Ca,ho,rr){var da=Hl(x,Ki,null,Ca),la=ho=="ltr"==(rr=="after")?"left":"right",ha=rr=="after"?da.begin:da.end-(/\s/.test(Ki.text.charAt(da.end-1))?2:1);return sa(ha,la)[la]}var co=bn(Ki,re.direction);return Jt(co,Ci||0,zi==null?dr:zi,function(Ca,ho,rr,da){var la=rr=="ltr",ha=sa(Ca,la?"left":"right"),va=sa(ho-1,la?"right":"left"),fl=Ci==null&&Ca==0,vo=zi==null&&ho==dr,Wa=da==0,Lr=!co||da==co.length-1;if(va.top-ha.top<=3){var Ba=(Ae?fl:vo)&&Wa,ac=(Ae?vo:fl)&&Lr,bs=Ba?be:(la?ha:va).left,Fs=ac?_e:(la?va:ha).right;et(bs,ha.top,Fs-bs,ha.bottom)}else{var qo,_a,pl,Za;la?(qo=Ae&&fl&&Wa?be:ha.left,_a=Ae?_e:uo(Ca,rr,"before"),pl=Ae?be:uo(ho,rr,"after"),Za=Ae&&vo&&Lr?_e:va.right):(qo=Ae?uo(Ca,rr,"before"):be,_a=!Ae&&fl&&Wa?_e:ha.right,pl=!Ae&&vo&&Lr?be:va.left,Za=Ae?uo(ho,rr,"after"):_e),et(qo,ha.top,_a-qo,ha.bottom),ha.bottom<va.top&&et(be,ha.bottom,null,va.top),et(pl,va.top,Za-pl,va.bottom)}(!jr||Zl(ha,jr)<0)&&(jr=ha),Zl(va,jr)<0&&(jr=va),(!Na||Zl(ha,Na)<0)&&(Na=ha),Zl(va,Na)<0&&(Na=va)}),{start:jr,end:Na}}var Wt=z.from(),zt=z.to();if(Wt.line==zt.line)dt(Wt.line,Wt.ch,zt.ch);else{var vn=Ke(re,Wt.line),An=Ke(re,zt.line),qn=Ai(vn)==Ai(An),di=dt(Wt.line,Wt.ch,qn?vn.text.length+1:null).end,xi=dt(zt.line,qn?0:null,zt.ch).start;qn&&(di.top<xi.top-2?(et(di.right,di.top,null,di.bottom),et(be,xi.top,xi.left,xi.bottom)):et(di.right,di.top,xi.left-di.right,di.bottom)),di.bottom<xi.top&&et(be,di.bottom,null,xi.top)}ne.appendChild(le)}function ku(x){if(x.state.focused){var z=x.display;clearInterval(z.blinker);var ne=!0;z.cursorDiv.style.visibility="",x.options.cursorBlinkRate>0?z.blinker=setInterval(function(){x.hasFocus()||Js(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Sl(x){x.state.focused||(x.display.input.focus(),Eu(x))}function Ec(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,Js(x))},100)}function Eu(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(vt(x,"focus",x,z),x.state.focused=!0,Nt(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Oe&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),ku(x))}function Js(x,z){x.state.delayingBlurEvent||(x.state.focused&&(vt(x,"blur",x,z),x.state.focused=!1,Ve(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function Vl(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var re=z.view[te],le=x.options.lineWrapping,pe=void 0,be=0;if(!re.hidden){if(Se&&Be<8){var _e=re.node.offsetTop+re.node.offsetHeight;pe=_e-ne,ne=_e}else{var Ae=re.node.getBoundingClientRect();pe=Ae.bottom-Ae.top,!le&&re.text.firstChild&&(be=re.text.firstChild.getBoundingClientRect().right-Ae.left-1)}var et=re.line.height-pe;if((et>.005||et<-.005)&&(yt(re.line,pe),Lc(re.line),re.rest))for(var dt=0;dt<re.rest.length;dt++)Lc(re.rest[dt]);if(be>x.display.sizerWidth){var Wt=Math.ceil(be/_r(x.display));Wt>x.display.maxLineLength&&(x.display.maxLineLength=Wt,x.display.maxLine=re.line,x.display.maxLineChanged=!0)}}}}function Lc(x){if(x.widgets)for(var z=0;z<x.widgets.length;++z){var ne=x.widgets[z],te=ne.node.parentNode;te&&(ne.height=te.offsetHeight)}}function Aa(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-eo(x));var re=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,le=Xt(z,te),pe=Xt(z,re);if(ne&&ne.ensure){var be=ne.ensure.from.line,_e=ne.ensure.to.line;be<le?(le=be,pe=Xt(z,Rn(Ke(z,be))+x.wrapper.clientHeight)):Math.min(_e,z.lastLine())>=pe&&(le=Xt(z,Rn(Ke(z,_e))-x.wrapper.clientHeight),pe=_e)}return{from:le,to:Math.max(pe,le+1)}}function ss(x,z){if(!Lt(x,"scrollCursorIntoView")){var ne=x.display,te=ne.sizer.getBoundingClientRect(),re=null;if(z.top+te.top<0?re=!0:z.bottom+te.top>(window.innerHeight||document.documentElement.clientHeight)&&(re=!1),re!=null&&!He){var le=je("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-eo(x.display))+`px;
height: `+(z.bottom-z.top+ka(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(le),le.scrollIntoView(re),x.display.lineSpace.removeChild(le)}}}function _s(x,z,ne,te){te==null&&(te=0);var re;!x.options.lineWrapping&&z==ne&&(z=z.ch?gt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?gt(z.line,z.ch+1,"before"):z);for(var le=0;le<5;le++){var pe=!1,be=La(x,z),_e=!ne||ne==z?be:La(x,ne);re={left:Math.min(be.left,_e.left),top:Math.min(be.top,_e.top)-te,right:Math.max(be.left,_e.left),bottom:Math.max(be.bottom,_e.bottom)+te};var Ae=jl(x,re),et=x.doc.scrollTop,dt=x.doc.scrollLeft;if(Ae.scrollTop!=null&&(Ms(x,Ae.scrollTop),Math.abs(x.doc.scrollTop-et)>1&&(pe=!0)),Ae.scrollLeft!=null&&(ks(x,Ae.scrollLeft),Math.abs(x.doc.scrollLeft-dt)>1&&(pe=!0)),!pe)break}return re}function Rd(x,z){var ne=jl(x,z);ne.scrollTop!=null&&Ms(x,ne.scrollTop),ne.scrollLeft!=null&&ks(x,ne.scrollLeft)}function jl(x,z){var ne=x.display,te=as(x.display);z.top<0&&(z.top=0);var re=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,le=bo(x),pe={};z.bottom-z.top>le&&(z.bottom=z.top+le);var be=x.doc.height+Ss(ne),_e=z.top<te,Ae=z.bottom>be-te;if(z.top<re)pe.scrollTop=_e?0:z.top;else if(z.bottom>re+le){var et=Math.min(z.top,(Ae?be:z.bottom)-le);et!=re&&(pe.scrollTop=et)}var dt=x.options.fixedGutter?0:ne.gutters.offsetWidth,Wt=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-dt,zt=ua(x)-ne.gutters.offsetWidth,vn=z.right-z.left>zt;return vn&&(z.right=z.left+zt),z.left<10?pe.scrollLeft=0:z.left<Wt?pe.scrollLeft=Math.max(0,z.left+dt-(vn?0:10)):z.right>zt+Wt-3&&(pe.scrollLeft=z.right+(vn?0:10)-zt),pe}function Lu(x,z){z!=null&&(Gl(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function Qs(x){Gl(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function el(x,z,ne){(z!=null||ne!=null)&&Gl(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Nd(x,z){Gl(x),x.curOp.scrollToPos=z}function Gl(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=bl(x,z.from),te=bl(x,z.to);Dc(x,ne,te,z.margin)}}function Dc(x,z,ne,te){var re=jl(x,{left:Math.min(z.left,ne.left),top:Math.min(z.top,ne.top)-te,right:Math.max(z.right,ne.right),bottom:Math.max(z.bottom,ne.bottom)+te});el(x,re.scrollLeft,re.scrollTop)}function Ms(x,z){Math.abs(x.doc.scrollTop-z)<2||(we||Tu(x,{top:z}),Ac(x,z,!0),we&&Tu(x),nl(x,100))}function Ac(x,z,ne){z=Math.max(0,Math.min(x.display.scroller.scrollHeight-x.display.scroller.clientHeight,z)),!(x.display.scroller.scrollTop==z&&!ne)&&(x.doc.scrollTop=z,x.display.scrollbars.setScrollTop(z),x.display.scroller.scrollTop!=z&&(x.display.scroller.scrollTop=z))}function ks(x,z,ne,te){z=Math.max(0,Math.min(z,x.display.scroller.scrollWidth-x.display.scroller.clientWidth)),!((ne?z==x.doc.scrollLeft:Math.abs(x.doc.scrollLeft-z)<2)&&!te)&&(x.doc.scrollLeft=z,Rc(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function tl(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+Ss(x.display));return{clientHeight:z.scroller.clientHeight,viewHeight:z.wrapper.clientHeight,scrollWidth:z.scroller.scrollWidth,clientWidth:z.scroller.clientWidth,viewWidth:z.wrapper.clientWidth,barLeft:x.options.fixedGutter?ne:0,docHeight:te,scrollHeight:te+ka(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var ls=function(x,z,ne){this.cm=ne;var te=this.vert=je("div",[je("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),re=this.horiz=je("div",[je("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=re.tabIndex=-1,x(te),x(re),sn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),sn(re,"scroll",function(){re.clientWidth&&z(re.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Se&&Be<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ls.prototype.update=function(x){var z=x.scrollWidth>x.clientWidth+1,ne=x.scrollHeight>x.clientHeight+1,te=x.nativeBarWidth;if(ne){this.vert.style.display="block",this.vert.style.bottom=z?te+"px":"0";var re=x.viewHeight-(z?te:0);this.vert.firstChild.style.height=Math.max(0,x.scrollHeight-x.clientHeight+re)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(z){this.horiz.style.display="block",this.horiz.style.right=ne?te+"px":"0",this.horiz.style.left=x.barLeft+"px";var le=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+le)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&x.clientHeight>0&&(te==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ne?te:0,bottom:z?te:0}},ls.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ls.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ls.prototype.zeroWidthHack=function(){var x=rt&&!Ie?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new xe,this.disableVert=new xe},ls.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var re=x.getBoundingClientRect(),le=ne=="vert"?document.elementFromPoint(re.right-1,(re.top+re.bottom)/2):document.elementFromPoint((re.right+re.left)/2,re.bottom-1);le!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},ls.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var mo=function(){};mo.prototype.update=function(){return{bottom:0,right:0}},mo.prototype.setScrollLeft=function(){},mo.prototype.setScrollTop=function(){},mo.prototype.clear=function(){};function Es(x,z){z||(z=tl(x));var ne=x.display.barWidth,te=x.display.barHeight;Du(x,z);for(var re=0;re<4&&ne!=x.display.barWidth||te!=x.display.barHeight;re++)ne!=x.display.barWidth&&x.options.lineWrapping&&Vl(x),Du(x,tl(x)),ne=x.display.barWidth,te=x.display.barHeight}function Du(x,z){var ne=x.display,te=ne.scrollbars.update(z);ne.sizer.style.paddingRight=(ne.barWidth=te.right)+"px",ne.sizer.style.paddingBottom=(ne.barHeight=te.bottom)+"px",ne.heightForcer.style.borderBottom=te.bottom+"px solid transparent",te.right&&te.bottom?(ne.scrollbarFiller.style.display="block",ne.scrollbarFiller.style.height=te.bottom+"px",ne.scrollbarFiller.style.width=te.right+"px"):ne.scrollbarFiller.style.display="",te.bottom&&x.options.coverGutterNextToScrollbar&&x.options.fixedGutter?(ne.gutterFiller.style.display="block",ne.gutterFiller.style.height=te.bottom+"px",ne.gutterFiller.style.width=z.gutterWidth+"px"):ne.gutterFiller.style.display=""}var Tc={native:ls,null:mo};function Bc(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ve(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Tc[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),sn(z,"mousedown",function(){x.state.focused&&setTimeout(function(){return x.display.input.focus()},0)}),z.setAttribute("cm-not-content","true")},function(z,ne){ne=="horizontal"?ks(x,z):Ms(x,z)},x),x.display.scrollbars.addClass&&Nt(x.display.wrapper,x.display.scrollbars.addClass)}var Fd=0;function Ls(x){x.curOp={cm:x,viewChanged:!1,startHeight:x.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Fd},Sr(x.curOp)}function us(x){var z=x.curOp;z&&Zi(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;$d(ne)})}function $d(x){for(var z=x.ops,ne=0;ne<z.length;ne++)zd(z[ne]);for(var te=0;te<z.length;te++)Kd(z[te]);for(var re=0;re<z.length;re++)Hd(z[re]);for(var le=0;le<z.length;le++)Wd(z[le]);for(var pe=0;pe<z.length;pe++)Zd(z[pe])}function zd(x){var z=x.cm,ne=z.display;Ic(z),x.updateMaxLine&&Pn(z),x.mustUpdate=x.viewChanged||x.forceUpdate||x.scrollTop!=null||x.scrollToPos&&(x.scrollToPos.from.line<ne.viewFrom||x.scrollToPos.to.line>=ne.viewTo)||ne.maxLineChanged&&z.options.lineWrapping,x.update=x.mustUpdate&&new Ul(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Kd(x){x.updatedDisplay=x.mustUpdate&&Au(x.cm,x.update)}function Hd(x){var z=x.cm,ne=z.display;x.updatedDisplay&&Vl(z),x.barMeasure=tl(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Ro(z,ne.maxLine,ne.maxLine.text.length).left+3,z.display.sizerWidth=x.adjustWidthTo,x.barMeasure.scrollWidth=Math.max(ne.scroller.clientWidth,ne.sizer.offsetLeft+x.adjustWidthTo+ka(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-ua(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Wd(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&ks(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==qe();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&Es(z,x.barMeasure),x.updatedDisplay&&Pu(z,x.barMeasure),x.selectionChanged&&ku(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Sl(x.cm)}function Zd(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Oc(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Ac(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&ks(z,x.scrollLeft,!0,!0),x.scrollToPos){var re=_s(z,ln(te,x.scrollToPos.from),ln(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,re)}var le=x.maybeHiddenMarkers,pe=x.maybeUnhiddenMarkers;if(le)for(var be=0;be<le.length;++be)le[be].lines.length||vt(le[be],"hide");if(pe)for(var _e=0;_e<pe.length;++_e)pe[_e].lines.length&&vt(pe[_e],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&vt(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function ca(x,z){if(x.curOp)return z();Ls(x);try{return z()}finally{us(x)}}function xa(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ls(x);try{return z.apply(x,arguments)}finally{us(x)}}}function oa(x){return function(){if(this.curOp)return x.apply(this,arguments);Ls(this);try{return x.apply(this,arguments)}finally{us(this)}}}function Ta(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ls(z);try{return x.apply(this,arguments)}finally{us(z)}}}function nl(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,Gt(Pc,x))}function Pc(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Pt(x,z.highlightFrontier),re=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(le){if(te.line>=x.display.viewFrom){var pe=le.styles,be=le.text.length>x.options.maxHighlightLength?ke(z.mode,te.state):null,_e=Kt(x,le,te,!0);be&&(te.state=be),le.styles=_e.styles;var Ae=le.styleClasses,et=_e.classes;et?le.styleClasses=et:Ae&&(le.styleClasses=null);for(var dt=!pe||pe.length!=le.styles.length||Ae!=et&&(!Ae||!et||Ae.bgClass!=et.bgClass||Ae.textClass!=et.textClass),Wt=0;!dt&&Wt<pe.length;++Wt)dt=pe[Wt]!=le.styles[Wt];dt&&re.push(te.line),le.stateAfter=te.save(),te.nextLine()}else le.text.length<=x.options.maxHighlightLength&&At(x,le.text,te),le.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return nl(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),re.length&&ca(x,function(){for(var le=0;le<re.length;le++)Ao(x,re[le],"text")})}}var Ul=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=Aa(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=ua(x),this.force=ne,this.dims=kr(x),this.events=[]};Ul.prototype.signal=function(x,z){Mn(x,z)&&this.events.push(arguments)},Ul.prototype.finish=function(){for(var x=0;x<this.events.length;x++)vt.apply(null,this.events[x])};function Ic(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=ka(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=ka(x)+"px",z.scrollbarsClipped=!0)}function Vd(x){if(x.hasFocus())return null;var z=qe();if(!z||!Ct(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Ct(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function jd(x){if(!(!x||!x.activeElt||x.activeElt==qe())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Ct(document.body,x.anchorNode)&&Ct(document.body,x.focusNode))){var z=window.getSelection(),ne=document.createRange();ne.setEnd(x.anchorNode,x.anchorOffset),ne.collapse(!1),z.removeAllRanges(),z.addRange(ne),z.extend(x.focusNode,x.focusOffset)}}function Au(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return To(x),!1;if(!z.force&&z.visible.from>=ne.viewFrom&&z.visible.to<=ne.viewTo&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo)&&ne.renderedView==ne.view&&Wl(x)==0)return!1;Xl(x)&&(To(x),z.dims=kr(x));var re=te.first+te.size,le=Math.max(z.visible.from-x.options.viewportMargin,te.first),pe=Math.min(re,z.visible.to+x.options.viewportMargin);ne.viewFrom<le&&le-ne.viewFrom<20&&(le=Math.max(te.first,ne.viewFrom)),ne.viewTo>pe&&ne.viewTo-pe<20&&(pe=Math.min(re,ne.viewTo)),ui&&(le=Ar(x.doc,le),pe=Xi(x.doc,pe));var be=le!=ne.viewFrom||pe!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,le,pe),ne.viewOffset=Rn(Ke(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var _e=Wl(x);if(!be&&_e==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Ae=Vd(x);return _e>4&&(ne.lineDiv.style.display="none"),Gd(x,ne.updateLineNumbers,z.dims),_e>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,jd(Ae),Xe(ne.cursorDiv),Xe(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,be&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,nl(x,400)),ne.updateLineNumbers=null,!0}function Oc(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==ua(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Ss(x.display)-bo(x),ne.top)}),z.visible=Aa(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=Aa(x.display,x.doc,ne));if(!Au(x,z))break;Vl(x);var re=tl(x);wl(x),Es(x,re),Pu(x,re),z.force=!1}z.signal(x,"update",x),(x.display.viewFrom!=x.display.reportedViewFrom||x.display.viewTo!=x.display.reportedViewTo)&&(z.signal(x,"viewportChange",x,x.display.viewFrom,x.display.viewTo),x.display.reportedViewFrom=x.display.viewFrom,x.display.reportedViewTo=x.display.viewTo)}function Tu(x,z){var ne=new Ul(x,z);if(Au(x,ne)){Vl(x),Oc(x,ne);var te=tl(x);wl(x),Es(x,te),Pu(x,te),ne.finish()}}function Gd(x,z,ne){var te=x.display,re=x.options.lineNumbers,le=te.lineDiv,pe=le.firstChild;function be(vn){var An=vn.nextSibling;return Oe&&rt&&x.display.currentWheelTarget==vn?vn.style.display="none":vn.parentNode.removeChild(vn),An}for(var _e=te.view,Ae=te.viewFrom,et=0;et<_e.length;et++){var dt=_e[et];if(!dt.hidden)if(!dt.node||dt.node.parentNode!=le){var Wt=aa(x,dt,Ae,ne);le.insertBefore(Wt,pe)}else{for(;pe!=dt.node;)pe=be(pe);var zt=re&&z!=null&&z<=Ae&&dt.lineNumber;dt.changes&&(ft(dt.changes,"gutter")>-1&&(zt=!1),Qi(x,dt,Ae,ne)),zt&&(Xe(dt.lineNumber),dt.lineNumber.appendChild(document.createTextNode(un(x.options,Ae)))),pe=dt.node.nextSibling}Ae+=dt.size}for(;pe;)pe=be(pe)}function Bu(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Pu(x,z){x.display.sizer.style.minHeight=z.docHeight+"px",x.display.heightForcer.style.top=z.docHeight+"px",x.display.gutters.style.height=z.docHeight+x.display.barHeight+ka(x)+"px"}function Rc(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Fr(z)-z.scroller.scrollLeft+x.doc.scrollLeft,re=z.gutters.offsetWidth,le=te+"px",pe=0;pe<ne.length;pe++)if(!ne[pe].hidden){x.options.fixedGutter&&(ne[pe].gutter&&(ne[pe].gutter.style.left=le),ne[pe].gutterBackground&&(ne[pe].gutterBackground.style.left=le));var be=ne[pe].alignable;if(be)for(var _e=0;_e<be.length;_e++)be[_e].style.left=le}x.options.fixedGutter&&(z.gutters.style.left=te+re+"px")}}function Xl(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=un(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var re=te.measure.appendChild(je("div",[je("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),le=re.firstChild.offsetWidth,pe=re.offsetWidth-le;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(le,te.lineGutter.offsetWidth-pe)+1,te.lineNumWidth=te.lineNumInnerWidth+pe,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Bu(x.display),!0}return!1}function Iu(x,z){for(var ne=[],te=!1,re=0;re<x.length;re++){var le=x[re],pe=null;if(typeof le!="string"&&(pe=le.style,le=le.className),le=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:le,style:pe})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Nc(x){var z=x.gutters,ne=x.gutterSpecs;Xe(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var re=ne[te],le=re.className,pe=re.style,be=z.appendChild(je("div",null,"CodeMirror-gutter "+le));pe&&(be.style.cssText=pe),le=="CodeMirror-linenumbers"&&(x.lineGutter=be,be.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Bu(x)}function Cl(x){Nc(x.display),$a(x),Rc(x)}function Ud(x,z,ne,te){var re=this;this.input=ne,re.scrollbarFiller=je("div",null,"CodeMirror-scrollbar-filler"),re.scrollbarFiller.setAttribute("cm-not-content","true"),re.gutterFiller=je("div",null,"CodeMirror-gutter-filler"),re.gutterFiller.setAttribute("cm-not-content","true"),re.lineDiv=It("div",null,"CodeMirror-code"),re.selectionDiv=je("div",null,null,"position: relative; z-index: 1"),re.cursorDiv=je("div",null,"CodeMirror-cursors"),re.measure=je("div",null,"CodeMirror-measure"),re.lineMeasure=je("div",null,"CodeMirror-measure"),re.lineSpace=It("div",[re.measure,re.lineMeasure,re.selectionDiv,re.cursorDiv,re.lineDiv],null,"position: relative; outline: none");var le=It("div",[re.lineSpace],"CodeMirror-lines");re.mover=je("div",[le],null,"position: relative"),re.sizer=je("div",[re.mover],"CodeMirror-sizer"),re.sizerWidth=null,re.heightForcer=je("div",null,null,"position: absolute; height: "+qt+"px; width: 1px;"),re.gutters=je("div",null,"CodeMirror-gutters"),re.lineGutter=null,re.scroller=je("div",[re.sizer,re.heightForcer,re.gutters],"CodeMirror-scroll"),re.scroller.setAttribute("tabIndex","-1"),re.wrapper=je("div",[re.scrollbarFiller,re.gutterFiller,re.scroller],"CodeMirror"),Se&&Be<8&&(re.gutters.style.zIndex=-1,re.scroller.style.paddingRight=0),!Oe&&!(we&&ot)&&(re.scroller.draggable=!0),x&&(x.appendChild?x.appendChild(re.wrapper):x(re.wrapper)),re.viewFrom=re.viewTo=z.first,re.reportedViewFrom=re.reportedViewTo=z.first,re.view=[],re.renderedView=null,re.externalMeasured=null,re.viewOffset=0,re.lastWrapHeight=re.lastWrapWidth=0,re.updateLineNumbers=null,re.nativeBarWidth=re.barHeight=re.barWidth=0,re.scrollbarsClipped=!1,re.lineNumWidth=re.lineNumInnerWidth=re.lineNumChars=null,re.alignWidgets=!1,re.cachedCharWidth=re.cachedTextHeight=re.cachedPaddingH=null,re.maxLine=null,re.maxLineLength=0,re.maxLineChanged=!1,re.wheelDX=re.wheelDY=re.wheelStartX=re.wheelStartY=null,re.shift=!1,re.selForContextMenu=null,re.activeTouch=null,re.gutterSpecs=Iu(te.gutters,te.lineNumbers),Nc(re),ne.init(re)}var ql=0,za=null;Se?za=-.53:we?za=15:Me?za=-.7:ht&&(za=-1/3);function il(x){var z=x.wheelDeltaX,ne=x.wheelDeltaY;return z==null&&x.detail&&x.axis==x.HORIZONTAL_AXIS&&(z=x.detail),ne==null&&x.detail&&x.axis==x.VERTICAL_AXIS?ne=x.detail:ne==null&&(ne=x.wheelDelta),{x:z,y:ne}}function Fc(x){var z=il(x);return z.x*=za,z.y*=za,z}function $c(x,z){var ne=il(z),te=ne.x,re=ne.y,le=x.display,pe=le.scroller,be=pe.scrollWidth>pe.clientWidth,_e=pe.scrollHeight>pe.clientHeight;if(te&&be||re&&_e){if(re&&rt&&Oe){e:for(var Ae=z.target,et=le.view;Ae!=pe;Ae=Ae.parentNode)for(var dt=0;dt<et.length;dt++)if(et[dt].node==Ae){x.display.currentWheelTarget=Ae;break e}}if(te&&!we&&!Ne&&za!=null){re&&_e&&Ms(x,Math.max(0,pe.scrollTop+re*za)),ks(x,Math.max(0,pe.scrollLeft+te*za)),(!re||re&&_e)&&ti(z),le.wheelStartX=null;return}if(re&&za!=null){var Wt=re*za,zt=x.doc.scrollTop,vn=zt+le.wrapper.clientHeight;Wt<0?zt=Math.max(0,zt+Wt-50):vn=Math.min(x.doc.height,vn+Wt+50),Tu(x,{top:zt,bottom:vn})}ql<20&&(le.wheelStartX==null?(le.wheelStartX=pe.scrollLeft,le.wheelStartY=pe.scrollTop,le.wheelDX=te,le.wheelDY=re,setTimeout(function(){if(le.wheelStartX!=null){var An=pe.scrollLeft-le.wheelStartX,qn=pe.scrollTop-le.wheelStartY,di=qn&&le.wheelDY&&qn/le.wheelDY||An&&le.wheelDX&&An/le.wheelDX;le.wheelStartX=le.wheelStartY=null,di&&(za=(za*ql+di)/(ql+1),++ql)}},200)):(le.wheelDX+=te,le.wheelDY+=re))}}var go=function(x,z){this.ranges=x,this.primIndex=z};go.prototype.primary=function(){return this.ranges[this.primIndex]},go.prototype.equals=function(x){if(x==this)return!0;if(x.primIndex!=this.primIndex||x.ranges.length!=this.ranges.length)return!1;for(var z=0;z<this.ranges.length;z++){var ne=this.ranges[z],te=x.ranges[z];if(!Bn(ne.anchor,te.anchor)||!Bn(ne.head,te.head))return!1}return!0},go.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Tr(yn(this.ranges[z].anchor),yn(this.ranges[z].head));return new go(x,this.primIndex)},go.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},go.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(jt(z,te.from())>=0&&jt(x,te.to())<=0)return ne}return-1};var Tr=function(x,z){this.anchor=x,this.head=z};Tr.prototype.from=function(){return Cn(this.anchor,this.head)},Tr.prototype.to=function(){return Tn(this.anchor,this.head)},Tr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Bo(x,z,ne){var te=x&&x.options.selectionsMayTouch,re=z[ne];z.sort(function(Wt,zt){return jt(Wt.from(),zt.from())}),ne=ft(z,re);for(var le=1;le<z.length;le++){var pe=z[le],be=z[le-1],_e=jt(be.to(),pe.from());if(te&&!pe.empty()?_e>0:_e>=0){var Ae=Cn(be.from(),pe.from()),et=Tn(be.to(),pe.to()),dt=be.empty()?pe.from()==pe.head:be.from()==be.head;le<=ne&&--ne,z.splice(--le,2,new Tr(dt?et:Ae,dt?Ae:et))}}return new go(z,ne)}function No(x,z){return new go([new Tr(x,z||x)],0)}function cs(x){return x.text?gt(x.from.line+x.text.length-1,$t(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function zc(x,z){if(jt(x,z.from)<0)return x;if(jt(x,z.to)<=0)return cs(z);var ne=x.line+z.text.length-(z.to.line-z.from.line)-1,te=x.ch;return x.line==z.to.line&&(te+=cs(z).ch-z.to.ch),gt(ne,te)}function Ou(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var re=x.sel.ranges[te];ne.push(new Tr(zc(re.anchor,z),zc(re.head,z)))}return Bo(x.cm,ne,x.sel.primIndex)}function rl(x,z,ne){return x.line==z.line?gt(ne.line,x.ch-z.ch+ne.ch):gt(ne.line+(x.line-z.line),x.ch)}function Ru(x,z,ne){for(var te=[],re=gt(x.first,0),le=re,pe=0;pe<z.length;pe++){var be=z[pe],_e=rl(be.from,re,le),Ae=rl(cs(be),re,le);if(re=be.to,le=Ae,ne=="around"){var et=x.sel.ranges[pe],dt=jt(et.head,et.anchor)<0;te[pe]=new Tr(dt?Ae:_e,dt?_e:Ae)}else te[pe]=new Tr(_e,_e)}return new go(te,x.sel.primIndex)}function Nu(x){x.doc.mode=Dn(x.options,x.doc.modeOption),al(x)}function al(x){x.doc.iter(function(z){z.stateAfter&&(z.stateAfter=null),z.styles&&(z.styles=null)}),x.doc.modeFrontier=x.doc.highlightFrontier=x.doc.first,nl(x,100),x.state.modeGen++,x.curOp&&$a(x)}function Kc(x,z){return z.from.ch==0&&z.to.ch==0&&$t(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function Fu(x,z,ne,te){function re(xi){return ne?ne[xi]:null}function le(xi,oi,Ci){qi(xi,oi,Ci,te),Si(xi,"change",xi,z)}function pe(xi,oi){for(var Ci=[],zi=xi;zi<oi;++zi)Ci.push(new Xn(Ae[zi],re(zi),te));return Ci}var be=z.from,_e=z.to,Ae=z.text,et=Ke(x,be.line),dt=Ke(x,_e.line),Wt=$t(Ae),zt=re(Ae.length-1),vn=_e.line-be.line;if(z.full)x.insert(0,pe(0,Ae.length)),x.remove(Ae.length,x.size-Ae.length);else if(Kc(x,z)){var An=pe(0,Ae.length-1);le(dt,dt.text,zt),vn&&x.remove(be.line,vn),An.length&&x.insert(be.line,An)}else if(et==dt)if(Ae.length==1)le(et,et.text.slice(0,be.ch)+Wt+et.text.slice(_e.ch),zt);else{var qn=pe(1,Ae.length-1);qn.push(new Xn(Wt+et.text.slice(_e.ch),zt,te)),le(et,et.text.slice(0,be.ch)+Ae[0],re(0)),x.insert(be.line+1,qn)}else if(Ae.length==1)le(et,et.text.slice(0,be.ch)+Ae[0]+dt.text.slice(_e.ch),re(0)),x.remove(be.line+1,vn);else{le(et,et.text.slice(0,be.ch)+Ae[0],re(0)),le(dt,Wt+dt.text.slice(_e.ch),zt);var di=pe(1,Ae.length-1);vn>1&&x.remove(be.line+1,vn-1),x.insert(be.line+1,di)}Si(x,"change",x,z)}function ds(x,z,ne){function te(re,le,pe){if(re.linked)for(var be=0;be<re.linked.length;++be){var _e=re.linked[be];if(_e.doc!=le){var Ae=pe&&_e.sharedHist;ne&&!Ae||(z(_e.doc,Ae),te(_e.doc,re,Ae))}}}te(x,null,!0)}function Yl(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,Da(x),Nu(x),Jl(x),x.options.lineWrapping||Pn(x),x.options.mode=z.modeOption,$a(x)}function Jl(x){(x.doc.direction=="rtl"?Nt:Ve)(x.display.lineDiv,"CodeMirror-rtl")}function $u(x){ca(x,function(){Jl(x),$a(x)})}function Ql(x){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=x||1}function zu(x,z){var ne={from:yn(z.from),to:cs(z),text:it(x,z.from,z.to)};return Zu(x,ne,z.from.line,z.to.line+1),ds(x,function(te){return Zu(te,ne,z.from.line,z.to.line+1)},!0),ne}function Hc(x){for(;x.length;){var z=$t(x);if(z.ranges)x.pop();else break}}function Ku(x,z){if(z)return Hc(x.done),$t(x.done);if(x.done.length&&!$t(x.done).ranges)return $t(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),$t(x.done)}function eu(x,z,ne,te){var re=x.history;re.undone.length=0;var le=+new Date,pe,be;if((re.lastOp==te||re.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&re.lastModTime>le-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(pe=Ku(re,re.lastOp==te)))be=$t(pe.changes),jt(z.from,z.to)==0&&jt(z.from,be.to)==0?be.to=cs(z):pe.changes.push(zu(x,z));else{var _e=$t(re.done);for((!_e||!_e.ranges)&&tu(x.sel,re.done),pe={changes:[zu(x,z)],generation:re.generation},re.done.push(pe);re.done.length>re.undoDepth;)re.done.shift(),re.done[0].ranges||re.done.shift()}re.done.push(ne),re.generation=++re.maxGeneration,re.lastModTime=re.lastSelTime=le,re.lastOp=re.lastSelOp=te,re.lastOrigin=re.lastSelOrigin=z.origin,be||vt(x,"historyAdded")}function Hu(x,z,ne,te){var re=z.charAt(0);return re=="*"||re=="+"&&ne.ranges.length==te.ranges.length&&ne.somethingSelected()==te.somethingSelected()&&new Date-x.history.lastSelTime<=(x.cm?x.cm.options.historyEventDelay:500)}function Wu(x,z,ne,te){var re=x.history,le=te&&te.origin;ne==re.lastSelOp||le&&re.lastSelOrigin==le&&(re.lastModTime==re.lastSelTime&&re.lastOrigin==le||Hu(x,le,$t(re.done),z))?re.done[re.done.length-1]=z:tu(z,re.done),re.lastSelTime=+new Date,re.lastSelOrigin=le,re.lastSelOp=ne,te&&te.clearRedo!==!1&&Hc(re.undone)}function tu(x,z){var ne=$t(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function Zu(x,z,ne,te){var re=z["spans_"+x.id],le=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(pe){pe.markedSpans&&((re||(re=z["spans_"+x.id]={}))[le]=pe.markedSpans),++le})}function Vu(x){if(!x)return null;for(var z,ne=0;ne<x.length;++ne)x[ne].marker.explicitlyCleared?z||(z=x.slice(0,ne)):z&&z.push(x[ne]);return z?z.length?z:null:x}function Xd(x,z){var ne=z["spans_"+x.id];if(!ne)return null;for(var te=[],re=0;re<z.text.length;++re)te.push(Vu(ne[re]));return te}function Wc(x,z){var ne=Xd(x,z),te=wn(x,z);if(!ne)return te;if(!te)return ne;for(var re=0;re<ne.length;++re){var le=ne[re],pe=te[re];if(le&&pe)e:for(var be=0;be<pe.length;++be){for(var _e=pe[be],Ae=0;Ae<le.length;++Ae)if(le[Ae].marker==_e.marker)continue e;le.push(_e)}else pe&&(ne[re]=pe)}return ne}function ol(x,z,ne){for(var te=[],re=0;re<x.length;++re){var le=x[re];if(le.ranges){te.push(ne?go.prototype.deepCopy.call(le):le);continue}var pe=le.changes,be=[];te.push({changes:be});for(var _e=0;_e<pe.length;++_e){var Ae=pe[_e],et=void 0;if(be.push({from:Ae.from,to:Ae.to,text:Ae.text}),z)for(var dt in Ae)(et=dt.match(/^spans_(\d+)$/))&&ft(z,Number(et[1]))>-1&&($t(be)[dt]=Ae[dt],delete Ae[dt])}}return te}function ju(x,z,ne,te){if(te){var re=x.anchor;if(ne){var le=jt(z,re)<0;le!=jt(ne,re)<0?(re=z,z=ne):le!=jt(z,ne)<0&&(z=ne)}return new Tr(re,z)}else return new Tr(ne||z,z)}function sl(x,z,ne,te,re){re==null&&(re=x.cm&&(x.cm.display.shift||x.extend)),wa(x,new go([ju(x.sel.primary(),z,ne,re)],0),te)}function Ei(x,z,ne){for(var te=[],re=x.cm&&(x.cm.display.shift||x.extend),le=0;le<x.sel.ranges.length;le++)te[le]=ju(x.sel.ranges[le],z[le],null,re);var pe=Bo(x.cm,te,x.sel.primIndex);wa(x,pe,ne)}function So(x,z,ne,te){var re=x.sel.ranges.slice(0);re[z]=ne,wa(x,Bo(x.cm,re,x.sel.primIndex),te)}function Zc(x,z,ne,te){wa(x,No(z,ne),te)}function qd(x,z,ne){var te={ranges:z.ranges,update:function(re){this.ranges=[];for(var le=0;le<re.length;le++)this.ranges[le]=new Tr(ln(x,re[le].anchor),ln(x,re[le].head))},origin:ne&&ne.origin};return vt(x,"beforeSelectionChange",x,te),x.cm&&vt(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Bo(x.cm,te.ranges,te.ranges.length-1):z}function no(x,z,ne){var te=x.history.done,re=$t(te);re&&re.ranges?(te[te.length-1]=z,nu(x,z,ne)):wa(x,z,ne)}function wa(x,z,ne){nu(x,z,ne),Wu(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function nu(x,z,ne){(Mn(x,"beforeSelectionChange")||x.cm&&Mn(x.cm,"beforeSelectionChange"))&&(z=qd(x,z,ne));var te=ne&&ne.bias||(jt(z.primary().head,x.sel.primary().head)<0?-1:1);Yd(x,ll(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&Qs(x.cm)}function Yd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Ln(x.cm)),Si(x,"cursorActivity",x))}function Jd(x){Yd(x,ll(x,x.sel,null,!1))}function ll(x,z,ne,te){for(var re,le=0;le<z.ranges.length;le++){var pe=z.ranges[le],be=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[le],_e=Gu(x,pe.anchor,be&&be.anchor,ne,te),Ae=Gu(x,pe.head,be&&be.head,ne,te);(re||_e!=pe.anchor||Ae!=pe.head)&&(re||(re=z.ranges.slice(0,le)),re[le]=new Tr(_e,Ae))}return re?Bo(x.cm,re,z.primIndex):z}function io(x,z,ne,te,re){var le=Ke(x,z.line);if(le.markedSpans)for(var pe=0;pe<le.markedSpans.length;++pe){var be=le.markedSpans[pe],_e=be.marker,Ae="selectLeft"in _e?!_e.selectLeft:_e.inclusiveLeft,et="selectRight"in _e?!_e.selectRight:_e.inclusiveRight;if((be.from==null||(Ae?be.from<=z.ch:be.from<z.ch))&&(be.to==null||(et?be.to>=z.ch:be.to>z.ch))){if(re&&(vt(_e,"beforeCursorEnter"),_e.explicitlyCleared))if(le.markedSpans){--pe;continue}else break;if(!_e.atomic)continue;if(ne){var dt=_e.find(te<0?1:-1),Wt=void 0;if((te<0?et:Ae)&&(dt=hs(x,dt,-te,dt&&dt.line==z.line?le:null)),dt&&dt.line==z.line&&(Wt=jt(dt,ne))&&(te<0?Wt<0:Wt>0))return io(x,dt,z,te,re)}var zt=_e.find(te<0?-1:1);return(te<0?Ae:et)&&(zt=hs(x,zt,te,zt.line==z.line?le:null)),zt?io(x,zt,z,te,re):null}}return z}function Gu(x,z,ne,te,re){var le=te||1,pe=io(x,z,ne,le,re)||!re&&io(x,z,ne,le,!0)||io(x,z,ne,-le,re)||!re&&io(x,z,ne,-le,!0);return pe||(x.cantEdit=!0,gt(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?ln(x,gt(z.line-1)):null:ne>0&&z.ch==(te||Ke(x,z.line)).text.length?z.line<x.first+x.size-1?gt(z.line+1,0):null:new gt(z.line,z.ch+ne)}function Vc(x){x.setSelection(gt(x.firstLine(),0),gt(x.lastLine()),Ue)}function Uu(x,z,ne){var te={canceled:!1,from:z.from,to:z.to,text:z.text,origin:z.origin,cancel:function(){return te.canceled=!0}};return ne&&(te.update=function(re,le,pe,be){re&&(te.from=ln(x,re)),le&&(te.to=ln(x,le)),pe&&(te.text=pe),be!==void 0&&(te.origin=be)}),vt(x,"beforeChange",x,te),x.cm&&vt(x.cm,"beforeChange",x.cm,te),te.canceled?(x.cm&&(x.cm.curOp.updateInput=2),null):{from:te.from,to:te.to,text:te.text,origin:te.origin}}function Ds(x,z,ne){if(x.cm){if(!x.cm.curOp)return xa(x.cm,Ds)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((Mn(x,"beforeChange")||x.cm&&Mn(x.cm,"beforeChange"))&&(z=Uu(x,z,!0),!z))){var te=vi&&!ne&&ri(x,z.from,z.to);if(te)for(var re=te.length-1;re>=0;--re)jc(x,{from:te[re].from,to:te[re].to,text:re?[""]:z.text,origin:z.origin});else jc(x,z)}}function jc(x,z){if(!(z.text.length==1&&z.text[0]==""&&jt(z.from,z.to)==0)){var ne=Ou(x,z);eu(x,z,ne,x.cm?x.cm.curOp.id:NaN),ul(x,z,ne,wn(x,z));var te=[];ds(x,function(re,le){!le&&ft(te,re.history)==-1&&(iu(re.history,z),te.push(re.history)),ul(re,z,null,wn(re,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var re=x.history,le,pe=x.sel,be=z=="undo"?re.done:re.undone,_e=z=="undo"?re.undone:re.done,Ae=0;Ae<be.length&&(le=be[Ae],!(ne?le.ranges&&!le.equals(x.sel):!le.ranges));Ae++);if(Ae!=be.length){for(re.lastOrigin=re.lastSelOrigin=null;;)if(le=be.pop(),le.ranges){if(tu(le,_e),ne&&!le.equals(x.sel)){wa(x,le,{clearRedo:!1});return}pe=le}else if(te){be.push(le);return}else break;var et=[];tu(pe,_e),_e.push({changes:et,generation:re.generation}),re.generation=le.generation||++re.maxGeneration;for(var dt=Mn(x,"beforeChange")||x.cm&&Mn(x.cm,"beforeChange"),Wt=function(An){var qn=le.changes[An];if(qn.origin=z,dt&&!Uu(x,qn,!1))return be.length=0,{};et.push(zu(x,qn));var di=An?Ou(x,qn):$t(be);ul(x,qn,di,Wc(x,qn)),!An&&x.cm&&x.cm.scrollIntoView({from:qn.from,to:cs(qn)});var xi=[];ds(x,function(oi,Ci){!Ci&&ft(xi,oi.history)==-1&&(iu(oi.history,qn),xi.push(oi.history)),ul(oi,qn,null,Wc(oi,qn))})},zt=le.changes.length-1;zt>=0;--zt){var vn=Wt(zt);if(vn)return vn.v}}}}function Xu(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Bt(x.sel.ranges,function(re){return new Tr(gt(re.anchor.line+z,re.anchor.ch),gt(re.head.line+z,re.head.ch))}),x.sel.primIndex),x.cm)){$a(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ao(x.cm,te,"gutter")}}function ul(x,z,ne,te){if(x.cm&&!x.cm.curOp)return xa(x.cm,ul)(x,z,ne,te);if(z.to.line<x.first){Xu(x,z.text.length-1-(z.to.line-z.from.line));return}if(!(z.from.line>x.lastLine())){if(z.from.line<x.first){var re=z.text.length-1-(x.first-z.from.line);Xu(x,re),z={from:gt(x.first,0),to:gt(z.to.line+re,z.to.ch),text:[$t(z.text)],origin:z.origin}}var le=x.lastLine();z.to.line>le&&(z={from:z.from,to:gt(le,Ke(x,le).text.length),text:[z.text[0]],origin:z.origin}),z.removed=it(x,z.from,z.to),ne||(ne=Ou(x,z)),x.cm?Qd(x.cm,z,te):Fu(x,z,te),nu(x,ne,Ue),x.cantEdit&&Gu(x,gt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,re=x.display,le=z.from,pe=z.to,be=!1,_e=le.line;x.options.lineWrapping||(_e=Dt(Ai(Ke(te,le.line))),te.iter(_e,pe.line+1,function(zt){if(zt==re.maxLine)return be=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Ln(x),Fu(te,z,ne,Xa(x)),x.options.lineWrapping||(te.iter(_e,le.line+z.text.length,function(zt){var vn=In(zt);vn>re.maxLineLength&&(re.maxLine=zt,re.maxLineLength=vn,re.maxLineChanged=!0,be=!1)}),be&&(x.curOp.updateMaxLine=!0)),Kn(te,le.line),nl(x,400);var Ae=z.text.length-(pe.line-le.line)-1;z.full?$a(x):le.line==pe.line&&z.text.length==1&&!Kc(x.doc,z)?Ao(x,le.line,"text"):$a(x,le.line,pe.line+1,Ae);var et=Mn(x,"changes"),dt=Mn(x,"change");if(dt||et){var Wt={from:le,to:pe,text:z.text,removed:z.removed,origin:z.origin};dt&&Si(x,"change",x,Wt),et&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(Wt)}x.display.selForContextMenu=null}function _l(x,z,ne,te,re){var le;te||(te=ne),jt(te,ne)<0&&(le=[te,ne],ne=le[0],te=le[1]),typeof z=="string"&&(z=x.splitLines(z)),Ds(x,{from:ne,to:te,text:z,origin:re})}function eh(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function th(x,z,ne,te){for(var re=0;re<x.length;++re){var le=x[re],pe=!0;if(le.ranges){le.copied||(le=x[re]=le.deepCopy(),le.copied=!0);for(var be=0;be<le.ranges.length;be++)eh(le.ranges[be].anchor,z,ne,te),eh(le.ranges[be].head,z,ne,te);continue}for(var _e=0;_e<le.changes.length;++_e){var Ae=le.changes[_e];if(ne<Ae.from.line)Ae.from=gt(Ae.from.line+te,Ae.from.ch),Ae.to=gt(Ae.to.line+te,Ae.to.ch);else if(z<=Ae.to.line){pe=!1;break}}pe||(x.splice(0,re+1),re=0)}}function iu(x,z){var ne=z.from.line,te=z.to.line,re=z.text.length-(te-ne)-1;th(x.done,ne,te,re),th(x.undone,ne,te,re)}function ru(x,z,ne,te){var re=z,le=z;return typeof z=="number"?le=Ke(x,Yn(x,z)):re=Dt(z),re==null?null:(te(le,re)&&x.cm&&Ao(x.cm,re,ne),le)}function As(x){this.lines=x,this.parent=null;for(var z=0,ne=0;ne<x.length;++ne)x[ne].parent=this,z+=x[ne].height;this.height=z}As.prototype={chunkSize:function(){return this.lines.length},removeInner:function(x,z){for(var ne=x,te=x+z;ne<te;++ne){var re=this.lines[ne];this.height-=re.height,hr(re),Si(re,"delete")}this.lines.splice(x,z)},collapse:function(x){x.push.apply(x,this.lines)},insertInner:function(x,z,ne){this.height+=ne,this.lines=this.lines.slice(0,x).concat(z).concat(this.lines.slice(x));for(var te=0;te<z.length;++te)z[te].parent=this},iterN:function(x,z,ne){for(var te=x+z;x<te;++x)if(ne(this.lines[x]))return!0}};function Ml(x){this.children=x;for(var z=0,ne=0,te=0;te<x.length;++te){var re=x[te];z+=re.chunkSize(),ne+=re.height,re.parent=this}this.size=z,this.height=ne,this.parent=null}Ml.prototype={chunkSize:function(){return this.size},removeInner:function(x,z){this.size-=z;for(var ne=0;ne<this.children.length;++ne){var te=this.children[ne],re=te.chunkSize();if(x<re){var le=Math.min(z,re-x),pe=te.height;if(te.removeInner(x,le),this.height-=pe-te.height,re==le&&(this.children.splice(ne--,1),te.parent=null),(z-=le)==0)break;x=0}else x-=re}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof As))){var be=[];this.collapse(be),this.children=[new As(be)],this.children[0].parent=this}},collapse:function(x){for(var z=0;z<this.children.length;++z)this.children[z].collapse(x)},insertInner:function(x,z,ne){this.size+=z.length,this.height+=ne;for(var te=0;te<this.children.length;++te){var re=this.children[te],le=re.chunkSize();if(x<=le){if(re.insertInner(x,z,ne),re.lines&&re.lines.length>50){for(var pe=re.lines.length%25+25,be=pe;be<re.lines.length;){var _e=new As(re.lines.slice(be,be+=25));re.height-=_e.height,this.children.splice(++te,0,_e),_e.parent=this}re.lines=re.lines.slice(0,pe),this.maybeSpill()}break}x-=le}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new Ml(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var re=ft(x.parent.children,x);x.parent.children.splice(re+1,0,ne)}else{var te=new Ml(x.children);te.parent=x,x.children=[te,ne],x=te}ne.parent=x.parent}while(x.children.length>10);x.parent.maybeSpill()}},iterN:function(x,z,ne){for(var te=0;te<this.children.length;++te){var re=this.children[te],le=re.chunkSize();if(x<le){var pe=Math.min(z,le-x);if(re.iterN(x,pe,ne))return!0;if((z-=pe)==0)break;x=0}else x-=le}}};var kl=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};kl.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=Dt(ne);if(!(te==null||!z)){for(var re=0;re<z.length;++re)z[re]==this&&z.splice(re--,1);z.length||(ne.widgets=null);var le=ao(this);yt(ne,Math.max(0,ne.height-le)),x&&(ca(x,function(){nh(x,ne,-le),Ao(x,te,"widget")}),Si(x,"lineWidgetCleared",x,this,te))}},kl.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var re=ao(this)-z;re&&(yr(this.doc,te)||yt(te,te.height+re),ne&&ca(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,re),Si(ne,"lineWidgetChanged",ne,x,Dt(te))}))},_n(kl);function nh(x,z,ne){Rn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&Lu(x,ne)}function ih(x,z,ne,te){var re=new kl(x,ne,te),le=x.cm;return le&&re.noHScroll&&(le.display.alignWidgets=!0),ru(x,z,"widget",function(pe){var be=pe.widgets||(pe.widgets=[]);if(re.insertAt==null?be.push(re):be.splice(Math.min(be.length-1,Math.max(0,re.insertAt)),0,re),re.line=pe,le&&!yr(x,pe)){var _e=Rn(pe)<x.scrollTop;yt(pe,pe.height+ao(re)),_e&&Lu(le,re.height),le.curOp.forceUpdate=!0}return!0}),le&&Si(le,"lineWidgetAdded",le,re,typeof z=="number"?z:Dt(z)),re}var rh=0,Ts=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++rh};Ts.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ls(x),Mn(this,"clear")){var ne=this.find();ne&&Si(this,"clear",ne.from,ne.to)}for(var te=null,re=null,le=0;le<this.lines.length;++le){var pe=this.lines[le],be=li(pe.markedSpans,this);x&&!this.collapsed?Ao(x,Dt(pe),"text"):x&&(be.to!=null&&(re=Dt(pe)),be.from!=null&&(te=Dt(pe))),pe.markedSpans=Qn(pe.markedSpans,be),be.from==null&&this.collapsed&&!yr(this.doc,pe)&&x&&yt(pe,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var _e=0;_e<this.lines.length;++_e){var Ae=Ai(this.lines[_e]),et=In(Ae);et>x.display.maxLineLength&&(x.display.maxLine=Ae,x.display.maxLineLength=et,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&$a(x,te,re+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&Jd(x.doc)),x&&Si(x,"markerCleared",x,this,te,re),z&&us(x),this.parent&&this.parent.clear()}},Ts.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,re=0;re<this.lines.length;++re){var le=this.lines[re],pe=li(le.markedSpans,this);if(pe.from!=null&&(ne=gt(z?le:Dt(le),pe.from),x==-1))return ne;if(pe.to!=null&&(te=gt(z?le:Dt(le),pe.to),x==1))return te}return ne&&{from:ne,to:te}},Ts.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||ca(te,function(){var re=z.line,le=Dt(z.line),pe=Ua(te,le);if(pe&&(Ir(pe),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!yr(ne.doc,re)&&ne.height!=null){var be=ne.height;ne.height=null;var _e=ao(ne)-be;_e&&yt(re,re.height+_e)}Si(te,"markerChanged",te,x)})},Ts.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||ft(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Ts.prototype.detachLine=function(x){if(this.lines.splice(ft(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},_n(Ts);function ps(x,z,ne,te,re){if(te&&te.shared)return Jr(x,z,ne,te,re);if(x.cm&&!x.cm.curOp)return xa(x.cm,ps)(x,z,ne,te,re);var le=new Ts(x,re),pe=jt(z,ne);if(te&&Ft(te,le,!1),pe>0||pe==0&&le.clearWhenEmpty!==!1)return le;if(le.replacedWith&&(le.collapsed=!0,le.widgetNode=It("span",[le.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||le.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(le.widgetNode.insertLeft=!0)),le.collapsed){if(Mi(x,z.line,z,ne,le)||z.line!=ne.line&&Mi(x,ne.line,z,ne,le))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fn()}le.addToHistory&&eu(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var be=z.line,_e=x.cm,Ae;if(x.iter(be,ne.line+1,function(dt){_e&&le.collapsed&&!_e.options.lineWrapping&&Ai(dt)==_e.display.maxLine&&(Ae=!0),le.collapsed&&be!=z.line&&yt(dt,0),Di(dt,new Jn(le,be==z.line?z.ch:null,be==ne.line?ne.ch:null)),++be}),le.collapsed&&x.iter(z.line,ne.line+1,function(dt){yr(x,dt)&&yt(dt,0)}),le.clearOnEnter&&sn(le,"beforeCursorEnter",function(){return le.clear()}),le.readOnly&&(ci(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),le.collapsed&&(le.id=++rh,le.atomic=!0),_e){if(Ae&&(_e.curOp.updateMaxLine=!0),le.collapsed)$a(_e,z.line,ne.line+1);else if(le.className||le.startStyle||le.endStyle||le.css||le.attributes||le.title)for(var et=z.line;et<=ne.line;et++)Ao(_e,et,"text");le.atomic&&Jd(_e.doc),Si(_e,"markerAdded",_e,le)}return le}var cr=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};cr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Si(this,"clear")}},cr.prototype.find=function(x,z){return this.primary.find(x,z)},_n(cr);function Jr(x,z,ne,te,re){te=Ft(te),te.shared=!1;var le=[ps(x,z,ne,te,re)],pe=le[0],be=te.widgetNode;return ds(x,function(_e){be&&(te.widgetNode=be.cloneNode(!0)),le.push(ps(_e,ln(_e,z),ln(_e,ne),te,re));for(var Ae=0;Ae<_e.linked.length;++Ae)if(_e.linked[Ae].isParent)return;pe=$t(le)}),new cr(le,pe)}function Bs(x){return x.findMarks(gt(x.first,0),x.clipPos(gt(x.lastLine())),function(z){return z.parent})}function ah(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],re=te.find(),le=x.clipPos(re.from),pe=x.clipPos(re.to);if(jt(le,pe)){var be=ps(x,le,pe,te.primary,te.primary.type);te.markers.push(be),be.parent=te}}}function Co(x){for(var z=function(te){var re=x[te],le=[re.primary.doc];ds(re.primary.doc,function(_e){return le.push(_e)});for(var pe=0;pe<re.markers.length;pe++){var be=re.markers[pe];ft(le,be.doc)==-1&&(be.parent=null,re.markers.splice(pe--,1))}},ne=0;ne<x.length;ne++)z(ne)}var oh=0,ga=function(x,z,ne,te,re){if(!(this instanceof ga))return new ga(x,z,ne,te,re);ne==null&&(ne=0),Ml.call(this,[new As([new Xn("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var le=gt(ne,0);this.sel=No(le),this.history=new Ql(null),this.id=++oh,this.modeOption=z,this.lineSep=te,this.direction=re=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),Fu(this,{from:le,to:le,text:x}),wa(this,No(le),Ue)};ga.prototype=se(Ml.prototype,{constructor:ga,iter:function(x,z,ne){ne?this.iterN(x-this.first,z-x,ne):this.iterN(this.first,this.first+this.size,x)},insert:function(x,z){for(var ne=0,te=0;te<z.length;++te)ne+=z[te].height;this.insertInner(x-this.first,z,ne)},remove:function(x,z){this.removeInner(x-this.first,z)},getValue:function(x){var z=kt(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Ta(function(x){var z=gt(this.first,0),ne=this.first+this.size-1;Ds(this,{from:z,to:gt(ne,Ke(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),wa(this,No(z),Ue)}),replaceRange:function(x,z,ne,te){z=ln(this,z),ne=ne?ln(this,ne):z,_l(this,x,z,ne,te)},getRange:function(x,z,ne){var te=it(this,ln(this,x),ln(this,z));return ne===!1?te:te.join(ne||this.lineSeparator())},getLine:function(x){var z=this.getLineHandle(x);return z&&z.text},getLineHandle:function(x){if(tn(this,x))return Ke(this,x)},getLineNumber:function(x){return Dt(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Ke(this,x)),Ai(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return ln(this,x)},getCursor:function(x){var z=this.sel.primary(),ne;return x==null||x=="head"?ne=z.head:x=="anchor"?ne=z.anchor:x=="end"||x=="to"||x===!1?ne=z.to():ne=z.from(),ne},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ta(function(x,z,ne){Zc(this,ln(this,typeof x=="number"?gt(x,z||0):x),null,ne)}),setSelection:Ta(function(x,z,ne){Zc(this,ln(this,x),ln(this,z||x),ne)}),extendSelection:Ta(function(x,z,ne){sl(this,ln(this,x),z&&ln(this,z),ne)}),extendSelections:Ta(function(x,z){Ei(this,Ze(this,x),z)}),extendSelectionsBy:Ta(function(x,z){var ne=Bt(this.sel.ranges,x);Ei(this,Ze(this,ne),z)}),setSelections:Ta(function(x,z,ne){if(x.length){for(var te=[],re=0;re<x.length;re++)te[re]=new Tr(ln(this,x[re].anchor),ln(this,x[re].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),wa(this,Bo(this.cm,te,z),ne)}}),addSelection:Ta(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Tr(ln(this,x),ln(this,z||x))),wa(this,Bo(this.cm,te,te.length-1),ne)}),getSelection:function(x){for(var z=this.sel.ranges,ne,te=0;te<z.length;te++){var re=it(this,z[te].from(),z[te].to());ne=ne?ne.concat(re):re}return x===!1?ne:ne.join(x||this.lineSeparator())},getSelections:function(x){for(var z=[],ne=this.sel.ranges,te=0;te<ne.length;te++){var re=it(this,ne[te].from(),ne[te].to());x!==!1&&(re=re.join(x||this.lineSeparator())),z[te]=re}return z},replaceSelection:function(x,z,ne){for(var te=[],re=0;re<this.sel.ranges.length;re++)te[re]=x;this.replaceSelections(te,z,ne||"+input")},replaceSelections:Ta(function(x,z,ne){for(var te=[],re=this.sel,le=0;le<re.ranges.length;le++){var pe=re.ranges[le];te[le]={from:pe.from(),to:pe.to(),text:this.splitLines(x[le]),origin:ne}}for(var be=z&&z!="end"&&Ru(this,te,z),_e=te.length-1;_e>=0;_e--)Ds(this,te[_e]);be?no(this,be):this.cm&&Qs(this.cm)}),undo:Ta(function(){fs(this,"undo")}),redo:Ta(function(){fs(this,"redo")}),undoSelection:Ta(function(){fs(this,"undo",!0)}),redoSelection:Ta(function(){fs(this,"redo",!0)}),setExtending:function(x){this.extend=x},getExtending:function(){return this.extend},historySize:function(){for(var x=this.history,z=0,ne=0,te=0;te<x.done.length;te++)x.done[te].ranges||++z;for(var re=0;re<x.undone.length;re++)x.undone[re].ranges||++ne;return{undo:z,redo:ne}},clearHistory:function(){var x=this;this.history=new Ql(this.history.maxGeneration),ds(this,function(z){return z.history=x.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(x){return x&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(x){return this.history.generation==(x||this.cleanGeneration)},getHistory:function(){return{done:ol(this.history.done),undone:ol(this.history.undone)}},setHistory:function(x){var z=this.history=new Ql(this.history.maxGeneration);z.done=ol(x.done.slice(0),null,!0),z.undone=ol(x.undone.slice(0),null,!0)},setGutterMarker:Ta(function(x,z,ne){return ru(this,x,"gutter",function(te){var re=te.gutterMarkers||(te.gutterMarkers={});return re[z]=ne,!ne&&ce(re)&&(te.gutterMarkers=null),!0})}),clearGutter:Ta(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&ru(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,ce(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!tn(this,x)||(z=x,x=Ke(this,x),!x))return null}else if(z=Dt(x),z==null)return null;return{line:z,handle:x,text:x.text,gutterMarkers:x.gutterMarkers,textClass:x.textClass,bgClass:x.bgClass,wrapClass:x.wrapClass,widgets:x.widgets}},addLineClass:Ta(function(x,z,ne){return ru(this,x,z=="gutter"?"gutter":"class",function(te){var re=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass";if(!te[re])te[re]=ne;else{if(Ee(ne).test(te[re]))return!1;te[re]+=" "+ne}return!0})}),removeLineClass:Ta(function(x,z,ne){return ru(this,x,z=="gutter"?"gutter":"class",function(te){var re=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",le=te[re];if(le)if(ne==null)te[re]=null;else{var pe=le.match(Ee(ne));if(!pe)return!1;var be=pe.index+pe[0].length;te[re]=le.slice(0,pe.index)+(!pe.index||be==le.length?"":" ")+le.slice(be)||null}else return!1;return!0})}),addLineWidget:Ta(function(x,z,ne){return ih(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return ps(this,ln(this,x),ln(this,z),ne,ne&&ne.type||"range")},setBookmark:function(x,z){var ne={replacedWith:z&&(z.nodeType==null?z.widget:z),insertLeft:z&&z.insertLeft,clearWhenEmpty:!1,shared:z&&z.shared,handleMouseEvents:z&&z.handleMouseEvents};return x=ln(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=ln(this,x);var z=[],ne=Ke(this,x.line).markedSpans;if(ne)for(var te=0;te<ne.length;++te){var re=ne[te];(re.from==null||re.from<=x.ch)&&(re.to==null||re.to>=x.ch)&&z.push(re.marker.parent||re.marker)}return z},findMarks:function(x,z,ne){x=ln(this,x),z=ln(this,z);var te=[],re=x.line;return this.iter(x.line,z.line+1,function(le){var pe=le.markedSpans;if(pe)for(var be=0;be<pe.length;be++){var _e=pe[be];!(_e.to!=null&&re==x.line&&x.ch>=_e.to||_e.from==null&&re!=x.line||_e.from!=null&&re==z.line&&_e.from>=z.ch)&&(!ne||ne(_e.marker))&&te.push(_e.marker.parent||_e.marker)}++re}),te},getAllMarks:function(){var x=[];return this.iter(function(z){var ne=z.markedSpans;if(ne)for(var te=0;te<ne.length;++te)ne[te].from!=null&&x.push(ne[te].marker)}),x},posFromIndex:function(x){var z,ne=this.first,te=this.lineSeparator().length;return this.iter(function(re){var le=re.text.length+te;if(le>x)return z=x,!0;x-=le,++ne}),ln(this,gt(ne,z))},indexFromPos:function(x){x=ln(this,x);var z=x.ch;if(x.line<this.first||x.ch<0)return 0;var ne=this.lineSeparator().length;return this.iter(this.first,x.line,function(te){z+=te.text.length+ne}),z},copy:function(x){var z=new ga(kt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return z.scrollTop=this.scrollTop,z.scrollLeft=this.scrollLeft,z.sel=this.sel,z.extend=!1,x&&(z.history.undoDepth=this.history.undoDepth,z.setHistory(this.getHistory())),z},linkedDoc:function(x){x||(x={});var z=this.first,ne=this.first+this.size;x.from!=null&&x.from>z&&(z=x.from),x.to!=null&&x.to<ne&&(ne=x.to);var te=new ga(kt(this,z,ne),x.mode||this.modeOption,z,this.lineSep,this.direction);return x.sharedHist&&(te.history=this.history),(this.linked||(this.linked=[])).push({doc:te,sharedHist:x.sharedHist}),te.linked=[{doc:this,isParent:!0,sharedHist:x.sharedHist}],ah(te,Bs(this)),te},unlinkDoc:function(x){if(x instanceof er&&(x=x.doc),this.linked)for(var z=0;z<this.linked.length;++z){var ne=this.linked[z];if(ne.doc==x){this.linked.splice(z,1),x.unlinkDoc(this),Co(Bs(this));break}}if(x.history==this.history){var te=[x.id];ds(x,function(re){return te.push(re.id)},!0),x.history=new Ql(null),x.history.done=ol(this.history.done,te),x.history.undone=ol(this.history.undone,te)}},iterLinkedDocs:function(x){ds(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):Yi(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ta(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&$u(this.cm))})}),ga.prototype.eachLine=ga.prototype.iter;var Gc=0;function Qh(x){var z=this;if(El(z),!(Lt(z,x)||oo(z.display,x))){ti(x),Se&&(Gc=+new Date);var ne=xo(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var re=te.length,le=Array(re),pe=0,be=function(){++pe==re&&xa(z,function(){ne=ln(z.doc,ne);var zt={from:ne,to:ne,text:z.doc.splitLines(le.filter(function(vn){return vn!=null}).join(z.doc.lineSeparator())),origin:"paste"};Ds(z.doc,zt),no(z.doc,No(ln(z.doc,ne),ln(z.doc,cs(zt))))})()},_e=function(zt,vn){if(z.options.allowDropFileTypes&&ft(z.options.allowDropFileTypes,zt.type)==-1){be();return}var An=new FileReader;An.onerror=function(){return be()},An.onload=function(){var qn=An.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qn)){be();return}le[vn]=qn,be()},An.readAsText(zt)},Ae=0;Ae<te.length;Ae++)_e(te[Ae],Ae);else{if(z.state.draggingText&&z.doc.sel.contains(ne)>-1){z.state.draggingText(x),setTimeout(function(){return z.display.input.focus()},20);return}try{var et=x.dataTransfer.getData("Text");if(et){var dt;if(z.state.draggingText&&!z.state.draggingText.copy&&(dt=z.listSelections()),nu(z.doc,No(ne,ne)),dt)for(var Wt=0;Wt<dt.length;++Wt)_l(z.doc,"",dt[Wt].anchor,dt[Wt].head,"drag");z.replaceSelection(et,"around","paste"),z.display.input.focus()}}catch(zt){}}}}function ef(x,z){if(Se&&(!x.state.draggingText||+new Date-Gc<100)){Bi(z);return}if(!(Lt(x,z)||oo(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!ht)){var ne=je("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ne&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Ne&&ne.parentNode.removeChild(ne)}}function Uc(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();kc(x,ne,te),x.display.dragCursor||(x.display.dragCursor=je("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),bt(x.display.dragCursor,te)}}function El(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function Ll(x){if(document.getElementsByClassName){for(var z=document.getElementsByClassName("CodeMirror"),ne=[],te=0;te<z.length;te++){var re=z[te].CodeMirror;re&&ne.push(re)}ne.length&&ne[0].operation(function(){for(var le=0;le<ne.length;le++)x(ne[le])})}}var $n=!1;function Xc(){$n||(qu(),$n=!0)}function qu(){var x;sn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(Yu)},100))}),sn(window,"blur",function(){return Ll(Js)})}function Yu(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Fo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},au=0;au<10;au++)Fo[au+48]=Fo[au+96]=String(au);for(var Ju=65;Ju<=90;Ju++)Fo[Ju]=String.fromCharCode(Ju);for(var ou=1;ou<=12;ou++)Fo[ou+111]=Fo[ou+63235]="F"+ou;var Zr={};Zr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Zr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Zr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Zr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Zr.default=rt?Zr.macDefault:Zr.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,re,le,pe=0;pe<z.length-1;pe++){var be=z[pe];if(/^(cmd|meta|m)$/i.test(be))le=!0;else if(/^a(lt)?$/i.test(be))ne=!0;else if(/^(c|ctrl|control)$/i.test(be))te=!0;else if(/^s(hift)?$/i.test(be))re=!0;else throw new Error("Unrecognized modifier name: "+be)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),le&&(x="Cmd-"+x),re&&(x="Shift-"+x),x}function qc(x){var z={};for(var ne in x)if(x.hasOwnProperty(ne)){var te=x[ne];if(/^(name|fallthrough|(de|at)tach)$/.test(ne))continue;if(te=="..."){delete x[ne];continue}for(var re=Bt(ne.split(" "),tf),le=0;le<re.length;le++){var pe=void 0,be=void 0;le==re.length-1?(be=re.join(" "),pe=te):(be=re.slice(0,le+1).join(" "),pe="...");var _e=z[be];if(!_e)z[be]=pe;else if(_e!=pe)throw new Error("Inconsistent bindings for "+be)}delete x[ne]}for(var Ae in z)x[Ae]=z[Ae];return x}function ms(x,z,ne,te){z=ro(z);var re=z.call?z.call(x,te):z[x];if(re===!1)return"nothing";if(re==="...")return"multi";if(re!=null&&ne(re))return"handled";if(z.fallthrough){if(Object.prototype.toString.call(z.fallthrough)!="[object Array]")return ms(x,z.fallthrough,ne,te);for(var le=0;le<z.fallthrough.length;le++){var pe=ms(x,z.fallthrough[le],ne,te);if(pe)return pe}}}function su(x){var z=typeof x=="string"?x:Fo[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function Ps(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(lt?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(lt?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function cl(x,z){if(Ne&&x.keyCode==34&&x.char)return!1;var ne=Fo[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),Ps(ne,x,z))}function ro(x){return typeof x=="string"?Zr[x]:x}function Po(x,z){for(var ne=x.doc.sel.ranges,te=[],re=0;re<ne.length;re++){for(var le=z(ne[re]);te.length&&jt(le.from,$t(te).to)<=0;){var pe=te.pop();if(jt(pe.from,le.from)<0){le.from=pe.from;break}}te.push(le)}ca(x,function(){for(var be=te.length-1;be>=0;be--)_l(x.doc,"",te[be].from,te[be].to,"+delete");Qs(x)})}function Ka(x,z,ne){var te=Ut(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Go(x,z,ne){var te=Ka(x,z.ch,ne);return te==null?null:new gt(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,re){if(x){z.doc.direction=="rtl"&&(re=-re);var le=bn(ne,z.doc.direction);if(le){var pe=re<0?$t(le):le[0],be=re<0==(pe.level==1),_e=be?"after":"before",Ae;if(pe.level>0||z.doc.direction=="rtl"){var et=Ia(z,ne);Ae=re<0?ne.text.length-1:0;var dt=Er(z,et,Ae).top;Ae=Ht(function(Wt){return Er(z,et,Wt).top==dt},re<0==(pe.level==1)?pe.from:pe.to-1,Ae),_e=="before"&&(Ae=Ka(ne,Ae,1))}else Ae=re<0?pe.to:pe.from;return new gt(te,Ae,_e)}}return new gt(te,re<0?ne.text.length:0,re<0?"before":"after")}function Uo(x,z,ne,te){var re=bn(z,x.doc.direction);if(!re)return Go(z,ne,te);ne.ch>=z.text.length?(ne.ch=z.text.length,ne.sticky="before"):ne.ch<=0&&(ne.ch=0,ne.sticky="after");var le=hn(re,ne.ch,ne.sticky),pe=re[le];if(x.doc.direction=="ltr"&&pe.level%2==0&&(te>0?pe.to>ne.ch:pe.from<ne.ch))return Go(z,ne,te);var be=function(di,xi){return Ka(z,di instanceof gt?di.ch:di,xi)},_e,Ae=function(di){return x.options.lineWrapping?(_e=_e||Ia(x,z),Hl(x,z,_e,di)):{begin:0,end:z.text.length}},et=Ae(ne.sticky=="before"?be(ne,-1):ne.ch);if(x.doc.direction=="rtl"||pe.level==1){var dt=pe.level==1==te<0,Wt=be(ne,dt?1:-1);if(Wt!=null&&(dt?Wt<=pe.to&&Wt<=et.end:Wt>=pe.from&&Wt>=et.begin)){var zt=dt?"before":"after";return new gt(ne.line,Wt,zt)}}var vn=function(di,xi,oi){for(var Ci=function(jr,Na){return Na?new gt(ne.line,be(jr,1),"before"):new gt(ne.line,jr,"after")};di>=0&&di<re.length;di+=xi){var zi=re[di],Ki=xi>0==(zi.level!=1),dr=Ki?oi.begin:be(oi.end,-1);if(zi.from<=dr&&dr<zi.to||(dr=Ki?zi.from:be(zi.to,-1),oi.begin<=dr&&dr<oi.end))return Ci(dr,Ki)}},An=vn(le+te,te,et);if(An)return An;var qn=te>0?et.end:be(et.begin,-1);return qn!=null&&!(te>0&&qn==z.text.length)&&(An=vn(te>0?0:re.length-1,te,Ae(qn)),An)?An:null}var Dl={selectAll:Vc,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),Ue)},killLine:function(x){return Po(x,function(z){if(z.empty()){var ne=Ke(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:gt(z.head.line+1,0)}:{from:z.head,to:gt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Po(x,function(z){return{from:gt(z.from().line,0),to:ln(x.doc,gt(z.to().line+1,0))}})},delLineLeft:function(x){return Po(x,function(z){return{from:gt(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return Po(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return{from:te,to:z.from()}})},delWrappedLineRight:function(x){return Po(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div");return{from:z.from(),to:te}})},undo:function(x){return x.undo()},redo:function(x){return x.redo()},undoSelection:function(x){return x.undoSelection()},redoSelection:function(x){return x.redoSelection()},goDocStart:function(x){return x.extendSelection(gt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(gt(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return Yc(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return sh(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return Jc(x,z.head.line)},{origin:"+move",bias:-1})},goLineRight:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div")},wt)},goLineLeft:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:0,top:ne},"div")},wt)},goLineLeftSmart:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return te.ch<x.getLine(te.line).search(/\S/)?sh(x,z.head):te},wt)},goLineUp:function(x){return x.moveV(-1,"line")},goLineDown:function(x){return x.moveV(1,"line")},goPageUp:function(x){return x.moveV(-1,"page")},goPageDown:function(x){return x.moveV(1,"page")},goCharLeft:function(x){return x.moveH(-1,"char")},goCharRight:function(x){return x.moveH(1,"char")},goColumnLeft:function(x){return x.moveH(-1,"column")},goColumnRight:function(x){return x.moveH(1,"column")},goWordLeft:function(x){return x.moveH(-1,"word")},goGroupRight:function(x){return x.moveH(1,"group")},goGroupLeft:function(x){return x.moveH(-1,"group")},goWordRight:function(x){return x.moveH(1,"word")},delCharBefore:function(x){return x.deleteH(-1,"codepoint")},delCharAfter:function(x){return x.deleteH(1,"char")},delWordBefore:function(x){return x.deleteH(-1,"word")},delWordAfter:function(x){return x.deleteH(1,"word")},delGroupBefore:function(x){return x.deleteH(-1,"group")},delGroupAfter:function(x){return x.deleteH(1,"group")},indentAuto:function(x){return x.indentSelection("smart")},indentMore:function(x){return x.indentSelection("add")},indentLess:function(x){return x.indentSelection("subtract")},insertTab:function(x){return x.replaceSelection(" ")},insertSoftTab:function(x){for(var z=[],ne=x.listSelections(),te=x.options.tabSize,re=0;re<ne.length;re++){var le=ne[re].from(),pe=Fe(x.getLine(le.line),le.ch,te);z.push(an(te-pe%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return ca(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var re=z[te].head,le=Ke(x.doc,re.line).text;if(le){if(re.ch==le.length&&(re=new gt(re.line,re.ch-1)),re.ch>0)re=new gt(re.line,re.ch+1),x.replaceRange(le.charAt(re.ch-1)+le.charAt(re.ch-2),gt(re.line,re.ch-2),re,"+transpose");else if(re.line>x.doc.first){var pe=Ke(x.doc,re.line-1).text;pe&&(re=new gt(re.line,1),x.replaceRange(le.charAt(0)+x.doc.lineSeparator()+pe.charAt(pe.length-1),gt(re.line-1,pe.length-1),re,"+transpose"))}}ne.push(new Tr(re,re))}x.setSelections(ne)})},newlineAndIndent:function(x){return ca(x,function(){for(var z=x.listSelections(),ne=z.length-1;ne>=0;ne--)x.replaceRange(x.doc.lineSeparator(),z[ne].anchor,z[ne].head,"+input");z=x.listSelections();for(var te=0;te<z.length;te++)x.indentLine(z[te].from().line,null,!0);Qs(x)})},openLine:function(x){return x.replaceSelection(`
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function Yc(x,z){var ne=Ke(x.doc,z),te=Ai(ne);return te!=ne&&(z=Dt(te)),dl(!0,x,te,z,1)}function Jc(x,z){var ne=Ke(x.doc,z),te=sr(ne);return te!=ne&&(z=Dt(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=Yc(x,z.line),te=Ke(x.doc,ne.line),re=bn(te,x.doc.direction);if(!re||re[0].level==0){var le=Math.max(ne.ch,te.text.search(/\S/)),pe=z.line==ne.line&&z.ch<=le&&z.ch;return gt(ne.line,pe?0:le,ne.sticky)}return ne}function Sa(x,z,ne){if(typeof z=="string"&&(z=Dl[z],!z))return!1;x.display.input.ensurePolled();var te=x.display.shift,re=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),ne&&(x.display.shift=!1),re=z(x)!=Ot}finally{x.display.shift=te,x.state.suppressEdits=!1}return re}function Xo(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var re=ms(z,x.state.keyMaps[te],ne,x);if(re)return re}return x.options.extraKeys&&ms(z,x.options.extraKeys,ne,x)||ms(z,x.options.keyMap,ne,x)}var nf=new xe;function Al(x,z,ne,te){var re=x.state.keySeq;if(re){if(su(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:nf.set(50,function(){x.state.keySeq==re&&(x.state.keySeq=null,x.display.input.reset())}),Qu(x,re+" "+z,ne,te))return!0}return Qu(x,z,ne,te)}function Qu(x,z,ne,te){var re=Xo(x,z,te);return re=="multi"&&(x.state.keySeq=z),re=="handled"&&Si(x,"keyHandled",x,z,ne),(re=="handled"||re=="multi")&&(ti(ne),ku(x)),!!re}function xr(x,z){var ne=cl(z,!0);return ne?z.shiftKey&&!x.state.keySeq?Al(x,"Shift-"+ne,z,function(te){return Sa(x,te,!0)})||Al(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Sa(x,te)}):Al(x,ne,z,function(te){return Sa(x,te)}):!1}function Tl(x,z,ne){return Al(x,"'"+ne+"'",z,function(te){return Sa(x,te,!0)})}var gs=null;function lu(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=qe(),!Lt(z,x))){Se&&Be<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=xr(z,x);Ne&&(gs=te?ne:null,!te&&ne==88&&!ji&&(rt?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),we&&!rt&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&gn(z)}}function gn(x){var z=x.display.lineDiv;Nt(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ve(z,"CodeMirror-crosshair"),tt(document,"keyup",ne),tt(document,"mouseover",ne))}sn(document,"keyup",ne),sn(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),Lt(this,x)}function uh(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(oo(z.display,x)||Lt(z,x)||x.ctrlKey&&!x.altKey||rt&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Ne&&ne==gs){gs=null,ti(x);return}if(!(Ne&&(!x.which||x.which<10)&&xr(z,x))){var re=String.fromCharCode(te==null?ne:te);re!="\b"&&(Tl(z,x,re)||z.display.input.onKeyPress(x))}}}var Qc=400,ed=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};ed.prototype.compare=function(x,z,ne){return this.time+Qc>x&&jt(z,this.pos)==0&&ne==this.button};var vs,uu;function rf(x,z){var ne=+new Date;return uu&&uu.compare(ne,x,z)?(vs=uu=null,"triple"):vs&&vs.compare(ne,x,z)?(uu=new ed(ne,x,z),vs=null,"double"):(vs=new ed(ne,x,z),uu=null,"single")}function Ha(x){var z=this,ne=z.display;if(!(Lt(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,oo(ne,x)){Oe||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!qa(z,x)){var te=xo(z,x),re=Zn(x),le=te?rf(te,re):"single";window.focus(),re==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&Is(z,re,te,le,x))&&(re==1?te?tc(z,te,le,x):_i(x)==ne.scroller&&ti(x):re==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):re==3&&(We?z.display.input.onContextMenu(x):Ec(z)))}}}function Is(x,z,ne,te,re){var le="Click";return te=="double"?le="Double"+le:te=="triple"&&(le="Triple"+le),le=(z==1?"Left":z==2?"Middle":"Right")+le,Al(x,Ps(le,re),re,function(pe){if(typeof pe=="string"&&(pe=Dl[pe]),!pe)return!1;var be=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),be=pe(x,ne)!=Ot}finally{x.state.suppressEdits=!1}return be})}function ec(x,z,ne){var te=x.getOption("configureMouse"),re=te?te(x,z,ne):{};if(re.unit==null){var le=Et?ne.shiftKey&&ne.metaKey:ne.altKey;re.unit=le?"rectangle":z=="single"?"char":z=="double"?"word":"line"}return(re.extend==null||x.doc.extend)&&(re.extend=x.doc.extend||ne.shiftKey),re.addNew==null&&(re.addNew=rt?ne.metaKey:ne.ctrlKey),re.moveOnDrag==null&&(re.moveOnDrag=!(rt?ne.altKey:ne.ctrlKey)),re}function tc(x,z,ne,te){Se?setTimeout(Gt(Sl,x),0):x.curOp.focus=qe();var re=ec(x,ne,te),le=x.doc.sel,pe;x.options.dragDrop&&Fi&&!x.isReadOnly()&&ne=="single"&&(pe=le.contains(z))>-1&&(jt((pe=le.ranges[pe]).from(),z)<0||z.xRel>0)&&(jt(pe.to(),z)>0||z.xRel<0)?af(x,te,z,re):td(x,te,z,re)}function af(x,z,ne,te){var re=x.display,le=!1,pe=xa(x,function(Ae){Oe&&(re.scroller.draggable=!1),x.state.draggingText=!1,tt(re.wrapper.ownerDocument,"mouseup",pe),tt(re.wrapper.ownerDocument,"mousemove",be),tt(re.scroller,"dragstart",_e),tt(re.scroller,"drop",pe),le||(ti(Ae),te.addNew||sl(x.doc,ne,null,null,te.extend),Oe&&!ht||Se&&Be==9?setTimeout(function(){re.wrapper.ownerDocument.body.focus({preventScroll:!0}),re.input.focus()},20):re.input.focus())}),be=function(Ae){le=le||Math.abs(z.clientX-Ae.clientX)+Math.abs(z.clientY-Ae.clientY)>=10},_e=function(){return le=!0};Oe&&(re.scroller.draggable=!0),x.state.draggingText=pe,pe.copy=!te.moveOnDrag,re.scroller.dragDrop&&re.scroller.dragDrop(),sn(re.wrapper.ownerDocument,"mouseup",pe),sn(re.wrapper.ownerDocument,"mousemove",be),sn(re.scroller,"dragstart",_e),sn(re.scroller,"drop",pe),Ec(x),setTimeout(function(){return re.input.focus()},20)}function ch(x,z,ne){if(ne=="char")return new Tr(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Tr(gt(z.line,0),ln(x.doc,gt(z.line+1,0)));var te=ne(x,z);return new Tr(te.from,te.to)}function td(x,z,ne,te){var re=x.display,le=x.doc;ti(z);var pe,be,_e=le.sel,Ae=_e.ranges;if(te.addNew&&!te.extend?(be=le.sel.contains(ne),be>-1?pe=Ae[be]:pe=new Tr(ne,ne)):(pe=le.sel.primary(),be=le.sel.primIndex),te.unit=="rectangle")te.addNew||(pe=new Tr(ne,ne)),ne=xo(x,z,!0,!0),be=-1;else{var et=ch(x,ne,te.unit);te.extend?pe=ju(pe,et.anchor,et.head,te.extend):pe=et}te.addNew?be==-1?(be=Ae.length,wa(le,Bo(x,Ae.concat([pe]),be),{scroll:!1,origin:"*mouse"})):Ae.length>1&&Ae[be].empty()&&te.unit=="char"&&!te.extend?(wa(le,Bo(x,Ae.slice(0,be).concat(Ae.slice(be+1)),0),{scroll:!1,origin:"*mouse"}),_e=le.sel):So(le,be,pe,Ge):(be=0,wa(le,new go([pe],0),Ge),_e=le.sel);var dt=ne;function Wt(oi){if(jt(dt,oi)!=0)if(dt=oi,te.unit=="rectangle"){for(var Ci=[],zi=x.options.tabSize,Ki=Fe(Ke(le,ne.line).text,ne.ch,zi),dr=Fe(Ke(le,oi.line).text,oi.ch,zi),jr=Math.min(Ki,dr),Na=Math.max(Ki,dr),sa=Math.min(ne.line,oi.line),uo=Math.min(x.lastLine(),Math.max(ne.line,oi.line));sa<=uo;sa++){var co=Ke(le,sa).text,Ca=dn(co,jr,zi);jr==Na?Ci.push(new Tr(gt(sa,Ca),gt(sa,Ca))):co.length>Ca&&Ci.push(new Tr(gt(sa,Ca),gt(sa,dn(co,Na,zi))))}Ci.length||Ci.push(new Tr(ne,ne)),wa(le,Bo(x,_e.ranges.slice(0,be).concat(Ci),be),{origin:"*mouse",scroll:!1}),x.scrollIntoView(oi)}else{var ho=pe,rr=ch(x,oi,te.unit),da=ho.anchor,la;jt(rr.anchor,da)>0?(la=rr.head,da=Cn(ho.from(),rr.anchor)):(la=rr.anchor,da=Tn(ho.to(),rr.head));var ha=_e.ranges.slice(0);ha[be]=dh(x,new Tr(ln(le,da),la)),wa(le,Bo(x,ha,be),Ge)}}var zt=re.wrapper.getBoundingClientRect(),vn=0;function An(oi){var Ci=++vn,zi=xo(x,oi,!0,te.unit=="rectangle");if(zi)if(jt(zi,dt)!=0){x.curOp.focus=qe(),Wt(zi);var Ki=Aa(re,le);(zi.line>=Ki.to||zi.line<Ki.from)&&setTimeout(xa(x,function(){vn==Ci&&An(oi)}),150)}else{var dr=oi.clientY<zt.top?-20:oi.clientY>zt.bottom?20:0;dr&&setTimeout(xa(x,function(){vn==Ci&&(re.scroller.scrollTop+=dr,An(oi))}),50)}}function qn(oi){x.state.selectingText=!1,vn=1/0,oi&&(ti(oi),re.input.focus()),tt(re.wrapper.ownerDocument,"mousemove",di),tt(re.wrapper.ownerDocument,"mouseup",xi),le.history.lastSelOrigin=null}var di=xa(x,function(oi){oi.buttons===0||!Zn(oi)?qn(oi):An(oi)}),xi=xa(x,qn);x.state.selectingText=xi,sn(re.wrapper.ownerDocument,"mousemove",di),sn(re.wrapper.ownerDocument,"mouseup",xi)}function dh(x,z){var ne=z.anchor,te=z.head,re=Ke(x.doc,ne.line);if(jt(ne,te)==0&&ne.sticky==te.sticky)return z;var le=bn(re);if(!le)return z;var pe=hn(le,ne.ch,ne.sticky),be=le[pe];if(be.from!=ne.ch&&be.to!=ne.ch)return z;var _e=pe+(be.from==ne.ch==(be.level!=1)?0:1);if(_e==0||_e==le.length)return z;var Ae;if(te.line!=ne.line)Ae=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var et=hn(le,te.ch,te.sticky),dt=et-pe||(te.ch-ne.ch)*(be.level==1?-1:1);et==_e-1||et==_e?Ae=dt<0:Ae=dt>0}var Wt=le[_e+(Ae?-1:0)],zt=Ae==(Wt.level==1),vn=zt?Wt.from:Wt.to,An=zt?"after":"before";return ne.ch==vn&&ne.sticky==An?z:new Tr(new gt(ne.line,vn,An),te)}function cu(x,z,ne,te){var re,le;if(z.touches)re=z.touches[0].clientX,le=z.touches[0].clientY;else try{re=z.clientX,le=z.clientY}catch(Wt){return!1}if(re>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&ti(z);var pe=x.display,be=pe.lineDiv.getBoundingClientRect();if(le>be.bottom||!Mn(x,ne))return pi(z);le-=be.top-pe.viewOffset;for(var _e=0;_e<x.display.gutterSpecs.length;++_e){var Ae=pe.gutters.childNodes[_e];if(Ae&&Ae.getBoundingClientRect().right>=re){var et=Xt(x.doc,le),dt=x.display.gutterSpecs[_e];return vt(x,ne,x,et,dt.className,z),pi(z)}}}function qa(x,z){return cu(x,z,"gutterClick",!0)}function Os(x,z){oo(x.display,z)||hh(x,z)||Lt(x,z,"contextmenu")||We||x.display.input.onContextMenu(z)}function hh(x,z){return Mn(x,"gutterContextMenu")?cu(x,z,"gutterContextMenu",!1):!1}function nd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wr(x)}var Rs={toString:function(){return"CodeMirror.Init"}},fh={},nc={};function of(x){var z=x.optionHandlers;function ne(te,re,le,pe){x.defaults[te]=re,le&&(z[te]=pe?function(be,_e,Ae){Ae!=Rs&&le(be,_e,Ae)}:le)}x.defineOption=ne,x.Init=Rs,ne("value","",function(te,re){return te.setValue(re)},!0),ne("mode",null,function(te,re){te.doc.modeOption=re,Nu(te)},!0),ne("indentUnit",2,Nu,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){al(te),Wr(te),$a(te)},!0),ne("lineSeparator",null,function(te,re){if(te.doc.lineSep=re,!!re){var le=[],pe=te.doc.first;te.doc.iter(function(_e){for(var Ae=0;;){var et=_e.text.indexOf(re,Ae);if(et==-1)break;Ae=et+re.length,le.push(gt(pe,et))}pe++});for(var be=le.length-1;be>=0;be--)_l(te.doc,re,le[be],gt(le[be].line,le[be].ch+re.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,re,le){te.state.specialChars=new RegExp(re.source+(re.test(" ")?"":"| "),"g"),le!=Rs&&te.refresh()}),ne("specialCharPlaceholder",Kr,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",ot?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ne("spellcheck",!1,function(te,re){return te.getInputField().spellcheck=re},!0),ne("autocorrect",!1,function(te,re){return te.getInputField().autocorrect=re},!0),ne("autocapitalize",!1,function(te,re){return te.getInputField().autocapitalize=re},!0),ne("rtlMoveVisually",!Zt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){nd(te),Cl(te)},!0),ne("keyMap","default",function(te,re,le){var pe=ro(re),be=le!=Rs&&ro(le);be&&be.detach&&be.detach(te,pe),pe.attach&&pe.attach(te,be||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,ph,!0),ne("gutters",[],function(te,re){te.display.gutterSpecs=Iu(re,te.options.lineNumbers),Cl(te)},!0),ne("fixedGutter",!0,function(te,re){te.display.gutters.style.left=re?Fr(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return Es(te)},!0),ne("scrollbarStyle","native",function(te){Bc(te),Es(te),te.display.scrollbars.setScrollTop(te.doc.scrollTop),te.display.scrollbars.setScrollLeft(te.doc.scrollLeft)},!0),ne("lineNumbers",!1,function(te,re){te.display.gutterSpecs=Iu(te.options.gutters,re),Cl(te)},!0),ne("firstLineNumber",1,Cl,!0),ne("lineNumberFormatter",function(te){return te},Cl,!0),ne("showCursorWhenSelecting",!1,wl,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,re){re=="nocursor"&&(Js(te),te.display.input.blur()),te.display.input.readOnlyChanged(re)}),ne("screenReaderLabel",null,function(te,re){re=re===""?null:re,te.display.input.screenReaderLabelChanged(re)}),ne("disableInput",!1,function(te,re){re||te.display.input.reset()},!0),ne("dragDrop",!0,sf),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,wl,!0),ne("singleCursorHeightPerLine",!0,wl,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,al,!0),ne("addModeClass",!1,al,!0),ne("pollInterval",100),ne("undoDepth",200,function(te,re){return te.doc.history.undoDepth=re}),ne("historyEventDelay",1250),ne("viewportMargin",10,function(te){return te.refresh()},!0),ne("maxHighlightLength",1e4,al,!0),ne("moveInputWithCursor",!0,function(te,re){re||te.display.input.resetPosition()}),ne("tabindex",null,function(te,re){return te.display.input.getField().tabIndex=re||""}),ne("autofocus",null),ne("direction","ltr",function(te,re){return te.doc.setDirection(re)},!0),ne("phrases",null)}function sf(x,z,ne){var te=ne&&ne!=Rs;if(!z!=!te){var re=x.display.dragFunctions,le=z?sn:tt;le(x.display.scroller,"dragstart",re.start),le(x.display.scroller,"dragenter",re.enter),le(x.display.scroller,"dragover",re.over),le(x.display.scroller,"dragleave",re.leave),le(x.display.scroller,"drop",re.drop)}}function ph(x){x.options.lineWrapping?(Nt(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ve(x.display.wrapper,"CodeMirror-wrap"),Pn(x)),Da(x),$a(x),Wr(x),setTimeout(function(){return Es(x)},100)}function er(x,z){var ne=this;if(!(this instanceof er))return new er(x,z);this.options=z=z?Ft(z):{},Ft(fh,z,!1);var te=z.value;typeof te=="string"?te=new ga(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var re=new er.inputStyles[z.inputStyle](this),le=this.display=new Ud(x,te,re,z);le.wrapper.CodeMirror=this,nd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new xe,keySeq:null,specialChars:null},z.autofocus&&!ot&&le.input.focus(),Se&&Be<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xc(),Ls(this),this.curOp.forceUpdate=!0,Yl(this,te),z.autofocus&&!ot||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Eu(ne)},20):Js(this);for(var pe in nc)nc.hasOwnProperty(pe)&&nc[pe](this,z[pe],Rs);Xl(this),z.finishInit&&z.finishInit(this);for(var be=0;be<id.length;++be)id[be](this);us(this),Oe&&z.lineWrapping&&getComputedStyle(le.lineDiv).textRendering=="optimizelegibility"&&(le.lineDiv.style.textRendering="auto")}er.defaults=fh,er.optionHandlers=nc;function lf(x){var z=x.display;sn(z.scroller,"mousedown",xa(x,Ha)),Se&&Be<11?sn(z.scroller,"dblclick",xa(x,function(_e){if(!Lt(x,_e)){var Ae=xo(x,_e);if(!(!Ae||qa(x,_e)||oo(x.display,_e))){ti(_e);var et=x.findWordAt(Ae);sl(x.doc,et.anchor,et.head)}}})):sn(z.scroller,"dblclick",function(_e){return Lt(x,_e)||ti(_e)}),sn(z.scroller,"contextmenu",function(_e){return Os(x,_e)}),sn(z.input.getField(),"contextmenu",function(_e){z.scroller.contains(_e.target)||Os(x,_e)});var ne,te={end:0};function re(){z.activeTouch&&(ne=setTimeout(function(){return z.activeTouch=null},1e3),te=z.activeTouch,te.end=+new Date)}function le(_e){if(_e.touches.length!=1)return!1;var Ae=_e.touches[0];return Ae.radiusX<=1&&Ae.radiusY<=1}function pe(_e,Ae){if(Ae.left==null)return!0;var et=Ae.left-_e.left,dt=Ae.top-_e.top;return et*et+dt*dt>20*20}sn(z.scroller,"touchstart",function(_e){if(!Lt(x,_e)&&!le(_e)&&!qa(x,_e)){z.input.ensurePolled(),clearTimeout(ne);var Ae=+new Date;z.activeTouch={start:Ae,moved:!1,prev:Ae-te.end<=300?te:null},_e.touches.length==1&&(z.activeTouch.left=_e.touches[0].pageX,z.activeTouch.top=_e.touches[0].pageY)}}),sn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),sn(z.scroller,"touchend",function(_e){var Ae=z.activeTouch;if(Ae&&!oo(z,_e)&&Ae.left!=null&&!Ae.moved&&new Date-Ae.start<300){var et=x.coordsChar(z.activeTouch,"page"),dt;!Ae.prev||pe(Ae,Ae.prev)?dt=new Tr(et,et):!Ae.prev.prev||pe(Ae,Ae.prev.prev)?dt=x.findWordAt(et):dt=new Tr(gt(et.line,0),ln(x.doc,gt(et.line+1,0))),x.setSelection(dt.anchor,dt.head),x.focus(),ti(_e)}re()}),sn(z.scroller,"touchcancel",re),sn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Ms(x,z.scroller.scrollTop),ks(x,z.scroller.scrollLeft,!0),vt(x,"scroll",x))}),sn(z.scroller,"mousewheel",function(_e){return $c(x,_e)}),sn(z.scroller,"DOMMouseScroll",function(_e){return $c(x,_e)}),sn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(_e){Lt(x,_e)||Bi(_e)},over:function(_e){Lt(x,_e)||(Uc(x,_e),Bi(_e))},start:function(_e){return ef(x,_e)},drop:xa(x,Qh),leave:function(_e){Lt(x,_e)||El(x)}};var be=z.input.getField();sn(be,"keyup",function(_e){return lh.call(x,_e)}),sn(be,"keydown",xa(x,lu)),sn(be,"keypress",xa(x,uh)),sn(be,"focus",function(_e){return Eu(x,_e)}),sn(be,"blur",function(_e){return Js(x,_e)})}var id=[];er.defineInitHook=function(x){return id.push(x)};function $o(x,z,ne,te){var re=x.doc,le;ne==null&&(ne="add"),ne=="smart"&&(re.mode.indent?le=Pt(x,z).state:ne="prev");var pe=x.options.tabSize,be=Ke(re,z),_e=Fe(be.text,null,pe);be.stateAfter&&(be.stateAfter=null);var Ae=be.text.match(/^\s*/)[0],et;if(!te&&!/\S/.test(be.text))et=0,ne="not";else if(ne=="smart"&&(et=re.mode.indent(le,be.text.slice(Ae.length),be.text),et==Ot||et>150)){if(!te)return;ne="prev"}ne=="prev"?z>re.first?et=Fe(Ke(re,z-1).text,null,pe):et=0:ne=="add"?et=_e+x.options.indentUnit:ne=="subtract"?et=_e-x.options.indentUnit:typeof ne=="number"&&(et=_e+ne),et=Math.max(0,et);var dt="",Wt=0;if(x.options.indentWithTabs)for(var zt=Math.floor(et/pe);zt;--zt)Wt+=pe,dt+=" ";if(Wt<et&&(dt+=an(et-Wt)),dt!=Ae)return _l(re,dt,gt(z,0),gt(z,Ae.length),"+input"),be.stateAfter=null,!0;for(var vn=0;vn<re.sel.ranges.length;vn++){var An=re.sel.ranges[vn];if(An.head.line==z&&An.head.ch<Ae.length){var qn=gt(z,Ae.length);So(re,vn,new Tr(qn,qn));break}}}var zo=null;function Ns(x){zo=x}function rd(x,z,ne,te,re){var le=x.doc;x.display.shift=!1,te||(te=le.sel);var pe=+new Date-200,be=re=="paste"||x.state.pasteIncoming>pe,_e=Yi(z),Ae=null;if(be&&te.ranges.length>1)if(zo&&zo.text.join(`
`)==z){if(te.ranges.length%zo.text.length==0){Ae=[];for(var et=0;et<zo.text.length;et++)Ae.push(le.splitLines(zo.text[et]))}}else _e.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Ae=Bt(_e,function(di){return[di]}));for(var dt=x.curOp.updateInput,Wt=te.ranges.length-1;Wt>=0;Wt--){var zt=te.ranges[Wt],vn=zt.from(),An=zt.to();zt.empty()&&(ne&&ne>0?vn=gt(vn.line,vn.ch-ne):x.state.overwrite&&!be?An=gt(An.line,Math.min(Ke(le,An.line).text.length,An.ch+$t(_e).length)):be&&zo&&zo.lineWise&&zo.text.join(`
`)==_e.join(`
`)&&(vn=An=gt(vn.line,0)));var qn={from:vn,to:An,text:Ae?Ae[Wt%Ae.length]:_e,origin:re||(be?"paste":x.state.cutIncoming>pe?"cut":"+input")};Ds(x.doc,qn),Si(x,"inputRead",x,qn)}z&&!be&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=dt),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function ad(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&ca(z,function(){return rd(z,ne,0,null,"paste")}),!0}function od(x,z){if(!(!x.options.electricChars||!x.options.smartIndent))for(var ne=x.doc.sel,te=ne.ranges.length-1;te>=0;te--){var re=ne.ranges[te];if(!(re.head.ch>100||te&&ne.ranges[te-1].head.line==re.head.line)){var le=x.getModeAt(re.head),pe=!1;if(le.electricChars){for(var be=0;be<le.electricChars.length;be++)if(z.indexOf(le.electricChars.charAt(be))>-1){pe=$o(x,re.head.line,"smart");break}}else le.electricInput&&le.electricInput.test(Ke(x.doc,re.head.line).text.slice(0,re.head.ch))&&(pe=$o(x,re.head.line,"smart"));pe&&Si(x,"electricInput",x,re.head.line)}}}function Bl(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var re=x.doc.sel.ranges[te].head.line,le={anchor:gt(re,0),head:gt(re+1,0)};ne.push(le),z.push(x.getRange(le.anchor,le.head))}return{text:z,ranges:ne}}function mh(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function sd(){var x=je("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=je("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Oe?x.style.width="1000px":x.setAttribute("wrap","off"),mt&&(x.style.border="1px solid black"),mh(x),z}function ld(x){var z=x.optionHandlers,ne=x.helpers={};x.prototype={constructor:x,focus:function(){window.focus(),this.display.input.focus()},setOption:function(te,re){var le=this.options,pe=le[te];le[te]==re&&te!="mode"||(le[te]=re,z.hasOwnProperty(te)&&xa(this,z[te])(this,re,pe),vt(this,"optionChange",this,te))},getOption:function(te){return this.options[te]},getDoc:function(){return this.doc},addKeyMap:function(te,re){this.state.keyMaps[re?"push":"unshift"](ro(te))},removeKeyMap:function(te){for(var re=this.state.keyMaps,le=0;le<re.length;++le)if(re[le]==te||re[le].name==te)return re.splice(le,1),!0},addOverlay:oa(function(te,re){var le=te.token?te:x.getMode(this.options,te);if(le.startState)throw new Error("Overlays may not be stateful.");Tt(this.state.overlays,{mode:le,modeSpec:te,opaque:re&&re.opaque,priority:re&&re.priority||0},function(pe){return pe.priority}),this.state.modeGen++,$a(this)}),removeOverlay:oa(function(te){for(var re=this.state.overlays,le=0;le<re.length;++le){var pe=re[le].modeSpec;if(pe==te||typeof te=="string"&&pe.name==te){re.splice(le,1),this.state.modeGen++,$a(this);return}}}),indentLine:oa(function(te,re,le){typeof re!="string"&&typeof re!="number"&&(re==null?re=this.options.smartIndent?"smart":"prev":re=re?"add":"subtract"),tn(this.doc,te)&&$o(this,te,re,le)}),indentSelection:oa(function(te){for(var re=this.doc.sel.ranges,le=-1,pe=0;pe<re.length;pe++){var be=re[pe];if(be.empty())be.head.line>le&&($o(this,be.head.line,te,!0),le=be.head.line,pe==this.doc.sel.primIndex&&Qs(this));else{var _e=be.from(),Ae=be.to(),et=Math.max(le,_e.line);le=Math.min(this.lastLine(),Ae.line-(Ae.ch?0:1))+1;for(var dt=et;dt<le;++dt)$o(this,dt,te);var Wt=this.doc.sel.ranges;_e.ch==0&&re.length==Wt.length&&Wt[pe].from().ch>0&&So(this.doc,pe,new Tr(_e,Wt[pe].to()),Ue)}}}),getTokenAt:function(te,re){return Vn(this,te,re)},getLineTokens:function(te,re){return Vn(this,gt(te),re,!0)},getTokenTypeAt:function(te){te=ln(this.doc,te);var re=_t(this,Ke(this.doc,te.line)),le=0,pe=(re.length-1)/2,be=te.ch,_e;if(be==0)_e=re[2];else for(;;){var Ae=le+pe>>1;if((Ae?re[Ae*2-1]:0)>=be)pe=Ae;else if(re[Ae*2+1]<be)le=Ae+1;else{_e=re[Ae*2+2];break}}var et=_e?_e.indexOf("overlay "):-1;return et<0?_e:et==0?null:_e.slice(0,et-1)},getModeAt:function(te){var re=this.doc.mode;return re.innerMode?x.innerMode(re,this.getTokenAt(te).state).mode:re},getHelper:function(te,re){return this.getHelpers(te,re)[0]},getHelpers:function(te,re){var le=[];if(!ne.hasOwnProperty(re))return le;var pe=ne[re],be=this.getModeAt(te);if(typeof be[re]=="string")pe[be[re]]&&le.push(pe[be[re]]);else if(be[re])for(var _e=0;_e<be[re].length;_e++){var Ae=pe[be[re][_e]];Ae&&le.push(Ae)}else be.helperType&&pe[be.helperType]?le.push(pe[be.helperType]):pe[be.name]&&le.push(pe[be.name]);for(var et=0;et<pe._global.length;et++){var dt=pe._global[et];dt.pred(be,this)&&ft(le,dt.val)==-1&&le.push(dt.val)}return le},getStateAfter:function(te,re){var le=this.doc;return te=Yn(le,te==null?le.first+le.size-1:te),Pt(this,te+1,re).state},cursorCoords:function(te,re){var le,pe=this.doc.sel.primary();return te==null?le=pe.head:typeof te=="object"?le=ln(this.doc,te):le=te?pe.from():pe.to(),La(this,le,re||"page")},charCoords:function(te,re){return lo(this,ln(this.doc,te),re||"page")},coordsChar:function(te,re){return te=so(this,te,re||"page"),Ys(this,te.left,te.top)},lineAtHeight:function(te,re){return te=so(this,{top:te,left:0},re||"page").top,Xt(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,re,le){var pe=!1,be;if(typeof te=="number"){var _e=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>_e&&(te=_e,pe=!0),be=Ke(this.doc,te)}else be=te;return Ra(this,be,{top:0,left:0},re||"page",le||pe).top+(pe?this.doc.height-Rn(be):0)},defaultTextHeight:function(){return as(this.display)},defaultCharWidth:function(){return _r(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,re,le,pe,be){var _e=this.display;te=La(this,ln(this.doc,te));var Ae=te.bottom,et=te.left;if(re.style.position="absolute",re.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(re),_e.sizer.appendChild(re),pe=="over")Ae=te.top;else if(pe=="above"||pe=="near"){var dt=Math.max(_e.wrapper.clientHeight,this.doc.height),Wt=Math.max(_e.sizer.clientWidth,_e.lineSpace.clientWidth);(pe=="above"||te.bottom+re.offsetHeight>dt)&&te.top>re.offsetHeight?Ae=te.top-re.offsetHeight:te.bottom+re.offsetHeight<=dt&&(Ae=te.bottom),et+re.offsetWidth>Wt&&(et=Wt-re.offsetWidth)}re.style.top=Ae+"px",re.style.left=re.style.right="",be=="right"?(et=_e.sizer.clientWidth-re.offsetWidth,re.style.right="0px"):(be=="left"?et=0:be=="middle"&&(et=(_e.sizer.clientWidth-re.offsetWidth)/2),re.style.left=et+"px"),le&&Rd(this,{left:et,top:Ae,right:et+re.offsetWidth,bottom:Ae+re.offsetHeight})},triggerOnKeyDown:oa(lu),triggerOnKeyPress:oa(uh),triggerOnKeyUp:lh,triggerOnMouseDown:oa(Ha),execCommand:function(te){if(Dl.hasOwnProperty(te))return Dl[te].call(null,this)},triggerElectric:oa(function(te){od(this,te)}),findPosH:function(te,re,le,pe){var be=1;re<0&&(be=-1,re=-re);for(var _e=ln(this.doc,te),Ae=0;Ae<re&&(_e=ic(this.doc,_e,be,le,pe),!_e.hitSide);++Ae);return _e},moveH:oa(function(te,re){var le=this;this.extendSelectionsBy(function(pe){return le.display.shift||le.doc.extend||pe.empty()?ic(le.doc,pe.head,te,re,le.options.rtlMoveVisually):te<0?pe.from():pe.to()},wt)}),deleteH:oa(function(te,re){var le=this.doc.sel,pe=this.doc;le.somethingSelected()?pe.replaceSelection("",null,"+delete"):Po(this,function(be){var _e=ic(pe,be.head,te,re,!1);return te<0?{from:_e,to:be.head}:{from:be.head,to:_e}})}),findPosV:function(te,re,le,pe){var be=1,_e=pe;re<0&&(be=-1,re=-re);for(var Ae=ln(this.doc,te),et=0;et<re;++et){var dt=La(this,Ae,"div");if(_e==null?_e=dt.left:dt.left=_e,Ae=gh(this,dt,be,le),Ae.hitSide)break}return Ae},moveV:oa(function(te,re){var le=this,pe=this.doc,be=[],_e=!this.display.shift&&!pe.extend&&pe.sel.somethingSelected();if(pe.extendSelectionsBy(function(et){if(_e)return te<0?et.from():et.to();var dt=La(le,et.head,"div");et.goalColumn!=null&&(dt.left=et.goalColumn),be.push(dt.left);var Wt=gh(le,dt,te,re);return re=="page"&&et==pe.sel.primary()&&Lu(le,lo(le,Wt,"div").top-dt.top),Wt},wt),be.length)for(var Ae=0;Ae<pe.sel.ranges.length;Ae++)pe.sel.ranges[Ae].goalColumn=be[Ae]}),findWordAt:function(te){var re=this.doc,le=Ke(re,te.line).text,pe=te.ch,be=te.ch;if(le){var _e=this.getHelper(te,"wordChars");(te.sticky=="before"||be==le.length)&&pe?--pe:++be;for(var Ae=le.charAt(pe),et=ve(Ae,_e)?function(dt){return ve(dt,_e)}:/\s/.test(Ae)?function(dt){return/\s/.test(dt)}:function(dt){return!/\s/.test(dt)&&!ve(dt)};pe>0&&et(le.charAt(pe-1));)--pe;for(;be<le.length&&et(le.charAt(be));)++be}return new Tr(gt(te.line,pe),gt(te.line,be))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Nt(this.display.cursorDiv,"CodeMirror-overwrite"):Ve(this.display.cursorDiv,"CodeMirror-overwrite"),vt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==qe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:oa(function(te,re){el(this,te,re)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-ka(this)-this.display.barHeight,width:te.scrollWidth-ka(this)-this.display.barWidth,clientHeight:bo(this),clientWidth:ua(this)}},scrollIntoView:oa(function(te,re){te==null?(te={from:this.doc.sel.primary().head,to:null},re==null&&(re=this.options.cursorScrollMargin)):typeof te=="number"?te={from:gt(te,0),to:null}:te.from==null&&(te={from:te,to:null}),te.to||(te.to=te.from),te.margin=re||0,te.from.line!=null?Nd(this,te):Dc(this,te.from,te.to,te.margin)}),setSize:oa(function(te,re){var le=this,pe=function(_e){return typeof _e=="number"||/^\d+$/.test(String(_e))?_e+"px":_e};te!=null&&(this.display.wrapper.style.width=pe(te)),re!=null&&(this.display.wrapper.style.height=pe(re)),this.options.lineWrapping&&Ea(this);var be=this.display.viewFrom;this.doc.iter(be,this.display.viewTo,function(_e){if(_e.widgets){for(var Ae=0;Ae<_e.widgets.length;Ae++)if(_e.widgets[Ae].noHScroll){Ao(le,be,"widget");break}}++be}),this.curOp.forceUpdate=!0,vt(this,"refresh",this)}),operation:function(te){return ca(this,te)},startOperation:function(){return Ls(this)},endOperation:function(){return us(this)},refresh:oa(function(){var te=this.display.cachedTextHeight;$a(this),this.curOp.forceUpdate=!0,Wr(this),el(this,this.doc.scrollLeft,this.doc.scrollTop),Bu(this.display),(te==null||Math.abs(te-as(this.display))>.5||this.options.lineWrapping)&&Da(this),vt(this,"refresh",this)}),swapDoc:oa(function(te){var re=this.doc;return re.cm=null,this.state.selectingText&&this.state.selectingText(),Yl(this,te),Wr(this),this.display.input.reset(),el(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Si(this,"swapDoc",this,re),re}),phrase:function(te){var re=this.options.phrases;return re&&Object.prototype.hasOwnProperty.call(re,te)?re[te]:te},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},_n(x),x.registerHelper=function(te,re,le){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][re]=le},x.registerGlobalHelper=function(te,re,le,pe){x.registerHelper(te,re,pe),ne[te]._global.push({pred:le,val:pe})}}function ic(x,z,ne,te,re){var le=z,pe=ne,be=Ke(x,z.line),_e=re&&x.direction=="rtl"?-ne:ne;function Ae(){var xi=z.line+_e;return xi<x.first||xi>=x.first+x.size?!1:(z=new gt(xi,z.ch,z.sticky),be=Ke(x,xi))}function et(xi){var oi;if(te=="codepoint"){var Ci=be.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Ci)?oi=null:oi=new gt(z.line,Math.max(0,Math.min(be.text.length,z.ch+ne*(Ci>=55296&&Ci<56320?2:1))),-ne)}else re?oi=Uo(x.cm,be,z,ne):oi=Go(be,z,ne);if(oi==null)if(!xi&&Ae())z=dl(re,x.cm,be,z.line,_e);else return!1;else z=oi;return!0}if(te=="char"||te=="codepoint")et();else if(te=="column")et(!0);else if(te=="word"||te=="group")for(var dt=null,Wt=te=="group",zt=x.cm&&x.cm.getHelper(z,"wordChars"),vn=!0;!(ne<0&&!et(!vn));vn=!1){var An=be.text.charAt(z.ch)||`
`,qn=ve(An,zt)?"w":Wt&&An==`
`?"n":!Wt||/\s/.test(An)?null:"p";if(Wt&&!vn&&!qn&&(qn="s"),dt&&dt!=qn){ne<0&&(ne=1,et(),z.sticky="after");break}if(qn&&(dt=qn),ne>0&&!et(!vn))break}var di=Gu(x,z,le,pe,!0);return Bn(le,di)&&(di.hitSide=!0),di}function gh(x,z,ne,te){var re=x.doc,le=z.left,pe;if(te=="page"){var be=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),_e=Math.max(be-.5*as(x.display),3);pe=(ne>0?z.bottom:z.top)+ne*_e}else te=="line"&&(pe=ne>0?z.bottom+3:z.top-3);for(var Ae;Ae=Ys(x,le,pe),!!Ae.outside;){if(ne<0?pe<=0:pe>=re.height){Ae.hitSide=!0;break}pe+=ne*5}return Ae}var $r=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$r.prototype.init=function(x){var z=this,ne=this,te=ne.cm,re=ne.div=x.lineDiv;mh(re,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function le(be){for(var _e=be.target;_e;_e=_e.parentNode){if(_e==re)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(_e.className))break}return!1}sn(re,"paste",function(be){!le(be)||Lt(te,be)||ad(be,te)||Be<=11&&setTimeout(xa(te,function(){return z.updateFromDOM()}),20)}),sn(re,"compositionstart",function(be){z.composing={data:be.data,done:!1}}),sn(re,"compositionupdate",function(be){z.composing||(z.composing={data:be.data,done:!1})}),sn(re,"compositionend",function(be){z.composing&&(be.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),sn(re,"touchstart",function(){return ne.forceCompositionEnd()}),sn(re,"input",function(){z.composing||z.readFromDOMSoon()});function pe(be){if(!(!le(be)||Lt(te,be))){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()}),be.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var _e=Bl(te);Ns({lineWise:!0,text:_e.text}),be.type=="cut"&&te.operation(function(){te.setSelections(_e.ranges,0,Ue),te.replaceSelection("",null,"cut")})}else return;if(be.clipboardData){be.clipboardData.clearData();var Ae=zo.text.join(`
`);if(be.clipboardData.setData("Text",Ae),be.clipboardData.getData("Text")==Ae){be.preventDefault();return}}var et=sd(),dt=et.firstChild;te.display.lineSpace.insertBefore(et,te.display.lineSpace.firstChild),dt.value=zo.text.join(`
`);var Wt=document.activeElement;Vt(dt),setTimeout(function(){te.display.lineSpace.removeChild(et),Wt.focus(),Wt==re&&ne.showPrimarySelection()},50)}}sn(re,"copy",pe),sn(re,"cut",pe)},$r.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},$r.prototype.prepareSelection=function(){var x=Mc(this.cm,!1);return x.focus=document.activeElement==this.div,x},$r.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},$r.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$r.prototype.showPrimarySelection=function(){var x=this.getSelection(),z=this.cm,ne=z.doc.sel.primary(),te=ne.from(),re=ne.to();if(z.display.viewTo==z.display.viewFrom||te.line>=z.display.viewTo||re.line<z.display.viewFrom){x.removeAllRanges();return}var le=rc(z,x.anchorNode,x.anchorOffset),pe=rc(z,x.focusNode,x.focusOffset);if(!(le&&!le.bad&&pe&&!pe.bad&&jt(Cn(le,pe),te)==0&&jt(Tn(le,pe),re)==0)){var be=z.display.view,_e=te.line>=z.display.viewFrom&&vh(z,te)||{node:be[0].measure.map[2],offset:0},Ae=re.line<z.display.viewTo&&vh(z,re);if(!Ae){var et=be[be.length-1].measure,dt=et.maps?et.maps[et.maps.length-1]:et.map;Ae={node:dt[dt.length-1],offset:dt[dt.length-2]-dt[dt.length-3]}}if(!_e||!Ae){x.removeAllRanges();return}var Wt=x.rangeCount&&x.getRangeAt(0),zt;try{zt=at(_e.node,_e.offset,Ae.offset,Ae.node)}catch(vn){}zt&&(!we&&z.state.focused?(x.collapse(_e.node,_e.offset),zt.collapsed||(x.removeAllRanges(),x.addRange(zt))):(x.removeAllRanges(),x.addRange(zt)),Wt&&x.anchorNode==null?x.addRange(Wt):we&&this.startGracePeriod()),this.rememberSelection()}},$r.prototype.startGracePeriod=function(){var x=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){x.gracePeriod=!1,x.selectionChanged()&&x.cm.operation(function(){return x.cm.curOp.selectionChanged=!0})},20)},$r.prototype.showMultipleSelections=function(x){bt(this.cm.display.cursorDiv,x.cursors),bt(this.cm.display.selectionDiv,x.selection)},$r.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},$r.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Ct(this.div,z)},$r.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$r.prototype.blur=function(){this.div.blur()},$r.prototype.getField=function(){return this.div},$r.prototype.supportsTouch=function(){return!0},$r.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():ca(this.cm,function(){return x.cm.curOp.selectionChanged=!0});function z(){x.cm.state.focused&&(x.pollSelection(),x.polling.set(x.cm.options.pollInterval,z))}this.polling.set(this.cm.options.pollInterval,z)},$r.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},$r.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(Ye&&Me&&this.cm.display.gutterSpecs.length&&uf(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=rc(z,x.anchorNode,x.anchorOffset),te=rc(z,x.focusNode,x.focusOffset);ne&&te&&ca(z,function(){wa(z.doc,No(ne,te),Ue),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},$r.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var x=this.cm,z=x.display,ne=x.doc.sel.primary(),te=ne.from(),re=ne.to();if(te.ch==0&&te.line>x.firstLine()&&(te=gt(te.line-1,Ke(x.doc,te.line-1).length)),re.ch==Ke(x.doc,re.line).text.length&&re.line<x.lastLine()&&(re=gt(re.line+1,0)),te.line<z.viewFrom||re.line>z.viewTo-1)return!1;var le,pe,be;te.line==z.viewFrom||(le=po(x,te.line))==0?(pe=Dt(z.view[0].line),be=z.view[0].node):(pe=Dt(z.view[le].line),be=z.view[le-1].node.nextSibling);var _e=po(x,re.line),Ae,et;if(_e==z.view.length-1?(Ae=z.viewTo-1,et=z.lineDiv.lastChild):(Ae=Dt(z.view[_e+1].line)-1,et=z.view[_e+1].node.previousSibling),!be)return!1;for(var dt=x.doc.splitLines(cf(x,be,et,pe,Ae)),Wt=it(x.doc,gt(pe,0),gt(Ae,Ke(x.doc,Ae).text.length));dt.length>1&&Wt.length>1;)if($t(dt)==$t(Wt))dt.pop(),Wt.pop(),Ae--;else if(dt[0]==Wt[0])dt.shift(),Wt.shift(),pe++;else break;for(var zt=0,vn=0,An=dt[0],qn=Wt[0],di=Math.min(An.length,qn.length);zt<di&&An.charCodeAt(zt)==qn.charCodeAt(zt);)++zt;for(var xi=$t(dt),oi=$t(Wt),Ci=Math.min(xi.length-(dt.length==1?zt:0),oi.length-(Wt.length==1?zt:0));vn<Ci&&xi.charCodeAt(xi.length-vn-1)==oi.charCodeAt(oi.length-vn-1);)++vn;if(dt.length==1&&Wt.length==1&&pe==te.line)for(;zt&&zt>te.ch&&xi.charCodeAt(xi.length-vn-1)==oi.charCodeAt(oi.length-vn-1);)zt--,vn++;dt[dt.length-1]=xi.slice(0,xi.length-vn).replace(/^\u200b+/,""),dt[0]=dt[0].slice(zt).replace(/\u200b+$/,"");var zi=gt(pe,zt),Ki=gt(Ae,Wt.length?$t(Wt).length-vn:0);if(dt.length>1||dt[0]||jt(zi,Ki))return _l(x.doc,dt,zi,Ki,"+input"),!0},$r.prototype.ensurePolled=function(){this.forceCompositionEnd()},$r.prototype.reset=function(){this.forceCompositionEnd()},$r.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},$r.prototype.readFromDOMSoon=function(){var x=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(x.readDOMTimeout=null,x.composing)if(x.composing.done)x.composing=null;else return;x.updateFromDOM()},80))},$r.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&ca(this.cm,function(){return $a(x.cm)})},$r.prototype.setUneditable=function(x){x.contentEditable="false"},$r.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||xa(this.cm,rd)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},$r.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},$r.prototype.onContextMenu=function(){},$r.prototype.resetPosition=function(){},$r.prototype.needsContentAttribute=!0;function vh(x,z){var ne=Ua(x,z.line);if(!ne||ne.hidden)return null;var te=Ke(x.doc,z.line),re=Eo(ne,te,z.line),le=bn(te,x.doc.direction),pe="left";if(le){var be=hn(le,z.ch);pe=be%2?"right":"left"}var _e=is(re.map,z.ch,pe);return _e.offset=_e.collapse=="right"?_e.end:_e.start,_e}function uf(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function Pl(x,z){return z&&(x.bad=!0),x}function cf(x,z,ne,te,re){var le="",pe=!1,be=x.doc.lineSeparator(),_e=!1;function Ae(zt){return function(vn){return vn.id==zt}}function et(){pe&&(le+=be,_e&&(le+=be),pe=_e=!1)}function dt(zt){zt&&(et(),le+=zt)}function Wt(zt){if(zt.nodeType==1){var vn=zt.getAttribute("cm-text");if(vn){dt(vn);return}var An=zt.getAttribute("cm-marker"),qn;if(An){var di=x.findMarks(gt(te,0),gt(re+1,0),Ae(+An));di.length&&(qn=di[0].find(0))&&dt(it(x.doc,qn.from,qn.to).join(be));return}if(zt.getAttribute("contenteditable")=="false")return;var xi=/^(pre|div|p|li|table|br)$/i.test(zt.nodeName);if(!/^br$/i.test(zt.nodeName)&&zt.textContent.length==0)return;xi&&et();for(var oi=0;oi<zt.childNodes.length;oi++)Wt(zt.childNodes[oi]);/^(pre|p)$/i.test(zt.nodeName)&&(_e=!0),xi&&(pe=!0)}else zt.nodeType==3&&dt(zt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Wt(z),z!=ne;)z=z.nextSibling,_e=!1;return le}function rc(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return Pl(x.clipPos(gt(x.display.viewTo-1)),!0);z=null,ne=0}else for(te=z;;te=te.parentNode){if(!te||te==x.display.lineDiv)return null;if(te.parentNode&&te.parentNode==x.display.lineDiv)break}for(var re=0;re<x.display.view.length;re++){var le=x.display.view[re];if(le.node==te)return df(le,z,ne)}}function df(x,z,ne){var te=x.text.firstChild,re=!1;if(!z||!Ct(te,z))return Pl(gt(Dt(x.line),0),!0);if(z==te&&(re=!0,z=te.childNodes[ne],ne=0,!z)){var le=x.rest?$t(x.rest):x.line;return Pl(gt(Dt(le),le.text.length),re)}var pe=z.nodeType==3?z:null,be=z;for(!pe&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(pe=z.firstChild,ne&&(ne=pe.nodeValue.length));be.parentNode!=te;)be=be.parentNode;var _e=x.measure,Ae=_e.maps;function et(qn,di,xi){for(var oi=-1;oi<(Ae?Ae.length:0);oi++)for(var Ci=oi<0?_e.map:Ae[oi],zi=0;zi<Ci.length;zi+=3){var Ki=Ci[zi+2];if(Ki==qn||Ki==di){var dr=Dt(oi<0?x.line:x.rest[oi]),jr=Ci[zi]+xi;return(xi<0||Ki!=qn)&&(jr=Ci[zi+(xi?1:0)]),gt(dr,jr)}}}var dt=et(pe,be,ne);if(dt)return Pl(dt,re);for(var Wt=be.nextSibling,zt=pe?pe.nodeValue.length-ne:0;Wt;Wt=Wt.nextSibling){if(dt=et(Wt,Wt.firstChild,0),dt)return Pl(gt(dt.line,dt.ch-zt),re);zt+=Wt.textContent.length}for(var vn=be.previousSibling,An=ne;vn;vn=vn.previousSibling){if(dt=et(vn,vn.firstChild,-1),dt)return Pl(gt(dt.line,dt.ch+An),re);An+=vn.textContent.length}}var Vr=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.hasSelection=!1,this.composing=null};Vr.prototype.init=function(x){var z=this,ne=this,te=this.cm;this.createField(x);var re=this.textarea;x.wrapper.insertBefore(this.wrapper,x.wrapper.firstChild),mt&&(re.style.width="0px"),sn(re,"input",function(){Se&&Be>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),sn(re,"paste",function(pe){Lt(te,pe)||ad(pe,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function le(pe){if(!Lt(te,pe)){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var be=Bl(te);Ns({lineWise:!0,text:be.text}),pe.type=="cut"?te.setSelections(be.ranges,null,Ue):(ne.prevInput="",re.value=be.text.join(`
`),Vt(re))}else return;pe.type=="cut"&&(te.state.cutIncoming=+new Date)}}sn(re,"cut",le),sn(re,"copy",le),sn(x.scroller,"paste",function(pe){if(!(oo(x,pe)||Lt(te,pe))){if(!re.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var be=new Event("paste");be.clipboardData=pe.clipboardData,re.dispatchEvent(be)}}),sn(x.lineSpace,"selectstart",function(pe){oo(x,pe)||ti(pe)}),sn(re,"compositionstart",function(){var pe=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:pe,range:te.markText(pe,te.getCursor("to"),{className:"CodeMirror-composing"})}}),sn(re,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},Vr.prototype.createField=function(x){this.wrapper=sd(),this.textarea=this.wrapper.firstChild},Vr.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},Vr.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=Mc(x);if(x.options.moveInputWithCursor){var re=La(x,ne.sel.primary().head,"div"),le=z.wrapper.getBoundingClientRect(),pe=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,re.top+pe.top-le.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,re.left+pe.left-le.left))}return te},Vr.prototype.showSelection=function(x){var z=this.cm,ne=z.display;bt(ne.cursorDiv,x.cursors),bt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},Vr.prototype.reset=function(x){if(!(this.contextMenuPending||this.composing)){var z=this.cm;if(z.somethingSelected()){this.prevInput="";var ne=z.getSelection();this.textarea.value=ne,z.state.focused&&Vt(this.textarea),Se&&Be>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",Se&&Be>=9&&(this.hasSelection=null))}},Vr.prototype.getField=function(){return this.textarea},Vr.prototype.supportsTouch=function(){return!1},Vr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ot||qe()!=this.textarea))try{this.textarea.focus()}catch(x){}},Vr.prototype.blur=function(){this.textarea.blur()},Vr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vr.prototype.receivedFocus=function(){this.slowPoll()},Vr.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},Vr.prototype.fastPoll=function(){var x=!1,z=this;z.pollingFast=!0;function ne(){var te=z.poll();!te&&!x?(x=!0,z.polling.set(60,ne)):(z.pollingFast=!1,z.slowPoll())}z.polling.set(20,ne)},Vr.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||bi(ne)&&!te&&!this.composing||z.isReadOnly()||z.options.disableInput||z.state.keySeq)return!1;var re=ne.value;if(re==te&&!z.somethingSelected())return!1;if(Se&&Be>=9&&this.hasSelection===re||rt&&/[\uf700-\uf7ff]/.test(re))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var le=re.charCodeAt(0);if(le==8203&&!te&&(te="\u200B"),le==8666)return this.reset(),this.cm.execCommand("undo")}for(var pe=0,be=Math.min(te.length,re.length);pe<be&&te.charCodeAt(pe)==re.charCodeAt(pe);)++pe;return ca(z,function(){rd(z,re.slice(pe),te.length-pe,null,x.composing?"*compose":null),re.length>1e3||re.indexOf(`
`)>-1?ne.value=x.prevInput="":x.prevInput=re,x.composing&&(x.composing.range.clear(),x.composing.range=z.markText(x.composing.start,z.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Vr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vr.prototype.onKeyPress=function(){Se&&Be>=9&&(this.hasSelection=null),this.fastPoll()},Vr.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,re=z.textarea;z.contextMenuPending&&z.contextMenuPending();var le=xo(ne,x),pe=te.scroller.scrollTop;if(!le||Ne)return;var be=ne.options.resetSelectionOnContextMenu;be&&ne.doc.sel.contains(le)==-1&&xa(ne,wa)(ne.doc,No(le),Ue);var _e=re.style.cssText,Ae=z.wrapper.style.cssText,et=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",re.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-et.top-5)+"px; left: "+(x.clientX-et.left-5)+`px;
z-index: 1000; background: `+(Se?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var dt;Oe&&(dt=window.scrollY),te.input.focus(),Oe&&window.scrollTo(null,dt),te.input.reset(),ne.somethingSelected()||(re.value=z.prevInput=" "),z.contextMenuPending=zt,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function Wt(){if(re.selectionStart!=null){var An=ne.somethingSelected(),qn="\u200B"+(An?re.value:"");re.value="\u21DA",re.value=qn,z.prevInput=An?"":"\u200B",re.selectionStart=1,re.selectionEnd=qn.length,te.selForContextMenu=ne.doc.sel}}function zt(){if(z.contextMenuPending==zt&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Ae,re.style.cssText=_e,Se&&Be<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=pe),re.selectionStart!=null)){(!Se||Se&&Be<9)&&Wt();var An=0,qn=function(){te.selForContextMenu==ne.doc.sel&&re.selectionStart==0&&re.selectionEnd>0&&z.prevInput=="\u200B"?xa(ne,Vc)(ne):An++<10?te.detectingSelectAll=setTimeout(qn,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(qn,200)}}if(Se&&Be>=9&&Wt(),We){Bi(x);var vn=function(){tt(window,"mouseup",vn),setTimeout(zt,20)};sn(window,"mouseup",vn)}else setTimeout(zt,50)},Vr.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},Vr.prototype.setUneditable=function(){},Vr.prototype.needsContentAttribute=!1;function hl(x,z){if(z=z?Ft(z):{},z.value=x.value,!z.tabindex&&x.tabIndex&&(z.tabindex=x.tabIndex),!z.placeholder&&x.placeholder&&(z.placeholder=x.placeholder),z.autofocus==null){var ne=qe();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=be.getValue()}var re;if(x.form&&(sn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var le=x.form;re=le.submit;try{var pe=le.submit=function(){te(),le.submit=re,le.submit(),le.submit=pe}}catch(_e){}}z.finishInit=function(_e){_e.save=te,_e.getTextArea=function(){return x},_e.toTextArea=function(){_e.toTextArea=isNaN,te(),x.parentNode.removeChild(_e.getWrapperElement()),x.style.display="",x.form&&(tt(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=re))}},x.style.display="none";var be=er(function(_e){return x.parentNode.insertBefore(_e,x.nextSibling)},z);return be}function Il(x){x.off=tt,x.on=sn,x.wheelEventPixels=Fc,x.Doc=ga,x.splitLines=Yi,x.countColumn=Fe,x.findColumn=dn,x.isWordChar=fe,x.Pass=Ot,x.signal=vt,x.Line=Xn,x.changeEnd=cs,x.scrollbarModel=Tc,x.Pos=gt,x.cmpPos=jt,x.modes=ir,x.mimeModes=$i,x.resolveMode=kn,x.getMode=Dn,x.modeExtensions=mi,x.extendMode=Qe,x.copyState=ke,x.startState=Le,x.innerMode=Pe,x.commands=Dl,x.keyMap=Zr,x.keyName=cl,x.isModifierKey=su,x.lookupKey=ms,x.normalizeKeyMap=qc,x.StringStream=De,x.SharedTextMarker=cr,x.TextMarker=Ts,x.LineWidget=kl,x.e_preventDefault=ti,x.e_stopPropagation=hi,x.e_stop=Bi,x.addClass=Nt,x.contains=Ct,x.rmClass=Ve,x.keyNames=Fo}of(er),ld(er);var ys="iter insert remove copy getEditor constructor".split(" ");for(var Io in ga.prototype)ga.prototype.hasOwnProperty(Io)&&ft(ys,Io)<0&&(er.prototype[Io]=function(x){return function(){return x.apply(this.doc,arguments)}}(ga.prototype[Io]));return _n(ga),er.inputStyles={textarea:Vr,contenteditable:$r},er.defineMode=function(x){!er.defaults.mode&&x!="null"&&(er.defaults.mode=x),si.apply(this,arguments)},er.defineMIME=fi,er.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),er.defineMIME("text/plain","null"),er.defineExtension=function(x,z){er.prototype[x]=z},er.defineDocExtension=function(x,z){ga.prototype[x]=z},er.fromTextArea=hl,Il(er),er.version="5.58.2",er})},25419:function(mn,rn,he){(function(we){we(he(89780),he(15525),he(98101))})(function(we){"use strict";we.defineMode("markdown",function(ct,Re){var st=we.getMode(ct,"text/html"),Se=st.name=="null";function Be(Fe){if(we.findModeByName){var xe=we.findModeByName(Fe);xe&&(Fe=xe.mime||xe.mimes[0])}var ft=we.getMode(ct,Fe);return ft.name=="null"?null:ft}Re.highlightFormatting===void 0&&(Re.highlightFormatting=!1),Re.maxBlockquoteDepth===void 0&&(Re.maxBlockquoteDepth=0),Re.taskLists===void 0&&(Re.taskLists=!1),Re.strikethrough===void 0&&(Re.strikethrough=!1),Re.emoji===void 0&&(Re.emoji=!1),Re.fencedCodeBlockHighlighting===void 0&&(Re.fencedCodeBlockHighlighting=!0),Re.fencedCodeBlockDefaultMode===void 0&&(Re.fencedCodeBlockDefaultMode="text/plain"),Re.xml===void 0&&(Re.xml=!0),Re.tokenTypeOverrides===void 0&&(Re.tokenTypeOverrides={});var Oe={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Ce in Oe)Oe.hasOwnProperty(Ce)&&Re.tokenTypeOverrides[Ce]&&(Oe[Ce]=Re.tokenTypeOverrides[Ce]);var Me=/^([*\-_])(?:\s*\1){2,}\s*$/,Ne=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ht=/^\[(x| )\](?=\s)/i,Ie=Re.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,He=/^ {0,3}(?:\={1,}|-{2,})\s*$/,mt=/^[^#!\[\]*_\\<>` "'(~:]+/,Ye=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,ot=/^\s*\[[^\]]+?\]:.*$/,rt=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,Et=" ";function Zt(Fe,xe,ft){return xe.f=xe.inline=ft,ft(Fe,xe)}function Je(Fe,xe,ft){return xe.f=xe.block=ft,ft(Fe,xe)}function lt(Fe){return!Fe||!/\S/.test(Fe.string)}function We(Fe){if(Fe.linkTitle=!1,Fe.linkHref=!1,Fe.linkText=!1,Fe.em=!1,Fe.strong=!1,Fe.strikethrough=!1,Fe.quote=0,Fe.indentedCode=!1,Fe.f==Ve){var xe=Se;if(!xe){var ft=we.innerMode(st,Fe.htmlState);xe=ft.mode.name=="xml"&&ft.state.tagStart===null&&!ft.state.context&&ft.state.tokenize.isInText}xe&&(Fe.f=It,Fe.block=Ee,Fe.htmlState=null)}return Fe.trailingSpace=0,Fe.trailingSpaceNewLine=!1,Fe.prevLine=Fe.thisLine,Fe.thisLine={stream:null},null}function Ee(Fe,xe){var ft=Fe.column()===xe.indentation,qt=lt(xe.prevLine.stream),Ot=xe.indentedCode,Ue=xe.prevLine.hr,Ge=xe.list!==!1,wt=(xe.listStack[xe.listStack.length-1]||0)+3;xe.indentedCode=!1;var dn=xe.indentation;if(xe.indentationDiff===null&&(xe.indentationDiff=xe.indentation,Ge)){for(xe.list=null;dn<xe.listStack[xe.listStack.length-1];)xe.listStack.pop(),xe.listStack.length?xe.indentation=xe.listStack[xe.listStack.length-1]:xe.list=!1;xe.list!==!1&&(xe.indentationDiff=dn-xe.listStack[xe.listStack.length-1])}var Rt=!qt&&!Ue&&!xe.prevLine.header&&(!Ge||!Ot)&&!xe.prevLine.fencedCodeEnd,an=(xe.list===!1||Ue||qt)&&xe.indentation<=wt&&Fe.match(Me),$t=null;if(xe.indentationDiff>=4&&(Ot||xe.prevLine.fencedCodeEnd||xe.prevLine.header||qt))return Fe.skipToEnd(),xe.indentedCode=!0,Oe.code;if(Fe.eatSpace())return null;if(ft&&xe.indentation<=wt&&($t=Fe.match(Ie))&&$t[1].length<=6)return xe.quote=0,xe.header=$t[1].length,xe.thisLine.header=!0,Re.highlightFormatting&&(xe.formatting="header"),xe.f=xe.inline,bt(xe);if(xe.indentation<=wt&&Fe.eat(">"))return xe.quote=ft?1:xe.quote+1,Re.highlightFormatting&&(xe.formatting="quote"),Fe.eatSpace(),bt(xe);if(!an&&!xe.setext&&ft&&xe.indentation<=wt&&($t=Fe.match(Ne))){var Bt=$t[1]?"ol":"ul";return xe.indentation=dn+Fe.current().length,xe.list=!0,xe.quote=0,xe.listStack.push(xe.indentation),xe.em=!1,xe.strong=!1,xe.code=!1,xe.strikethrough=!1,Re.taskLists&&Fe.match(ht,!1)&&(xe.taskList=!0),xe.f=xe.inline,Re.highlightFormatting&&(xe.formatting=["list","list-"+Bt]),bt(xe)}else{if(ft&&xe.indentation<=wt&&($t=Fe.match(Ye,!0)))return xe.quote=0,xe.fencedEndRE=new RegExp($t[1]+"+ *$"),xe.localMode=Re.fencedCodeBlockHighlighting&&Be($t[2]||Re.fencedCodeBlockDefaultMode),xe.localMode&&(xe.localState=we.startState(xe.localMode)),xe.f=xe.block=Xe,Re.highlightFormatting&&(xe.formatting="code-block"),xe.code=-1,bt(xe);if(xe.setext||(!Rt||!Ge)&&!xe.quote&&xe.list===!1&&!xe.code&&!an&&!ot.test(Fe.string)&&($t=Fe.lookAhead(1))&&($t=$t.match(He)))return xe.setext?(xe.header=xe.setext,xe.setext=0,Fe.skipToEnd(),Re.highlightFormatting&&(xe.formatting="header")):(xe.header=$t[0].charAt(0)=="="?1:2,xe.setext=xe.header),xe.thisLine.header=!0,xe.f=xe.inline,bt(xe);if(an)return Fe.skipToEnd(),xe.hr=!0,xe.thisLine.hr=!0,Oe.hr;if(Fe.peek()==="[")return Zt(Fe,xe,Qt)}return Zt(Fe,xe,xe.inline)}function Ve(Fe,xe){var ft=st.token(Fe,xe.htmlState);if(!Se){var qt=we.innerMode(st,xe.htmlState);(qt.mode.name=="xml"&&qt.state.tagStart===null&&!qt.state.context&&qt.state.tokenize.isInText||xe.md_inside&&Fe.current().indexOf(">")>-1)&&(xe.f=It,xe.block=Ee,xe.htmlState=null)}return ft}function Xe(Fe,xe){var ft=xe.listStack[xe.listStack.length-1]||0,qt=xe.indentation<ft,Ot=ft+3;if(xe.fencedEndRE&&xe.indentation<=Ot&&(qt||Fe.match(xe.fencedEndRE))){Re.highlightFormatting&&(xe.formatting="code-block");var Ue;return qt||(Ue=bt(xe)),xe.localMode=xe.localState=null,xe.block=Ee,xe.f=It,xe.fencedEndRE=null,xe.code=0,xe.thisLine.fencedCodeEnd=!0,qt?Je(Fe,xe,xe.block):Ue}else return xe.localMode?xe.localMode.token(Fe,xe.localState):(Fe.skipToEnd(),Oe.code)}function bt(Fe){var xe=[];if(Fe.formatting){xe.push(Oe.formatting),typeof Fe.formatting=="string"&&(Fe.formatting=[Fe.formatting]);for(var ft=0;ft<Fe.formatting.length;ft++)xe.push(Oe.formatting+"-"+Fe.formatting[ft]),Fe.formatting[ft]==="header"&&xe.push(Oe.formatting+"-"+Fe.formatting[ft]+"-"+Fe.header),Fe.formatting[ft]==="quote"&&(!Re.maxBlockquoteDepth||Re.maxBlockquoteDepth>=Fe.quote?xe.push(Oe.formatting+"-"+Fe.formatting[ft]+"-"+Fe.quote):xe.push("error"))}if(Fe.taskOpen)return xe.push("meta"),xe.length?xe.join(" "):null;if(Fe.taskClosed)return xe.push("property"),xe.length?xe.join(" "):null;if(Fe.linkHref?xe.push(Oe.linkHref,"url"):(Fe.strong&&xe.push(Oe.strong),Fe.em&&xe.push(Oe.em),Fe.strikethrough&&xe.push(Oe.strikethrough),Fe.emoji&&xe.push(Oe.emoji),Fe.linkText&&xe.push(Oe.linkText),Fe.code&&xe.push(Oe.code),Fe.image&&xe.push(Oe.image),Fe.imageAltText&&xe.push(Oe.imageAltText,"link"),Fe.imageMarker&&xe.push(Oe.imageMarker)),Fe.header&&xe.push(Oe.header,Oe.header+"-"+Fe.header),Fe.quote&&(xe.push(Oe.quote),!Re.maxBlockquoteDepth||Re.maxBlockquoteDepth>=Fe.quote?xe.push(Oe.quote+"-"+Fe.quote):xe.push(Oe.quote+"-"+Re.maxBlockquoteDepth)),Fe.list!==!1){var qt=(Fe.listStack.length-1)%3;qt?qt===1?xe.push(Oe.list2):xe.push(Oe.list3):xe.push(Oe.list1)}return Fe.trailingSpaceNewLine?xe.push("trailing-space-new-line"):Fe.trailingSpace&&xe.push("trailing-space-"+(Fe.trailingSpace%2?"a":"b")),xe.length?xe.join(" "):null}function je(Fe,xe){if(Fe.match(mt,!0))return bt(xe)}function It(Fe,xe){var ft=xe.text(Fe,xe);if(typeof ft!="undefined")return ft;if(xe.list)return xe.list=null,bt(xe);if(xe.taskList){var qt=Fe.match(ht,!0)[1]===" ";return qt?xe.taskOpen=!0:xe.taskClosed=!0,Re.highlightFormatting&&(xe.formatting="task"),xe.taskList=!1,bt(xe)}if(xe.taskOpen=!1,xe.taskClosed=!1,xe.header&&Fe.match(/^#+$/,!0))return Re.highlightFormatting&&(xe.formatting="header"),bt(xe);var Ot=Fe.next();if(xe.linkTitle){xe.linkTitle=!1;var Ue=Ot;Ot==="("&&(Ue=")"),Ue=(Ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ge="^\\s*(?:[^"+Ue+"\\\\]+|\\\\\\\\|\\\\.)"+Ue;if(Fe.match(new RegExp(Ge),!0))return Oe.linkHref}if(Ot==="`"){var wt=xe.formatting;Re.highlightFormatting&&(xe.formatting="code"),Fe.eatWhile("`");var dn=Fe.current().length;if(xe.code==0&&(!xe.quote||dn==1))return xe.code=dn,bt(xe);if(dn==xe.code){var Rt=bt(xe);return xe.code=0,Rt}else return xe.formatting=wt,bt(xe)}else if(xe.code)return bt(xe);if(Ot==="\\"&&(Fe.next(),Re.highlightFormatting)){var an=bt(xe),$t=Oe.formatting+"-escape";return an?an+" "+$t:$t}if(Ot==="!"&&Fe.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return xe.imageMarker=!0,xe.image=!0,Re.highlightFormatting&&(xe.formatting="image"),bt(xe);if(Ot==="["&&xe.imageMarker&&Fe.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return xe.imageMarker=!1,xe.imageAltText=!0,Re.highlightFormatting&&(xe.formatting="image"),bt(xe);if(Ot==="]"&&xe.imageAltText){Re.highlightFormatting&&(xe.formatting="image");var an=bt(xe);return xe.imageAltText=!1,xe.image=!1,xe.inline=xe.f=Ct,an}if(Ot==="["&&!xe.image)return xe.linkText&&Fe.match(/^.*?\]/)||(xe.linkText=!0,Re.highlightFormatting&&(xe.formatting="link")),bt(xe);if(Ot==="]"&&xe.linkText){Re.highlightFormatting&&(xe.formatting="link");var an=bt(xe);return xe.linkText=!1,xe.inline=xe.f=Fe.match(/\(.*?\)| ?\[.*?\]/,!1)?Ct:It,an}if(Ot==="<"&&Fe.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=at,Re.highlightFormatting&&(xe.formatting="link");var an=bt(xe);return an?an+=" ":an="",an+Oe.linkInline}if(Ot==="<"&&Fe.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=at,Re.highlightFormatting&&(xe.formatting="link");var an=bt(xe);return an?an+=" ":an="",an+Oe.linkEmail}if(Re.xml&&Ot==="<"&&Fe.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Bt=Fe.string.indexOf(">",Fe.pos);if(Bt!=-1){var Tt=Fe.string.substring(Fe.start,Bt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Tt)&&(xe.md_inside=!0)}return Fe.backUp(1),xe.htmlState=we.startState(st),Je(Fe,xe,Ve)}if(Re.xml&&Ot==="<"&&Fe.match(/^\/\w*?>/))return xe.md_inside=!1,"tag";if(Ot==="*"||Ot==="_"){for(var ge=1,se=Fe.pos==1?" ":Fe.string.charAt(Fe.pos-2);ge<3&&Fe.eat(Ot);)ge++;var oe=Fe.peek()||" ",fe=!/\s/.test(oe)&&(!rt.test(oe)||/\s/.test(se)||rt.test(se)),ve=!/\s/.test(se)&&(!rt.test(se)||/\s/.test(oe)||rt.test(oe)),ce=null,$e=null;if(ge%2&&(!xe.em&&fe&&(Ot==="*"||!ve||rt.test(se))?ce=!0:xe.em==Ot&&ve&&(Ot==="*"||!fe||rt.test(oe))&&(ce=!1)),ge>1&&(!xe.strong&&fe&&(Ot==="*"||!ve||rt.test(se))?$e=!0:xe.strong==Ot&&ve&&(Ot==="*"||!fe||rt.test(oe))&&($e=!1)),$e!=null||ce!=null){Re.highlightFormatting&&(xe.formatting=ce==null?"strong":$e==null?"em":"strong em"),ce===!0&&(xe.em=Ot),$e===!0&&(xe.strong=Ot);var Rt=bt(xe);return ce===!1&&(xe.em=!1),$e===!1&&(xe.strong=!1),Rt}}else if(Ot===" "&&(Fe.eat("*")||Fe.eat("_"))){if(Fe.peek()===" ")return bt(xe);Fe.backUp(1)}if(Re.strikethrough){if(Ot==="~"&&Fe.eatWhile(Ot)){if(xe.strikethrough){Re.highlightFormatting&&(xe.formatting="strikethrough");var Rt=bt(xe);return xe.strikethrough=!1,Rt}else if(Fe.match(/^[^\s]/,!1))return xe.strikethrough=!0,Re.highlightFormatting&&(xe.formatting="strikethrough"),bt(xe)}else if(Ot===" "&&Fe.match(/^~~/,!0)){if(Fe.peek()===" ")return bt(xe);Fe.backUp(2)}}if(Re.emoji&&Ot===":"&&Fe.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){xe.emoji=!0,Re.highlightFormatting&&(xe.formatting="emoji");var xt=bt(xe);return xe.emoji=!1,xt}return Ot===" "&&(Fe.match(/^ +$/,!1)?xe.trailingSpace++:xe.trailingSpace&&(xe.trailingSpaceNewLine=!0)),bt(xe)}function at(Fe,xe){var ft=Fe.next();if(ft===">"){xe.f=xe.inline=It,Re.highlightFormatting&&(xe.formatting="link");var qt=bt(xe);return qt?qt+=" ":qt="",qt+Oe.linkInline}return Fe.match(/^[^>]+/,!0),Oe.linkInline}function Ct(Fe,xe){if(Fe.eatSpace())return null;var ft=Fe.next();return ft==="("||ft==="["?(xe.f=xe.inline=Nt(ft==="("?")":"]"),Re.highlightFormatting&&(xe.formatting="link-string"),xe.linkHref=!0,bt(xe)):"error"}var qe={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Nt(Fe){return function(xe,ft){var qt=xe.next();if(qt===Fe){ft.f=ft.inline=It,Re.highlightFormatting&&(ft.formatting="link-string");var Ot=bt(ft);return ft.linkHref=!1,Ot}return xe.match(qe[Fe]),ft.linkHref=!0,bt(ft)}}function Qt(Fe,xe){return Fe.match(/^([^\]\\]|\\.)*\]:/,!1)?(xe.f=Vt,Fe.next(),Re.highlightFormatting&&(xe.formatting="link"),xe.linkText=!0,bt(xe)):Zt(Fe,xe,It)}function Vt(Fe,xe){if(Fe.match(/^\]:/,!0)){xe.f=xe.inline=Gt,Re.highlightFormatting&&(xe.formatting="link");var ft=bt(xe);return xe.linkText=!1,ft}return Fe.match(/^([^\]\\]|\\.)+/,!0),Oe.linkText}function Gt(Fe,xe){return Fe.eatSpace()?null:(Fe.match(/^[^\s]+/,!0),Fe.peek()===void 0?xe.linkTitle=!0:Fe.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),xe.f=xe.inline=It,Oe.linkHref+" url")}var Ft={startState:function(){return{f:Ee,prevLine:{stream:null},thisLine:{stream:null},block:Ee,htmlState:null,indentation:0,inline:It,text:je,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(Fe){return{f:Fe.f,prevLine:Fe.prevLine,thisLine:Fe.thisLine,block:Fe.block,htmlState:Fe.htmlState&&we.copyState(st,Fe.htmlState),indentation:Fe.indentation,localMode:Fe.localMode,localState:Fe.localMode?we.copyState(Fe.localMode,Fe.localState):null,inline:Fe.inline,text:Fe.text,formatting:!1,linkText:Fe.linkText,linkTitle:Fe.linkTitle,linkHref:Fe.linkHref,code:Fe.code,em:Fe.em,strong:Fe.strong,strikethrough:Fe.strikethrough,emoji:Fe.emoji,header:Fe.header,setext:Fe.setext,hr:Fe.hr,taskList:Fe.taskList,list:Fe.list,listStack:Fe.listStack.slice(0),quote:Fe.quote,indentedCode:Fe.indentedCode,trailingSpace:Fe.trailingSpace,trailingSpaceNewLine:Fe.trailingSpaceNewLine,md_inside:Fe.md_inside,fencedEndRE:Fe.fencedEndRE}},token:function(Fe,xe){if(xe.formatting=!1,Fe!=xe.thisLine.stream){if(xe.header=0,xe.hr=!1,Fe.match(/^\s*$/,!0))return We(xe),null;if(xe.prevLine=xe.thisLine,xe.thisLine={stream:Fe},xe.taskList=!1,xe.trailingSpace=0,xe.trailingSpaceNewLine=!1,!xe.localState&&(xe.f=xe.block,xe.f!=Ve)){var ft=Fe.match(/^\s*/,!0)[0].replace(/\t/g,Et).length;if(xe.indentation=ft,xe.indentationDiff=null,ft>0)return null}}return xe.f(Fe,xe)},innerMode:function(Fe){return Fe.block==Ve?{state:Fe.htmlState,mode:st}:Fe.localState?{state:Fe.localState,mode:Fe.localMode}:{state:Fe,mode:Ft}},indent:function(Fe,xe,ft){return Fe.block==Ve&&st.indent?st.indent(Fe.htmlState,xe,ft):Fe.localState&&Fe.localMode.indent?Fe.localMode.indent(Fe.localState,xe,ft):we.Pass},blankLine:We,getType:bt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ft},"xml"),we.defineMIME("text/markdown","markdown"),we.defineMIME("text/x-markdown","markdown")})},98101:function(mn,rn,he){(function(we){we(he(89780))})(function(we){"use strict";we.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ct=0;ct<we.modeInfo.length;ct++){var Re=we.modeInfo[ct];Re.mimes&&(Re.mime=Re.mimes[0])}we.findModeByMIME=function(st){st=st.toLowerCase();for(var Se=0;Se<we.modeInfo.length;Se++){var Be=we.modeInfo[Se];if(Be.mime==st)return Be;if(Be.mimes){for(var Oe=0;Oe<Be.mimes.length;Oe++)if(Be.mimes[Oe]==st)return Be}}if(/\+xml$/.test(st))return we.findModeByMIME("application/xml");if(/\+json$/.test(st))return we.findModeByMIME("application/json")},we.findModeByExtension=function(st){st=st.toLowerCase();for(var Se=0;Se<we.modeInfo.length;Se++){var Be=we.modeInfo[Se];if(Be.ext){for(var Oe=0;Oe<Be.ext.length;Oe++)if(Be.ext[Oe]==st)return Be}}},we.findModeByFileName=function(st){for(var Se=0;Se<we.modeInfo.length;Se++){var Be=we.modeInfo[Se];if(Be.file&&Be.file.test(st))return Be}var Oe=st.lastIndexOf("."),Ce=Oe>-1&&st.substring(Oe+1,st.length);if(Ce)return we.findModeByExtension(Ce)},we.findModeByName=function(st){st=st.toLowerCase();for(var Se=0;Se<we.modeInfo.length;Se++){var Be=we.modeInfo[Se];if(Be.name.toLowerCase()==st)return Be;if(Be.alias){for(var Oe=0;Oe<Be.alias.length;Oe++)if(Be.alias[Oe].toLowerCase()==st)return Be}}}})},67549:function(mn,rn,he){(function(we){we(he(89780))})(function(we){"use strict";we.defineMode("stex",function(ct,Re){"use strict";function st(mt,Ye){mt.cmdState.push(Ye)}function Se(mt){return mt.cmdState.length>0?mt.cmdState[mt.cmdState.length-1]:null}function Be(mt){var Ye=mt.cmdState.pop();Ye&&Ye.closeBracket()}function Oe(mt){for(var Ye=mt.cmdState,ot=Ye.length-1;ot>=0;ot--){var rt=Ye[ot];if(rt.name!="DEFAULT")return rt}return{styleIdentifier:function(){return null}}}function Ce(mt,Ye,ot){return function(){this.name=mt,this.bracketNo=0,this.style=Ye,this.styles=ot,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var Me={};Me.importmodule=Ce("importmodule","tag",["string","builtin"]),Me.documentclass=Ce("documentclass","tag",["","atom"]),Me.usepackage=Ce("usepackage","tag",["atom"]),Me.begin=Ce("begin","tag",["atom"]),Me.end=Ce("end","tag",["atom"]),Me.label=Ce("label","tag",["atom"]),Me.ref=Ce("ref","tag",["atom"]),Me.eqref=Ce("eqref","tag",["atom"]),Me.cite=Ce("cite","tag",["atom"]),Me.bibitem=Ce("bibitem","tag",["atom"]),Me.Bibitem=Ce("Bibitem","tag",["atom"]),Me.RBibitem=Ce("RBibitem","tag",["atom"]),Me.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Ne(mt,Ye){mt.f=Ye}function ht(mt,Ye){var ot;if(mt.match(/^\\[a-zA-Z@]+/)){var rt=mt.current().slice(1);return ot=Me.hasOwnProperty(rt)?Me[rt]:Me.DEFAULT,ot=new ot,st(Ye,ot),Ne(Ye,He),ot.style}if(mt.match(/^\\[$&%#{}_]/)||mt.match(/^\\[,;!\/\\]/))return"tag";if(mt.match("\\["))return Ne(Ye,function(Zt,Je){return Ie(Zt,Je,"\\]")}),"keyword";if(mt.match("\\("))return Ne(Ye,function(Zt,Je){return Ie(Zt,Je,"\\)")}),"keyword";if(mt.match("$$"))return Ne(Ye,function(Zt,Je){return Ie(Zt,Je,"$$")}),"keyword";if(mt.match("$"))return Ne(Ye,function(Zt,Je){return Ie(Zt,Je,"$")}),"keyword";var Et=mt.next();if(Et=="%")return mt.skipToEnd(),"comment";if(Et=="}"||Et=="]"){if(ot=Se(Ye),ot)ot.closeBracket(Et),Ne(Ye,He);else return"error";return"bracket"}else return Et=="{"||Et=="["?(ot=Me.DEFAULT,ot=new ot,st(Ye,ot),"bracket"):/\d/.test(Et)?(mt.eatWhile(/[\w.%]/),"atom"):(mt.eatWhile(/[\w\-_]/),ot=Oe(Ye),ot.name=="begin"&&(ot.argument=mt.current()),ot.styleIdentifier())}function Ie(mt,Ye,ot){if(mt.eatSpace())return null;if(ot&&mt.match(ot))return Ne(Ye,ht),"keyword";if(mt.match(/^\\[a-zA-Z@]+/))return"tag";if(mt.match(/^[a-zA-Z]+/))return"variable-2";if(mt.match(/^\\[$&%#{}_]/)||mt.match(/^\\[,;!\/]/)||mt.match(/^[\^_&]/))return"tag";if(mt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(mt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var rt=mt.next();return rt=="{"||rt=="}"||rt=="["||rt=="]"||rt=="("||rt==")"?"bracket":rt=="%"?(mt.skipToEnd(),"comment"):"error"}function He(mt,Ye){var ot=mt.peek(),rt;return ot=="{"||ot=="["?(rt=Se(Ye),rt.openBracket(ot),mt.eat(ot),Ne(Ye,ht),"bracket"):/[ \t\r]/.test(ot)?(mt.eat(ot),null):(Ne(Ye,ht),Be(Ye),ht(mt,Ye))}return{startState:function(){var mt=Re.inMathMode?function(Ye,ot){return Ie(Ye,ot)}:ht;return{cmdState:[],f:mt}},copyState:function(mt){return{cmdState:mt.cmdState.slice(),f:mt.f}},token:function(mt,Ye){return Ye.f(mt,Ye)},blankLine:function(mt){mt.f=ht,mt.cmdState.length=0},lineComment:"%"}}),we.defineMIME("text/x-stex","stex"),we.defineMIME("text/x-latex","stex")})},15525:function(mn,rn,he){(function(we){we(he(89780))})(function(we){"use strict";var ct={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},Re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};we.defineMode("xml",function(st,Se){var Be=st.indentUnit,Oe={},Ce=Se.htmlMode?ct:Re;for(var Me in Ce)Oe[Me]=Ce[Me];for(var Me in Se)Oe[Me]=Se[Me];var Ne,ht;function Ie(at,Ct){function qe(Vt){return Ct.tokenize=Vt,Vt(at,Ct)}var Nt=at.next();if(Nt=="<")return at.eat("!")?at.eat("[")?at.match("CDATA[")?qe(Ye("atom","]]>")):null:at.match("--")?qe(Ye("comment","-->")):at.match("DOCTYPE",!0,!0)?(at.eatWhile(/[\w\._\-]/),qe(ot(1))):null:at.eat("?")?(at.eatWhile(/[\w\._\-]/),Ct.tokenize=Ye("meta","?>"),"meta"):(Ne=at.eat("/")?"closeTag":"openTag",Ct.tokenize=He,"tag bracket");if(Nt=="&"){var Qt;return at.eat("#")?at.eat("x")?Qt=at.eatWhile(/[a-fA-F\d]/)&&at.eat(";"):Qt=at.eatWhile(/[\d]/)&&at.eat(";"):Qt=at.eatWhile(/[\w\.\-:]/)&&at.eat(";"),Qt?"atom":"error"}else return at.eatWhile(/[^&<]/),null}Ie.isInText=!0;function He(at,Ct){var qe=at.next();if(qe==">"||qe=="/"&&at.eat(">"))return Ct.tokenize=Ie,Ne=qe==">"?"endTag":"selfcloseTag","tag bracket";if(qe=="=")return Ne="equals",null;if(qe=="<"){Ct.tokenize=Ie,Ct.state=Je,Ct.tagName=Ct.tagStart=null;var Nt=Ct.tokenize(at,Ct);return Nt?Nt+" tag error":"tag error"}else return/[\'\"]/.test(qe)?(Ct.tokenize=mt(qe),Ct.stringStartCol=at.column(),Ct.tokenize(at,Ct)):(at.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function mt(at){var Ct=function(qe,Nt){for(;!qe.eol();)if(qe.next()==at){Nt.tokenize=He;break}return"string"};return Ct.isInAttribute=!0,Ct}function Ye(at,Ct){return function(qe,Nt){for(;!qe.eol();){if(qe.match(Ct)){Nt.tokenize=Ie;break}qe.next()}return at}}function ot(at){return function(Ct,qe){for(var Nt;(Nt=Ct.next())!=null;){if(Nt=="<")return qe.tokenize=ot(at+1),qe.tokenize(Ct,qe);if(Nt==">")if(at==1){qe.tokenize=Ie;break}else return qe.tokenize=ot(at-1),qe.tokenize(Ct,qe)}return"meta"}}function rt(at,Ct,qe){this.prev=at.context,this.tagName=Ct,this.indent=at.indented,this.startOfLine=qe,(Oe.doNotIndent.hasOwnProperty(Ct)||at.context&&at.context.noIndent)&&(this.noIndent=!0)}function Et(at){at.context&&(at.context=at.context.prev)}function Zt(at,Ct){for(var qe;;){if(!at.context||(qe=at.context.tagName,!Oe.contextGrabbers.hasOwnProperty(qe)||!Oe.contextGrabbers[qe].hasOwnProperty(Ct)))return;Et(at)}}function Je(at,Ct,qe){return at=="openTag"?(qe.tagStart=Ct.column(),lt):at=="closeTag"?We:Je}function lt(at,Ct,qe){return at=="word"?(qe.tagName=Ct.current(),ht="tag",Xe):Oe.allowMissingTagName&&at=="endTag"?(ht="tag bracket",Xe(at,Ct,qe)):(ht="error",lt)}function We(at,Ct,qe){if(at=="word"){var Nt=Ct.current();return qe.context&&qe.context.tagName!=Nt&&Oe.implicitlyClosed.hasOwnProperty(qe.context.tagName)&&Et(qe),qe.context&&qe.context.tagName==Nt||Oe.matchClosing===!1?(ht="tag",Ee):(ht="tag error",Ve)}else return Oe.allowMissingTagName&&at=="endTag"?(ht="tag bracket",Ee(at,Ct,qe)):(ht="error",Ve)}function Ee(at,Ct,qe){return at!="endTag"?(ht="error",Ee):(Et(qe),Je)}function Ve(at,Ct,qe){return ht="error",Ee(at,Ct,qe)}function Xe(at,Ct,qe){if(at=="word")return ht="attribute",bt;if(at=="endTag"||at=="selfcloseTag"){var Nt=qe.tagName,Qt=qe.tagStart;return qe.tagName=qe.tagStart=null,at=="selfcloseTag"||Oe.autoSelfClosers.hasOwnProperty(Nt)?Zt(qe,Nt):(Zt(qe,Nt),qe.context=new rt(qe,Nt,Qt==qe.indented)),Je}return ht="error",Xe}function bt(at,Ct,qe){return at=="equals"?je:(Oe.allowMissing||(ht="error"),Xe(at,Ct,qe))}function je(at,Ct,qe){return at=="string"?It:at=="word"&&Oe.allowUnquoted?(ht="string",Xe):(ht="error",Xe(at,Ct,qe))}function It(at,Ct,qe){return at=="string"?It:Xe(at,Ct,qe)}return{startState:function(at){var Ct={tokenize:Ie,state:Je,indented:at||0,tagName:null,tagStart:null,context:null};return at!=null&&(Ct.baseIndent=at),Ct},token:function(at,Ct){if(!Ct.tagName&&at.sol()&&(Ct.indented=at.indentation()),at.eatSpace())return null;Ne=null;var qe=Ct.tokenize(at,Ct);return(qe||Ne)&&qe!="comment"&&(ht=null,Ct.state=Ct.state(Ne||qe,at,Ct),ht&&(qe=ht=="error"?qe+" error":ht)),qe},indent:function(at,Ct,qe){var Nt=at.context;if(at.tokenize.isInAttribute)return at.tagStart==at.indented?at.stringStartCol+1:at.indented+Be;if(Nt&&Nt.noIndent)return we.Pass;if(at.tokenize!=He&&at.tokenize!=Ie)return qe?qe.match(/^(\s*)/)[0].length:0;if(at.tagName)return Oe.multilineTagIndentPastTag!==!1?at.tagStart+at.tagName.length+2:at.tagStart+Be*(Oe.multilineTagIndentFactor||1);if(Oe.alignCDATA&&/<!\[CDATA\[/.test(Ct))return 0;var Qt=Ct&&/^<(\/)?([\w_:\.-]*)/.exec(Ct);if(Qt&&Qt[1])for(;Nt;)if(Nt.tagName==Qt[2]){Nt=Nt.prev;break}else if(Oe.implicitlyClosed.hasOwnProperty(Nt.tagName))Nt=Nt.prev;else break;else if(Qt)for(;Nt;){var Vt=Oe.contextGrabbers[Nt.tagName];if(Vt&&Vt.hasOwnProperty(Qt[2]))Nt=Nt.prev;else break}for(;Nt&&Nt.prev&&!Nt.startOfLine;)Nt=Nt.prev;return Nt?Nt.indent+Be:at.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Oe.htmlMode?"html":"xml",helperType:Oe.htmlMode?"html":"xml",skipAttribute:function(at){at.state==je&&(at.state=Xe)},xmlCurrentTag:function(at){return at.tagName?{name:at.tagName,close:at.type=="closeTag"}:null},xmlCurrentContext:function(at){for(var Ct=[],qe=at.context;qe;qe=qe.prev)qe.tagName&&Ct.push(qe.tagName);return Ct.reverse()}}}),we.defineMIME("text/xml","xml"),we.defineMIME("application/xml","xml"),we.mimeModes.hasOwnProperty("text/html")||we.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(mn,rn,he){"use strict";he.d(rn,{hP:function(){return Tt}});var we=function(ge,se){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,fe){oe.__proto__=fe}||function(oe,fe){for(var ve in fe)Object.prototype.hasOwnProperty.call(fe,ve)&&(oe[ve]=fe[ve])})(ge,se)};function ct(ge,se){function oe(){this.constructor=ge}we(ge,se),ge.prototype=se===null?Object.create(se):(oe.prototype=se.prototype,new oe)}function Re(ge,se,oe,fe){return new(oe||(oe=Promise))(function(ve,ce){function $e(Ht){try{Ut(fe.next(Ht))}catch(Jt){ce(Jt)}}function xt(Ht){try{Ut(fe.throw(Ht))}catch(Jt){ce(Jt)}}function Ut(Ht){var Jt;Ht.done?ve(Ht.value):(Jt=Ht.value,Jt instanceof oe?Jt:new oe(function(en){en(Jt)})).then($e,xt)}Ut((fe=fe.apply(ge,se||[])).next())})}function st(ge,se){var oe,fe,ve,ce,$e={label:0,sent:function(){if(1&ve[0])throw ve[1];return ve[1]},trys:[],ops:[]};return ce={next:xt(0),throw:xt(1),return:xt(2)},typeof Symbol=="function"&&(ce[Symbol.iterator]=function(){return this}),ce;function xt(Ut){return function(Ht){return function(Jt){if(oe)throw new TypeError("Generator is already executing.");for(;$e;)try{if(oe=1,fe&&(ve=2&Jt[0]?fe.return:Jt[0]?fe.throw||((ve=fe.return)&&ve.call(fe),0):fe.next)&&!(ve=ve.call(fe,Jt[1])).done)return ve;switch(fe=0,ve&&(Jt=[2&Jt[0],ve.value]),Jt[0]){case 0:case 1:ve=Jt;break;case 4:return $e.label++,{value:Jt[1],done:!1};case 5:$e.label++,fe=Jt[1],Jt=[0];continue;case 7:Jt=$e.ops.pop(),$e.trys.pop();continue;default:if(ve=$e.trys,!((ve=ve.length>0&&ve[ve.length-1])||Jt[0]!==6&&Jt[0]!==2)){$e=0;continue}if(Jt[0]===3&&(!ve||Jt[1]>ve[0]&&Jt[1]<ve[3])){$e.label=Jt[1];break}if(Jt[0]===6&&$e.label<ve[1]){$e.label=ve[1],ve=Jt;break}if(ve&&$e.label<ve[2]){$e.label=ve[2],$e.ops.push(Jt);break}ve[2]&&$e.ops.pop(),$e.trys.pop();continue}Jt=se.call(ge,$e)}catch(en){Jt=[6,en],fe=0}finally{oe=ve=0}if(5&Jt[0])throw Jt[1];return{value:Jt[0]?Jt[1]:void 0,done:!0}}([Ut,Ht])}}}function Se(){for(var ge=0,se=0,oe=arguments.length;se<oe;se++)ge+=arguments[se].length;var fe=Array(ge),ve=0;for(se=0;se<oe;se++)for(var ce=arguments[se],$e=0,xt=ce.length;$e<xt;$e++,ve++)fe[ve]=ce[$e];return fe}var Be=function(){function ge(){}return ge.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ge.setAttributes=function(se,oe){for(var fe=0,ve=oe;fe<ve.length;fe++){var ce=ve[fe],$e=ce[0],xt=ce[1];se.setAttribute($e,xt)}},ge.createRect=function(se,oe,fe){var ve=document.createElementNS("http://www.w3.org/2000/svg","rect");return ve.setAttribute("width",se.toString()),ve.setAttribute("height",oe.toString()),fe&&ge.setAttributes(ve,fe),ve},ge.createLine=function(se,oe,fe,ve,ce){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",se.toString()),$e.setAttribute("y1",oe.toString()),$e.setAttribute("x2",fe.toString()),$e.setAttribute("y2",ve.toString()),ce&&ge.setAttributes($e,ce),$e},ge.createPolygon=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","polygon");return fe.setAttribute("points",se),oe&&ge.setAttributes(fe,oe),fe},ge.createCircle=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","circle");return fe.setAttribute("cx",(se/2).toString()),fe.setAttribute("cy",(se/2).toString()),fe.setAttribute("r",se.toString()),oe&&ge.setAttributes(fe,oe),fe},ge.createEllipse=function(se,oe,fe){var ve=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ve.setAttribute("cx",(se/2).toString()),ve.setAttribute("cy",(oe/2).toString()),ve.setAttribute("rx",(se/2).toString()),ve.setAttribute("ry",(oe/2).toString()),fe&&ge.setAttributes(ve,fe),ve},ge.createGroup=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return se&&ge.setAttributes(oe,se),oe},ge.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ge.createMarker=function(se,oe,fe,ve,ce,$e,xt){var Ut=document.createElementNS("http://www.w3.org/2000/svg","marker");return ge.setAttributes(Ut,[["id",se],["orient",oe],["markerWidth",fe.toString()],["markerHeight",ve.toString()],["refX",ce.toString()],["refY",$e.toString()]]),Ut.appendChild(xt),Ut},ge.createText=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),se&&ge.setAttributes(oe,se),oe},ge.createTSpan=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","tspan");return fe.textContent=se,oe&&ge.setAttributes(fe,oe),fe},ge.createImage=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return se&&ge.setAttributes(oe,se),oe},ge.createPoint=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return fe.x=se,fe.y=oe,fe},ge.createPath=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","path");return fe.setAttribute("d",se),oe&&ge.setAttributes(fe,oe),fe},ge}(),Oe=function(){function ge(){}return ge.addKey=function(se){ge.key=se},Object.defineProperty(ge,"isLicensed",{get:function(){return!!ge.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ge.key)},enumerable:!1,configurable:!0}),ge}(),Ce=function(){function ge(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ge.prototype.rasterize=function(se,oe,fe){var ve=this;return new Promise(function(ce){var $e=fe!==void 0?fe:document.createElement("canvas");se===null&&(ve.markersOnly=!0,ve.naturalSize=!1);var xt=document.createElementNS("http://www.w3.org/2000/svg","svg");xt.setAttribute("xmlns","http://www.w3.org/2000/svg"),xt.setAttribute("width",oe.width.baseVal.valueAsString),xt.setAttribute("height",oe.height.baseVal.valueAsString),xt.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),xt.innerHTML=oe.innerHTML,ve.naturalSize===!0?(xt.width.baseVal.value=se.naturalWidth,xt.height.baseVal.value=se.naturalHeight):ve.width!==void 0&&ve.height!==void 0&&(xt.width.baseVal.value=ve.width,xt.height.baseVal.value=ve.height),$e.width=xt.width.baseVal.value,$e.height=xt.height.baseVal.value;var Ut=xt.outerHTML,Ht=$e.getContext("2d");ve.markersOnly!==!0&&Ht.drawImage(se,0,0,$e.width,$e.height);var Jt=window.URL,en=new Image($e.width,$e.height);en.setAttribute("crossOrigin","anonymous");var hn=new Blob([Ut],{type:"image/svg+xml"}),pn=Jt.createObjectURL(hn);en.onload=function(){Ht.drawImage(en,0,0),Jt.revokeObjectURL(pn);var bn=$e.toDataURL(ve.imageType,ve.imageQuality);ce(bn)},en.src=pn})},ge}(),Me=function(){},Ne=function(){function ge(se){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+se+"_"}return Object.defineProperty(ge.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ge.prototype.addClass=function(se){return this.styleSheet===void 0&&this.addStyleSheet(),se.name=""+this.classNamePrefix+se.localName,this.classes.push(se),this.styleSheet.sheet.insertRule("."+se.name+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length),se},ge.prototype.addRule=function(se){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(se),this.styleSheet.sheet.insertRule(se.selector+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length)},ge.prototype.addStyleSheet=function(){var se;this.styleSheet=document.createElement("style"),((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).appendChild(this.styleSheet),this.addRule(new ht("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ht("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ht("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ie("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ie("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ge.prototype.removeStyleSheet=function(){var se;this.styleSheet&&(((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ge}(),ht=function(ge,se){this.selector=ge,this.style=se},Ie=function(ge,se){this.localName=ge,this.style=se},He=function(){function ge(se,oe,fe,ve,ce){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=se,this.displayMode=oe,this.markerItems=fe,this.uiStyleSettings=ve,this.styles=ce,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ge.prototype.show=function(se){var oe=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",this.uiContainer.appendChild(fe),this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(ce){var $e=document.createElement("div");$e.className=""+oe.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",ce.typeName),$e.innerHTML=ce.icon,$e.addEventListener("click",function(){oe.markerToolbarButtonClicked($e,ce)}),oe.buttons.push($e),oe.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ve=document.createElement("div");ve.className=this.toolbarBlockStyleClass.name,ve.style.whiteSpace="nowrap",ve.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ve),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ge.prototype.addButtonClickListener=function(se){this.buttonClickListeners.push(se)},ge.prototype.removeButtonClickListener=function(se){this.buttonClickListeners.indexOf(se)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(se),1)},ge.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ge.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var se=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var oe=0;oe<this.markerButtons.length;oe++)oe<se||oe===se&&this.markerButtons.length-1===se?this.markerButtonBlock.appendChild(this.markerButtons[oe]):(oe===se&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[oe]))}},ge.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ge.prototype.resetButtonStyles=function(){var se=this;this.buttons.forEach(function(oe){oe.className=oe.className.replace(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name,"").trim(),oe.className=oe.className.replace(se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:se.toolbarActiveButtonStyleColorsClass.name,"").trim(),oe.className+=" "+(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name)})},ge.prototype.addActionButton=function(se,oe,fe){var ve=this,ce=document.createElement("div");switch(ce.className=""+this.toolbarButtonStyleClass.name,ce.innerHTML=oe,ce.setAttribute("data-action",fe),ce.addEventListener("click",function(){ve.actionToolbarButtonClicked(ce,fe)}),fe){case"select":ce.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ce.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ce.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ce.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ce.style.fill=this.uiStyleSettings.closeButtonColor}se.appendChild(ce),this.buttons.push(ce)},ge.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ie("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ie("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ie("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ie("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Ie("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ie("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
padding: `+se+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ht("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ht("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ge.prototype.markerToolbarButtonClicked=function(se,oe){this.setActiveButton(se),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(fe){return fe("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},ge.prototype.actionToolbarButtonClicked=function(se,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(fe){return fe("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ge.prototype.setActiveButton=function(se){this.resetButtonStyles(),se.className=se.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),se.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ge.prototype.setActiveMarkerButton=function(se){var oe=this.markerButtons.find(function(fe){return fe.getAttribute("data-type-name")===se});oe&&this.setActiveButton(oe)},ge.prototype.setCurrentMarker=function(se){var oe=this;this.currentMarker=se,this.buttons.filter(function(fe){return/delete|notes/.test(fe.getAttribute("data-action"))}).forEach(function(fe){oe.currentMarker===void 0?(fe.style.fillOpacity="0.4",fe.style.pointerEvents="none"):(fe.style.fillOpacity="1",fe.style.pointerEvents="all")})},ge}(),mt=function(){function ge(se,oe,fe,ve){this.panels=[],this.panelButtons=[],this.markerjsContainer=se,this.displayMode=oe,this.uiStyleSettings=fe,this.styles=ve,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ge.prototype.addStyles=function(){var se;this.toolboxStyleClass=this.styles.addClass(new Ie("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ie("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ie("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ie("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ie("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ie("toolbox-panel-row_colors",`
background-color: `+((se=this.uiStyleSettings.toolboxBackgroundColor)!==null&&se!==void 0?se:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ie("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
padding: `+oe+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ht("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ht("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ge.prototype.show=function(se){var oe;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolboxStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ge.prototype.setPanelButtons=function(se){var oe,fe,ve=this;this.panels=se,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((fe=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&fe!==void 0?fe:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ce){var $e;ce.uiStyleSettings=ve.uiStyleSettings;var xt=document.createElement("div");xt.className=ve.toolboxButtonStyleClass.name+" "+(($e=ve.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:ve.toolboxButtonStyleColorsClass.name),xt.innerHTML=ce.icon,xt.title=ce.title,xt.addEventListener("click",function(){ve.panelButtonClick(ce)}),ve.panelButtons.push(xt),ve.buttonRow.appendChild(xt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ge.prototype.panelButtonClick=function(se){var oe=this,fe=-1;if(se!==this.activePanel){fe=this.panels.indexOf(se),this.panelRow.innerHTML="";var ve=se.getUi();ve.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ve),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=se}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){oe.displayMode==="inline"?oe.panelRow.style.display="none":oe.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ce,$e){var xt,Ut;ce.className=oe.toolboxButtonStyleClass.name+" "+($e===fe?""+((xt=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xt!==void 0?xt:oe.toolboxActiveButtonStyleColorsClass.name):""+((Ut=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ut!==void 0?Ut:oe.toolboxButtonStyleColorsClass.name))})},ge}(),Ye=function(ge,se){this.title=ge,this.icon=se},ot=function(ge){function se(oe,fe,ve,ce){var $e=ge.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=fe,$e.currentColor=ve,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.overflow="hidden",fe.style.whiteSpace="nowrap",this.colors.forEach(function(ve){var ce=oe.getColorBox(ve);fe.appendChild(ce),oe.colorBoxes.push(ce)}),fe},se.prototype.getColorBox=function(oe){var fe=this,ve=this.uiStyleSettings.toolbarHeight/4,ce=this.uiStyleSettings.toolbarHeight-ve,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=ce-2+"px",$e.style.height=ce-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(ce+2)/2+"px",$e.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){fe.setCurrentColor(oe,$e)});var xt=document.createElement("div");return xt.style.display="inline-block",xt.style.width=ce-2+"px",xt.style.height=ce-2+"px",xt.style.backgroundColor=oe,xt.style.borderRadius=ce/2+"px",oe==="transparent"&&(xt.style.fill=this.uiStyleSettings.toolboxAccentColor,xt.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),$e.appendChild(xt),$e},se.prototype.setCurrentColor=function(oe,fe){var ve=this;this.currentColor=oe,this.colorBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},se}(Ye),rt=function(){function ge(se,oe,fe){this._state="new",this._isSelected=!1,this._container=se,this._overlayContainer=oe,this.globalSettings=fe,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ge.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ge.prototype.ownsTarget=function(se){return!1},Object.defineProperty(ge.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ge.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ge.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ge.prototype.pointerDown=function(se,oe){},ge.prototype.dblClick=function(se,oe){},ge.prototype.manipulate=function(se){},ge.prototype.pointerUp=function(se){this.stateChanged()},ge.prototype.dispose=function(){},ge.prototype.addMarkerVisualToContainer=function(se){this.container.childNodes.length>0?this.container.insertBefore(se,this.container.childNodes[0]):this.container.appendChild(se)},ge.prototype.getState=function(){return{typeName:ge.typeName,state:this.state,notes:this.notes}},ge.prototype.restoreState=function(se){this._state=se.state,this.notes=se.notes},ge.prototype.scale=function(se,oe){},ge.prototype.colorChanged=function(se){this.onColorChanged&&this.onColorChanged(se),this.stateChanged()},ge.prototype.fillColorChanged=function(se){this.onFillColorChanged&&this.onFillColorChanged(se),this.stateChanged()},ge.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var se=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),se.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(se)&&this.onStateChanged(this)}},ge.typeName="MarkerBase",ge}(),Et=function(){function ge(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ge.prototype.findGripByVisual=function(se){return this.topLeft.ownsTarget(se)?this.topLeft:this.topCenter.ownsTarget(se)?this.topCenter:this.topRight.ownsTarget(se)?this.topRight:this.centerLeft.ownsTarget(se)?this.centerLeft:this.centerRight.ownsTarget(se)?this.centerRight:this.bottomLeft.ownsTarget(se)?this.bottomLeft:this.bottomCenter.ownsTarget(se)?this.bottomCenter:this.bottomRight.ownsTarget(se)?this.bottomRight:void 0},ge}(),Zt=function(){function ge(){this.GRIP_SIZE=10,this.visual=Be.createGroup(),this.visual.appendChild(Be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Be.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ge.prototype.ownsTarget=function(se){return se===this.visual||se===this.visual.childNodes[0]||se===this.visual.childNodes[1]},ge}(),Je=function(){function ge(){}return ge.toITransformMatrix=function(se){return{a:se.a,b:se.b,c:se.c,d:se.d,e:se.e,f:se.f}},ge.toSVGMatrix=function(se,oe){return se.a=oe.a,se.b=oe.b,se.c=oe.c,se.d=oe.d,se.e=oe.e,se.f=oe.f,se},ge}(),lt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.left=0,ce.top=0,ce.width=0,ce.height=0,ce.defaultSize={x:50,y:20},ce.offsetX=0,ce.offsetY=0,ce.rotationAngle=0,ce.CB_DISTANCE=10,ce._suppressMarkerCreateEvent=!1,ce.container.transform.baseVal.appendItem(Be.createTransform()),ce.setupControlBox(),ce}return ct(se,ge),Object.defineProperty(se.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"visual",{get:function(){return this._visual},set:function(oe){this._visual=oe;var fe=Be.createTransform();this._visual.transform.baseVal.appendItem(fe)},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!!ge.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.left=oe.x,this.top=oe.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ve=this.unrotatePoint(oe);if(this.manipulationStartX=ve.x,this.manipulationStartY=ve.y,this.offsetX=ve.x-this.left,this.offsetY=ve.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(fe),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(fe)){this.activeGrip=this.rotatorGrip;var ce=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ce.x-this.width/2,this.top=ce.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},se.prototype.pointerUp=function(oe){var fe=this.state;ge.prototype.pointerUp.call(this,oe),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(oe),this._state="select",fe==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},se.prototype.moveVisual=function(oe){this.visual.style.transform="translate("+oe.x+"px, "+oe.y+"px)"},se.prototype.manipulate=function(oe){var fe=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(fe.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(fe.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(fe):this.state==="rotate"&&this.rotate(oe)},se.prototype.resize=function(oe){var fe=this.manipulationStartLeft,ve=this.manipulationStartWidth,ce=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:fe=this.manipulationStartLeft+oe.x-this.manipulationStartX,ve=this.manipulationStartWidth+this.manipulationStartLeft-fe;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ve=this.manipulationStartWidth+oe.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ce=this.manipulationStartTop+oe.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-ce;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+oe.y-this.manipulationStartY}ve>=0?(this.left=fe,this.width=ve):(this.left=fe+ve,this.width=-ve),$e>=0?(this.top=ce,this.height=$e):(this.top=ce+$e,this.height=-$e),this.setSize()},se.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},se.prototype.rotate=function(oe){if(Math.abs(oe.x-this.centerX)>.1){var fe=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*fe,this.applyRotation()}},se.prototype.applyRotation=function(){var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0)},se.prototype.rotatePoint=function(oe){if(this.rotationAngle===0)return oe;var fe=this.container.getCTM(),ve=Be.createPoint(oe.x,oe.y);return{x:(ve=ve.matrixTransform(fe)).x,y:ve.y}},se.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var fe=this.container.getCTM();fe=fe.inverse();var ve=Be.createPoint(oe.x,oe.y);return{x:(ve=ve.matrixTransform(fe)).x,y:ve.y}},se.prototype.select=function(){ge.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ge.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Be.createGroup();var oe=Be.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=Be.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Be.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Et,this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){var oe=this.controlBox.transform.baseVal.getItem(0);oe.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(oe,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},se.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},se.prototype.createGrip=function(){var oe=new Zt;return oe.visual.transform.baseVal.appendItem(Be.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,fe=-oe/2,ve=fe,ce=(this.width+this.CB_DISTANCE)/2-oe/2,$e=(this.height+this.CB_DISTANCE)/2-oe/2,xt=this.height+this.CB_DISTANCE-oe/2,Ut=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,fe,ve),this.positionGrip(this.controlGrips.topCenter.visual,ce,ve),this.positionGrip(this.controlGrips.topRight.visual,Ut,ve),this.positionGrip(this.controlGrips.centerLeft.visual,fe,$e),this.positionGrip(this.controlGrips.centerRight.visual,Ut,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,fe,xt),this.positionGrip(this.controlGrips.bottomCenter.visual,ce,xt),this.positionGrip(this.controlGrips.bottomRight.visual,Ut,xt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ce,ve-3*this.CB_DISTANCE)},se.prototype.positionGrip=function(oe,fe,ve){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(fe,ve),oe.transform.baseVal.replaceItem(ce,0)},se.prototype.hideControlBox=function(){this.controlBox.style.display="none"},se.prototype.showControlBox=function(){this.controlBox.style.display=""},se.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ge.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe);var fe=oe;this.left=fe.left,this.top=fe.top,this.width=fe.width,this.height=fe.height,this.rotationAngle=fe.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,fe.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,fe.containerTransformMatrix))},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe);var ve=this.rotatePoint({x:this.left,y:this.top}),ce=this.unrotatePoint({x:ve.x*oe,y:ve.y*fe});this.left=ce.x,this.top=ce.y,this.width=this.width*oe,this.height=this.height*fe,this.adjustControlBox()},se}(rt),We=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.opacity=1,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Be.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){ge.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Be.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ge.prototype.getState.call(this))},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.opacity=fe.opacity,this.createVisual(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.setSize()},se.title="Rectangle marker",se}(lt),Ee=function(ge){function se(oe,fe,ve,ce){var $e=ge.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=fe,$e.currentWidth=ve,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",this.widths.forEach(function(ve){var ce=document.createElement("div");ce.style.display="flex",ce.style.flexGrow="2",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderColor=ve===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentWidth(ve,ce)}),fe.appendChild(ce);var $e=document.createElement("div");$e.innerText=ve.toString(),$e.style.marginRight="5px",ce.appendChild($e);var xt=document.createElement("div");xt.style.minHeight="20px",xt.style.flexGrow="2",xt.style.display="flex",xt.style.alignItems="center";var Ut=document.createElement("hr");Ut.style.minWidth="20px",Ut.style.border="0px",Ut.style.borderTop=ve+"px solid "+oe.uiStyleSettings.toolboxColor,Ut.style.flexGrow="2",xt.appendChild(Ut),ce.appendChild(xt),oe.widthBoxes.push(ce)}),fe},se.prototype.setCurrentWidth=function(oe,fe){var ve=this;this.currentWidth=oe,this.widthBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},se}(Ye),Ve=function(ge){function se(oe,fe,ve,ce){var $e=ge.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=fe,$e.currentStyle=ve,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",this.styles.forEach(function(ve){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.overflow="hidden",ce.style.maxWidth=100/oe.styles.length-5+"%",ce.style.borderColor=ve===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentStyle(ve,ce)}),fe.appendChild(ce);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var xt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ve!==""?'stroke-dasharray="'+ve+'"':"")+` />
</svg>`;$e.innerHTML=xt,ce.appendChild($e),oe.styleBoxes.push(ce)}),fe},se.prototype.setCurrentStyle=function(oe,fe){var ve=this;this.currentStyle=oe,this.styleBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},se}(Ye),Xe=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.strokeColor=ve.defaultColor,ce.strokeWidth=ve.defaultStrokeWidth,ce.strokeDasharray=ve.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",ve.defaultColorSet,ve.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ct(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="FrameMarker",se.title="Frame marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',se}(We),bt=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},je=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.x1=0,ce.y1=0,ce.x2=0,ce.y2=0,ce.defaultLength=50,ce.manipulationStartX=0,ce.manipulationStartY=0,ce.manipulationStartX1=0,ce.manipulationStartY1=0,ce.manipulationStartX2=0,ce.manipulationStartY2=0,ce.setupControlBox(),ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!!ge.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.state==="new"&&(this.x1=oe.x,this.y1=oe.y,this.x2=oe.x,this.y2=oe.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(fe)?this.activeGrip=this.grip1:this.grip2.ownsTarget(fe)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},se.prototype.pointerUp=function(oe){var fe=this.state;ge.prototype.pointerUp.call(this,oe),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(oe),this._state="select",fe==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},se.prototype.adjustVisual=function(){},se.prototype.manipulate=function(oe){this.state==="creating"?this.resize(oe):this.state==="move"?(this.x1=this.manipulationStartX1+oe.x-this.manipulationStartX,this.y1=this.manipulationStartY1+oe.y-this.manipulationStartY,this.x2=this.manipulationStartX2+oe.x-this.manipulationStartX,this.y2=this.manipulationStartY2+oe.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(oe)},se.prototype.resize=function(oe){switch(this.activeGrip){case this.grip1:this.x1=oe.x,this.y1=oe.y;break;case this.grip2:case void 0:this.x2=oe.x,this.y2=oe.y}this.adjustVisual(),this.adjustControlBox()},se.prototype.select=function(){ge.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ge.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Be.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){this.positionGrips()},se.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},se.prototype.createGrip=function(){var oe=new Zt;return oe.visual.transform.baseVal.appendItem(Be.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-oe/2,this.y1-oe/2),this.positionGrip(this.grip2.visual,this.x2-oe/2,this.y2-oe/2)},se.prototype.positionGrip=function(oe,fe,ve){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(fe,ve),oe.transform.baseVal.replaceItem(ce,0)},se.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ge.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe);var fe=oe;this.x1=fe.x1,this.y1=fe.y1,this.x2=fe.x2,this.y2=fe.y2},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.x1=this.x1*oe,this.y1=this.y1*fe,this.x2=this.x2*oe,this.y2=this.y2*fe,this.adjustVisual(),this.adjustControlBox()},se}(rt),It=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.strokeColor=ve.defaultColor,ce.strokeWidth=ve.defaultStrokeWidth,ce.strokeDasharray=ve.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",ve.defaultColorSet,ve.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},se.prototype.createVisual=function(){this.visual=Be.createGroup(),this.selectorLine=Be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},se.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Be.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Be.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Be.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe);var fe=oe;this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.createVisual(),this.adjustVisual()},se.typeName="LineMarker",se.title="Line marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',se}(je),at=function(ge){function se(oe,fe,ve,ce){var $e=ge.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=fe,$e.currentFont=ve,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.overflow="hidden",fe.style.flexGrow="2",this.fonts.forEach(function(ve){var ce=document.createElement("div");ce.style.display="inline-block",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.overflow="hidden",ce.style.maxWidth=100/oe.fonts.length-5+"%",ce.style.borderColor=ve===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentFont(ve,ce)}),fe.appendChild(ce);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=ve,$e.style.overflow="hidden";var xt=document.createElement("div");xt.style.whiteSpace="nowrap",xt.style.overflow="hidden",xt.style.textOverflow="ellipsis",xt.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(xt),ce.appendChild($e),oe.fontBoxes.push(ce)}),fe},se.prototype.setCurrentFont=function(oe,fe){var ve=this;this.currentFont=oe,this.fontBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},se}(Ye),Ct=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.color="transparent",ce.padding=5,ce.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",ce.text=ce.DEFAULT_TEXT,ce.isMoved=!1,ce.color=ve.defaultColor,ce.fontFamily=ve.defaultFontFamily,ce.defaultSize={x:100,y:30},ce.setColor=ce.setColor.bind(ce),ce.setFont=ce.setFont.bind(ce),ce.renderText=ce.renderText.bind(ce),ce.sizeText=ce.sizeText.bind(ce),ce.textEditDivClicked=ce.textEditDivClicked.bind(ce),ce.showTextEditor=ce.showTextEditor.bind(ce),ce.setSize=ce.setSize.bind(ce),ce.positionTextEditor=ce.positionTextEditor.bind(ce),ce.colorPanel=new ot("Color",ve.defaultColorSet,ve.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.fontFamilyPanel=new at("Font",ve.defaultFontFamilies,ve.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){if(ge.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var fe=!1;return this.textElement.childNodes.forEach(function(ve){ve===oe&&(fe=!0)}),fe},se.prototype.createVisual=function(){this.visual=Be.createGroup(),this.bgRectangle=Be.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Be.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Be.createTransform()),this.textElement.transform.baseVal.appendItem(Be.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.renderText=function(){var oe=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(fe){oe.textElement.appendChild(Be.createTSpan(fe.trim()===""?" ":fe.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},se.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),fe=1;if(oe.width>0&&oe.height>0){var ve=(1*this.width-this.width*this.padding*2/100)/oe.width,ce=(1*this.height-this.height*this.padding*2/100)/oe.height;fe=Math.min(ve,ce)}return fe},se.prototype.getTextPosition=function(oe){var fe=this.textElement.getBBox(),ve=0,ce=0;return fe.width>0&&fe.height>0&&(ve=(this.width-fe.width*oe)/2,ce=this.height/2-fe.height*oe/2),{x:ve,y:ce}},se.prototype.sizeText=function(){var oe=this.textElement.getBBox(),fe=this.getTextScale(),ve=this.getTextPosition(fe);ve.y-=oe.y*fe,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ve.x+"px, "+ve.y+"px) scale("+fe+", "+fe+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ve.x,ve.y),this.textElement.transform.baseVal.getItem(1).setScale(fe,fe))},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Be.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},se.prototype.pointerUp=function(oe){var fe=this.state;fe==="creating"&&(this._suppressMarkerCreateEvent=!0),ge.prototype.pointerUp.call(this,oe),this.setSize(),(fe==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.showTextEditor=function(){var oe=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(fe){fe.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var fe=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&fe>.9;)fe-=.1,oe.textEditor.style.fontSize=Math.max(fe,.9)+"em"}),this.textEditor.addEventListener("keyup",function(fe){fe.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(fe){if(fe.clipboardData){var ve=fe.clipboardData.getData("text"),ce=window.getSelection();if(!ce.rangeCount)return!1;ce.deleteFromDocument(),ce.getRangeAt(0).insertNode(document.createTextNode(ve)),fe.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){oe.textEditDivClicked(oe.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},se.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var oe=this.getTextScale(),fe=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ve=this.textElement.getBBox(),ce={x:ve.width*oe,y:ve.height*oe};fe.x-=ce.x/2,fe.y-=ce.y/2,this.textEditor.style.top=fe.y+"px",this.textEditor.style.left=fe.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-fe.x+"px",this.textEditor.style.fontSize=Math.max(16*oe,12)+"px",this.textElement.style.display="none"}},se.prototype.textEditDivClicked=function(oe){this.text=oe.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},se.prototype.select=function(){ge.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},se.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ge.prototype.deselect.call(this)},se.prototype.dblClick=function(oe,fe){ge.prototype.dblClick.call(this,oe,fe),this.showTextEditor()},se.prototype.setColor=function(oe){this.textElement&&Be.setAttributes(this.textElement,[["fill",oe]]),this.color=oe,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(oe)},se.prototype.setFont=function(oe){this.textElement&&Be.setAttributes(this.textElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},se.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},se.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.color=fe.color,this.fontFamily=fe.fontFamily,this.padding=fe.padding,this.text=fe.text,this.createVisual(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.setSize(),this.sizeText(),this.positionTextEditor()},se.typeName="TextMarker",se.title="Text marker",se.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',se}(lt),qe=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.color="transparent",ce.lineWidth=3,ce.drawing=!1,ce.pixelRatio=1,ce.color=ve.defaultColor,ce.lineWidth=ve.defaultStrokeWidth,ce.pixelRatio=ve.freehandPixelRatio,ce.setColor=ce.setColor.bind(ce),ce.addCanvas=ce.addCanvas.bind(ce),ce.finishCreation=ce.finishCreation.bind(ce),ce.setLineWidth=ce.setLineWidth.bind(ce),ce.colorPanel=new ot("Color",ve.defaultColorSet,ve.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.lineWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.lineWidthPanel.onWidthChanged=ce.setLineWidth,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},se.prototype.createVisual=function(){this.visual=Be.createGroup(),this.drawingImage=Be.createImage(),this.visual.appendChild(this.drawingImage);var oe=Be.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(oe.x,oe.y),this.drawing=!0):ge.prototype.pointerDown.call(this,oe,fe)},se.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),Be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ge.prototype.pointerUp.call(this,oe)},se.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},se.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ge.prototype.select.call(this)},se.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ge.prototype.deselect.call(this)},se.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),fe=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ve=fe[0],ce=fe[1],$e=fe[2],xt=fe[3],Ut=!1,Ht=0;Ht<this.canvasElement.height;Ht++)for(var Jt=0;Jt<this.canvasElement.width;Jt++)oe.data[Ht*this.canvasElement.width*4+4*Jt+3]>0&&(Ut=!0,Ht<ce&&(ce=Ht),Jt<ve&&(ve=Jt),Ht>xt&&(xt=Ht),Jt>$e&&($e=Jt));if(Ut){this.left=ve/this.pixelRatio,this.top=ce/this.pixelRatio,this.width=($e-ve)/this.pixelRatio,this.height=(xt-ce)/this.pixelRatio;var en=document.createElement("canvas");en.width=$e-ve,en.height=xt-ce,en.getContext("2d").putImageData(this.canvasContext.getImageData(ve,ce,$e-ve,xt-ce),0,0),this.drawingImgUrl=en.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},se.prototype.setDrawingImage=function(){Be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Be.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},se.prototype.setColor=function(oe){this.color=oe,this.colorChanged(oe)},se.prototype.setLineWidth=function(oe){this.lineWidth=oe},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({drawingImgUrl:this.drawingImgUrl},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){this.createVisual(),ge.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.setDrawingImage()},se.typeName="FreehandMarker",se.title="Freehand marker",se.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',se}(lt),Nt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,ve||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return ce.typeBoxes=[],ce.currentType=fe,ce.setCurrentType=ce.setCurrentType.bind(ce),ce}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2";for(var ve=function(xt){var Ut="both";switch(xt){case 0:Ut="both";break;case 1:Ut="start";break;case 2:Ut="end";break;case 3:Ut="none"}var Ht=document.createElement("div");if(Ht.style.display="flex",Ht.style.flexGrow="2",Ht.style.alignItems="center",Ht.style.justifyContent="space-between",Ht.style.padding="5px",Ht.style.borderWidth="2px",Ht.style.borderStyle="solid",Ht.style.borderColor=Ut===ce.currentType?ce.uiStyleSettings.toolboxAccentColor:"transparent",Ht.addEventListener("click",function(){oe.setCurrentType(Ut,Ht)}),fe.appendChild(Ht),Ut==="both"||Ut==="start"){var Jt=document.createElement("div");Jt.style.display="flex",Jt.style.alignItems="center",Jt.style.minHeight="20px",Jt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Jt.style.marginLeft="5px",Ht.appendChild(Jt)}var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.style.flexGrow="2";var hn=document.createElement("hr");if(hn.style.minWidth="20px",hn.style.border="0px",hn.style.borderTop="3px solid "+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee"),hn.style.flexGrow="2",en.appendChild(hn),Ht.appendChild(en),Ut==="both"||Ut==="end"){var pn=document.createElement("div");pn.style.display="flex",pn.style.alignItems="center",pn.style.minHeight="20px",pn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,pn.style.marginRight="5px",Ht.appendChild(pn)}ce.typeBoxes.push(Ht)},ce=this,$e=0;$e<4;$e++)ve($e);return fe},se.prototype.setCurrentType=function(oe,fe){var ve=this;this.currentType=oe,this.typeBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings!==void 0?ve.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},se}(Ye),Qt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.arrowType="end",ce.arrowBaseHeight=10,ce.arrowBaseWidth=10,ce.getArrowPoints=ce.getArrowPoints.bind(ce),ce.setArrowType=ce.setArrowType.bind(ce),ce.arrowTypePanel=new Nt("Arrow type","end"),ce.arrowTypePanel.onArrowTypeChanged=ce.setArrowType,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},se.prototype.getArrowPoints=function(oe,fe){var ve=this.arrowBaseWidth+2*this.strokeWidth,ce=this.arrowBaseHeight+2*this.strokeWidth;return oe-ve/2+","+(fe+ce/2)+" "+oe+","+(fe-ce/2)+" "+(oe+ve/2)+","+(fe+ce/2)},se.prototype.createTips=function(){this.arrow1=Be.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Be.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Be.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Be.createTransform()),this.visual.appendChild(this.arrow2)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ge.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Be.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Be.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var oe=0;Math.abs(this.x1-this.x2)>.1&&(oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var fe=this.arrow1.transform.baseVal.getItem(0);fe.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(fe,0);var ve=this.arrow2.transform.baseVal.getItem(0);ve.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ve,0)}},se.prototype.setArrowType=function(oe){this.arrowType=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({arrowType:this.arrowType},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe);var fe=oe;this.arrowType=fe.arrowType,this.createTips(),this.adjustVisual()},se.typeName="ArrowMarker",se.title="Arrow marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',se}(It),Vt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.fillColor=ve.defaultFillColor,ce.strokeWidth=0,ce.fillPanel=new ot("Color",ve.defaultColorSet,ve.defaultFillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce}return ct(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="CoverMarker",se.title="Cover marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',se}(We),Gt=function(ge){function se(oe,fe,ve,ce){var $e=ge.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=fe,$e.currentOpacity=ve,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return ct(se,ge),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",fe.style.justifyContent="space-between",this.opacities.forEach(function(ve){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.justifyContent="center",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderColor=ve===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentOpacity(ve,ce)}),fe.appendChild(ce);var $e=document.createElement("div");$e.innerText=100*ve+"%",ce.appendChild($e),oe.opacityBoxes.push(ce)}),fe},se.prototype.setCurrentOpacity=function(oe,fe){var ve=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},se}(Ye),Ft=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.setOpacity=ce.setOpacity.bind(ce),ce.fillColor=ve.defaultHighlightColor,ce.strokeWidth=0,ce.opacity=ve.defaultHighlightOpacity,ce.fillPanel=new ot("Color",ve.defaultColorSet,ce.fillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce.opacityPanel=new Gt("Opacity",ve.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return ct(se,ge),se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="HighlightMarker",se.title="Highlight marker",se.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',se}(Vt),Fe='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',xe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ft=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.bgColor="transparent",ce.tipPosition={x:0,y:0},ce.tipBase1Position={x:0,y:0},ce.tipBase2Position={x:0,y:0},ce.tipMoving=!1,ce.color=ve.defaultStrokeColor,ce.bgColor=ve.defaultFillColor,ce.fontFamily=ve.defaultFontFamily,ce.defaultSize={x:100,y:30},ce.setBgColor=ce.setBgColor.bind(ce),ce.getTipPoints=ce.getTipPoints.bind(ce),ce.positionTip=ce.positionTip.bind(ce),ce.setTipPoints=ce.setTipPoints.bind(ce),ce.colorPanel=new ot("Text color",ve.defaultColorSet,ce.color,Fe),ce.colorPanel.onColorChanged=ce.setColor,ce.bgColorPanel=new ot("Fill color",ve.defaultColorSet,ce.bgColor,xe),ce.bgColorPanel.onColorChanged=ce.setBgColor,ce.fontFamilyPanel=new at("Font",ve.defaultFontFamilies,ve.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.tipGrip=new Zt,ce.tipGrip.visual.transform.baseVal.appendItem(Be.createTransform()),ce.controlBox.appendChild(ce.tipGrip.visual),ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return ge.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},se.prototype.createTip=function(){Be.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Be.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},se.prototype.pointerDown=function(oe,fe){this.state==="new"&&ge.prototype.pointerDown.call(this,oe,fe),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(fe)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ge.prototype.pointerDown.call(this,oe,fe)},se.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ge.prototype.pointerUp.call(this,oe);else{var fe=this.state==="creating";ge.prototype.pointerUp.call(this,oe),this.setTipPoints(fe),this.positionTip()}},se.prototype.manipulate=function(oe){if(this.tipMoving){var fe=this.unrotatePoint(oe);this.tipPosition={x:fe.x-this.manipulationStartLeft,y:fe.y-this.manipulationStartTop},this.positionTip()}else ge.prototype.manipulate.call(this,oe)},se.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(Be.setAttributes(this.bgRectangle,[["fill",oe]]),Be.setAttributes(this.tip,[["fill",oe]])),this.bgColor=oe,this.fillColorChanged(oe)},se.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},se.prototype.setTipPoints=function(oe){oe===void 0&&(oe=!1);var fe=Math.min(this.height/2,15),ve=this.height/5;oe&&(this.tipPosition={x:fe+ve/2,y:this.height+20});var ce=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?ce<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:fe,y:0},this.tipBase2Position={x:fe+ve,y:0}):(this.tipBase1Position={x:0,y:fe},this.tipBase2Position={x:0,y:fe+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ce<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-fe-ve,y:0},this.tipBase2Position={x:this.width-fe,y:0}):(this.tipBase1Position={x:this.width,y:fe},this.tipBase2Position={x:this.width,y:fe+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ce<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-fe-ve,y:this.height},this.tipBase2Position={x:this.width-fe,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-fe-ve},this.tipBase2Position={x:this.width,y:this.height-fe}):ce<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:fe,y:this.height},this.tipBase2Position={x:fe+ve,y:this.height}):(this.tipBase1Position={x:0,y:this.height-fe},this.tipBase2Position={x:0,y:this.height-fe-ve})},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.positionTip()},se.prototype.positionTip=function(){Be.setAttributes(this.tip,[["points",this.getTipPoints()]]);var oe=this.tipGrip.visual.transform.baseVal.getItem(0);oe.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(oe,0)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.positionTip(),ge.prototype.select.call(this)},se.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.bgColor=fe.bgColor,this.tipPosition=fe.tipPosition,ge.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*fe},this.positionTip()},se.typeName="CalloutMarker",se.title="Callout marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',se}(Ct),qt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.opacity=1,ce.strokeColor=ve.defaultColor,ce.strokeWidth=ve.defaultStrokeWidth,ce.strokeDasharray=ve.defaultStrokeDasharray,ce.fillColor=ve.defaultFillColor,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.setOpacity=ce.setOpacity.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce.strokePanel=new ot("Line color",Se(ve.defaultColorSet,["transparent"]),ve.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new ot("Fill color",Se(ve.defaultColorSet,["transparent"]),ce.fillColor,xe),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.opacityPanel=new Gt("Opacity",ve.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Be.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Be.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},se.prototype.pointerUp=function(oe){ge.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Be.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.opacity=fe.opacity,this.createVisual(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.setSize()},se.typeName="EllipseMarker",se.title="Ellipse marker",se.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',se}(lt),Ot=function(ge){function se(oe,fe,ve){return ge.call(this,oe,fe,ve)||this}return ct(se,ge),Object.defineProperty(se.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},se.prototype.createTips=function(){this.tip1=Be.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(Be.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Be.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(Be.createTransform()),this.visual.appendChild(this.tip2)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ge.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Be.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Be.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),fe=this.tip1.transform.baseVal.getItem(0);fe.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(fe,0);var ve=this.tip2.transform.baseVal.getItem(0);ve.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ve,0)}},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe),this.createTips(),this.adjustVisual()},se.typeName="MeasurementMarker",se.title="Measurement marker",se.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',se}(It),Ue=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.strokePanel.colors=ve.defaultColorSet,ce.fillColor="transparent",ce}return ct(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="EllipseFrameMarker",se.title="Ellipse frame marker",se.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',se}(qt),Ge=function(){function ge(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ge.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ge.prototype.addUndoStep=function(se){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(se)||(this.undoStack.push(se),JSON.stringify(this.lastRedoStep)!==JSON.stringify(se)&&this.redoStack.splice(0,this.redoStack.length))},ge.prototype.replaceLastUndoStep=function(se){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=se)},ge.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ge.prototype.undo=function(){if(this.undoStack.length>1){var se=this.undoStack.pop();return se!==void 0&&this.redoStack.push(se),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ge.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ge}(),wt=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.curveX=0,ce.curveY=0,ce.manipulationStartCurveX=0,ce.manipulationStartCurveY=0,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.positionGrips=ce.positionGrips.bind(ce),ce.addControlGrips=ce.addControlGrips.bind(ce),ce.adjustVisual=ce.adjustVisual.bind(ce),ce.setupControlBox=ce.setupControlBox.bind(ce),ce.resize=ce.resize.bind(ce),ce.strokeColor=ve.defaultColor,ce.strokeWidth=ve.defaultStrokeWidth,ce.strokeDasharray=ve.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",ve.defaultColorSet,ve.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorCurve&&oe!==this.visibleCurve&&!this.curveGrip.ownsTarget(oe))},se.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},se.prototype.createVisual=function(){this.visual=Be.createGroup(),this.selectorCurve=Be.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Be.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=oe.x,this.curveY=oe.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(fe)&&(this.activeGrip=this.curveGrip,this._state="resize")},se.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Be.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Be.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Be.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setupControlBox=function(){ge.prototype.setupControlBox.call(this),this.curveControlLine1=Be.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Be.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},se.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ge.prototype.addControlGrips.call(this)},se.prototype.positionGrips=function(){ge.prototype.positionGrips.call(this);var oe=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-oe/2,this.curveY-oe/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},se.prototype.manipulate=function(oe){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+oe.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+oe.y-this.manipulationStartY),ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ge.prototype.resize.call(this,oe),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual()},se.prototype.scale=function(oe,fe){this.curveX=this.curveX*oe,this.curveY=this.curveY*fe,ge.prototype.scale.call(this,oe,fe)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.prototype.restoreState.call(this,oe);var fe=oe;this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.curveX=fe.curveX,this.curveY=fe.curveY,this.createVisual(),this.adjustVisual()},se.typeName="CurveMarker",se.title="Curve marker",se.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',se}(je),dn=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,fe,ve)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.textColor="transparent",ce.fontSize="1rem",ce.isMoved=!1,ce.captionText="Caption",ce.PADDING=5,ce.captionBoxWidth=0,ce.captionBoxHeight=0,ce.strokeColor=ve.defaultColor,ce.strokeWidth=ve.defaultStrokeWidth,ce.strokeDasharray=ve.defaultStrokeDasharray,ce.fillColor=ve.defaultFillColor,ce.textColor=ve.defaultStrokeColor,ce.fontFamily=ve.defaultFontFamily,ce.fontSize=ve.defaultCaptionFontSize,ce.captionText=ve.defaultCaptionText,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce.sizeCaption=ce.sizeCaption.bind(ce),ce.setCaptionText=ce.setCaptionText.bind(ce),ce.showTextEditor=ce.showTextEditor.bind(ce),ce.positionTextEditor=ce.positionTextEditor.bind(ce),ce.finishTextEditing=ce.finishTextEditing.bind(ce),ce.setFont=ce.setFont.bind(ce),ce.setTextColor=ce.setTextColor.bind(ce),ce.strokePanel=new ot("Line color",Se(ve.defaultColorSet,["transparent"]),ce.strokeColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new ot("Fill color",Se(ve.defaultColorSet,["transparent"]),ce.fillColor,xe),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.fontFamilyPanel=new at("Font",ve.defaultFontFamilies,ve.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.textColorPanel=new ot("Text color",ve.defaultColorSet,ce.textColor,Fe),ce.textColorPanel.onColorChanged=ce.setTextColor,ce}return ct(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},se.prototype.createVisual=function(){this.visual=Be.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Be.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Be.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=Be.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},se.prototype.setCaptionText=function(oe){this.captionText=oe,this.captionElement.textContent=this.captionText,this.sizeCaption()},se.prototype.pointerDown=function(oe,fe){ge.prototype.pointerDown.call(this,oe,fe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.setSize()},se.prototype.sizeCaption=function(){var oe=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=oe.width+2*this.PADDING,this.captionBoxHeight=oe.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Be.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),Be.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},se.prototype.showTextEditor=function(){var oe=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(fe){fe.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(fe){fe.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(fe){fe.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},se.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},se.prototype.finishTextEditing=function(oe){this.setCaptionText(oe.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},se.prototype.setFont=function(oe){this.captionElement&&Be.setAttributes(this.captionElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},se.prototype.setTextColor=function(oe){this.captionElement&&Be.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Be.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},se.prototype.pointerUp=function(oe){ge.prototype.pointerUp.call(this,oe),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.dblClick=function(oe,fe){ge.prototype.dblClick.call(this,oe,fe),this.showTextEditor()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&Be.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&Be.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&Be.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&Be.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},ge.prototype.getState.call(this));return oe.typeName=this.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.textColor=fe.textColor,this.fontFamily=fe.fontFamily,this.captionText=fe.captionText,this.fontSize=fe.fontSize,this.createVisual(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ge.prototype.scale.call(this,oe,fe),this.setSize()},se.typeName="CaptionFrameMarker",se.title="Caption frame marker",se.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',se}(lt),Rt=function(){function ge(se,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=se,this.cancelable=oe}return Object.defineProperty(ge.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ge.prototype.preventDefault=function(){this._defaultPrevented=!0},ge}(),an=function(ge){function se(oe,fe,ve){var ce=ge.call(this,oe,!1)||this;return ce.dataUrl=fe,ce.state=ve,ce}return ct(se,ge),se}(Rt),$t=function(ge){function se(oe,fe,ve){ve===void 0&&(ve=!1);var ce=ge.call(this,oe,ve)||this;return ce.marker=fe,ce}return ct(se,ge),se}(Rt),Bt=function(){function ge(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ge.prototype.addEventListener=function(se,oe){this[se].push(oe)},ge.prototype.removeEventListener=function(se,oe){var fe=this[se].indexOf(oe);fe>-1&&this[se].splice(fe,1)},ge}(),Tt=function(){function ge(se){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new bt,this._isOpen=!1,this.undoRedoManager=new Ge,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ge.instanceCounter++,this.styles=new Ne(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=se,this.targetRoot=document.body,this.width=se.clientWidth,this.height=se.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ge.prototype,"ALL_MARKER_TYPES",{get:function(){return[Xe,qe,Qt,Ct,Ue,qt,Ft,ft,Ot,Vt,It,wt,dn]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Xe,qe,Qt,Ct,qt,Ft,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Xe,qe,Qt,Ct,Ft]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(se){var oe=this;this._availableMarkerTypes.splice(0),se.forEach(function(fe){if(typeof fe=="string"){var ve=oe.ALL_MARKER_TYPES.find(function(ce){return ce.typeName===fe});ve!==void 0&&oe._availableMarkerTypes.push(ve)}else oe._availableMarkerTypes.push(fe)})},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(se){this._zoomLevel=se,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ge.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Oe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ge.prototype.show=function(){var se=this;this.styles.styleSheetRoot===void 0&&Me.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Me.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new Rt(se))})},ge.prototype.render=function(){return Re(this,void 0,void 0,function(){var se;return st(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(se=new Ce).naturalSize=this.renderAtNaturalSize,se.imageType=this.renderImageType,se.imageQuality=this.renderImageQuality,se.markersOnly=this.renderMarkersOnly,se.width=this.renderWidth,se.height=this.renderHeight,[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return oe.sent(),[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,oe.sent()]}})})},ge.prototype.close=function(se){var oe=this;if(se===void 0&&(se=!1),this.isOpen){var fe=!1;se||this.eventListeners.beforeclose.forEach(function(ve){var ce=new Rt(oe,!0);ve(ce),ce.defaultPrevented&&(fe=!0)}),fe||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ve){return ve(new Rt(oe))}),this.detachEvents(),this._isOpen=!1)}},ge.prototype.addMarkersToToolbar=function(){for(var se,oe=[],fe=0;fe<arguments.length;fe++)oe[fe]=arguments[fe];(se=this._availableMarkerTypes).push.apply(se,oe)},ge.prototype.addRenderEventListener=function(se){this.addEventListener("render",function(oe){se(oe.dataUrl,oe.state)})},ge.prototype.removeRenderEventListener=function(se){},ge.prototype.addCloseEventListener=function(se){this.addEventListener("close",function(){se()})},ge.prototype.removeCloseEventListener=function(se){},ge.prototype.setupResizeObserver=function(){var se=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){se.resize(se.target.clientWidth,se.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return se.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ge.prototype.onPopupTargetResize=function(){var se=1*this.target.clientWidth/this.target.clientHeight,oe=this.editorCanvas.clientWidth/se>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*se:this.editorCanvas.clientWidth,fe=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/se;this.resize(oe,fe)},ge.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ge.prototype.resize=function(se,oe){this._isResizing=!0;var fe=se/this.imageWidth,ve=oe/this.imageHeight;this.imageWidth=Math.round(se),this.imageHeight=Math.round(oe),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(fe,ve),this._isResizing=!1},ge.prototype.scaleMarkers=function(se,oe){var fe,ve=this;this._currentMarker&&this._currentMarker instanceof Ct?this._currentMarker.scale(se,oe):(fe=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ce){ce!==ve._currentMarker&&ce.scale(se,oe)}),fe!==void 0&&this.setCurrentMarker(fe)},ge.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ge.prototype.setTopLeft=function(){var se=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=se.left-oe.left,this.top=se.top-oe.top},ge.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ge.prototype.addDefs=function(){for(var se,oe=[],fe=0;fe<arguments.length;fe++)oe[fe]=arguments[fe];this.defs=Be.createDefs(),this.addDefsToImage(),(se=this.defs).append.apply(se,oe)},ge.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ge.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ge.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ge.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ge.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ge.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ge.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ge.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var se=document.createElement("a");se.href="https://markerjs.com/",se.target="_blank",se.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',se.title="Powered by marker.js",se.style.display="grid",se.style.alignItems="center",se.style.justifyItems="center",se.style.padding="3px",se.style.width="20px",se.style.height="20px",this.logoUI.appendChild(se),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ge.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ge.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ge.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ge.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var se=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=se+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new He(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new mt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ge.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ge.prototype.removeMarker=function(se){this.markerImage.removeChild(se.container),this.markers.indexOf(se)>-1&&this.markers.splice(this.markers.indexOf(se),1),se.dispose()},ge.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ge.prototype.toolbarButtonClicked=function(se,oe){if(se==="marker"&&oe!==void 0)this.createNewMarker(oe);else if(se==="action")switch(oe){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ge.prototype.deleteSelectedMarker=function(){var se=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ve){var ce=new $t(se,se._currentMarker,!0);ve(ce),ce.defaultPrevented&&(oe=!0)}),!oe){var fe=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ve){return ve(new $t(se,fe))})}}},ge.prototype.clear=function(){var se=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var xt=new $t(se,void 0,!0);$e(xt),xt.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var fe=function($e){var xt=ve.markers[$e];ve.setCurrentMarker(ve.markers[$e]),ve._currentMarker.dispose(),ve.markerImage.removeChild(ve._currentMarker.container),ve.markers.splice(ve.markers.indexOf(ve._currentMarker),1),ve.eventListeners.markerdelete.forEach(function(Ut){return Ut(new $t(se,xt))})},ve=this,ce=this.markers.length-1;ce>=0;ce--)fe(ce);this.addUndoStep()}},Object.defineProperty(ge.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ge.prototype.showNotesEditor=function(){var se;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(se=this._currentMarker.notes)!==null&&se!==void 0?se:"",this.overlayContainer.appendChild(this.notesArea))},ge.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ge.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ge.prototype.addUndoStep=function(){var se=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),fe=this.undoRedoManager.getLastUndoStep();if(!fe||fe.width===oe.width&&fe.height===oe.height){var ve=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),ve<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ce){return ce(new Rt(se))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(ce){return ce(new Rt(se))})}},ge.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ge.prototype.undoStep=function(){var se=this,oe=this.undoRedoManager.undo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(fe){return fe(new Rt(se))}))},ge.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ge.prototype.redoStep=function(){var se=this,oe=this.undoRedoManager.redo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(fe){return fe(new Rt(se))}))},ge.prototype.stepZoom=function(){var se=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=se<this.zoomSteps.length-1?this.zoomSteps[se+1]:this.zoomSteps[0]},ge.prototype.panTo=function(se){this.contentDiv.scrollBy({left:this.prevPanPoint.x-se.x,top:this.prevPanPoint.y-se.y}),this.prevPanPoint=se},ge.prototype.startRenderAndClose=function(){return Re(this,void 0,void 0,function(){var se,oe,fe=this;return st(this,function(ve){switch(ve.label){case 0:return[4,this.render()];case 1:return se=ve.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(ce){return ce(new an(fe,se,oe))}),this.close(!0),[2]}})})},ge.prototype.getState=function(se){se===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(fe){return oe.markers.push(fe.getState())}),oe},ge.prototype.restoreState=function(se){var oe=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);se.markers.forEach(function(fe){var ve=oe._availableMarkerTypes.find(function($e){return $e.typeName===fe.typeName});if(ve!==void 0){var ce=oe.addNewMarker(ve);ce.restoreState(fe),oe.markers.push(ce)}}),se.width&&se.height&&(se.width!==this.imageWidth||se.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/se.width,this.imageHeight/se.height),this.eventListeners.restorestate.forEach(function(fe){return fe(new Rt(oe))})},ge.prototype.addNewMarker=function(se){var oe=Be.createGroup();return this.markerImage.appendChild(oe),new se(oe,this.overlayContainer,this.settings)},ge.prototype.createNewMarker=function(se){var oe,fe=this;(oe=typeof se=="string"?this._availableMarkerTypes.find(function(ve){return ve.typeName===se}):se)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(oe),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(oe.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ve){return ve(new $t(fe,fe._currentMarker))}))},ge.prototype.markerCreated=function(se){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(se),this.setCurrentMarker(se),se instanceof qe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(qe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(fe){return fe(new $t(oe,oe._currentMarker))})},ge.prototype.colorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=se,this.settings.defaultStrokeColor=se)},ge.prototype.fillColorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=se)},ge.prototype.markerStateChanged=function(se){var oe=this;this.eventListeners.markerchange.forEach(function(fe){return fe(new $t(oe,se))})},ge.prototype.setCurrentMarker=function(se){var oe=this;this._currentMarker!==se&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(fe){return fe(new $t(oe,oe._currentMarker))})),this._currentMarker=se,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(fe){return fe(new $t(oe,oe._currentMarker))}))},ge.prototype.onPointerDown=function(se){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||se.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var oe=this.markers.find(function(fe){return fe.ownsTarget(se.target)});oe!==void 0?(this.setCurrentMarker(oe),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:se.clientX,y:se.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY))},ge.prototype.onDblClick=function(se){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(fe){return fe.ownsTarget(se.target)});oe!==void 0&&oe!==this._currentMarker&&this.setCurrentMarker(oe),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target):this.setCurrentMarker()}},ge.prototype.onPointerMove=function(se){this.touchPoints!==1&&se.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||se.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(se.clientX,se.clientY)):this.zoomLevel>1&&this.panTo({x:se.clientX,y:se.clientY}))},ge.prototype.onPointerUp=function(se){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(se.clientX,se.clientY)),this.isDragging=!1,this.addUndoStep()},ge.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ge.prototype.onKeyUp=function(se){this._currentMarker===void 0||this.notesArea!==void 0||se.key!=="Delete"&&se.key!=="Backspace"||this.deleteSelectedMarker()},ge.prototype.clientToLocalCoordinates=function(se,oe){var fe=this.markerImage.getBoundingClientRect();return{x:(se-fe.left)/this.zoomLevel,y:(oe-fe.top)/this.zoomLevel}},ge.prototype.onWindowResize=function(){this.positionUI()},ge.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var se=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=se+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ge.prototype.addLicenseKey=function(se){Oe.addKey(se)},ge.prototype.addEventListener=function(se,oe){this.eventListeners.addEventListener(se,oe)},ge.prototype.removeEventListener=function(se,oe){this.eventListeners.removeEventListener(se,oe)},ge.prototype.renderState=function(se){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(se),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ge.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ge.prototype.focus=function(){var se=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(oe){return oe(new Rt(se))}))},ge.prototype.blur=function(){var se=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(oe){return oe(new Rt(se))}))},ge.instanceCounter=0,ge}()},5630:function(mn,rn,he){"use strict";var we=he(60499),ct=he(85899),Re=he(18642),st=he(72190),Se=he(42244),Be=he(92310),Oe=he.n(Be),Ce=he(18929),Me=he(59301),Ne=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],ht=(0,Me.forwardRef)(function(Ie,He){var mt,Ye=Ie.prefixCls,ot=Ye===void 0?"rc-checkbox":Ye,rt=Ie.className,Et=Ie.style,Zt=Ie.checked,Je=Ie.disabled,lt=Ie.defaultChecked,We=lt===void 0?!1:lt,Ee=Ie.type,Ve=Ee===void 0?"checkbox":Ee,Xe=Ie.title,bt=Ie.onChange,je=(0,Se.Z)(Ie,Ne),It=(0,Me.useRef)(null),at=(0,Ce.Z)(We,{value:Zt}),Ct=(0,st.Z)(at,2),qe=Ct[0],Nt=Ct[1];(0,Me.useImperativeHandle)(He,function(){return{focus:function(){var Ft;(Ft=It.current)===null||Ft===void 0||Ft.focus()},blur:function(){var Ft;(Ft=It.current)===null||Ft===void 0||Ft.blur()},input:It.current}});var Qt=Oe()(ot,rt,(mt={},(0,Re.Z)(mt,"".concat(ot,"-checked"),qe),(0,Re.Z)(mt,"".concat(ot,"-disabled"),Je),mt)),Vt=function(Ft){Je||("checked"in Ie||Nt(Ft.target.checked),bt==null||bt({target:(0,ct.Z)((0,ct.Z)({},Ie),{},{type:Ve,checked:Ft.target.checked}),stopPropagation:function(){Ft.stopPropagation()},preventDefault:function(){Ft.preventDefault()},nativeEvent:Ft.nativeEvent}))};return Me.createElement("span",{className:Qt,title:Xe,style:Et},Me.createElement("input",(0,we.Z)({},je,{className:"".concat(ot,"-input"),ref:It,onChange:Vt,disabled:Je,checked:!!qe,type:Ve})),Me.createElement("span",{className:"".concat(ot,"-inner")}))});rn.Z=ht},31561:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ve}});var we=he(60499),ct=he(18642),Re=he(72190),st=he(42244),Se=he(35593),Be=he(92310),Oe=he.n(Be),Ce=he(8654),Me=he(59301),Ne=he(10228),ht=he(16089),Ie=Ne.Z.ESC,He=Ne.Z.TAB;function mt(Xe){var bt=Xe.visible,je=Xe.triggerRef,It=Xe.onVisibleChange,at=Xe.autoFocus,Ct=Xe.overlayRef,qe=Me.useRef(!1),Nt=function(){if(bt){var Ft,Fe;(Ft=je.current)===null||Ft===void 0||(Fe=Ft.focus)===null||Fe===void 0||Fe.call(Ft),It==null||It(!1)}},Qt=function(){var Ft;return(Ft=Ct.current)!==null&&Ft!==void 0&&Ft.focus?(Ct.current.focus(),qe.current=!0,!0):!1},Vt=function(Ft){switch(Ft.keyCode){case Ie:Nt();break;case He:{var Fe=!1;qe.current||(Fe=Qt()),Fe?Ft.preventDefault():Nt();break}}};Me.useEffect(function(){return bt?(window.addEventListener("keydown",Vt),at&&(0,ht.Z)(Qt,3),function(){window.removeEventListener("keydown",Vt),qe.current=!1}):function(){qe.current=!1}},[bt])}var Ye=(0,Me.forwardRef)(function(Xe,bt){var je=Xe.overlay,It=Xe.arrow,at=Xe.prefixCls,Ct=(0,Me.useMemo)(function(){var Nt;return typeof je=="function"?Nt=je():Nt=je,Nt},[je]),qe=(0,Ce.sQ)(bt,Ct==null?void 0:Ct.ref);return Me.createElement(Me.Fragment,null,It&&Me.createElement("div",{className:"".concat(at,"-arrow")}),Me.cloneElement(Ct,{ref:(0,Ce.Yr)(Ct)?qe:void 0}))}),ot=Ye,rt={adjustX:1,adjustY:1},Et=[0,0],Zt={topLeft:{points:["bl","tl"],overflow:rt,offset:[0,-4],targetOffset:Et},top:{points:["bc","tc"],overflow:rt,offset:[0,-4],targetOffset:Et},topRight:{points:["br","tr"],overflow:rt,offset:[0,-4],targetOffset:Et},bottomLeft:{points:["tl","bl"],overflow:rt,offset:[0,4],targetOffset:Et},bottom:{points:["tc","bc"],overflow:rt,offset:[0,4],targetOffset:Et},bottomRight:{points:["tr","br"],overflow:rt,offset:[0,4],targetOffset:Et}},Je=Zt,lt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function We(Xe,bt){var je,It=Xe.arrow,at=It===void 0?!1:It,Ct=Xe.prefixCls,qe=Ct===void 0?"rc-dropdown":Ct,Nt=Xe.transitionName,Qt=Xe.animation,Vt=Xe.align,Gt=Xe.placement,Ft=Gt===void 0?"bottomLeft":Gt,Fe=Xe.placements,xe=Fe===void 0?Je:Fe,ft=Xe.getPopupContainer,qt=Xe.showAction,Ot=Xe.hideAction,Ue=Xe.overlayClassName,Ge=Xe.overlayStyle,wt=Xe.visible,dn=Xe.trigger,Rt=dn===void 0?["hover"]:dn,an=Xe.autoFocus,$t=Xe.overlay,Bt=Xe.children,Tt=Xe.onVisibleChange,ge=(0,st.Z)(Xe,lt),se=Me.useState(),oe=(0,Re.Z)(se,2),fe=oe[0],ve=oe[1],ce="visible"in Xe?wt:fe,$e=Me.useRef(null),xt=Me.useRef(null),Ut=Me.useRef(null);Me.useImperativeHandle(bt,function(){return $e.current});var Ht=function(tt){ve(tt),Tt==null||Tt(tt)};mt({visible:ce,triggerRef:Ut,onVisibleChange:Ht,autoFocus:an,overlayRef:xt});var Jt=function(tt){var vt=Xe.onOverlayClick;ve(!1),vt&&vt(tt)},en=function(){return Me.createElement(ot,{ref:xt,overlay:$t,prefixCls:qe,arrow:at})},hn=function(){return typeof $t=="function"?en:en()},pn=function(){var tt=Xe.minOverlayWidthMatchTrigger,vt=Xe.alignPoint;return"minOverlayWidthMatchTrigger"in Xe?tt:!vt},bn=function(){var tt=Xe.openClassName;return tt!==void 0?tt:"".concat(qe,"-open")},pt=Me.cloneElement(Bt,{className:Oe()((je=Bt.props)===null||je===void 0?void 0:je.className,ce&&bn()),ref:(0,Ce.Yr)(Bt)?(0,Ce.sQ)(Ut,Bt.ref):void 0}),sn=Ot;return!sn&&Rt.indexOf("contextMenu")!==-1&&(sn=["click"]),Me.createElement(Se.Z,(0,we.Z)({builtinPlacements:xe},ge,{prefixCls:qe,ref:$e,popupClassName:Oe()(Ue,(0,ct.Z)({},"".concat(qe,"-show-arrow"),at)),popupStyle:Ge,action:Rt,showAction:qt,hideAction:sn,popupPlacement:Ft,popupAlign:Vt,popupTransitionName:Nt,popupAnimation:Qt,popupVisible:ce,stretch:pn()?"minWidth":"",popup:hn(),onPopupVisibleChange:Ht,onPopupClick:Jt,getPopupContainer:ft}),pt)}var Ee=Me.forwardRef(We),Ve=Ee},93681:function(mn,rn,he){"use strict";he.r(rn),he.d(rn,{BaseInput:function(){return Ne},default:function(){return Zt}});var we=he(60499),ct=he(85899),Re=he(18642),st=he(43749),Se=he(92310),Be=he.n(Se),Oe=he(59301),Ce=he(5643),Me=function(lt){var We,Ee,Ve=lt.inputElement,Xe=lt.prefixCls,bt=lt.prefix,je=lt.suffix,It=lt.addonBefore,at=lt.addonAfter,Ct=lt.className,qe=lt.style,Nt=lt.disabled,Qt=lt.readOnly,Vt=lt.focused,Gt=lt.triggerFocus,Ft=lt.allowClear,Fe=lt.value,xe=lt.handleReset,ft=lt.hidden,qt=lt.classes,Ot=lt.classNames,Ue=lt.dataAttrs,Ge=lt.styles,wt=lt.components,dn=(wt==null?void 0:wt.affixWrapper)||"span",Rt=(wt==null?void 0:wt.groupWrapper)||"span",an=(wt==null?void 0:wt.wrapper)||"span",$t=(wt==null?void 0:wt.groupAddon)||"span",Bt=(0,Oe.useRef)(null),Tt=function(en){var hn;(hn=Bt.current)!==null&&hn!==void 0&&hn.contains(en.target)&&(Gt==null||Gt())},ge=function(){var en;if(!Ft)return null;var hn=!Nt&&!Qt&&Fe,pn="".concat(Xe,"-clear-icon"),bn=(0,st.Z)(Ft)==="object"&&Ft!==null&&Ft!==void 0&&Ft.clearIcon?Ft.clearIcon:"\u2716";return Oe.createElement("span",{onClick:xe,onMouseDown:function(sn){return sn.preventDefault()},className:Be()(pn,(en={},(0,Re.Z)(en,"".concat(pn,"-hidden"),!hn),(0,Re.Z)(en,"".concat(pn,"-has-suffix"),!!je),en)),role:"button",tabIndex:-1},bn)},se=(0,Oe.cloneElement)(Ve,{value:Fe,hidden:ft,className:Be()((We=Ve.props)===null||We===void 0?void 0:We.className,!(0,Ce.X3)(lt)&&!(0,Ce.He)(lt)&&Ct)||null,style:(0,ct.Z)((0,ct.Z)({},(Ee=Ve.props)===null||Ee===void 0?void 0:Ee.style),!(0,Ce.X3)(lt)&&!(0,Ce.He)(lt)?qe:{})});if((0,Ce.X3)(lt)){var oe,fe="".concat(Xe,"-affix-wrapper"),ve=Be()(fe,(oe={},(0,Re.Z)(oe,"".concat(fe,"-disabled"),Nt),(0,Re.Z)(oe,"".concat(fe,"-focused"),Vt),(0,Re.Z)(oe,"".concat(fe,"-readonly"),Qt),(0,Re.Z)(oe,"".concat(fe,"-input-with-clear-btn"),je&&Ft&&Fe),oe),!(0,Ce.He)(lt)&&Ct,qt==null?void 0:qt.affixWrapper,Ot==null?void 0:Ot.affixWrapper),ce=(je||Ft)&&Oe.createElement("span",{className:Be()("".concat(Xe,"-suffix"),Ot==null?void 0:Ot.suffix),style:Ge==null?void 0:Ge.suffix},ge(),je);se=Oe.createElement(dn,(0,we.Z)({className:ve,style:(0,ct.Z)((0,ct.Z)({},(0,Ce.He)(lt)?void 0:qe),Ge==null?void 0:Ge.affixWrapper),hidden:!(0,Ce.He)(lt)&&ft,onClick:Tt},Ue==null?void 0:Ue.affixWrapper,{ref:Bt}),bt&&Oe.createElement("span",{className:Be()("".concat(Xe,"-prefix"),Ot==null?void 0:Ot.prefix),style:Ge==null?void 0:Ge.prefix},bt),(0,Oe.cloneElement)(Ve,{value:Fe,hidden:null}),ce)}if((0,Ce.He)(lt)){var $e="".concat(Xe,"-group"),xt="".concat($e,"-addon"),Ut=Be()("".concat(Xe,"-wrapper"),$e,qt==null?void 0:qt.wrapper),Ht=Be()("".concat(Xe,"-group-wrapper"),Ct,qt==null?void 0:qt.group);return Oe.createElement(Rt,{className:Ht,style:qe,hidden:ft},Oe.createElement(an,{className:Ut},It&&Oe.createElement($t,{className:xt},It),(0,Oe.cloneElement)(se,{hidden:null}),at&&Oe.createElement($t,{className:xt},at)))}return se},Ne=Me,ht=he(77654),Ie=he(72190),He=he(42244),mt=he(18929),Ye=he(2738),ot=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],rt=(0,Oe.forwardRef)(function(Je,lt){var We=Je.autoComplete,Ee=Je.onChange,Ve=Je.onFocus,Xe=Je.onBlur,bt=Je.onPressEnter,je=Je.onKeyDown,It=Je.prefixCls,at=It===void 0?"rc-input":It,Ct=Je.disabled,qe=Je.htmlSize,Nt=Je.className,Qt=Je.maxLength,Vt=Je.suffix,Gt=Je.showCount,Ft=Je.type,Fe=Ft===void 0?"text":Ft,xe=Je.classes,ft=Je.classNames,qt=Je.styles,Ot=(0,He.Z)(Je,ot),Ue=(0,mt.Z)(Je.defaultValue,{value:Je.value}),Ge=(0,Ie.Z)(Ue,2),wt=Ge[0],dn=Ge[1],Rt=(0,Oe.useState)(!1),an=(0,Ie.Z)(Rt,2),$t=an[0],Bt=an[1],Tt=(0,Oe.useRef)(null),ge=function(Ht){Tt.current&&(0,Ce.nH)(Tt.current,Ht)};(0,Oe.useImperativeHandle)(lt,function(){return{focus:ge,blur:function(){var Ht;(Ht=Tt.current)===null||Ht===void 0||Ht.blur()},setSelectionRange:function(Ht,Jt,en){var hn;(hn=Tt.current)===null||hn===void 0||hn.setSelectionRange(Ht,Jt,en)},select:function(){var Ht;(Ht=Tt.current)===null||Ht===void 0||Ht.select()},input:Tt.current}}),(0,Oe.useEffect)(function(){Bt(function(Ut){return Ut&&Ct?!1:Ut})},[Ct]);var se=function(Ht){Je.value===void 0&&dn(Ht.target.value),Tt.current&&(0,Ce.rJ)(Tt.current,Ht,Ee)},oe=function(Ht){bt&&Ht.key==="Enter"&&bt(Ht),je==null||je(Ht)},fe=function(Ht){Bt(!0),Ve==null||Ve(Ht)},ve=function(Ht){Bt(!1),Xe==null||Xe(Ht)},ce=function(Ht){dn(""),ge(),Tt.current&&(0,Ce.rJ)(Tt.current,Ht,Ee)},$e=function(){var Ht=(0,Ye.Z)(Je,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Oe.createElement("input",(0,we.Z)({autoComplete:We},Ht,{onChange:se,onFocus:fe,onBlur:ve,onKeyDown:oe,className:Be()(at,(0,Re.Z)({},"".concat(at,"-disabled"),Ct),ft==null?void 0:ft.input),style:qt==null?void 0:qt.input,ref:Tt,size:qe,type:Fe}))},xt=function(){var Ht=Number(Qt)>0;if(Vt||Gt){var Jt=(0,Ce.D7)(wt),en=(0,ht.Z)(Jt).length,hn=(0,st.Z)(Gt)==="object"?Gt.formatter({value:Jt,count:en,maxLength:Qt}):"".concat(en).concat(Ht?" / ".concat(Qt):"");return Oe.createElement(Oe.Fragment,null,!!Gt&&Oe.createElement("span",{className:Be()("".concat(at,"-show-count-suffix"),(0,Re.Z)({},"".concat(at,"-show-count-has-suffix"),!!Vt),ft==null?void 0:ft.count),style:(0,ct.Z)({},qt==null?void 0:qt.count)},hn),Vt)}return null};return Oe.createElement(Ne,(0,we.Z)({},Ot,{prefixCls:at,className:Nt,inputElement:$e(),handleReset:ce,value:(0,Ce.D7)(wt),focused:$t,triggerFocus:ge,suffix:xt(),disabled:Ct,classes:xe,classNames:ft,styles:qt}))}),Et=rt,Zt=Et},5643:function(mn,rn,he){"use strict";he.d(rn,{D7:function(){return Se},He:function(){return we},X3:function(){return ct},nH:function(){return st},rJ:function(){return Re}});function we(Be){return!!(Be.addonBefore||Be.addonAfter)}function ct(Be){return!!(Be.prefix||Be.suffix||Be.allowClear)}function Re(Be,Oe,Ce,Me){if(Ce){var Ne=Oe;if(Oe.type==="click"){var ht=Be.cloneNode(!0);Ne=Object.create(Oe,{target:{value:ht},currentTarget:{value:ht}}),ht.value="",Ce(Ne);return}if(Me!==void 0){Ne=Object.create(Oe,{target:{value:Be},currentTarget:{value:Be}}),Be.value=Me,Ce(Ne);return}Ce(Ne)}}function st(Be,Oe){if(Be){Be.focus(Oe);var Ce=Oe||{},Me=Ce.cursor;if(Me){var Ne=Be.value.length;switch(Me){case"start":Be.setSelectionRange(0,0);break;case"end":Be.setSelectionRange(Ne,Ne);break;default:Be.setSelectionRange(0,Ne)}}}}function Se(Be){return typeof Be=="undefined"||Be===null?"":String(Be)}},15285:function(mn,rn,he){"use strict";he.d(rn,{iz:function(){return un},ck:function(){return nr},BW:function(){return tn},sN:function(){return nr},Wd:function(){return it},ZP:function(){return Un},Xl:function(){return je}});var we=he(60499),ct=he(18642),Re=he(85899),st=he(77654),Se=he(72190),Be=he(42244),Oe=he(92310),Ce=he.n(Oe),Me=he(83836),Ne=he(18929),ht=he(13697),Ie=he(48736),He=he(59301),mt=he(4676),Ye=He.createContext(null);function ot(Ze,St){return Ze===void 0?null:"".concat(Ze,"-").concat(St)}function rt(Ze){var St=He.useContext(Ye);return ot(St,Ze)}var Et=he(80547),Zt=["children","locked"],Je=He.createContext(null);function lt(Ze,St){var Mt=(0,Re.Z)({},Ze);return Object.keys(St).forEach(function(Kt){var _t=St[Kt];_t!==void 0&&(Mt[Kt]=_t)}),Mt}function We(Ze){var St=Ze.children,Mt=Ze.locked,Kt=(0,Be.Z)(Ze,Zt),_t=He.useContext(Je),Pt=(0,Et.Z)(function(){return lt(_t,Kt)},[_t,Kt],function(At,on){return!Mt&&(At[0]!==on[0]||!(0,ht.Z)(At[1],on[1],!0))});return He.createElement(Je.Provider,{value:Pt},St)}var Ee=[],Ve=He.createContext(null);function Xe(){return He.useContext(Ve)}var bt=He.createContext(Ee);function je(Ze){var St=He.useContext(bt);return He.useMemo(function(){return Ze!==void 0?[].concat((0,st.Z)(St),[Ze]):St},[St,Ze])}var It=He.createContext(null),at=He.createContext({}),Ct=at,qe=he(29194);function Nt(Ze){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,qe.Z)(Ze)){var Mt=Ze.nodeName.toLowerCase(),Kt=["input","select","textarea","button"].includes(Mt)||Ze.isContentEditable||Mt==="a"&&!!Ze.getAttribute("href"),_t=Ze.getAttribute("tabindex"),Pt=Number(_t),At=null;return _t&&!Number.isNaN(Pt)?At=Pt:Kt&&At===null&&(At=0),Kt&&Ze.disabled&&(At=null),At!==null&&(At>=0||St&&At<0)}return!1}function Qt(Ze){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mt=(0,st.Z)(Ze.querySelectorAll("*")).filter(function(Kt){return Nt(Kt,St)});return Nt(Ze,St)&&Mt.unshift(Ze),Mt}var Vt=null;function Gt(){Vt=document.activeElement}function Ft(){Vt=null}function Fe(){if(Vt)try{Vt.focus()}catch(Ze){}}function xe(Ze,St){if(St.keyCode===9){var Mt=Qt(Ze),Kt=Mt[St.shiftKey?0:Mt.length-1],_t=Kt===document.activeElement||Ze===document.activeElement;if(_t){var Pt=Mt[St.shiftKey?Mt.length-1:0];Pt.focus(),St.preventDefault()}}}var ft=he(10228),qt=he(16089),Ot=ft.Z.LEFT,Ue=ft.Z.RIGHT,Ge=ft.Z.UP,wt=ft.Z.DOWN,dn=ft.Z.ENTER,Rt=ft.Z.ESC,an=ft.Z.HOME,$t=ft.Z.END,Bt=[Ge,wt,Ot,Ue];function Tt(Ze,St,Mt,Kt){var _t,Pt,At,on,cn="prev",xn="next",Vn="children",ni="parent";if(Ze==="inline"&&Kt===dn)return{inlineTrigger:!0};var gi=(_t={},(0,ct.Z)(_t,Ge,cn),(0,ct.Z)(_t,wt,xn),_t),ii=(Pt={},(0,ct.Z)(Pt,Ot,Mt?xn:cn),(0,ct.Z)(Pt,Ue,Mt?cn:xn),(0,ct.Z)(Pt,wt,Vn),(0,ct.Z)(Pt,dn,Vn),Pt),Kn=(At={},(0,ct.Z)(At,Ge,cn),(0,ct.Z)(At,wt,xn),(0,ct.Z)(At,dn,Vn),(0,ct.Z)(At,Rt,ni),(0,ct.Z)(At,Ot,Mt?Vn:ni),(0,ct.Z)(At,Ue,Mt?ni:Vn),At),vi={inline:gi,horizontal:ii,vertical:Kn,inlineSub:gi,horizontalSub:Kn,verticalSub:Kn},ui=(on=vi["".concat(Ze).concat(St?"":"Sub")])===null||on===void 0?void 0:on[Kt];switch(ui){case cn:return{offset:-1,sibling:!0};case xn:return{offset:1,sibling:!0};case ni:return{offset:-1,sibling:!1};case Vn:return{offset:1,sibling:!1};default:return null}}function ge(Ze){for(var St=Ze;St;){if(St.getAttribute("data-menu-list"))return St;St=St.parentElement}return null}function se(Ze,St){for(var Mt=Ze||document.activeElement;Mt;){if(St.has(Mt))return Mt;Mt=Mt.parentElement}return null}function oe(Ze,St){var Mt=Qt(Ze,!0);return Mt.filter(function(Kt){return St.has(Kt)})}function fe(Ze,St,Mt){var Kt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ze)return null;var _t=oe(Ze,St),Pt=_t.length,At=_t.findIndex(function(on){return Mt===on});return Kt<0?At===-1?At=Pt-1:At-=1:Kt>0&&(At+=1),At=(At+Pt)%Pt,_t[At]}var ve=function(St,Mt){var Kt=new Set,_t=new Map,Pt=new Map;return St.forEach(function(At){var on=document.querySelector("[data-menu-id='".concat(ot(Mt,At),"']"));on&&(Kt.add(on),Pt.set(on,At),_t.set(At,on))}),{elements:Kt,key2element:_t,element2key:Pt}};function ce(Ze,St,Mt,Kt,_t,Pt,At,on,cn,xn){var Vn=He.useRef(),ni=He.useRef();ni.current=St;var gi=function(){qt.Z.cancel(Vn.current)};return He.useEffect(function(){return function(){gi()}},[]),function(ii){var Kn=ii.which;if([].concat(Bt,[dn,Rt,an,$t]).includes(Kn)){var vi=Pt(),ui=ve(vi,Kt),ci=ui,Fn=ci.elements,Jn=ci.key2element,li=ci.element2key,Qn=Jn.get(St),Di=se(Qn,Fn),Hi=li.get(Di),ai=Tt(Ze,At(Hi,!0).length===1,Mt,Kn);if(!ai&&Kn!==an&&Kn!==$t)return;(Bt.includes(Kn)||[an,$t].includes(Kn))&&ii.preventDefault();var wn=function(Ii){if(Ii){var fr=Ii,Gn=Ii.querySelector("a");Gn!=null&&Gn.getAttribute("href")&&(fr=Gn);var Hn=li.get(Ii);on(Hn),gi(),Vn.current=(0,qt.Z)(function(){ni.current===Hn&&fr.focus()})}};if([an,$t].includes(Kn)||ai.sibling||!Di){var fn;!Di||Ze==="inline"?fn=_t.current:fn=ge(Di);var ri,jn=oe(fn,Fn);Kn===an?ri=jn[0]:Kn===$t?ri=jn[jn.length-1]:ri=fe(fn,Fn,Di,ai.offset),wn(ri)}else if(ai.inlineTrigger)cn(Hi);else if(ai.offset>0)cn(Hi,!0),gi(),Vn.current=(0,qt.Z)(function(){ui=ve(vi,Kt);var Ui=Di.getAttribute("aria-controls"),Ii=document.getElementById(Ui),fr=fe(Ii,ui.elements);wn(fr)},5);else if(ai.offset<0){var yi=At(Hi,!0),Ti=yi[yi.length-2],wi=Jn.get(Ti);cn(Ti,!1),wn(wi)}}xn==null||xn(ii)}}function $e(Ze){Promise.resolve().then(Ze)}var xt="__RC_UTIL_PATH_SPLIT__",Ut=function(St){return St.join(xt)},Ht=function(St){return St.split(xt)},Jt="rc-menu-more";function en(){var Ze=He.useState({}),St=(0,Se.Z)(Ze,2),Mt=St[1],Kt=(0,He.useRef)(new Map),_t=(0,He.useRef)(new Map),Pt=He.useState([]),At=(0,Se.Z)(Pt,2),on=At[0],cn=At[1],xn=(0,He.useRef)(0),Vn=(0,He.useRef)(!1),ni=function(){Vn.current||Mt({})},gi=(0,He.useCallback)(function(Jn,li){var Qn=Ut(li);_t.current.set(Qn,Jn),Kt.current.set(Jn,Qn),xn.current+=1;var Di=xn.current;$e(function(){Di===xn.current&&ni()})},[]),ii=(0,He.useCallback)(function(Jn,li){var Qn=Ut(li);_t.current.delete(Qn),Kt.current.delete(Jn)},[]),Kn=(0,He.useCallback)(function(Jn){cn(Jn)},[]),vi=(0,He.useCallback)(function(Jn,li){var Qn=Kt.current.get(Jn)||"",Di=Ht(Qn);return li&&on.includes(Di[0])&&Di.unshift(Jt),Di},[on]),ui=(0,He.useCallback)(function(Jn,li){return Jn.some(function(Qn){var Di=vi(Qn,!0);return Di.includes(li)})},[vi]),ci=function(){var li=(0,st.Z)(Kt.current.keys());return on.length&&li.push(Jt),li},Fn=(0,He.useCallback)(function(Jn){var li="".concat(Kt.current.get(Jn)).concat(xt),Qn=new Set;return(0,st.Z)(_t.current.keys()).forEach(function(Di){Di.startsWith(li)&&Qn.add(_t.current.get(Di))}),Qn},[]);return He.useEffect(function(){return function(){Vn.current=!0}},[]),{registerPath:gi,unregisterPath:ii,refreshOverflowKeys:Kn,isSubPathKey:ui,getKeyPath:vi,getKeys:ci,getSubPathKeys:Fn}}function hn(Ze){var St=He.useRef(Ze);St.current=Ze;var Mt=He.useCallback(function(){for(var Kt,_t=arguments.length,Pt=new Array(_t),At=0;At<_t;At++)Pt[At]=arguments[At];return(Kt=St.current)===null||Kt===void 0?void 0:Kt.call.apply(Kt,[St].concat(Pt))},[]);return Ze?Mt:void 0}var pn=Math.random().toFixed(5).toString().slice(2),bn=0;function pt(Ze){var St=(0,Ne.Z)(Ze,{value:Ze}),Mt=(0,Se.Z)(St,2),Kt=Mt[0],_t=Mt[1];return He.useEffect(function(){bn+=1;var Pt="".concat(pn,"-").concat(bn);_t("rc-menu-uuid-".concat(Pt))},[]),Kt}var sn=he(38705),zn=he(17212),tt=he(39153),vt=he(55401),Lt=he(2738),Ln=he(8654);function Mn(Ze,St,Mt,Kt){var _t=He.useContext(Je),Pt=_t.activeKey,At=_t.onActive,on=_t.onInactive,cn={active:Pt===Ze};return St||(cn.onMouseEnter=function(xn){Mt==null||Mt({key:Ze,domEvent:xn}),At(Ze)},cn.onMouseLeave=function(xn){Kt==null||Kt({key:Ze,domEvent:xn}),on(Ze)}),cn}function _n(Ze){var St=He.useContext(Je),Mt=St.mode,Kt=St.rtl,_t=St.inlineIndent;if(Mt!=="inline")return null;var Pt=Ze;return Kt?{paddingRight:Pt*_t}:{paddingLeft:Pt*_t}}function ti(Ze){var St=Ze.icon,Mt=Ze.props,Kt=Ze.children,_t;return St===null||St===!1?null:(typeof St=="function"?_t=He.createElement(St,(0,Re.Z)({},Mt)):typeof St!="boolean"&&(_t=St),_t||Kt||null)}var hi=["item"];function pi(Ze){var St=Ze.item,Mt=(0,Be.Z)(Ze,hi);return Object.defineProperty(Mt,"item",{get:function(){return(0,Ie.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),St}}),Mt}var Bi=["title","attribute","elementRef"],_i=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Zn=["active"],Fi=function(Ze){(0,tt.Z)(Mt,Ze);var St=(0,vt.Z)(Mt);function Mt(){return(0,sn.Z)(this,Mt),St.apply(this,arguments)}return(0,zn.Z)(Mt,[{key:"render",value:function(){var _t=this.props,Pt=_t.title,At=_t.attribute,on=_t.elementRef,cn=(0,Be.Z)(_t,Bi),xn=(0,Lt.Z)(cn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Ie.ZP)(!At,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),He.createElement(Me.Z.Item,(0,we.Z)({},At,{title:typeof Pt=="string"?Pt:void 0},xn,{ref:on}))}}]),Mt}(He.Component),Wi=He.forwardRef(function(Ze,St){var Mt,Kt=Ze.style,_t=Ze.className,Pt=Ze.eventKey,At=Ze.warnKey,on=Ze.disabled,cn=Ze.itemIcon,xn=Ze.children,Vn=Ze.role,ni=Ze.onMouseEnter,gi=Ze.onMouseLeave,ii=Ze.onClick,Kn=Ze.onKeyDown,vi=Ze.onFocus,ui=(0,Be.Z)(Ze,_i),ci=rt(Pt),Fn=He.useContext(Je),Jn=Fn.prefixCls,li=Fn.onItemClick,Qn=Fn.disabled,Di=Fn.overflowDisabled,Hi=Fn.itemIcon,ai=Fn.selectedKeys,wn=Fn.onActive,fn=He.useContext(Ct),ri=fn._internalRenderMenuItem,jn="".concat(Jn,"-item"),yi=He.useRef(),Ti=He.useRef(),wi=Qn||on,Ui=(0,Ln.x1)(St,Ti),Ii=je(Pt),fr=function(Pn){return{key:Pt,keyPath:(0,st.Z)(Ii).reverse(),item:yi.current,domEvent:Pn}},Gn=cn||Hi,Hn=Mn(Pt,wi,ni,gi),Mi=Hn.active,Ai=(0,Be.Z)(Hn,Zn),sr=ai.includes(Pt),qr=_n(Ii.length),Ar=function(Pn){if(!wi){var Xn=fr(Pn);ii==null||ii(pi(Xn)),li(Xn)}},Xi=function(Pn){if(Kn==null||Kn(Pn),Pn.which===ft.Z.ENTER){var Xn=fr(Pn);ii==null||ii(pi(Xn)),li(Xn)}},yr=function(Pn){wn(Pt),vi==null||vi(Pn)},pr={};Ze.role==="option"&&(pr["aria-selected"]=sr);var Rn=He.createElement(Fi,(0,we.Z)({ref:yi,elementRef:Ui,role:Vn===null?"none":Vn||"menuitem",tabIndex:on?null:-1,"data-menu-id":Di&&ci?null:ci},ui,Ai,pr,{component:"li","aria-disabled":on,style:(0,Re.Z)((0,Re.Z)({},qr),Kt),className:Ce()(jn,(Mt={},(0,ct.Z)(Mt,"".concat(jn,"-active"),Mi),(0,ct.Z)(Mt,"".concat(jn,"-selected"),sr),(0,ct.Z)(Mt,"".concat(jn,"-disabled"),wi),Mt),_t),onClick:Ar,onKeyDown:Xi,onFocus:yr}),xn,He.createElement(ti,{props:(0,Re.Z)((0,Re.Z)({},Ze),{},{isSelected:sr}),icon:Gn}));return ri&&(Rn=ri(Rn,Ze,{selected:sr})),Rn});function Gi(Ze,St){var Mt=Ze.eventKey,Kt=Xe(),_t=je(Mt);return He.useEffect(function(){if(Kt)return Kt.registerPath(Mt,_t),function(){Kt.unregisterPath(Mt,_t)}},[_t]),Kt?null:He.createElement(Wi,(0,we.Z)({},Ze,{ref:St}))}var nr=He.forwardRef(Gi),Pi=["className","children"],Yi=function(St,Mt){var Kt=St.className,_t=St.children,Pt=(0,Be.Z)(St,Pi),At=He.useContext(Je),on=At.prefixCls,cn=At.mode,xn=At.rtl;return He.createElement("ul",(0,we.Z)({className:Ce()(on,xn&&"".concat(on,"-rtl"),"".concat(on,"-sub"),"".concat(on,"-").concat(cn==="inline"?"inline":"vertical"),Kt),role:"menu"},Pt,{"data-menu-list":!0,ref:Mt}),_t)},bi=He.forwardRef(Yi);bi.displayName="SubMenuList";var ji=bi,Ji=he(11592);function Vi(Ze,St){return(0,Ji.Z)(Ze).map(function(Mt,Kt){if(He.isValidElement(Mt)){var _t,Pt,At=Mt.key,on=(_t=(Pt=Mt.props)===null||Pt===void 0?void 0:Pt.eventKey)!==null&&_t!==void 0?_t:At,cn=on==null;cn&&(on="tmp_key-".concat([].concat((0,st.Z)(St),[Kt]).join("-")));var xn={key:on,eventKey:on};return He.cloneElement(Mt,xn)}return Mt})}var ir=he(35593),$i={adjustX:1,adjustY:1},si={topLeft:{points:["bl","tl"],overflow:$i},topRight:{points:["br","tr"],overflow:$i},bottomLeft:{points:["tl","bl"],overflow:$i},bottomRight:{points:["tr","br"],overflow:$i},leftTop:{points:["tr","tl"],overflow:$i},leftBottom:{points:["br","bl"],overflow:$i},rightTop:{points:["tl","tr"],overflow:$i},rightBottom:{points:["bl","br"],overflow:$i}},fi={topLeft:{points:["bl","tl"],overflow:$i},topRight:{points:["br","tr"],overflow:$i},bottomLeft:{points:["tl","bl"],overflow:$i},bottomRight:{points:["tr","br"],overflow:$i},rightTop:{points:["tr","tl"],overflow:$i},rightBottom:{points:["br","bl"],overflow:$i},leftTop:{points:["tl","tr"],overflow:$i},leftBottom:{points:["bl","br"],overflow:$i}},kn=null;function Dn(Ze,St,Mt){if(St)return St;if(Mt)return Mt[Ze]||Mt.other}var mi={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Qe(Ze){var St=Ze.prefixCls,Mt=Ze.visible,Kt=Ze.children,_t=Ze.popup,Pt=Ze.popupStyle,At=Ze.popupClassName,on=Ze.popupOffset,cn=Ze.disabled,xn=Ze.mode,Vn=Ze.onVisibleChange,ni=He.useContext(Je),gi=ni.getPopupContainer,ii=ni.rtl,Kn=ni.subMenuOpenDelay,vi=ni.subMenuCloseDelay,ui=ni.builtinPlacements,ci=ni.triggerSubMenuAction,Fn=ni.forceSubMenuRender,Jn=ni.rootClassName,li=ni.motion,Qn=ni.defaultMotions,Di=He.useState(!1),Hi=(0,Se.Z)(Di,2),ai=Hi[0],wn=Hi[1],fn=ii?(0,Re.Z)((0,Re.Z)({},fi),ui):(0,Re.Z)((0,Re.Z)({},si),ui),ri=mi[xn],jn=Dn(xn,li,Qn),yi=He.useRef(jn);xn!=="inline"&&(yi.current=jn);var Ti=(0,Re.Z)((0,Re.Z)({},yi.current),{},{leavedClassName:"".concat(St,"-hidden"),removeOnLeave:!1,motionAppear:!0}),wi=He.useRef();return He.useEffect(function(){return wi.current=(0,qt.Z)(function(){wn(Mt)}),function(){qt.Z.cancel(wi.current)}},[Mt]),He.createElement(ir.Z,{prefixCls:St,popupClassName:Ce()("".concat(St,"-popup"),(0,ct.Z)({},"".concat(St,"-rtl"),ii),At,Jn),stretch:xn==="horizontal"?"minWidth":null,getPopupContainer:gi,builtinPlacements:fn,popupPlacement:ri,popupVisible:ai,popup:_t,popupStyle:Pt,popupAlign:on&&{offset:on},action:cn?[]:[ci],mouseEnterDelay:Kn,mouseLeaveDelay:vi,onPopupVisibleChange:Vn,forceRender:Fn,popupMotion:Ti,fresh:!0},Kt)}var ke=he(77900);function Pe(Ze){var St=Ze.id,Mt=Ze.open,Kt=Ze.keyPath,_t=Ze.children,Pt="inline",At=He.useContext(Je),on=At.prefixCls,cn=At.forceSubMenuRender,xn=At.motion,Vn=At.defaultMotions,ni=At.mode,gi=He.useRef(!1);gi.current=ni===Pt;var ii=He.useState(!gi.current),Kn=(0,Se.Z)(ii,2),vi=Kn[0],ui=Kn[1],ci=gi.current?Mt:!1;He.useEffect(function(){gi.current&&ui(!1)},[ni]);var Fn=(0,Re.Z)({},Dn(Pt,xn,Vn));Kt.length>1&&(Fn.motionAppear=!1);var Jn=Fn.onVisibleChanged;return Fn.onVisibleChanged=function(li){return!gi.current&&!li&&ui(!0),Jn==null?void 0:Jn(li)},vi?null:He.createElement(We,{mode:Pt,locked:!gi.current},He.createElement(ke.default,(0,we.Z)({visible:ci},Fn,{forceRender:cn,removeOnLeave:!1,leavedClassName:"".concat(on,"-hidden")}),function(li){var Qn=li.className,Di=li.style;return He.createElement(ji,{id:St,className:Qn,style:Di},_t)}))}var Le=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],De=["active"],Ke=function(St){var Mt,Kt=St.style,_t=St.className,Pt=St.title,At=St.eventKey,on=St.warnKey,cn=St.disabled,xn=St.internalPopupClose,Vn=St.children,ni=St.itemIcon,gi=St.expandIcon,ii=St.popupClassName,Kn=St.popupOffset,vi=St.popupStyle,ui=St.onClick,ci=St.onMouseEnter,Fn=St.onMouseLeave,Jn=St.onTitleClick,li=St.onTitleMouseEnter,Qn=St.onTitleMouseLeave,Di=(0,Be.Z)(St,Le),Hi=rt(At),ai=He.useContext(Je),wn=ai.prefixCls,fn=ai.mode,ri=ai.openKeys,jn=ai.disabled,yi=ai.overflowDisabled,Ti=ai.activeKey,wi=ai.selectedKeys,Ui=ai.itemIcon,Ii=ai.expandIcon,fr=ai.onItemClick,Gn=ai.onOpenChange,Hn=ai.onActive,Mi=He.useContext(Ct),Ai=Mi._internalRenderSubMenuItem,sr=He.useContext(It),qr=sr.isSubPathKey,Ar=je(),Xi="".concat(wn,"-submenu"),yr=jn||cn,pr=He.useRef(),Rn=He.useRef(),In=ni!=null?ni:Ui,Pn=gi!=null?gi:Ii,Xn=ri.includes(At),qi=!yi&&Xn,hr=qr(wi,At),br=Mn(At,yr,li,Qn),mr=br.active,ar=(0,Be.Z)(br,De),wr=He.useState(!1),Kr=(0,Se.Z)(wr,2),Br=Kr[0],pa=Kr[1],ea=function(Nr){yr||pa(Nr)},Or=function(Nr){ea(!0),ci==null||ci({key:At,domEvent:Nr})},Qa=function(Nr){ea(!1),Fn==null||Fn({key:At,domEvent:Nr})},Ma=He.useMemo(function(){return mr||(fn!=="inline"?Br||qr([Ti],At):!1)},[fn,mr,Ti,Br,At,qr]),ma=_n(Ar.length),ta=function(Nr){yr||(Jn==null||Jn({key:At,domEvent:Nr}),fn==="inline"&&Gn(At,!Xn))},Sr=hn(function(Rr){ui==null||ui(pi(Rr)),fr(Rr)}),ki=function(Nr){fn!=="inline"&&Gn(At,Nr)},Zi=function(){Hn(At)},Ri=Hi&&"".concat(Hi,"-popup"),Si=He.createElement("div",(0,we.Z)({role:"menuitem",style:ma,className:"".concat(Xi,"-title"),tabIndex:yr?null:-1,ref:pr,title:typeof Pt=="string"?Pt:null,"data-menu-id":yi&&Hi?null:Hi,"aria-expanded":qi,"aria-haspopup":!0,"aria-controls":Ri,"aria-disabled":yr,onClick:ta,onFocus:Zi},ar),Pt,He.createElement(ti,{icon:fn!=="horizontal"?Pn:void 0,props:(0,Re.Z)((0,Re.Z)({},St),{},{isOpen:qi,isSubMenu:!0})},He.createElement("i",{className:"".concat(Xi,"-arrow")}))),tr=He.useRef(fn);if(fn!=="inline"&&Ar.length>1?tr.current="vertical":tr.current=fn,!yi){var Qi=tr.current;Si=He.createElement(Qe,{mode:Qi,prefixCls:Xi,visible:!xn&&qi&&fn!=="inline",popupClassName:ii,popupOffset:Kn,popupStyle:vi,popup:He.createElement(We,{mode:Qi==="horizontal"?"vertical":Qi},He.createElement(ji,{id:Ri,ref:Rn},Vn)),disabled:yr,onVisibleChange:ki},Si)}var Pr=He.createElement(Me.Z.Item,(0,we.Z)({role:"none"},Di,{component:"li",style:Kt,className:Ce()(Xi,"".concat(Xi,"-").concat(fn),_t,(Mt={},(0,ct.Z)(Mt,"".concat(Xi,"-open"),qi),(0,ct.Z)(Mt,"".concat(Xi,"-active"),Ma),(0,ct.Z)(Mt,"".concat(Xi,"-selected"),hr),(0,ct.Z)(Mt,"".concat(Xi,"-disabled"),yr),Mt)),onMouseEnter:Or,onMouseLeave:Qa}),Si,!yi&&He.createElement(Pe,{id:Ri,open:qi,keyPath:Ar},Vn));return Ai&&(Pr=Ai(Pr,St,{selected:hr,active:Ma,open:qi,disabled:yr})),He.createElement(We,{onItemClick:Sr,mode:fn==="horizontal"?"vertical":fn,itemIcon:In,expandIcon:Pn},Pr)};function it(Ze){var St=Ze.eventKey,Mt=Ze.children,Kt=je(St),_t=Vi(Mt,Kt),Pt=Xe();He.useEffect(function(){if(Pt)return Pt.registerPath(St,Kt),function(){Pt.unregisterPath(St,Kt)}},[Kt]);var At;return Pt?At=_t:At=He.createElement(Ke,Ze,_t),He.createElement(bt.Provider,{value:Kt},At)}var kt=he(43749),yt=["className","title","eventKey","children"],Dt=["children"],Xt=function(St){var Mt=St.className,Kt=St.title,_t=St.eventKey,Pt=St.children,At=(0,Be.Z)(St,yt),on=He.useContext(Je),cn=on.prefixCls,xn="".concat(cn,"-item-group");return He.createElement("li",(0,we.Z)({role:"presentation"},At,{onClick:function(ni){return ni.stopPropagation()},className:Ce()(xn,Mt)}),He.createElement("div",{role:"presentation",className:"".concat(xn,"-title"),title:typeof Kt=="string"?Kt:void 0},Kt),He.createElement("ul",{role:"group",className:"".concat(xn,"-list")},Pt))};function tn(Ze){var St=Ze.children,Mt=(0,Be.Z)(Ze,Dt),Kt=je(Mt.eventKey),_t=Vi(St,Kt),Pt=Xe();return Pt?_t:He.createElement(Xt,(0,Lt.Z)(Mt,["warnKey"]),_t)}function un(Ze){var St=Ze.className,Mt=Ze.style,Kt=He.useContext(Je),_t=Kt.prefixCls,Pt=Xe();return Pt?null:He.createElement("li",{role:"separator",className:Ce()("".concat(_t,"-item-divider"),St),style:Mt})}var gt=["label","children","key","type"];function jt(Ze){return(Ze||[]).map(function(St,Mt){if(St&&(0,kt.Z)(St)==="object"){var Kt=St,_t=Kt.label,Pt=Kt.children,At=Kt.key,on=Kt.type,cn=(0,Be.Z)(Kt,gt),xn=At!=null?At:"tmp-".concat(Mt);return Pt||on==="group"?on==="group"?He.createElement(tn,(0,we.Z)({key:xn},cn,{title:_t}),jt(Pt)):He.createElement(it,(0,we.Z)({key:xn},cn,{title:_t}),jt(Pt)):on==="divider"?He.createElement(un,(0,we.Z)({key:xn},cn)):He.createElement(nr,(0,we.Z)({key:xn},cn),_t)}return null}).filter(function(St){return St})}function Bn(Ze,St,Mt){var Kt=Ze;return St&&(Kt=jt(St)),Vi(Kt,Mt)}var yn=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Tn=[],Cn=He.forwardRef(function(Ze,St){var Mt,Kt,_t=Ze,Pt=_t.prefixCls,At=Pt===void 0?"rc-menu":Pt,on=_t.rootClassName,cn=_t.style,xn=_t.className,Vn=_t.tabIndex,ni=Vn===void 0?0:Vn,gi=_t.items,ii=_t.children,Kn=_t.direction,vi=_t.id,ui=_t.mode,ci=ui===void 0?"vertical":ui,Fn=_t.inlineCollapsed,Jn=_t.disabled,li=_t.disabledOverflow,Qn=_t.subMenuOpenDelay,Di=Qn===void 0?.1:Qn,Hi=_t.subMenuCloseDelay,ai=Hi===void 0?.1:Hi,wn=_t.forceSubMenuRender,fn=_t.defaultOpenKeys,ri=_t.openKeys,jn=_t.activeKey,yi=_t.defaultActiveFirst,Ti=_t.selectable,wi=Ti===void 0?!0:Ti,Ui=_t.multiple,Ii=Ui===void 0?!1:Ui,fr=_t.defaultSelectedKeys,Gn=_t.selectedKeys,Hn=_t.onSelect,Mi=_t.onDeselect,Ai=_t.inlineIndent,sr=Ai===void 0?24:Ai,qr=_t.motion,Ar=_t.defaultMotions,Xi=_t.triggerSubMenuAction,yr=Xi===void 0?"hover":Xi,pr=_t.builtinPlacements,Rn=_t.itemIcon,In=_t.expandIcon,Pn=_t.overflowedIndicator,Xn=Pn===void 0?"...":Pn,qi=_t.overflowedIndicatorPopupClassName,hr=_t.getPopupContainer,br=_t.onClick,mr=_t.onOpenChange,ar=_t.onKeyDown,wr=_t.openAnimation,Kr=_t.openTransitionName,Br=_t._internalRenderMenuItem,pa=_t._internalRenderSubMenuItem,ea=(0,Be.Z)(_t,yn),Or=He.useMemo(function(){return Bn(ii,gi,Tn)},[ii,gi]),Qa=He.useState(!1),Ma=(0,Se.Z)(Qa,2),ma=Ma[0],ta=Ma[1],Sr=He.useRef(),ki=pt(vi),Zi=Kn==="rtl",Ri=(0,Ne.Z)(fn,{value:ri,postState:function(kr){return kr||Tn}}),Si=(0,Se.Z)(Ri,2),tr=Si[0],Qi=Si[1],Pr=function(kr){var Fr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Xa(){Qi(kr),mr==null||mr(kr)}Fr?(0,mt.flushSync)(Xa):Xa()},Rr=He.useState(tr),Nr=(0,Se.Z)(Rr,2),Yr=Nr[0],ur=Nr[1],lr=He.useRef(!1),Hr=He.useMemo(function(){return(ci==="inline"||ci==="vertical")&&Fn?["vertical",Fn]:[ci,!1]},[ci,Fn]),aa=(0,Se.Z)(Hr,2),ia=aa[0],Xr=aa[1],ts=ia==="inline",ao=He.useState(ia),oo=(0,Se.Z)(ao,2),eo=oo[0],Ss=oo[1],fo=He.useState(Xr),ka=(0,Se.Z)(fo,2),ua=ka[0],bo=ka[1];He.useEffect(function(){Ss(ia),bo(Xr),lr.current&&(ts?Qi(Yr):Pr(Tn))},[ia,Xr]);var ko=He.useState(0),Eo=(0,Se.Z)(ko,2),ns=Eo[0],Ro=Eo[1],Ua=ns>=Or.length-1||eo!=="horizontal"||li;He.useEffect(function(){ts&&ur(tr)},[tr]),He.useEffect(function(){return lr.current=!0,function(){lr.current=!1}},[]);var Ia=en(),Er=Ia.registerPath,Lo=Ia.unregisterPath,is=Ia.refreshOverflowKeys,Do=Ia.isSubPathKey,gr=Ia.getKeyPath,or=Ia.getKeys,Ir=Ia.getSubPathKeys,Ea=He.useMemo(function(){return{registerPath:Er,unregisterPath:Lo}},[Er,Lo]),Wr=He.useMemo(function(){return{isSubPathKey:Do}},[Do]);He.useEffect(function(){is(Ua?Tn:Or.slice(ns+1).map(function(_r){return _r.key}))},[ns,Ua]);var Oa=(0,Ne.Z)(jn||yi&&((Mt=Or[0])===null||Mt===void 0?void 0:Mt.key),{value:jn}),Fa=(0,Se.Z)(Oa,2),to=Fa[0],Ra=Fa[1],so=hn(function(_r){Ra(_r)}),lo=hn(function(){Ra(void 0)});(0,He.useImperativeHandle)(St,function(){return{list:Sr.current,focus:function(kr){var Fr,Xa=or(),Da=ve(Xa,ki),xo=Da.elements,po=Da.key2element,$a=Da.element2key,Ao=oe(Sr.current,xo),To=to!=null?to:Ao[0]?$a.get(Ao[0]):(Fr=Or.find(function(Wl){return!Wl.props.disabled}))===null||Fr===void 0?void 0:Fr.key,wo=po.get(To);if(To&&wo){var os;wo==null||(os=wo.focus)===null||os===void 0||os.call(wo,kr)}}}});var La=(0,Ne.Z)(fr||[],{value:Gn,postState:function(kr){return Array.isArray(kr)?kr:kr==null?Tn:[kr]}}),bl=(0,Se.Z)(La,2),Vo=bl[0],Ys=bl[1],Kl=function(kr){if(wi){var Fr=kr.key,Xa=Vo.includes(Fr),Da;Ii?Xa?Da=Vo.filter(function(po){return po!==Fr}):Da=[].concat((0,st.Z)(Vo),[Fr]):Da=[Fr],Ys(Da);var xo=(0,Re.Z)((0,Re.Z)({},kr),{},{selectedKeys:Da});Xa?Mi==null||Mi(xo):Hn==null||Hn(xo)}!Ii&&tr.length&&eo!=="inline"&&Pr(Tn)},Hl=hn(function(_r){br==null||br(pi(_r)),Kl(_r)}),Cs=hn(function(_r,kr){var Fr=tr.filter(function(Da){return Da!==_r});if(kr)Fr.push(_r);else if(eo!=="inline"){var Xa=Ir(_r);Fr=Fr.filter(function(Da){return!Xa.has(Da)})}(0,ht.Z)(tr,Fr,!0)||Pr(Fr,!0)}),Mu=function(kr,Fr){var Xa=Fr!=null?Fr:!tr.includes(kr);Cs(kr,Xa)},rs=ce(eo,to,Zi,ki,Sr,or,gr,Ra,Mu,ar);He.useEffect(function(){ta(!0)},[]);var xl=He.useMemo(function(){return{_internalRenderMenuItem:Br,_internalRenderSubMenuItem:pa}},[Br,pa]),jo=eo!=="horizontal"||li?Or:Or.map(function(_r,kr){return He.createElement(We,{key:_r.key,overflowDisabled:kr>ns},_r)}),as=He.createElement(Me.Z,(0,we.Z)({id:vi,ref:Sr,prefixCls:"".concat(At,"-overflow"),component:"ul",itemComponent:nr,className:Ce()(At,"".concat(At,"-root"),"".concat(At,"-").concat(eo),xn,(Kt={},(0,ct.Z)(Kt,"".concat(At,"-inline-collapsed"),ua),(0,ct.Z)(Kt,"".concat(At,"-rtl"),Zi),Kt),on),dir:Kn,style:cn,role:"menu",tabIndex:ni,data:jo,renderRawItem:function(kr){return kr},renderRawRest:function(kr){var Fr=kr.length,Xa=Fr?Or.slice(-Fr):null;return He.createElement(it,{eventKey:Jt,title:Xn,disabled:Ua,internalPopupClose:Fr===0,popupClassName:qi},Xa)},maxCount:eo!=="horizontal"||li?Me.Z.INVALIDATE:Me.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(kr){Ro(kr)},onKeyDown:rs},ea));return He.createElement(Ct.Provider,{value:xl},He.createElement(Ye.Provider,{value:ki},He.createElement(We,{prefixCls:At,rootClassName:on,mode:eo,openKeys:tr,rtl:Zi,disabled:Jn,motion:ma?qr:null,defaultMotions:ma?Ar:null,activeKey:to,onActive:so,onInactive:lo,selectedKeys:Vo,inlineIndent:sr,subMenuOpenDelay:Di,subMenuCloseDelay:ai,forceSubMenuRender:wn,builtinPlacements:pr,triggerSubMenuAction:yr,getPopupContainer:hr,itemIcon:Rn,expandIcon:In,onItemClick:Hl,onOpenChange:Cs},He.createElement(It.Provider,{value:Wr},as),He.createElement("div",{style:{display:"none"},"aria-hidden":!0},He.createElement(Ve.Provider,{value:Ea},Or)))))}),Yn=Cn,ln=Yn;ln.Item=nr,ln.SubMenu=it,ln.ItemGroup=tn,ln.Divider=un;var Un=ln},83836:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Gt}});var we=he(60499),ct=he(85899),Re=he(72190),st=he(42244),Se=he(59301),Be=he(92310),Oe=he.n(Be),Ce=he(29301),Me=he(34280),Ne=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ht=void 0;function Ie(Ft,Fe){var xe=Ft.prefixCls,ft=Ft.invalidate,qt=Ft.item,Ot=Ft.renderItem,Ue=Ft.responsive,Ge=Ft.responsiveDisabled,wt=Ft.registerSize,dn=Ft.itemKey,Rt=Ft.className,an=Ft.style,$t=Ft.children,Bt=Ft.display,Tt=Ft.order,ge=Ft.component,se=ge===void 0?"div":ge,oe=(0,st.Z)(Ft,Ne),fe=Ue&&!Bt;function ve(Ht){wt(dn,Ht)}Se.useEffect(function(){return function(){ve(null)}},[]);var ce=Ot&&qt!==ht?Ot(qt,{index:Tt}):$t,$e;ft||($e={opacity:fe?0:1,height:fe?0:ht,overflowY:fe?"hidden":ht,order:Ue?Tt:ht,pointerEvents:fe?"none":ht,position:fe?"absolute":ht});var xt={};fe&&(xt["aria-hidden"]=!0);var Ut=Se.createElement(se,(0,we.Z)({className:Oe()(!ft&&xe,Rt),style:(0,ct.Z)((0,ct.Z)({},$e),an)},xt,oe,{ref:Fe}),ce);return Ue&&(Ut=Se.createElement(Ce.Z,{onResize:function(Jt){var en=Jt.offsetWidth;ve(en)},disabled:Ge},Ut)),Ut}var He=Se.forwardRef(Ie);He.displayName="Item";var mt=He,Ye=he(6089),ot=he(4676),rt=he(16089);function Et(Ft){if(typeof MessageChannel=="undefined")(0,rt.Z)(Ft);else{var Fe=new MessageChannel;Fe.port1.onmessage=function(){return Ft()},Fe.port2.postMessage(void 0)}}function Zt(){var Ft=Se.useRef(null),Fe=function(ft){Ft.current||(Ft.current=[],Et(function(){(0,ot.unstable_batchedUpdates)(function(){Ft.current.forEach(function(qt){qt()}),Ft.current=null})})),Ft.current.push(ft)};return Fe}function Je(Ft,Fe){var xe=Se.useState(Fe),ft=(0,Re.Z)(xe,2),qt=ft[0],Ot=ft[1],Ue=(0,Ye.Z)(function(Ge){Ft(function(){Ot(Ge)})});return[qt,Ue]}var lt=Se.createContext(null),We=["component"],Ee=["className"],Ve=["className"],Xe=function(Fe,xe){var ft=Se.useContext(lt);if(!ft){var qt=Fe.component,Ot=qt===void 0?"div":qt,Ue=(0,st.Z)(Fe,We);return Se.createElement(Ot,(0,we.Z)({},Ue,{ref:xe}))}var Ge=ft.className,wt=(0,st.Z)(ft,Ee),dn=Fe.className,Rt=(0,st.Z)(Fe,Ve);return Se.createElement(lt.Provider,{value:null},Se.createElement(mt,(0,we.Z)({ref:xe,className:Oe()(Ge,dn)},wt,Rt)))},bt=Se.forwardRef(Xe);bt.displayName="RawItem";var je=bt,It=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],at="responsive",Ct="invalidate";function qe(Ft){return"+ ".concat(Ft.length," ...")}function Nt(Ft,Fe){var xe=Ft.prefixCls,ft=xe===void 0?"rc-overflow":xe,qt=Ft.data,Ot=qt===void 0?[]:qt,Ue=Ft.renderItem,Ge=Ft.renderRawItem,wt=Ft.itemKey,dn=Ft.itemWidth,Rt=dn===void 0?10:dn,an=Ft.ssr,$t=Ft.style,Bt=Ft.className,Tt=Ft.maxCount,ge=Ft.renderRest,se=Ft.renderRawRest,oe=Ft.prefix,fe=Ft.suffix,ve=Ft.component,ce=ve===void 0?"div":ve,$e=Ft.itemComponent,xt=Ft.onVisibleChange,Ut=(0,st.Z)(Ft,It),Ht=an==="full",Jt=Zt(),en=Je(Jt,null),hn=(0,Re.Z)(en,2),pn=hn[0],bn=hn[1],pt=pn||0,sn=Je(Jt,new Map),zn=(0,Re.Z)(sn,2),tt=zn[0],vt=zn[1],Lt=Je(Jt,0),Ln=(0,Re.Z)(Lt,2),Mn=Ln[0],_n=Ln[1],ti=Je(Jt,0),hi=(0,Re.Z)(ti,2),pi=hi[0],Bi=hi[1],_i=Je(Jt,0),Zn=(0,Re.Z)(_i,2),Fi=Zn[0],Wi=Zn[1],Gi=Je(Jt,0),nr=(0,Re.Z)(Gi,2),Pi=nr[0],Yi=nr[1],bi=(0,Se.useState)(null),ji=(0,Re.Z)(bi,2),Ji=ji[0],Vi=ji[1],ir=(0,Se.useState)(null),$i=(0,Re.Z)(ir,2),si=$i[0],fi=$i[1],kn=Se.useMemo(function(){return si===null&&Ht?Number.MAX_SAFE_INTEGER:si||0},[si,pn]),Dn=(0,Se.useState)(!1),mi=(0,Re.Z)(Dn,2),Qe=mi[0],ke=mi[1],Pe="".concat(ft,"-item"),Le=Math.max(Mn,pi),De=Tt===at,Ke=Ot.length&&De,it=Tt===Ct,kt=Ke||typeof Tt=="number"&&Ot.length>Tt,yt=(0,Se.useMemo)(function(){var Pt=Ot;return Ke?pn===null&&Ht?Pt=Ot:Pt=Ot.slice(0,Math.min(Ot.length,pt/Rt)):typeof Tt=="number"&&(Pt=Ot.slice(0,Tt)),Pt},[Ot,Rt,pn,Tt,Ke]),Dt=(0,Se.useMemo)(function(){return Ke?Ot.slice(kn+1):Ot.slice(yt.length)},[Ot,yt,Ke,kn]),Xt=(0,Se.useCallback)(function(Pt,At){var on;return typeof wt=="function"?wt(Pt):(on=wt&&(Pt==null?void 0:Pt[wt]))!==null&&on!==void 0?on:At},[wt]),tn=(0,Se.useCallback)(Ue||function(Pt){return Pt},[Ue]);function un(Pt,At,on){si===Pt&&(At===void 0||At===Ji)||(fi(Pt),on||(ke(Pt<Ot.length-1),xt==null||xt(Pt)),At!==void 0&&Vi(At))}function gt(Pt,At){bn(At.clientWidth)}function jt(Pt,At){vt(function(on){var cn=new Map(on);return At===null?cn.delete(Pt):cn.set(Pt,At),cn})}function Bn(Pt,At){Bi(At),_n(pi)}function yn(Pt,At){Wi(At)}function Tn(Pt,At){Yi(At)}function Cn(Pt){return tt.get(Xt(yt[Pt],Pt))}(0,Me.Z)(function(){if(pt&&typeof Le=="number"&&yt){var Pt=Fi+Pi,At=yt.length,on=At-1;if(!At){un(0,null);return}for(var cn=0;cn<At;cn+=1){var xn=Cn(cn);if(Ht&&(xn=xn||0),xn===void 0){un(cn-1,void 0,!0);break}if(Pt+=xn,on===0&&Pt<=pt||cn===on-1&&Pt+Cn(on)<=pt){un(on,null);break}else if(Pt+Le>pt){un(cn-1,Pt-xn-Pi+pi);break}}fe&&Cn(0)+Pi>pt&&Vi(null)}},[pt,tt,pi,Fi,Pi,Xt,yt]);var Yn=Qe&&!!Dt.length,ln={};Ji!==null&&Ke&&(ln={position:"absolute",left:Ji,top:0});var Un={prefixCls:Pe,responsive:Ke,component:$e,invalidate:it},Ze=Ge?function(Pt,At){var on=Xt(Pt,At);return Se.createElement(lt.Provider,{key:on,value:(0,ct.Z)((0,ct.Z)({},Un),{},{order:At,item:Pt,itemKey:on,registerSize:jt,display:At<=kn})},Ge(Pt,At))}:function(Pt,At){var on=Xt(Pt,At);return Se.createElement(mt,(0,we.Z)({},Un,{order:At,key:on,item:Pt,renderItem:tn,itemKey:on,registerSize:jt,display:At<=kn}))},St={order:Yn?kn:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:Bn,display:Yn},Mt=ge||qe,Kt=se?Se.createElement(lt.Provider,{value:(0,ct.Z)((0,ct.Z)({},Un),St)},se(Dt)):Se.createElement(mt,(0,we.Z)({},Un,St),typeof Mt=="function"?Mt(Dt):Mt),_t=Se.createElement(ce,(0,we.Z)({className:Oe()(!it&&ft,Bt),style:$t,ref:Fe},Ut),oe&&Se.createElement(mt,(0,we.Z)({},Un,{responsive:De,responsiveDisabled:!Ke,order:-1,className:"".concat(Pe,"-prefix"),registerSize:yn,display:!0}),oe),yt.map(Ze),kt?Kt:null,fe&&Se.createElement(mt,(0,we.Z)({},Un,{responsive:De,responsiveDisabled:!Ke,order:kn,className:"".concat(Pe,"-suffix"),registerSize:Tn,display:!0,style:ln}),fe));return De?Se.createElement(Ce.Z,{onResize:gt,disabled:!Ke},_t):_t}var Qt=Se.forwardRef(Nt);Qt.displayName="Overflow",Qt.Item=je,Qt.RESPONSIVE=at,Qt.INVALIDATE=Ct;var Vt=Qt,Gt=Vt},17115:function(mn,rn,he){"use strict";he.d(rn,{ZP:function(){return Oe}});var we=he(72190),ct=he(59301),Re=he(47273),st=0,Se=(0,Re.Z)();function Be(){var Ce;return Se?(Ce=st,st+=1):Ce="TEST_OR_SSR",Ce}function Oe(Ce){var Me=ct.useState(),Ne=(0,we.Z)(Me,2),ht=Ne[0],Ie=Ne[1];return ct.useEffect(function(){Ie("rc_select_".concat(Be()))},[]),Ce||ht}},77861:function(mn,rn,he){"use strict";he.d(rn,{Ac:function(){return pn},Xo:function(){return pi},Wx:function(){return _i},ZP:function(){return Pe},lk:function(){return lt}});var we=he(60499),ct=he(77654),Re=he(18642),st=he(85899),Se=he(72190),Be=he(42244),Oe=he(43749),Ce=he(18929),Me=he(48736),Ne=he(59301),ht=he(92310),Ie=he.n(ht),He=he(34280),mt=he(49658),Ye=he(10228),ot=he(8654),rt=function(De){var Ke=De.className,it=De.customizeIcon,kt=De.customizeIconProps,yt=De.onMouseDown,Dt=De.onClick,Xt=De.children,tn;return typeof it=="function"?tn=it(kt):tn=it,Ne.createElement("span",{className:Ke,onMouseDown:function(gt){gt.preventDefault(),yt&&yt(gt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Dt,"aria-hidden":!0},tn!==void 0?tn:Ne.createElement("span",{className:Ie()(Ke.split(/\s+/).map(function(un){return"".concat(un,"-icon")}))},Xt))},Et=rt;function Zt(Le,De,Ke,it,kt){var yt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Dt=arguments.length>6?arguments[6]:void 0,Xt=arguments.length>7?arguments[7]:void 0,tn=Ne.useMemo(function(){if((0,Oe.Z)(it)==="object")return it.clearIcon;if(kt)return kt},[it,kt]),un=Ne.useMemo(function(){return!!(!yt&&it&&(Ke.length||Dt)&&!(Xt==="combobox"&&Dt===""))},[it,yt,Ke.length,Dt,Xt]);return{allowClear:un,clearIcon:Ne.createElement(Et,{className:"".concat(Le,"-clear"),onMouseDown:De,customizeIcon:tn},"\xD7")}}var Je=Ne.createContext(null);function lt(){return Ne.useContext(Je)}function We(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,De=Ne.useState(!1),Ke=(0,Se.Z)(De,2),it=Ke[0],kt=Ke[1],yt=Ne.useRef(null),Dt=function(){window.clearTimeout(yt.current)};Ne.useEffect(function(){return Dt},[]);var Xt=function(un,gt){Dt(),yt.current=window.setTimeout(function(){kt(un),gt&&gt()},Le)};return[it,Xt,Dt]}function Ee(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,De=Ne.useRef(null),Ke=Ne.useRef(null);Ne.useEffect(function(){return function(){window.clearTimeout(Ke.current)}},[]);function it(kt){(kt||De.current===null)&&(De.current=kt),window.clearTimeout(Ke.current),Ke.current=window.setTimeout(function(){De.current=null},Le)}return[function(){return De.current},it]}function Ve(Le,De,Ke,it){var kt=Ne.useRef(null);kt.current={open:De,triggerOpen:Ke,customizedTrigger:it},Ne.useEffect(function(){function yt(Dt){var Xt;if(!((Xt=kt.current)!==null&&Xt!==void 0&&Xt.customizedTrigger)){var tn=Dt.target;tn.shadowRoot&&Dt.composed&&(tn=Dt.composedPath()[0]||tn),kt.current.open&&Le().filter(function(un){return un}).every(function(un){return!un.contains(tn)&&un!==tn})&&kt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",yt),function(){return window.removeEventListener("mousedown",yt)}},[])}var Xe=he(26112),bt=he(83836),je=function(De,Ke){var it,kt,yt=De.prefixCls,Dt=De.id,Xt=De.inputElement,tn=De.disabled,un=De.tabIndex,gt=De.autoFocus,jt=De.autoComplete,Bn=De.editable,yn=De.activeDescendantId,Tn=De.value,Cn=De.maxLength,Yn=De.onKeyDown,ln=De.onMouseDown,Un=De.onChange,Ze=De.onPaste,St=De.onCompositionStart,Mt=De.onCompositionEnd,Kt=De.open,_t=De.attrs,Pt=Xt||Ne.createElement("input",null),At=Pt,on=At.ref,cn=At.props,xn=cn.onKeyDown,Vn=cn.onChange,ni=cn.onMouseDown,gi=cn.onCompositionStart,ii=cn.onCompositionEnd,Kn=cn.style;return(0,Me.Kp)(!("maxLength"in Pt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Pt=Ne.cloneElement(Pt,(0,st.Z)((0,st.Z)((0,st.Z)({type:"search"},cn),{},{id:Dt,ref:(0,ot.sQ)(Ke,on),disabled:tn,tabIndex:un,autoComplete:jt||"off",autoFocus:gt,className:Ie()("".concat(yt,"-selection-search-input"),(it=Pt)===null||it===void 0||(kt=it.props)===null||kt===void 0?void 0:kt.className),role:"combobox","aria-label":"Search","aria-expanded":Kt||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Dt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Dt,"_list"),"aria-activedescendant":Kt?yn:void 0},_t),{},{value:Bn?Tn:"",maxLength:Cn,readOnly:!Bn,unselectable:Bn?null:"on",style:(0,st.Z)((0,st.Z)({},Kn),{},{opacity:Bn?null:0}),onKeyDown:function(ui){Yn(ui),xn&&xn(ui)},onMouseDown:function(ui){ln(ui),ni&&ni(ui)},onChange:function(ui){Un(ui),Vn&&Vn(ui)},onCompositionStart:function(ui){St(ui),gi&&gi(ui)},onCompositionEnd:function(ui){Mt(ui),ii&&ii(ui)},onPaste:Ze})),Pt},It=Ne.forwardRef(je);It.displayName="Input";var at=It;function Ct(Le){return Array.isArray(Le)?Le:Le!==void 0?[Le]:[]}var qe=typeof window!="undefined"&&window.document&&window.document.documentElement,Nt=qe;function Qt(Le){return Le!=null}function Vt(Le){return!Le&&Le!==0}function Gt(Le){return["string","number"].includes((0,Oe.Z)(Le))}function Ft(Le){var De=void 0;return Le&&(Gt(Le.title)?De=Le.title.toString():Gt(Le.label)&&(De=Le.label.toString())),De}function Fe(Le,De){Nt?Ne.useLayoutEffect(Le,De):Ne.useEffect(Le,De)}function xe(Le){var De;return(De=Le.key)!==null&&De!==void 0?De:Le.value}var ft=function(De){De.preventDefault(),De.stopPropagation()},qt=function(De){var Ke=De.id,it=De.prefixCls,kt=De.values,yt=De.open,Dt=De.searchValue,Xt=De.autoClearSearchValue,tn=De.inputRef,un=De.placeholder,gt=De.disabled,jt=De.mode,Bn=De.showSearch,yn=De.autoFocus,Tn=De.autoComplete,Cn=De.activeDescendantId,Yn=De.tabIndex,ln=De.removeIcon,Un=De.maxTagCount,Ze=De.maxTagTextLength,St=De.maxTagPlaceholder,Mt=St===void 0?function(Ti){return"+ ".concat(Ti.length," ...")}:St,Kt=De.tagRender,_t=De.onToggleOpen,Pt=De.onRemove,At=De.onInputChange,on=De.onInputPaste,cn=De.onInputKeyDown,xn=De.onInputMouseDown,Vn=De.onInputCompositionStart,ni=De.onInputCompositionEnd,gi=Ne.useRef(null),ii=(0,Ne.useState)(0),Kn=(0,Se.Z)(ii,2),vi=Kn[0],ui=Kn[1],ci=(0,Ne.useState)(!1),Fn=(0,Se.Z)(ci,2),Jn=Fn[0],li=Fn[1],Qn="".concat(it,"-selection"),Di=yt||jt==="multiple"&&Xt===!1||jt==="tags"?Dt:"",Hi=jt==="tags"||jt==="multiple"&&Xt===!1||Bn&&(yt||Jn);Fe(function(){ui(gi.current.scrollWidth)},[Di]);function ai(Ti,wi,Ui,Ii,fr){return Ne.createElement("span",{className:Ie()("".concat(Qn,"-item"),(0,Re.Z)({},"".concat(Qn,"-item-disabled"),Ui)),title:Ft(Ti)},Ne.createElement("span",{className:"".concat(Qn,"-item-content")},wi),Ii&&Ne.createElement(Et,{className:"".concat(Qn,"-item-remove"),onMouseDown:ft,onClick:fr,customizeIcon:ln},"\xD7"))}function wn(Ti,wi,Ui,Ii,fr){var Gn=function(Mi){ft(Mi),_t(!yt)};return Ne.createElement("span",{onMouseDown:Gn},Kt({label:wi,value:Ti,disabled:Ui,closable:Ii,onClose:fr}))}function fn(Ti){var wi=Ti.disabled,Ui=Ti.label,Ii=Ti.value,fr=!gt&&!wi,Gn=Ui;if(typeof Ze=="number"&&(typeof Ui=="string"||typeof Ui=="number")){var Hn=String(Gn);Hn.length>Ze&&(Gn="".concat(Hn.slice(0,Ze),"..."))}var Mi=function(sr){sr&&sr.stopPropagation(),Pt(Ti)};return typeof Kt=="function"?wn(Ii,Gn,wi,fr,Mi):ai(Ti,Gn,wi,fr,Mi)}function ri(Ti){var wi=typeof Mt=="function"?Mt(Ti):Mt;return ai({title:wi},wi,!1)}var jn=Ne.createElement("div",{className:"".concat(Qn,"-search"),style:{width:vi},onFocus:function(){li(!0)},onBlur:function(){li(!1)}},Ne.createElement(at,{ref:tn,open:yt,prefixCls:it,id:Ke,inputElement:null,disabled:gt,autoFocus:yn,autoComplete:Tn,editable:Hi,activeDescendantId:Cn,value:Di,onKeyDown:cn,onMouseDown:xn,onChange:At,onPaste:on,onCompositionStart:Vn,onCompositionEnd:ni,tabIndex:Yn,attrs:(0,Xe.Z)(De,!0)}),Ne.createElement("span",{ref:gi,className:"".concat(Qn,"-search-mirror"),"aria-hidden":!0},Di,"\xA0")),yi=Ne.createElement(bt.Z,{prefixCls:"".concat(Qn,"-overflow"),data:kt,renderItem:fn,renderRest:ri,suffix:jn,itemKey:xe,maxCount:Un});return Ne.createElement(Ne.Fragment,null,yi,!kt.length&&!Di&&Ne.createElement("span",{className:"".concat(Qn,"-placeholder")},un))},Ot=qt,Ue=function(De){var Ke=De.inputElement,it=De.prefixCls,kt=De.id,yt=De.inputRef,Dt=De.disabled,Xt=De.autoFocus,tn=De.autoComplete,un=De.activeDescendantId,gt=De.mode,jt=De.open,Bn=De.values,yn=De.placeholder,Tn=De.tabIndex,Cn=De.showSearch,Yn=De.searchValue,ln=De.activeValue,Un=De.maxLength,Ze=De.onInputKeyDown,St=De.onInputMouseDown,Mt=De.onInputChange,Kt=De.onInputPaste,_t=De.onInputCompositionStart,Pt=De.onInputCompositionEnd,At=De.title,on=Ne.useState(!1),cn=(0,Se.Z)(on,2),xn=cn[0],Vn=cn[1],ni=gt==="combobox",gi=ni||Cn,ii=Bn[0],Kn=Yn||"";ni&&ln&&!xn&&(Kn=ln),Ne.useEffect(function(){ni&&Vn(!1)},[ni,ln]);var vi=gt!=="combobox"&&!jt&&!Cn?!1:!!Kn,ui=At===void 0?Ft(ii):At,ci=function(){if(ii)return null;var Jn=vi?{visibility:"hidden"}:void 0;return Ne.createElement("span",{className:"".concat(it,"-selection-placeholder"),style:Jn},yn)};return Ne.createElement(Ne.Fragment,null,Ne.createElement("span",{className:"".concat(it,"-selection-search")},Ne.createElement(at,{ref:yt,prefixCls:it,id:kt,open:jt,inputElement:Ke,disabled:Dt,autoFocus:Xt,autoComplete:tn,editable:gi,activeDescendantId:un,value:Kn,onKeyDown:Ze,onMouseDown:St,onChange:function(Jn){Vn(!0),Mt(Jn)},onPaste:Kt,onCompositionStart:_t,onCompositionEnd:Pt,tabIndex:Tn,attrs:(0,Xe.Z)(De,!0),maxLength:ni?Un:void 0})),!ni&&ii?Ne.createElement("span",{className:"".concat(it,"-selection-item"),title:ui,style:vi?{visibility:"hidden"}:void 0},ii.label):null,ci())},Ge=Ue;function wt(Le){return![Ye.Z.ESC,Ye.Z.SHIFT,Ye.Z.BACKSPACE,Ye.Z.TAB,Ye.Z.WIN_KEY,Ye.Z.ALT,Ye.Z.META,Ye.Z.WIN_KEY_RIGHT,Ye.Z.CTRL,Ye.Z.SEMICOLON,Ye.Z.EQUALS,Ye.Z.CAPS_LOCK,Ye.Z.CONTEXT_MENU,Ye.Z.F1,Ye.Z.F2,Ye.Z.F3,Ye.Z.F4,Ye.Z.F5,Ye.Z.F6,Ye.Z.F7,Ye.Z.F8,Ye.Z.F9,Ye.Z.F10,Ye.Z.F11,Ye.Z.F12].includes(Le)}var dn=function(De,Ke){var it=(0,Ne.useRef)(null),kt=(0,Ne.useRef)(!1),yt=De.prefixCls,Dt=De.open,Xt=De.mode,tn=De.showSearch,un=De.tokenWithEnter,gt=De.autoClearSearchValue,jt=De.onSearch,Bn=De.onSearchSubmit,yn=De.onToggleOpen,Tn=De.onInputKeyDown,Cn=De.domRef;Ne.useImperativeHandle(Ke,function(){return{focus:function(){it.current.focus()},blur:function(){it.current.blur()}}});var Yn=Ee(0),ln=(0,Se.Z)(Yn,2),Un=ln[0],Ze=ln[1],St=function(Kn){var vi=Kn.which;(vi===Ye.Z.UP||vi===Ye.Z.DOWN)&&Kn.preventDefault(),Tn&&Tn(Kn),vi===Ye.Z.ENTER&&Xt==="tags"&&!kt.current&&!Dt&&(Bn==null||Bn(Kn.target.value)),wt(vi)&&yn(!0)},Mt=function(){Ze(!0)},Kt=(0,Ne.useRef)(null),_t=function(Kn){jt(Kn,!0,kt.current)!==!1&&yn(!0)},Pt=function(){kt.current=!0},At=function(Kn){kt.current=!1,Xt!=="combobox"&&_t(Kn.target.value)},on=function(Kn){var vi=Kn.target.value;if(un&&Kt.current&&/[\r\n]/.test(Kt.current)){var ui=Kt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");vi=vi.replace(ui,Kt.current)}Kt.current=null,_t(vi)},cn=function(Kn){var vi=Kn.clipboardData,ui=vi.getData("text");Kt.current=ui},xn=function(Kn){var vi=Kn.target;if(vi!==it.current){var ui=document.body.style.msTouchAction!==void 0;ui?setTimeout(function(){it.current.focus()}):it.current.focus()}},Vn=function(Kn){var vi=Un();Kn.target!==it.current&&!vi&&Xt!=="combobox"&&Kn.preventDefault(),(Xt!=="combobox"&&(!tn||!vi)||!Dt)&&(Dt&&gt!==!1&&jt("",!0,!1),yn())},ni={inputRef:it,onInputKeyDown:St,onInputMouseDown:Mt,onInputChange:on,onInputPaste:cn,onInputCompositionStart:Pt,onInputCompositionEnd:At},gi=Xt==="multiple"||Xt==="tags"?Ne.createElement(Ot,(0,we.Z)({},De,ni)):Ne.createElement(Ge,(0,we.Z)({},De,ni));return Ne.createElement("div",{ref:Cn,className:"".concat(yt,"-selector"),onClick:xn,onMouseDown:Vn},gi)},Rt=Ne.forwardRef(dn);Rt.displayName="Selector";var an=Rt,$t=he(35593),Bt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Tt=function(De){var Ke=De===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Ke,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Ke,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Ke,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Ke,adjustY:1},htmlRegion:"scroll"}}},ge=function(De,Ke){var it=De.prefixCls,kt=De.disabled,yt=De.visible,Dt=De.children,Xt=De.popupElement,tn=De.animation,un=De.transitionName,gt=De.dropdownStyle,jt=De.dropdownClassName,Bn=De.direction,yn=Bn===void 0?"ltr":Bn,Tn=De.placement,Cn=De.builtinPlacements,Yn=De.dropdownMatchSelectWidth,ln=De.dropdownRender,Un=De.dropdownAlign,Ze=De.getPopupContainer,St=De.empty,Mt=De.getTriggerDOMNode,Kt=De.onPopupVisibleChange,_t=De.onPopupMouseEnter,Pt=(0,Be.Z)(De,Bt),At="".concat(it,"-dropdown"),on=Xt;ln&&(on=ln(Xt));var cn=Ne.useMemo(function(){return Cn||Tt(Yn)},[Cn,Yn]),xn=tn?"".concat(At,"-").concat(tn):un,Vn=typeof Yn=="number",ni=Ne.useMemo(function(){return Vn?null:Yn===!1?"minWidth":"width"},[Yn,Vn]),gi=gt;Vn&&(gi=(0,st.Z)((0,st.Z)({},gi),{},{width:Yn}));var ii=Ne.useRef(null);return Ne.useImperativeHandle(Ke,function(){return{getPopupElement:function(){return ii.current}}}),Ne.createElement($t.Z,(0,we.Z)({},Pt,{showAction:Kt?["click"]:[],hideAction:Kt?["click"]:[],popupPlacement:Tn||(yn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:cn,prefixCls:At,popupTransitionName:xn,popup:Ne.createElement("div",{ref:ii,onMouseEnter:_t},on),stretch:ni,popupAlign:Un,popupVisible:yt,getPopupContainer:Ze,popupClassName:Ie()(jt,(0,Re.Z)({},"".concat(At,"-empty"),St)),popupStyle:gi,getTriggerDOMNode:Mt,onPopupVisibleChange:Kt}),Dt)},se=Ne.forwardRef(ge);se.displayName="SelectTrigger";var oe=se,fe=he(48745);function ve(Le,De){var Ke=Le.key,it;return"value"in Le&&(it=Le.value),Ke!=null?Ke:it!==void 0?it:"rc-index-key-".concat(De)}function ce(Le,De){var Ke=Le||{},it=Ke.label,kt=Ke.value,yt=Ke.options,Dt=Ke.groupLabel,Xt=it||(De?"children":"label");return{label:Xt,value:kt||"value",options:yt||"options",groupLabel:Dt||Xt}}function $e(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ke=De.fieldNames,it=De.childrenAsData,kt=[],yt=ce(Ke,!1),Dt=yt.label,Xt=yt.value,tn=yt.options,un=yt.groupLabel;function gt(jt,Bn){jt.forEach(function(yn){if(Bn||!(tn in yn)){var Tn=yn[Xt];kt.push({key:ve(yn,kt.length),groupOption:Bn,data:yn,label:yn[Dt],value:Tn})}else{var Cn=yn[un];Cn===void 0&&it&&(Cn=yn.label),kt.push({key:ve(yn,kt.length),group:!0,data:yn,label:Cn}),gt(yn[tn],!0)}})}return gt(Le,!1),kt}function xt(Le){var De=(0,st.Z)({},Le);return"props"in De||Object.defineProperty(De,"props",{get:function(){return(0,Me.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),De}}),De}function Ut(Le,De){if(!De||!De.length)return null;var Ke=!1;function it(yt,Dt){var Xt=(0,fe.Z)(Dt),tn=Xt[0],un=Xt.slice(1);if(!tn)return[yt];var gt=yt.split(tn);return Ke=Ke||gt.length>1,gt.reduce(function(jt,Bn){return[].concat((0,ct.Z)(jt),(0,ct.Z)(it(Bn,un)))},[]).filter(function(jt){return jt})}var kt=it(Le,De);return Ke?kt:null}var Ht=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Jt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function en(Le){return Le==="tags"||Le==="multiple"}var hn=Ne.forwardRef(function(Le,De){var Ke,it,kt=Le.id,yt=Le.prefixCls,Dt=Le.className,Xt=Le.showSearch,tn=Le.tagRender,un=Le.direction,gt=Le.omitDomProps,jt=Le.displayValues,Bn=Le.onDisplayValuesChange,yn=Le.emptyOptions,Tn=Le.notFoundContent,Cn=Tn===void 0?"Not Found":Tn,Yn=Le.onClear,ln=Le.mode,Un=Le.disabled,Ze=Le.loading,St=Le.getInputElement,Mt=Le.getRawInputElement,Kt=Le.open,_t=Le.defaultOpen,Pt=Le.onDropdownVisibleChange,At=Le.activeValue,on=Le.onActiveValueChange,cn=Le.activeDescendantId,xn=Le.searchValue,Vn=Le.autoClearSearchValue,ni=Le.onSearch,gi=Le.onSearchSplit,ii=Le.tokenSeparators,Kn=Le.allowClear,vi=Le.suffixIcon,ui=Le.clearIcon,ci=Le.OptionList,Fn=Le.animation,Jn=Le.transitionName,li=Le.dropdownStyle,Qn=Le.dropdownClassName,Di=Le.dropdownMatchSelectWidth,Hi=Le.dropdownRender,ai=Le.dropdownAlign,wn=Le.placement,fn=Le.builtinPlacements,ri=Le.getPopupContainer,jn=Le.showAction,yi=jn===void 0?[]:jn,Ti=Le.onFocus,wi=Le.onBlur,Ui=Le.onKeyUp,Ii=Le.onKeyDown,fr=Le.onMouseDown,Gn=(0,Be.Z)(Le,Ht),Hn=en(ln),Mi=(Xt!==void 0?Xt:Hn)||ln==="combobox",Ai=(0,st.Z)({},Gn);Jt.forEach(function(gr){delete Ai[gr]}),gt==null||gt.forEach(function(gr){delete Ai[gr]});var sr=Ne.useState(!1),qr=(0,Se.Z)(sr,2),Ar=qr[0],Xi=qr[1];Ne.useEffect(function(){Xi((0,mt.Z)())},[]);var yr=Ne.useRef(null),pr=Ne.useRef(null),Rn=Ne.useRef(null),In=Ne.useRef(null),Pn=Ne.useRef(null),Xn=We(),qi=(0,Se.Z)(Xn,3),hr=qi[0],br=qi[1],mr=qi[2];Ne.useImperativeHandle(De,function(){var gr,or;return{focus:(gr=In.current)===null||gr===void 0?void 0:gr.focus,blur:(or=In.current)===null||or===void 0?void 0:or.blur,scrollTo:function(Ea){var Wr;return(Wr=Pn.current)===null||Wr===void 0?void 0:Wr.scrollTo(Ea)}}});var ar=Ne.useMemo(function(){var gr;if(ln!=="combobox")return xn;var or=(gr=jt[0])===null||gr===void 0?void 0:gr.value;return typeof or=="string"||typeof or=="number"?String(or):""},[xn,ln,jt]),wr=ln==="combobox"&&typeof St=="function"&&St()||null,Kr=typeof Mt=="function"&&Mt(),Br=(0,ot.x1)(pr,Kr==null||(Ke=Kr.props)===null||Ke===void 0?void 0:Ke.ref),pa=Ne.useState(!1),ea=(0,Se.Z)(pa,2),Or=ea[0],Qa=ea[1];(0,He.Z)(function(){Qa(!0)},[]);var Ma=(0,Ce.Z)(!1,{defaultValue:_t,value:Kt}),ma=(0,Se.Z)(Ma,2),ta=ma[0],Sr=ma[1],ki=Or?ta:!1,Zi=!Cn&&yn;(Un||Zi&&ki&&ln==="combobox")&&(ki=!1);var Ri=Zi?!1:ki,Si=Ne.useCallback(function(gr){var or=gr!==void 0?gr:!ki;Un||(Sr(or),ki!==or&&(Pt==null||Pt(or)))},[Un,ki,Sr,Pt]),tr=Ne.useMemo(function(){return(ii||[]).some(function(gr){return[`
`,`\r
`].includes(gr)})},[ii]),Qi=function(or,Ir,Ea){var Wr=!0,Oa=or;on==null||on(null);var Fa=Ea?null:Ut(or,ii);return ln!=="combobox"&&Fa&&(Oa="",gi==null||gi(Fa),Si(!1),Wr=!1),ni&&ar!==Oa&&ni(Oa,{source:Ir?"typing":"effect"}),Wr},Pr=function(or){!or||!or.trim()||ni(or,{source:"submit"})};Ne.useEffect(function(){!ki&&!Hn&&ln!=="combobox"&&Qi("",!1,!1)},[ki]),Ne.useEffect(function(){ta&&Un&&Sr(!1),Un&&br(!1)},[Un]);var Rr=Ee(),Nr=(0,Se.Z)(Rr,2),Yr=Nr[0],ur=Nr[1],lr=function(or){var Ir=Yr(),Ea=or.which;if(Ea===Ye.Z.ENTER&&(ln!=="combobox"&&or.preventDefault(),ki||Si(!0)),ur(!!ar),Ea===Ye.Z.BACKSPACE&&!Ir&&Hn&&!ar&&jt.length){for(var Wr=(0,ct.Z)(jt),Oa=null,Fa=Wr.length-1;Fa>=0;Fa-=1){var to=Wr[Fa];if(!to.disabled){Wr.splice(Fa,1),Oa=to;break}}Oa&&Bn(Wr,{type:"remove",values:[Oa]})}for(var Ra=arguments.length,so=new Array(Ra>1?Ra-1:0),lo=1;lo<Ra;lo++)so[lo-1]=arguments[lo];if(ki&&Pn.current){var La;(La=Pn.current).onKeyDown.apply(La,[or].concat(so))}Ii==null||Ii.apply(void 0,[or].concat(so))},Hr=function(or){for(var Ir=arguments.length,Ea=new Array(Ir>1?Ir-1:0),Wr=1;Wr<Ir;Wr++)Ea[Wr-1]=arguments[Wr];if(ki&&Pn.current){var Oa;(Oa=Pn.current).onKeyUp.apply(Oa,[or].concat(Ea))}Ui==null||Ui.apply(void 0,[or].concat(Ea))},aa=function(or){var Ir=jt.filter(function(Ea){return Ea!==or});Bn(Ir,{type:"remove",values:[or]})},ia=Ne.useRef(!1),Xr=function(){br(!0),Un||(Ti&&!ia.current&&Ti.apply(void 0,arguments),yi.includes("focus")&&Si(!0)),ia.current=!0},ts=function(){br(!1,function(){ia.current=!1,Si(!1)}),!Un&&(ar&&(ln==="tags"?ni(ar,{source:"submit"}):ln==="multiple"&&ni("",{source:"blur"})),wi&&wi.apply(void 0,arguments))},ao=[];Ne.useEffect(function(){return function(){ao.forEach(function(gr){return clearTimeout(gr)}),ao.splice(0,ao.length)}},[]);var oo=function(or){var Ir,Ea=or.target,Wr=(Ir=Rn.current)===null||Ir===void 0?void 0:Ir.getPopupElement();if(Wr&&Wr.contains(Ea)){var Oa=setTimeout(function(){var so=ao.indexOf(Oa);if(so!==-1&&ao.splice(so,1),mr(),!Ar&&!Wr.contains(document.activeElement)){var lo;(lo=In.current)===null||lo===void 0||lo.focus()}});ao.push(Oa)}for(var Fa=arguments.length,to=new Array(Fa>1?Fa-1:0),Ra=1;Ra<Fa;Ra++)to[Ra-1]=arguments[Ra];fr==null||fr.apply(void 0,[or].concat(to))},eo=Ne.useState({}),Ss=(0,Se.Z)(eo,2),fo=Ss[1];function ka(){fo({})}var ua;Kr&&(ua=function(or){Si(or)}),Ve(function(){var gr;return[yr.current,(gr=Rn.current)===null||gr===void 0?void 0:gr.getPopupElement()]},Ri,Si,!!Kr);var bo=Ne.useMemo(function(){return(0,st.Z)((0,st.Z)({},Le),{},{notFoundContent:Cn,open:ki,triggerOpen:Ri,id:kt,showSearch:Mi,multiple:Hn,toggleOpen:Si})},[Le,Cn,Ri,ki,kt,Mi,Hn,Si]),ko=!!vi||Ze,Eo;ko&&(Eo=Ne.createElement(Et,{className:Ie()("".concat(yt,"-arrow"),(0,Re.Z)({},"".concat(yt,"-arrow-loading"),Ze)),customizeIcon:vi,customizeIconProps:{loading:Ze,searchValue:ar,open:ki,focused:hr,showSearch:Mi}}));var ns=function(){var or;Yn==null||Yn(),(or=In.current)===null||or===void 0||or.focus(),Bn([],{type:"clear",values:jt}),Qi("",!1,!1)},Ro=Zt(yt,ns,jt,Kn,ui,Un,ar,ln),Ua=Ro.allowClear,Ia=Ro.clearIcon,Er=Ne.createElement(ci,{ref:Pn}),Lo=Ie()(yt,Dt,(it={},(0,Re.Z)(it,"".concat(yt,"-focused"),hr),(0,Re.Z)(it,"".concat(yt,"-multiple"),Hn),(0,Re.Z)(it,"".concat(yt,"-single"),!Hn),(0,Re.Z)(it,"".concat(yt,"-allow-clear"),Kn),(0,Re.Z)(it,"".concat(yt,"-show-arrow"),ko),(0,Re.Z)(it,"".concat(yt,"-disabled"),Un),(0,Re.Z)(it,"".concat(yt,"-loading"),Ze),(0,Re.Z)(it,"".concat(yt,"-open"),ki),(0,Re.Z)(it,"".concat(yt,"-customize-input"),wr),(0,Re.Z)(it,"".concat(yt,"-show-search"),Mi),it)),is=Ne.createElement(oe,{ref:Rn,disabled:Un,prefixCls:yt,visible:Ri,popupElement:Er,animation:Fn,transitionName:Jn,dropdownStyle:li,dropdownClassName:Qn,direction:un,dropdownMatchSelectWidth:Di,dropdownRender:Hi,dropdownAlign:ai,placement:wn,builtinPlacements:fn,getPopupContainer:ri,empty:yn,getTriggerDOMNode:function(){return pr.current},onPopupVisibleChange:ua,onPopupMouseEnter:ka},Kr?Ne.cloneElement(Kr,{ref:Br}):Ne.createElement(an,(0,we.Z)({},Le,{domRef:pr,prefixCls:yt,inputElement:wr,ref:In,id:kt,showSearch:Mi,autoClearSearchValue:Vn,mode:ln,activeDescendantId:cn,tagRender:tn,values:jt,open:ki,onToggleOpen:Si,activeValue:At,searchValue:ar,onSearch:Qi,onSearchSubmit:Pr,onRemove:aa,tokenWithEnter:tr}))),Do;return Kr?Do=is:Do=Ne.createElement("div",(0,we.Z)({className:Lo},Ai,{ref:yr,onMouseDown:oo,onKeyDown:lr,onKeyUp:Hr,onFocus:Xr,onBlur:ts}),hr&&!ki&&Ne.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(jt.map(function(gr){var or=gr.label,Ir=gr.value;return["number","string"].includes((0,Oe.Z)(or))?or:Ir}).join(", "))),is,Eo,Ua&&Ia),Ne.createElement(Je.Provider,{value:bo},Do)}),pn=hn,bn=function(Le,De){var Ke=Ne.useRef({values:new Map,options:new Map}),it=Ne.useMemo(function(){var yt=Ke.current,Dt=yt.values,Xt=yt.options,tn=Le.map(function(jt){if(jt.label===void 0){var Bn;return(0,st.Z)((0,st.Z)({},jt),{},{label:(Bn=Dt.get(jt.value))===null||Bn===void 0?void 0:Bn.label})}return jt}),un=new Map,gt=new Map;return tn.forEach(function(jt){un.set(jt.value,jt),gt.set(jt.value,De.get(jt.value)||Xt.get(jt.value))}),Ke.current.values=un,Ke.current.options=gt,tn},[Le,De]),kt=Ne.useCallback(function(yt){return De.get(yt)||Ke.current.options.get(yt)},[De]);return[it,kt]};function pt(Le,De){return Ct(Le).join("").toUpperCase().includes(De)}var sn=function(Le,De,Ke,it,kt){return Ne.useMemo(function(){if(!Ke||it===!1)return Le;var yt=De.options,Dt=De.label,Xt=De.value,tn=[],un=typeof it=="function",gt=Ke.toUpperCase(),jt=un?it:function(yn,Tn){return kt?pt(Tn[kt],gt):Tn[yt]?pt(Tn[Dt!=="children"?Dt:"label"],gt):pt(Tn[Xt],gt)},Bn=un?function(yn){return xt(yn)}:function(yn){return yn};return Le.forEach(function(yn){if(yn[yt]){var Tn=jt(Ke,Bn(yn));if(Tn)tn.push(yn);else{var Cn=yn[yt].filter(function(Yn){return jt(Ke,Bn(Yn))});Cn.length&&tn.push((0,st.Z)((0,st.Z)({},yn),{},(0,Re.Z)({},yt,Cn)))}return}jt(Ke,Bn(yn))&&tn.push(yn)}),tn},[Le,it,kt,Ke,De])},zn=he(17115),tt=he(11592),vt=["children","value"],Lt=["children"];function Ln(Le){var De=Le,Ke=De.key,it=De.props,kt=it.children,yt=it.value,Dt=(0,Be.Z)(it,vt);return(0,st.Z)({key:Ke,value:yt!==void 0?yt:Ke,children:kt},Dt)}function Mn(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,tt.Z)(Le).map(function(Ke,it){if(!Ne.isValidElement(Ke)||!Ke.type)return null;var kt=Ke,yt=kt.type.isSelectOptGroup,Dt=kt.key,Xt=kt.props,tn=Xt.children,un=(0,Be.Z)(Xt,Lt);return De||!yt?Ln(Ke):(0,st.Z)((0,st.Z)({key:"__RC_SELECT_GRP__".concat(Dt===null?it:Dt,"__"),label:Dt},un),{},{options:Mn(tn)})}).filter(function(Ke){return Ke})}function _n(Le,De,Ke,it,kt){return Ne.useMemo(function(){var yt=Le,Dt=!Le;Dt&&(yt=Mn(De));var Xt=new Map,tn=new Map,un=function(Bn,yn,Tn){Tn&&typeof Tn=="string"&&Bn.set(yn[Tn],yn)};function gt(jt){for(var Bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,yn=0;yn<jt.length;yn+=1){var Tn=jt[yn];!Tn[Ke.options]||Bn?(Xt.set(Tn[Ke.value],Tn),un(tn,Tn,Ke.label),un(tn,Tn,it),un(tn,Tn,kt)):gt(Tn[Ke.options],!0)}}return gt(yt),{options:yt,valueOptions:Xt,labelOptions:tn}},[Le,De,Ke,it,kt])}function ti(Le){var De=Ne.useRef();De.current=Le;var Ke=Ne.useCallback(function(){return De.current.apply(De,arguments)},[]);return Ke}var hi=function(){return null};hi.isSelectOptGroup=!0;var pi=hi,Bi=function(){return null};Bi.isSelectOption=!0;var _i=Bi,Zn=he(80547),Fi=he(2738),Wi=he(48911),Gi=Ne.createContext(null),nr=Gi;function Pi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Yi=["disabled","title","children","style","className"];function bi(Le){return typeof Le=="string"||typeof Le=="number"}var ji=function(De,Ke){var it=lt(),kt=it.prefixCls,yt=it.id,Dt=it.open,Xt=it.multiple,tn=it.mode,un=it.searchValue,gt=it.toggleOpen,jt=it.notFoundContent,Bn=it.onPopupScroll,yn=Ne.useContext(nr),Tn=yn.flattenOptions,Cn=yn.onActiveValue,Yn=yn.defaultActiveFirstOption,ln=yn.onSelect,Un=yn.menuItemSelectedIcon,Ze=yn.rawValues,St=yn.fieldNames,Mt=yn.virtual,Kt=yn.direction,_t=yn.listHeight,Pt=yn.listItemHeight,At="".concat(kt,"-item"),on=(0,Zn.Z)(function(){return Tn},[Dt,Tn],function(ai,wn){return wn[0]&&ai[1]!==wn[1]}),cn=Ne.useRef(null),xn=function(wn){wn.preventDefault()},Vn=function(wn){cn.current&&cn.current.scrollTo(typeof wn=="number"?{index:wn}:wn)},ni=function(wn){for(var fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ri=on.length,jn=0;jn<ri;jn+=1){var yi=(wn+jn*fn+ri)%ri,Ti=on[yi],wi=Ti.group,Ui=Ti.data;if(!wi&&!Ui.disabled)return yi}return-1},gi=Ne.useState(function(){return ni(0)}),ii=(0,Se.Z)(gi,2),Kn=ii[0],vi=ii[1],ui=function(wn){var fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;vi(wn);var ri={source:fn?"keyboard":"mouse"},jn=on[wn];if(!jn){Cn(null,-1,ri);return}Cn(jn.value,wn,ri)};(0,Ne.useEffect)(function(){ui(Yn!==!1?ni(0):-1)},[on.length,un]);var ci=Ne.useCallback(function(ai){return Ze.has(ai)&&tn!=="combobox"},[tn,(0,ct.Z)(Ze).toString(),Ze.size]);(0,Ne.useEffect)(function(){var ai=setTimeout(function(){if(!Xt&&Dt&&Ze.size===1){var fn=Array.from(Ze)[0],ri=on.findIndex(function(jn){var yi=jn.data;return yi.value===fn});ri!==-1&&(ui(ri),Vn(ri))}});if(Dt){var wn;(wn=cn.current)===null||wn===void 0||wn.scrollTo(void 0)}return function(){return clearTimeout(ai)}},[Dt,un,Tn.length]);var Fn=function(wn){wn!==void 0&&ln(wn,{selected:!Ze.has(wn)}),Xt||gt(!1)};if(Ne.useImperativeHandle(Ke,function(){return{onKeyDown:function(wn){var fn=wn.which,ri=wn.ctrlKey;switch(fn){case Ye.Z.N:case Ye.Z.P:case Ye.Z.UP:case Ye.Z.DOWN:{var jn=0;if(fn===Ye.Z.UP?jn=-1:fn===Ye.Z.DOWN?jn=1:Pi()&&ri&&(fn===Ye.Z.N?jn=1:fn===Ye.Z.P&&(jn=-1)),jn!==0){var yi=ni(Kn+jn,jn);Vn(yi),ui(yi,!0)}break}case Ye.Z.ENTER:{var Ti=on[Kn];Ti&&!Ti.data.disabled?Fn(Ti.value):Fn(void 0),Dt&&wn.preventDefault();break}case Ye.Z.ESC:gt(!1),Dt&&wn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(wn){Vn(wn)}}}),on.length===0)return Ne.createElement("div",{role:"listbox",id:"".concat(yt,"_list"),className:"".concat(At,"-empty"),onMouseDown:xn},jt);var Jn=Object.keys(St).map(function(ai){return St[ai]}),li=function(wn){return wn.label};function Qn(ai,wn){var fn=ai.group;return{role:fn?"presentation":"option",id:"".concat(yt,"_list_").concat(wn)}}var Di=function(wn){var fn=on[wn];if(!fn)return null;var ri=fn.data||{},jn=ri.value,yi=fn.group,Ti=(0,Xe.Z)(ri,!0),wi=li(fn);return fn?Ne.createElement("div",(0,we.Z)({"aria-label":typeof wi=="string"&&!yi?wi:null},Ti,{key:wn},Qn(fn,wn),{"aria-selected":ci(jn)}),jn):null},Hi={role:"listbox",id:"".concat(yt,"_list")};return Ne.createElement(Ne.Fragment,null,Mt&&Ne.createElement("div",(0,we.Z)({},Hi,{style:{height:0,width:0,overflow:"hidden"}}),Di(Kn-1),Di(Kn),Di(Kn+1)),Ne.createElement(Wi.Z,{itemKey:"key",ref:cn,data:on,height:_t,itemHeight:Pt,fullHeight:!1,onMouseDown:xn,onScroll:Bn,virtual:Mt,direction:Kt,innerProps:Mt?null:Hi},function(ai,wn){var fn,ri=ai.group,jn=ai.groupOption,yi=ai.data,Ti=ai.label,wi=ai.value,Ui=yi.key;if(ri){var Ii,fr=(Ii=yi.title)!==null&&Ii!==void 0?Ii:bi(Ti)?Ti.toString():void 0;return Ne.createElement("div",{className:Ie()(At,"".concat(At,"-group")),title:fr},Ti!==void 0?Ti:Ui)}var Gn=yi.disabled,Hn=yi.title,Mi=yi.children,Ai=yi.style,sr=yi.className,qr=(0,Be.Z)(yi,Yi),Ar=(0,Fi.Z)(qr,Jn),Xi=ci(wi),yr="".concat(At,"-option"),pr=Ie()(At,yr,sr,(fn={},(0,Re.Z)(fn,"".concat(yr,"-grouped"),jn),(0,Re.Z)(fn,"".concat(yr,"-active"),Kn===wn&&!Gn),(0,Re.Z)(fn,"".concat(yr,"-disabled"),Gn),(0,Re.Z)(fn,"".concat(yr,"-selected"),Xi),fn)),Rn=li(ai),In=!Un||typeof Un=="function"||Xi,Pn=typeof Rn=="number"?Rn:Rn||wi,Xn=bi(Pn)?Pn.toString():void 0;return Hn!==void 0&&(Xn=Hn),Ne.createElement("div",(0,we.Z)({},(0,Xe.Z)(Ar),Mt?{}:Qn(ai,wn),{"aria-selected":Xi,className:pr,title:Xn,onMouseMove:function(){Kn===wn||Gn||ui(wn)},onClick:function(){Gn||Fn(wi)},style:Ai}),Ne.createElement("div",{className:"".concat(yr,"-content")},Pn),Ne.isValidElement(Un)||Xi,In&&Ne.createElement(Et,{className:"".concat(At,"-option-state"),customizeIcon:Un,customizeIconProps:{isSelected:Xi}},Xi?"\u2713":null))}))},Ji=Ne.forwardRef(ji);Ji.displayName="OptionList";var Vi=Ji;function ir(Le){var De=Le.mode,Ke=Le.options,it=Le.children,kt=Le.backfill,yt=Le.allowClear,Dt=Le.placeholder,Xt=Le.getInputElement,tn=Le.showSearch,un=Le.onSearch,gt=Le.defaultOpen,jt=Le.autoFocus,Bn=Le.labelInValue,yn=Le.value,Tn=Le.inputValue,Cn=Le.optionLabelProp,Yn=isMultiple(De),ln=tn!==void 0?tn:Yn||De==="combobox",Un=Ke||convertChildrenToData(it);if(warning(De!=="tags"||Un.every(function(Kt){return!Kt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),De==="tags"||De==="combobox"){var Ze=Un.some(function(Kt){return Kt.options?Kt.options.some(function(_t){return typeof("value"in _t?_t.value:_t.key)=="number"}):typeof("value"in Kt?Kt.value:Kt.key)=="number"});warning(!Ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(De!=="combobox"||!Cn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(De==="combobox"||!kt,"`backfill` only works with `combobox` mode."),warning(De==="combobox"||!Xt,"`getInputElement` only work with `combobox` mode."),noteOnce(De!=="combobox"||!Xt||!yt||!Dt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),un&&!ln&&De!=="combobox"&&De!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!gt||jt,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),yn!=null){var St=toArray(yn);warning(!Bn||St.every(function(Kt){return _typeof(Kt)==="object"&&("key"in Kt||"value"in Kt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Yn||Array.isArray(yn),"`value` should be array when `mode` is `multiple` or `tags`")}if(it){var Mt=null;toNodeArray(it).some(function(Kt){if(!React.isValidElement(Kt)||!Kt.type)return!1;var _t=Kt,Pt=_t.type;if(Pt.isSelectOption)return!1;if(Pt.isSelectOptGroup){var At=toNodeArray(Kt.props.children).every(function(on){return!React.isValidElement(on)||!Kt.type||on.type.isSelectOption?!0:(Mt=on.type,!1)});return!At}return Mt=Pt,!0}),Mt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Mt.displayName||Mt.name||Mt,"`.")),warning(Tn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function $i(Le,De){if(Le){var Ke=function it(kt){for(var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Dt=0;Dt<kt.length;Dt++){var Xt=kt[Dt];if(Xt[De==null?void 0:De.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!yt&&Array.isArray(Xt[De==null?void 0:De.options])&&it(Xt[De==null?void 0:De.options],!0))break}};Ke(Le)}}var si=null,fi=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],kn=["inputValue"];function Dn(Le){return!Le||(0,Oe.Z)(Le)!=="object"}var mi=Ne.forwardRef(function(Le,De){var Ke=Le.id,it=Le.mode,kt=Le.prefixCls,yt=kt===void 0?"rc-select":kt,Dt=Le.backfill,Xt=Le.fieldNames,tn=Le.inputValue,un=Le.searchValue,gt=Le.onSearch,jt=Le.autoClearSearchValue,Bn=jt===void 0?!0:jt,yn=Le.onSelect,Tn=Le.onDeselect,Cn=Le.dropdownMatchSelectWidth,Yn=Cn===void 0?!0:Cn,ln=Le.filterOption,Un=Le.filterSort,Ze=Le.optionFilterProp,St=Le.optionLabelProp,Mt=Le.options,Kt=Le.children,_t=Le.defaultActiveFirstOption,Pt=Le.menuItemSelectedIcon,At=Le.virtual,on=Le.direction,cn=Le.listHeight,xn=cn===void 0?200:cn,Vn=Le.listItemHeight,ni=Vn===void 0?20:Vn,gi=Le.value,ii=Le.defaultValue,Kn=Le.labelInValue,vi=Le.onChange,ui=(0,Be.Z)(Le,fi),ci=(0,zn.ZP)(Ke),Fn=en(it),Jn=!!(!Mt&&Kt),li=Ne.useMemo(function(){return ln===void 0&&it==="combobox"?!1:ln},[ln,it]),Qn=Ne.useMemo(function(){return ce(Xt,Jn)},[JSON.stringify(Xt),Jn]),Di=(0,Ce.Z)("",{value:un!==void 0?un:tn,postState:function(Zi){return Zi||""}}),Hi=(0,Se.Z)(Di,2),ai=Hi[0],wn=Hi[1],fn=_n(Mt,Kt,Qn,Ze,St),ri=fn.valueOptions,jn=fn.labelOptions,yi=fn.options,Ti=Ne.useCallback(function(ki){var Zi=Ct(ki);return Zi.map(function(Ri){var Si,tr,Qi,Pr,Rr;if(Dn(Ri))Si=Ri;else{var Nr;Qi=Ri.key,tr=Ri.label,Si=(Nr=Ri.value)!==null&&Nr!==void 0?Nr:Qi}var Yr=ri.get(Si);if(Yr){var ur;if(tr===void 0&&(tr=Yr==null?void 0:Yr[St||Qn.label]),Qi===void 0&&(Qi=(ur=Yr==null?void 0:Yr.key)!==null&&ur!==void 0?ur:Si),Pr=Yr==null?void 0:Yr.disabled,Rr=Yr==null?void 0:Yr.title,0)var lr}return{label:tr,value:Si,key:Qi,disabled:Pr,title:Rr}})},[Qn,St,ri]),wi=(0,Ce.Z)(ii,{value:gi}),Ui=(0,Se.Z)(wi,2),Ii=Ui[0],fr=Ui[1],Gn=Ne.useMemo(function(){var ki,Zi=Ti(Ii);return it==="combobox"&&Vt((ki=Zi[0])===null||ki===void 0?void 0:ki.value)?[]:Zi},[Ii,Ti,it]),Hn=bn(Gn,ri),Mi=(0,Se.Z)(Hn,2),Ai=Mi[0],sr=Mi[1],qr=Ne.useMemo(function(){if(!it&&Ai.length===1){var ki=Ai[0];if(ki.value===null&&(ki.label===null||ki.label===void 0))return[]}return Ai.map(function(Zi){var Ri;return(0,st.Z)((0,st.Z)({},Zi),{},{label:(Ri=Zi.label)!==null&&Ri!==void 0?Ri:Zi.value})})},[it,Ai]),Ar=Ne.useMemo(function(){return new Set(Ai.map(function(ki){return ki.value}))},[Ai]);Ne.useEffect(function(){if(it==="combobox"){var ki,Zi=(ki=Ai[0])===null||ki===void 0?void 0:ki.value;wn(Qt(Zi)?String(Zi):"")}},[Ai]);var Xi=ti(function(ki,Zi){var Ri,Si=Zi!=null?Zi:ki;return Ri={},(0,Re.Z)(Ri,Qn.value,ki),(0,Re.Z)(Ri,Qn.label,Si),Ri}),yr=Ne.useMemo(function(){if(it!=="tags")return yi;var ki=(0,ct.Z)(yi),Zi=function(Si){return ri.has(Si)};return(0,ct.Z)(Ai).sort(function(Ri,Si){return Ri.value<Si.value?-1:1}).forEach(function(Ri){var Si=Ri.value;Zi(Si)||ki.push(Xi(Si,Ri.label))}),ki},[Xi,yi,ri,Ai,it]),pr=sn(yr,Qn,ai,li,Ze),Rn=Ne.useMemo(function(){return it!=="tags"||!ai||pr.some(function(ki){return ki[Ze||"value"]===ai})||pr.some(function(ki){return ki[Qn.value]===ai})?pr:[Xi(ai)].concat((0,ct.Z)(pr))},[Xi,Ze,it,pr,ai,Qn]),In=Ne.useMemo(function(){return Un?(0,ct.Z)(Rn).sort(function(ki,Zi){return Un(ki,Zi)}):Rn},[Rn,Un]),Pn=Ne.useMemo(function(){return $e(In,{fieldNames:Qn,childrenAsData:Jn})},[In,Qn,Jn]),Xn=function(Zi){var Ri=Ti(Zi);if(fr(Ri),vi&&(Ri.length!==Ai.length||Ri.some(function(Qi,Pr){var Rr;return((Rr=Ai[Pr])===null||Rr===void 0?void 0:Rr.value)!==(Qi==null?void 0:Qi.value)}))){var Si=Kn?Ri:Ri.map(function(Qi){return Qi.value}),tr=Ri.map(function(Qi){return xt(sr(Qi.value))});vi(Fn?Si:Si[0],Fn?tr:tr[0])}},qi=Ne.useState(null),hr=(0,Se.Z)(qi,2),br=hr[0],mr=hr[1],ar=Ne.useState(0),wr=(0,Se.Z)(ar,2),Kr=wr[0],Br=wr[1],pa=_t!==void 0?_t:it!=="combobox",ea=Ne.useCallback(function(ki,Zi){var Ri=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Si=Ri.source,tr=Si===void 0?"keyboard":Si;Br(Zi),Dt&&it==="combobox"&&ki!==null&&tr==="keyboard"&&mr(String(ki))},[Dt,it]),Or=function(Zi,Ri,Si){var tr=function(){var ia,Xr=sr(Zi);return[Kn?{label:Xr==null?void 0:Xr[Qn.label],value:Zi,key:(ia=Xr==null?void 0:Xr.key)!==null&&ia!==void 0?ia:Zi}:Zi,xt(Xr)]};if(Ri&&yn){var Qi=tr(),Pr=(0,Se.Z)(Qi,2),Rr=Pr[0],Nr=Pr[1];yn(Rr,Nr)}else if(!Ri&&Tn&&Si!=="clear"){var Yr=tr(),ur=(0,Se.Z)(Yr,2),lr=ur[0],Hr=ur[1];Tn(lr,Hr)}},Qa=ti(function(ki,Zi){var Ri,Si=Fn?Zi.selected:!0;Si?Ri=Fn?[].concat((0,ct.Z)(Ai),[ki]):[ki]:Ri=Ai.filter(function(tr){return tr.value!==ki}),Xn(Ri),Or(ki,Si),it==="combobox"?mr(""):(!en||Bn)&&(wn(""),mr(""))}),Ma=function(Zi,Ri){Xn(Zi);var Si=Ri.type,tr=Ri.values;(Si==="remove"||Si==="clear")&&tr.forEach(function(Qi){Or(Qi.value,!1,Si)})},ma=function(Zi,Ri){if(wn(Zi),mr(null),Ri.source==="submit"){var Si=(Zi||"").trim();if(Si){var tr=Array.from(new Set([].concat((0,ct.Z)(Ar),[Si])));Xn(tr),Or(Si,!0),wn("")}return}Ri.source!=="blur"&&(it==="combobox"&&Xn(Zi),gt==null||gt(Zi))},ta=function(Zi){var Ri=Zi;it!=="tags"&&(Ri=Zi.map(function(tr){var Qi=jn.get(tr);return Qi==null?void 0:Qi.value}).filter(function(tr){return tr!==void 0}));var Si=Array.from(new Set([].concat((0,ct.Z)(Ar),(0,ct.Z)(Ri))));Xn(Si),Si.forEach(function(tr){Or(tr,!0)})},Sr=Ne.useMemo(function(){var ki=At!==!1&&Yn!==!1;return(0,st.Z)((0,st.Z)({},fn),{},{flattenOptions:Pn,onActiveValue:ea,defaultActiveFirstOption:pa,onSelect:Qa,menuItemSelectedIcon:Pt,rawValues:Ar,fieldNames:Qn,virtual:ki,direction:on,listHeight:xn,listItemHeight:ni,childrenAsData:Jn})},[fn,Pn,ea,pa,Qa,Pt,Ar,Qn,At,Yn,xn,ni,Jn]);return Ne.createElement(nr.Provider,{value:Sr},Ne.createElement(pn,(0,we.Z)({},ui,{id:ci,prefixCls:yt,ref:De,omitDomProps:kn,mode:it,displayValues:qr,onDisplayValuesChange:Ma,direction:on,searchValue:ai,onSearch:ma,autoClearSearchValue:Bn,onSearchSplit:ta,dropdownMatchSelectWidth:Yn,OptionList:Vi,emptyOptions:!Pn.length,activeValue:br,activeDescendantId:"".concat(ci,"_list_").concat(Kr)})))}),Qe=mi;Qe.Option=_i,Qe.OptGroup=pi;var ke=Qe,Pe=ke},9296:function(mn,rn,he){"use strict";he.r(rn),he.d(rn,{ResizableTextArea:function(){return It},default:function(){return Vt}});var we=he(60499),ct=he(85899),Re=he(18642),st=he(43749),Se=he(72190),Be=he(42244),Oe=he(77654),Ce=he(92310),Me=he.n(Ce),Ne=he(93681),ht=he(5643),Ie=he(18929),He=he(59301),mt=he(29301),Ye=he(34280),ot=he(16089),rt=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,Et=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Zt={},Je;function lt(Gt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Gt.getAttribute("id")||Gt.getAttribute("data-reactid")||Gt.getAttribute("name");if(Ft&&Zt[Fe])return Zt[Fe];var xe=window.getComputedStyle(Gt),ft=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),qt=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Ot=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),Ue=Et.map(function(wt){return"".concat(wt,":").concat(xe.getPropertyValue(wt))}).join(";"),Ge={sizingStyle:Ue,paddingSize:qt,borderSize:Ot,boxSizing:ft};return Ft&&Fe&&(Zt[Fe]=Ge),Ge}function We(Gt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Je||(Je=document.createElement("textarea"),Je.setAttribute("tab-index","-1"),Je.setAttribute("aria-hidden","true"),document.body.appendChild(Je)),Gt.getAttribute("wrap")?Je.setAttribute("wrap",Gt.getAttribute("wrap")):Je.removeAttribute("wrap");var ft=lt(Gt,Ft),qt=ft.paddingSize,Ot=ft.borderSize,Ue=ft.boxSizing,Ge=ft.sizingStyle;Je.setAttribute("style","".concat(Ge,";").concat(rt)),Je.value=Gt.value||Gt.placeholder||"";var wt=void 0,dn=void 0,Rt,an=Je.scrollHeight;if(Ue==="border-box"?an+=Ot:Ue==="content-box"&&(an-=qt),Fe!==null||xe!==null){Je.value=" ";var $t=Je.scrollHeight-qt;Fe!==null&&(wt=$t*Fe,Ue==="border-box"&&(wt=wt+qt+Ot),an=Math.max(wt,an)),xe!==null&&(dn=$t*xe,Ue==="border-box"&&(dn=dn+qt+Ot),Rt=an>dn?"":"hidden",an=Math.min(dn,an))}var Bt={height:an,overflowY:Rt,resize:"none"};return wt&&(Bt.minHeight=wt),dn&&(Bt.maxHeight=dn),Bt}var Ee=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Ve=0,Xe=1,bt=2,je=He.forwardRef(function(Gt,Ft){var Fe=Gt,xe=Fe.prefixCls,ft=Fe.onPressEnter,qt=Fe.defaultValue,Ot=Fe.value,Ue=Fe.autoSize,Ge=Fe.onResize,wt=Fe.className,dn=Fe.style,Rt=Fe.disabled,an=Fe.onChange,$t=Fe.onInternalAutoSize,Bt=(0,Be.Z)(Fe,Ee),Tt=(0,Ie.Z)(qt,{value:Ot,postState:function(pi){return pi!=null?pi:""}}),ge=(0,Se.Z)(Tt,2),se=ge[0],oe=ge[1],fe=function(pi){oe(pi.target.value),an==null||an(pi)},ve=He.useRef();He.useImperativeHandle(Ft,function(){return{textArea:ve.current}});var ce=He.useMemo(function(){return Ue&&(0,st.Z)(Ue)==="object"?[Ue.minRows,Ue.maxRows]:[]},[Ue]),$e=(0,Se.Z)(ce,2),xt=$e[0],Ut=$e[1],Ht=!!Ue,Jt=function(){try{if(document.activeElement===ve.current){var pi=ve.current,Bi=pi.selectionStart,_i=pi.selectionEnd,Zn=pi.scrollTop;ve.current.setSelectionRange(Bi,_i),ve.current.scrollTop=Zn}}catch(Fi){}},en=He.useState(bt),hn=(0,Se.Z)(en,2),pn=hn[0],bn=hn[1],pt=He.useState(),sn=(0,Se.Z)(pt,2),zn=sn[0],tt=sn[1],vt=function(){bn(Ve)};(0,Ye.Z)(function(){Ht&&vt()},[Ot,xt,Ut,Ht]),(0,Ye.Z)(function(){if(pn===Ve)bn(Xe);else if(pn===Xe){var hi=We(ve.current,!1,xt,Ut);bn(bt),tt(hi)}else Jt()},[pn]);var Lt=He.useRef(),Ln=function(){ot.Z.cancel(Lt.current)},Mn=function(pi){pn===bt&&(Ge==null||Ge(pi),Ue&&(Ln(),Lt.current=(0,ot.Z)(function(){vt()})))};He.useEffect(function(){return Ln},[]);var _n=Ht?zn:null,ti=(0,ct.Z)((0,ct.Z)({},dn),_n);return(pn===Ve||pn===Xe)&&(ti.overflowY="hidden",ti.overflowX="hidden"),He.createElement(mt.Z,{onResize:Mn,disabled:!(Ue||Ge)},He.createElement("textarea",(0,we.Z)({},Bt,{ref:ve,style:ti,className:Me()(xe,wt,(0,Re.Z)({},"".concat(xe,"-disabled"),Rt)),disabled:Rt,value:se,onChange:fe})))}),It=je,at=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Ct(Gt,Ft){return(0,Oe.Z)(Gt||"").slice(0,Ft).join("")}function qe(Gt,Ft,Fe,xe){var ft=Fe;return Gt?ft=Ct(Fe,xe):(0,Oe.Z)(Ft||"").length<Fe.length&&(0,Oe.Z)(Fe||"").length>xe&&(ft=Ft),ft}var Nt=He.forwardRef(function(Gt,Ft){var Fe,xe=Gt.defaultValue,ft=Gt.value,qt=Gt.onFocus,Ot=Gt.onBlur,Ue=Gt.onChange,Ge=Gt.allowClear,wt=Gt.maxLength,dn=Gt.onCompositionStart,Rt=Gt.onCompositionEnd,an=Gt.suffix,$t=Gt.prefixCls,Bt=$t===void 0?"rc-textarea":$t,Tt=Gt.classes,ge=Gt.showCount,se=Gt.className,oe=Gt.style,fe=Gt.disabled,ve=Gt.hidden,ce=Gt.classNames,$e=Gt.styles,xt=Gt.onResize,Ut=(0,Be.Z)(Gt,at),Ht=(0,Ie.Z)(xe,{value:ft,defaultValue:xe}),Jt=(0,Se.Z)(Ht,2),en=Jt[0],hn=Jt[1],pn=(0,He.useRef)(null),bn=He.useState(!1),pt=(0,Se.Z)(bn,2),sn=pt[0],zn=pt[1],tt=He.useState(!1),vt=(0,Se.Z)(tt,2),Lt=vt[0],Ln=vt[1],Mn=He.useRef(),_n=He.useRef(0),ti=He.useState(null),hi=(0,Se.Z)(ti,2),pi=hi[0],Bi=hi[1],_i=function(){var Dn;(Dn=pn.current)===null||Dn===void 0||Dn.textArea.focus()};(0,He.useImperativeHandle)(Ft,function(){return{resizableTextArea:pn.current,focus:_i,blur:function(){var Dn;(Dn=pn.current)===null||Dn===void 0||Dn.textArea.blur()}}}),(0,He.useEffect)(function(){zn(function(kn){return!fe&&kn})},[fe]);var Zn=Number(wt)>0,Fi=function(Dn){Ln(!0),Mn.current=en,_n.current=Dn.currentTarget.selectionStart,dn==null||dn(Dn)},Wi=function(Dn){Ln(!1);var mi=Dn.currentTarget.value;if(Zn){var Qe,ke=_n.current>=wt+1||_n.current===((Qe=Mn.current)===null||Qe===void 0?void 0:Qe.length);mi=qe(ke,Mn.current,mi,wt)}mi!==en&&(hn(mi),(0,ht.rJ)(Dn.currentTarget,Dn,Ue,mi)),Rt==null||Rt(Dn)},Gi=function(Dn){var mi=Dn.target.value;if(!Lt&&Zn){var Qe=Dn.target.selectionStart>=wt+1||Dn.target.selectionStart===mi.length||!Dn.target.selectionStart;mi=qe(Qe,en,mi,wt)}hn(mi),(0,ht.rJ)(Dn.currentTarget,Dn,Ue,mi)},nr=function(Dn){var mi=Ut.onPressEnter,Qe=Ut.onKeyDown;Dn.key==="Enter"&&mi&&mi(Dn),Qe==null||Qe(Dn)},Pi=function(Dn){zn(!0),qt==null||qt(Dn)},Yi=function(Dn){zn(!1),Ot==null||Ot(Dn)},bi=function(Dn){var mi;hn(""),_i(),(0,ht.rJ)((mi=pn.current)===null||mi===void 0?void 0:mi.textArea,Dn,Ue)},ji=(0,ht.D7)(en);!Lt&&Zn&&ft==null&&(ji=Ct(ji,wt));var Ji=an,Vi;if(ge){var ir=(0,Oe.Z)(ji).length;(0,st.Z)(ge)==="object"?Vi=ge.formatter({value:ji,count:ir,maxLength:wt}):Vi="".concat(ir).concat(Zn?" / ".concat(wt):""),Ji=He.createElement(He.Fragment,null,Ji,He.createElement("span",{className:Me()("".concat(Bt,"-data-count"),ce==null?void 0:ce.count),style:$e==null?void 0:$e.count},Vi))}var $i=function(Dn){var mi;xt==null||xt(Dn),(mi=pn.current)!==null&&mi!==void 0&&mi.textArea.style.height&&Bi(!0)},si=!Ut.autoSize&&!ge&&!Ge,fi=He.createElement(Ne.BaseInput,{value:ji,allowClear:Ge,handleReset:bi,suffix:Ji,prefixCls:Bt,classes:{affixWrapper:Me()(Tt==null?void 0:Tt.affixWrapper,(Fe={},(0,Re.Z)(Fe,"".concat(Bt,"-show-count"),ge),(0,Re.Z)(Fe,"".concat(Bt,"-textarea-allow-clear"),Ge),Fe))},disabled:fe,focused:sn,className:se,style:(0,ct.Z)((0,ct.Z)({},oe),pi&&!si?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Vi=="string"?Vi:void 0}},hidden:ve,inputElement:He.createElement(It,(0,we.Z)({},Ut,{onKeyDown:nr,onChange:Gi,onFocus:Pi,onBlur:Yi,onCompositionStart:Fi,onCompositionEnd:Wi,className:ce==null?void 0:ce.textarea,style:(0,ct.Z)((0,ct.Z)({},$e==null?void 0:$e.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:fe,prefixCls:Bt,onResize:$i,ref:pn}))});return fi}),Qt=Nt,Vt=Qt},48911:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Tt}});var we=he(60499),ct=he(43749),Re=he(85899),st=he(18642),Se=he(72190),Be=he(42244),Oe=he(92310),Ce=he.n(Oe),Me=he(29301),Ne=he(70425),ht=he(34280),Ie=he(59301),He=he(4676),mt=Ie.forwardRef(function(ge,se){var oe=ge.height,fe=ge.offsetY,ve=ge.offsetX,ce=ge.children,$e=ge.prefixCls,xt=ge.onInnerResize,Ut=ge.innerProps,Ht=ge.rtl,Jt=ge.extra,en={},hn={display:"flex",flexDirection:"column"};return fe!==void 0&&(en={height:oe,position:"relative",overflow:"hidden"},hn=(0,Re.Z)((0,Re.Z)({},hn),{},(0,st.Z)((0,st.Z)((0,st.Z)((0,st.Z)((0,st.Z)({transform:"translateY(".concat(fe,"px)")},Ht?"marginRight":"marginLeft",-ve),"position","absolute"),"left",0),"right",0),"top",0))),Ie.createElement("div",{style:en},Ie.createElement(Me.Z,{onResize:function(bn){var pt=bn.offsetHeight;pt&&xt&&xt()}},Ie.createElement("div",(0,we.Z)({style:hn,className:Ce()((0,st.Z)({},"".concat($e,"-holder-inner"),$e)),ref:se},Ut),ce,Jt)))});mt.displayName="Filler";var Ye=mt;function ot(ge){var se=ge.children,oe=ge.setRef,fe=Ie.useCallback(function(ve){oe(ve)},[]);return Ie.cloneElement(se,{ref:fe})}function rt(ge,se,oe,fe,ve,ce,$e,xt){var Ut=xt.getKey;return ge.slice(se,oe+1).map(function(Ht,Jt){var en=se+Jt,hn=$e(Ht,en,{style:{width:fe},offsetX:ve}),pn=Ut(Ht);return Ie.createElement(ot,{key:pn,setRef:function(pt){return ce(Ht,pt)}},hn)})}function Et(ge,se,oe,fe){var ve=oe-ge,ce=se-oe,$e=Math.min(ve,ce)*2;if(fe<=$e){var xt=Math.floor(fe/2);return fe%2?oe+xt+1:oe-xt}return ve>ce?oe-(fe-ce):oe+(fe-ve)}function Zt(ge,se,oe){var fe=ge.length,ve=se.length,ce,$e;if(fe===0&&ve===0)return null;fe<ve?(ce=ge,$e=se):(ce=se,$e=ge);var xt={__EMPTY_ITEM__:!0};function Ut(bn){return bn!==void 0?oe(bn):xt}for(var Ht=null,Jt=Math.abs(fe-ve)!==1,en=0;en<$e.length;en+=1){var hn=Ut(ce[en]),pn=Ut($e[en]);if(hn!==pn){Ht=en,Jt=Jt||hn!==Ut($e[en+1]);break}}return Ht===null?null:{index:Ht,multiple:Jt}}function Je(ge,se,oe){var fe=Ie.useState(ge),ve=(0,Se.Z)(fe,2),ce=ve[0],$e=ve[1],xt=Ie.useState(null),Ut=(0,Se.Z)(xt,2),Ht=Ut[0],Jt=Ut[1];return Ie.useEffect(function(){var en=Zt(ce||[],ge||[],se);(en==null?void 0:en.index)!==void 0&&(oe==null||oe(en.index),Jt(ge[en.index])),$e(ge)},[ge]),[Ht]}var lt=he(16089),We=(typeof navigator=="undefined"?"undefined":(0,ct.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Ee=We,Ve=function(ge,se,oe,fe){var ve=(0,Ie.useRef)(!1),ce=(0,Ie.useRef)(null);function $e(){clearTimeout(ce.current),ve.current=!0,ce.current=setTimeout(function(){ve.current=!1},50)}var xt=(0,Ie.useRef)({top:ge,bottom:se,left:oe,right:fe});return xt.current.top=ge,xt.current.bottom=se,xt.current.left=oe,xt.current.right=fe,function(Ut,Ht){var Jt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,en=Ut?Ht<0&&xt.current.left||Ht>0&&xt.current.right:Ht<0&&xt.current.top||Ht>0&&xt.current.bottom;return Jt&&en?(clearTimeout(ce.current),ve.current=!1):(!en||ve.current)&&$e(),!ve.current&&en}};function Xe(ge,se,oe,fe,ve,ce,$e){var xt=(0,Ie.useRef)(0),Ut=(0,Ie.useRef)(null),Ht=(0,Ie.useRef)(null),Jt=(0,Ie.useRef)(!1),en=Ve(se,oe,fe,ve);function hn(tt,vt){if(lt.Z.cancel(Ut.current),!en(!1,vt)){var Lt=tt;if(!Lt._virtualHandled)Lt._virtualHandled=!0;else return;xt.current+=vt,Ht.current=vt,Ee||Lt.preventDefault(),Ut.current=(0,lt.Z)(function(){var Ln=Jt.current?10:1;$e(xt.current*Ln,!1),xt.current=0})}}function pn(tt,vt){$e(vt,!0),Ee||tt.preventDefault()}var bn=(0,Ie.useRef)(null),pt=(0,Ie.useRef)(null);function sn(tt){if(ge){lt.Z.cancel(pt.current),pt.current=(0,lt.Z)(function(){bn.current=null},2);var vt=tt.deltaX,Lt=tt.deltaY,Ln=tt.shiftKey,Mn=vt,_n=Lt;(bn.current==="sx"||!bn.current&&Ln&&Lt&&!vt)&&(Mn=Lt,_n=0,bn.current="sx");var ti=Math.abs(Mn),hi=Math.abs(_n);bn.current===null&&(bn.current=ce&&ti>hi?"x":"y"),bn.current==="y"?hn(tt,_n):pn(tt,Mn)}}function zn(tt){ge&&(Jt.current=tt.detail===Ht.current)}return[sn,zn]}function bt(ge,se,oe,fe){var ve=Ie.useMemo(function(){return[new Map,[]]},[ge,oe.id,fe]),ce=(0,Se.Z)(ve,2),$e=ce[0],xt=ce[1],Ut=function(Jt){var en=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jt,hn=$e.get(Jt),pn=$e.get(en);if(hn===void 0||pn===void 0)for(var bn=ge.length,pt=xt.length;pt<bn;pt+=1){var sn,zn=ge[pt],tt=se(zn);$e.set(tt,pt);var vt=(sn=oe.get(tt))!==null&&sn!==void 0?sn:fe;if(xt[pt]=(xt[pt-1]||0)+vt,tt===Jt&&(hn=pt),tt===en&&(pn=pt),hn!==void 0&&pn!==void 0)break}return{top:xt[hn-1]||0,bottom:xt[pn]}};return Ut}var je=he(38705),It=he(17212),at=function(){function ge(){(0,je.Z)(this,ge),(0,st.Z)(this,"maps",void 0),(0,st.Z)(this,"id",0),(0,st.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,It.Z)(ge,[{key:"set",value:function(oe,fe){this.diffRecords.set(oe,this.maps[oe]),this.maps[oe]=fe,this.id+=1}},{key:"get",value:function(oe){return this.maps[oe]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ge}(),Ct=at;function qe(ge){var se=parseFloat(ge);return isNaN(se)?0:se}function Nt(ge,se,oe){var fe=Ie.useState(0),ve=(0,Se.Z)(fe,2),ce=ve[0],$e=ve[1],xt=(0,Ie.useRef)(new Map),Ut=(0,Ie.useRef)(new Ct),Ht=(0,Ie.useRef)(0);function Jt(){Ht.current+=1}function en(){var pn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Jt();var bn=function(){var zn=!1;xt.current.forEach(function(tt,vt){if(tt&&tt.offsetParent){var Lt=tt.offsetHeight,Ln=getComputedStyle(tt),Mn=Ln.marginTop,_n=Ln.marginBottom,ti=qe(Mn),hi=qe(_n),pi=Lt+ti+hi;Ut.current.get(vt)!==pi&&(Ut.current.set(vt,pi),zn=!0)}}),zn&&$e(function(tt){return tt+1})};if(pn)bn();else{Ht.current+=1;var pt=Ht.current;Promise.resolve().then(function(){pt===Ht.current&&bn()})}}function hn(pn,bn){var pt=ge(pn),sn=xt.current.get(pt);bn?(xt.current.set(pt,bn),en()):xt.current.delete(pt),!sn!=!bn&&(bn?se==null||se(pn):oe==null||oe(pn))}return(0,Ie.useEffect)(function(){return Jt},[]),[hn,en,Ut.current,ce]}var Qt=14/15;function Vt(ge,se,oe){var fe=(0,Ie.useRef)(!1),ve=(0,Ie.useRef)(0),ce=(0,Ie.useRef)(0),$e=(0,Ie.useRef)(null),xt=(0,Ie.useRef)(null),Ut,Ht=function(pn){if(fe.current){var bn=Math.ceil(pn.touches[0].pageX),pt=Math.ceil(pn.touches[0].pageY),sn=ve.current-bn,zn=ce.current-pt,tt=Math.abs(sn)>Math.abs(zn);tt?ve.current=bn:ce.current=pt;var vt=oe(tt,tt?sn:zn,!1,pn);vt&&pn.preventDefault(),clearInterval(xt.current),vt&&(xt.current=setInterval(function(){tt?sn*=Qt:zn*=Qt;var Lt=Math.floor(tt?sn:zn);(!oe(tt,Lt,!0)||Math.abs(Lt)<=.1)&&clearInterval(xt.current)},16))}},Jt=function(){fe.current=!1,Ut()},en=function(pn){Ut(),pn.touches.length===1&&!fe.current&&(fe.current=!0,ve.current=Math.ceil(pn.touches[0].pageX),ce.current=Math.ceil(pn.touches[0].pageY),$e.current=pn.target,$e.current.addEventListener("touchmove",Ht,{passive:!1}),$e.current.addEventListener("touchend",Jt,{passive:!0}))};Ut=function(){$e.current&&($e.current.removeEventListener("touchmove",Ht),$e.current.removeEventListener("touchend",Jt))},(0,ht.Z)(function(){return ge&&se.current.addEventListener("touchstart",en,{passive:!0}),function(){var hn;(hn=se.current)===null||hn===void 0||hn.removeEventListener("touchstart",en),Ut(),clearInterval(xt.current)}},[ge])}function Gt(ge){return Math.floor(Math.pow(ge,.5))}function Ft(ge,se){var oe="touches"in ge?ge.touches[0]:ge;return oe[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function Fe(ge,se,oe){Ie.useEffect(function(){var fe=se.current;if(ge&&fe){var ve=!1,ce,$e,xt=function(){lt.Z.cancel(ce)},Ut=function hn(){xt(),ce=(0,lt.Z)(function(){oe($e),hn()})},Ht=function(){ve=!1,xt()},Jt=function(pn){if(!(pn.target.draggable||pn.button!==0)){var bn=pn;bn._virtualHandled||(bn._virtualHandled=!0,ve=!0)}},en=function(pn){if(ve){var bn=Ft(pn,!1),pt=fe.getBoundingClientRect(),sn=pt.top,zn=pt.bottom;if(bn<=sn){var tt=sn-bn;$e=-Gt(tt),Ut()}else if(bn>=zn){var vt=bn-zn;$e=Gt(vt),Ut()}else xt()}};return fe.addEventListener("mousedown",Jt),fe.ownerDocument.addEventListener("mouseup",Ht),fe.ownerDocument.addEventListener("mousemove",en),fe.ownerDocument.addEventListener("dragend",Ht),function(){fe.removeEventListener("mousedown",Jt),fe.ownerDocument.removeEventListener("mouseup",Ht),fe.ownerDocument.removeEventListener("mousemove",en),fe.ownerDocument.removeEventListener("dragend",Ht),xt()}}},[ge])}var xe=10;function ft(ge,se,oe,fe,ve,ce,$e,xt){var Ut=Ie.useRef(),Ht=Ie.useState(null),Jt=(0,Se.Z)(Ht,2),en=Jt[0],hn=Jt[1];return(0,ht.Z)(function(){if(en&&en.times<xe){if(!ge.current){hn(function(Yi){return(0,Re.Z)({},Yi)});return}ce();var pn=en.targetAlign,bn=en.originAlign,pt=en.index,sn=en.offset,zn=ge.current.clientHeight,tt=!1,vt=pn,Lt=null;if(zn){for(var Ln=pn||bn,Mn=0,_n=0,ti=0,hi=Math.min(se.length-1,pt),pi=0;pi<=hi;pi+=1){var Bi=ve(se[pi]);_n=Mn;var _i=oe.get(Bi);ti=_n+(_i===void 0?fe:_i),Mn=ti}for(var Zn=Ln==="top"?sn:zn-sn,Fi=hi;Fi>=0;Fi-=1){var Wi=ve(se[Fi]),Gi=oe.get(Wi);if(Gi===void 0){tt=!0;break}if(Zn-=Gi,Zn<=0)break}switch(Ln){case"top":Lt=_n-sn;break;case"bottom":Lt=ti-zn+sn;break;default:{var nr=ge.current.scrollTop,Pi=nr+zn;_n<nr?vt="top":ti>Pi&&(vt="bottom")}}Lt!==null&&$e(Lt),Lt!==en.lastTop&&(tt=!0)}tt&&hn((0,Re.Z)((0,Re.Z)({},en),{},{times:en.times+1,targetAlign:vt,lastTop:Lt}))}},[en,ge.current]),function(pn){if(pn==null){xt();return}if(lt.Z.cancel(Ut.current),typeof pn=="number")$e(pn);else if(pn&&(0,ct.Z)(pn)==="object"){var bn,pt=pn.align;"index"in pn?bn=pn.index:bn=se.findIndex(function(tt){return ve(tt)===pn.key});var sn=pn.offset,zn=sn===void 0?0:sn;hn({times:0,index:bn,offset:zn,originAlign:pt})}}}var qt=Ie.forwardRef(function(ge,se){var oe=ge.prefixCls,fe=ge.rtl,ve=ge.scrollOffset,ce=ge.scrollRange,$e=ge.onStartMove,xt=ge.onStopMove,Ut=ge.onScroll,Ht=ge.horizontal,Jt=ge.spinSize,en=ge.containerSize,hn=ge.style,pn=ge.thumbStyle,bn=ge.showScrollBar,pt=Ie.useState(!1),sn=(0,Se.Z)(pt,2),zn=sn[0],tt=sn[1],vt=Ie.useState(null),Lt=(0,Se.Z)(vt,2),Ln=Lt[0],Mn=Lt[1],_n=Ie.useState(null),ti=(0,Se.Z)(_n,2),hi=ti[0],pi=ti[1],Bi=!fe,_i=Ie.useRef(),Zn=Ie.useRef(),Fi=Ie.useState(bn),Wi=(0,Se.Z)(Fi,2),Gi=Wi[0],nr=Wi[1],Pi=Ie.useRef(),Yi=function(){bn===!0||bn===!1||(clearTimeout(Pi.current),nr(!0),Pi.current=setTimeout(function(){nr(!1)},3e3))},bi=ce-en||0,ji=en-Jt||0,Ji=Ie.useMemo(function(){if(ve===0||bi===0)return 0;var Qe=ve/bi;return Qe*ji},[ve,bi,ji]),Vi=function(ke){ke.stopPropagation(),ke.preventDefault()},ir=Ie.useRef({top:Ji,dragging:zn,pageY:Ln,startTop:hi});ir.current={top:Ji,dragging:zn,pageY:Ln,startTop:hi};var $i=function(ke){tt(!0),Mn(Ft(ke,Ht)),pi(ir.current.top),$e(),ke.stopPropagation(),ke.preventDefault()};Ie.useEffect(function(){var Qe=function(De){De.preventDefault()},ke=_i.current,Pe=Zn.current;return ke.addEventListener("touchstart",Qe,{passive:!1}),Pe.addEventListener("touchstart",$i,{passive:!1}),function(){ke.removeEventListener("touchstart",Qe),Pe.removeEventListener("touchstart",$i)}},[]);var si=Ie.useRef();si.current=bi;var fi=Ie.useRef();fi.current=ji,Ie.useEffect(function(){if(zn){var Qe,ke=function(De){var Ke=ir.current,it=Ke.dragging,kt=Ke.pageY,yt=Ke.startTop;lt.Z.cancel(Qe);var Dt=_i.current.getBoundingClientRect(),Xt=en/(Ht?Dt.width:Dt.height);if(it){var tn=(Ft(De,Ht)-kt)*Xt,un=yt;!Bi&&Ht?un-=tn:un+=tn;var gt=si.current,jt=fi.current,Bn=jt?un/jt:0,yn=Math.ceil(Bn*gt);yn=Math.max(yn,0),yn=Math.min(yn,gt),Qe=(0,lt.Z)(function(){Ut(yn,Ht)})}},Pe=function(){tt(!1),xt()};return window.addEventListener("mousemove",ke,{passive:!0}),window.addEventListener("touchmove",ke,{passive:!0}),window.addEventListener("mouseup",Pe,{passive:!0}),window.addEventListener("touchend",Pe,{passive:!0}),function(){window.removeEventListener("mousemove",ke),window.removeEventListener("touchmove",ke),window.removeEventListener("mouseup",Pe),window.removeEventListener("touchend",Pe),lt.Z.cancel(Qe)}}},[zn]),Ie.useEffect(function(){return Yi(),function(){clearTimeout(Pi.current)}},[ve]),Ie.useImperativeHandle(se,function(){return{delayHidden:Yi}});var kn="".concat(oe,"-scrollbar"),Dn={position:"absolute",visibility:Gi?null:"hidden"},mi={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Ht?(Object.assign(Dn,{height:8,left:0,right:0,bottom:0}),Object.assign(mi,(0,st.Z)({height:"100%",width:Jt},Bi?"left":"right",Ji))):(Object.assign(Dn,(0,st.Z)({width:8,top:0,bottom:0},Bi?"right":"left",0)),Object.assign(mi,{width:"100%",height:Jt,top:Ji})),Ie.createElement("div",{ref:_i,className:Ce()(kn,(0,st.Z)((0,st.Z)((0,st.Z)({},"".concat(kn,"-horizontal"),Ht),"".concat(kn,"-vertical"),!Ht),"".concat(kn,"-visible"),Gi)),style:(0,Re.Z)((0,Re.Z)({},Dn),hn),onMouseDown:Vi,onMouseMove:Yi},Ie.createElement("div",{ref:Zn,className:Ce()("".concat(kn,"-thumb"),(0,st.Z)({},"".concat(kn,"-thumb-moving"),zn)),style:(0,Re.Z)((0,Re.Z)({},mi),pn),onMouseDown:$i}))}),Ot=qt,Ue=20;function Ge(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ge/se*ge;return isNaN(oe)&&(oe=0),oe=Math.max(oe,Ue),Math.floor(oe)}var wt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],dn=[],Rt={overflowY:"auto",overflowAnchor:"none"};function an(ge,se){var oe=ge.prefixCls,fe=oe===void 0?"rc-virtual-list":oe,ve=ge.className,ce=ge.height,$e=ge.itemHeight,xt=ge.fullHeight,Ut=xt===void 0?!0:xt,Ht=ge.style,Jt=ge.data,en=ge.children,hn=ge.itemKey,pn=ge.virtual,bn=ge.direction,pt=ge.scrollWidth,sn=ge.component,zn=sn===void 0?"div":sn,tt=ge.onScroll,vt=ge.onVirtualScroll,Lt=ge.onVisibleChange,Ln=ge.innerProps,Mn=ge.extraRender,_n=ge.styles,ti=ge.showScrollBar,hi=ti===void 0?"optional":ti,pi=(0,Be.Z)(ge,wt),Bi=Ie.useCallback(function(Gn){return typeof hn=="function"?hn(Gn):Gn==null?void 0:Gn[hn]},[hn]),_i=Nt(Bi,null,null),Zn=(0,Se.Z)(_i,4),Fi=Zn[0],Wi=Zn[1],Gi=Zn[2],nr=Zn[3],Pi=!!(pn!==!1&&ce&&$e),Yi=Ie.useMemo(function(){return Object.values(Gi.maps).reduce(function(Gn,Hn){return Gn+Hn},0)},[Gi.id,Gi.maps]),bi=Pi&&Jt&&(Math.max($e*Jt.length,Yi)>ce||!!pt),ji=bn==="rtl",Ji=Ce()(fe,(0,st.Z)({},"".concat(fe,"-rtl"),ji),ve),Vi=Jt||dn,ir=(0,Ie.useRef)(),$i=(0,Ie.useRef)(),si=(0,Ie.useRef)(),fi=(0,Ie.useState)(0),kn=(0,Se.Z)(fi,2),Dn=kn[0],mi=kn[1],Qe=(0,Ie.useState)(0),ke=(0,Se.Z)(Qe,2),Pe=ke[0],Le=ke[1],De=(0,Ie.useState)(!1),Ke=(0,Se.Z)(De,2),it=Ke[0],kt=Ke[1],yt=function(){kt(!0)},Dt=function(){kt(!1)},Xt={getKey:Bi};function tn(Gn){mi(function(Hn){var Mi;typeof Gn=="function"?Mi=Gn(Hn):Mi=Gn;var Ai=ni(Mi);return ir.current.scrollTop=Ai,Ai})}var un=(0,Ie.useRef)({start:0,end:Vi.length}),gt=(0,Ie.useRef)(),jt=Je(Vi,Bi),Bn=(0,Se.Z)(jt,1),yn=Bn[0];gt.current=yn;var Tn=Ie.useMemo(function(){if(!Pi)return{scrollHeight:void 0,start:0,end:Vi.length-1,offset:void 0};if(!bi){var Gn;return{scrollHeight:((Gn=$i.current)===null||Gn===void 0?void 0:Gn.offsetHeight)||0,start:0,end:Vi.length-1,offset:void 0}}for(var Hn=0,Mi,Ai,sr,qr=Vi.length,Ar=0;Ar<qr;Ar+=1){var Xi=Vi[Ar],yr=Bi(Xi),pr=Gi.get(yr),Rn=Hn+(pr===void 0?$e:pr);Rn>=Dn&&Mi===void 0&&(Mi=Ar,Ai=Hn),Rn>Dn+ce&&sr===void 0&&(sr=Ar),Hn=Rn}return Mi===void 0&&(Mi=0,Ai=0,sr=Math.ceil(ce/$e)),sr===void 0&&(sr=Vi.length-1),sr=Math.min(sr+1,Vi.length-1),{scrollHeight:Hn,start:Mi,end:sr,offset:Ai}},[bi,Pi,Dn,Vi,nr,ce]),Cn=Tn.scrollHeight,Yn=Tn.start,ln=Tn.end,Un=Tn.offset;un.current.start=Yn,un.current.end=ln,Ie.useLayoutEffect(function(){var Gn=Gi.getRecord();if(Gn.size===1){var Hn=Array.from(Gn.keys())[0],Mi=Gn.get(Hn),Ai=Vi[Yn];if(Ai&&Mi===void 0){var sr=Bi(Ai);if(sr===Hn){var qr=Gi.get(Hn),Ar=qr-$e;tn(function(Xi){return Xi+Ar})}}}Gi.resetRecord()},[Cn]);var Ze=Ie.useState({width:0,height:ce}),St=(0,Se.Z)(Ze,2),Mt=St[0],Kt=St[1],_t=function(Hn){Kt({width:Hn.offsetWidth,height:Hn.offsetHeight})},Pt=(0,Ie.useRef)(),At=(0,Ie.useRef)(),on=Ie.useMemo(function(){return Ge(Mt.width,pt)},[Mt.width,pt]),cn=Ie.useMemo(function(){return Ge(Mt.height,Cn)},[Mt.height,Cn]),xn=Cn-ce,Vn=(0,Ie.useRef)(xn);Vn.current=xn;function ni(Gn){var Hn=Gn;return Number.isNaN(Vn.current)||(Hn=Math.min(Hn,Vn.current)),Hn=Math.max(Hn,0),Hn}var gi=Dn<=0,ii=Dn>=xn,Kn=Pe<=0,vi=Pe>=pt,ui=Ve(gi,ii,Kn,vi),ci=function(){return{x:ji?-Pe:Pe,y:Dn}},Fn=(0,Ie.useRef)(ci()),Jn=(0,Ne.useEvent)(function(Gn){if(vt){var Hn=(0,Re.Z)((0,Re.Z)({},ci()),Gn);(Fn.current.x!==Hn.x||Fn.current.y!==Hn.y)&&(vt(Hn),Fn.current=Hn)}});function li(Gn,Hn){var Mi=Gn;Hn?((0,He.flushSync)(function(){Le(Mi)}),Jn()):tn(Mi)}function Qn(Gn){var Hn=Gn.currentTarget.scrollTop;Hn!==Dn&&tn(Hn),tt==null||tt(Gn),Jn()}var Di=function(Hn){var Mi=Hn,Ai=pt?pt-Mt.width:0;return Mi=Math.max(Mi,0),Mi=Math.min(Mi,Ai),Mi},Hi=(0,Ne.useEvent)(function(Gn,Hn){Hn?((0,He.flushSync)(function(){Le(function(Mi){var Ai=Mi+(ji?-Gn:Gn);return Di(Ai)})}),Jn()):tn(function(Mi){var Ai=Mi+Gn;return Ai})}),ai=Xe(Pi,gi,ii,Kn,vi,!!pt,Hi),wn=(0,Se.Z)(ai,2),fn=wn[0],ri=wn[1];Vt(Pi,ir,function(Gn,Hn,Mi,Ai){var sr=Ai;return ui(Gn,Hn,Mi)?!1:!sr||!sr._virtualHandled?(sr&&(sr._virtualHandled=!0),fn({preventDefault:function(){},deltaX:Gn?Hn:0,deltaY:Gn?0:Hn}),!0):!1}),Fe(bi,ir,function(Gn){tn(function(Hn){return Hn+Gn})}),(0,ht.Z)(function(){function Gn(Mi){var Ai=gi&&Mi.detail<0,sr=ii&&Mi.detail>0;Pi&&!Ai&&!sr&&Mi.preventDefault()}var Hn=ir.current;return Hn.addEventListener("wheel",fn,{passive:!1}),Hn.addEventListener("DOMMouseScroll",ri,{passive:!0}),Hn.addEventListener("MozMousePixelScroll",Gn,{passive:!1}),function(){Hn.removeEventListener("wheel",fn),Hn.removeEventListener("DOMMouseScroll",ri),Hn.removeEventListener("MozMousePixelScroll",Gn)}},[Pi,gi,ii]),(0,ht.Z)(function(){if(pt){var Gn=Di(Pe);Le(Gn),Jn({x:Gn})}},[Mt.width,pt]);var jn=function(){var Hn,Mi;(Hn=Pt.current)===null||Hn===void 0||Hn.delayHidden(),(Mi=At.current)===null||Mi===void 0||Mi.delayHidden()},yi=ft(ir,Vi,Gi,$e,Bi,function(){return Wi(!0)},tn,jn);Ie.useImperativeHandle(se,function(){return{nativeElement:si.current,getScrollInfo:ci,scrollTo:function(Hn){function Mi(Ai){return Ai&&(0,ct.Z)(Ai)==="object"&&("left"in Ai||"top"in Ai)}Mi(Hn)?(Hn.left!==void 0&&Le(Di(Hn.left)),yi(Hn.top)):yi(Hn)}}}),(0,ht.Z)(function(){if(Lt){var Gn=Vi.slice(Yn,ln+1);Lt(Gn,Vi)}},[Yn,ln,Vi]);var Ti=bt(Vi,Bi,Gi,$e),wi=Mn==null?void 0:Mn({start:Yn,end:ln,virtual:bi,offsetX:Pe,offsetY:Un,rtl:ji,getSize:Ti}),Ui=rt(Vi,Yn,ln,pt,Pe,Fi,en,Xt),Ii=null;ce&&(Ii=(0,Re.Z)((0,st.Z)({},Ut?"height":"maxHeight",ce),Rt),Pi&&(Ii.overflowY="hidden",pt&&(Ii.overflowX="hidden"),it&&(Ii.pointerEvents="none")));var fr={};return ji&&(fr.dir="rtl"),Ie.createElement("div",(0,we.Z)({ref:si,style:(0,Re.Z)((0,Re.Z)({},Ht),{},{position:"relative"}),className:Ji},fr,pi),Ie.createElement(Me.Z,{onResize:_t},Ie.createElement(zn,{className:"".concat(fe,"-holder"),style:Ii,ref:ir,onScroll:Qn,onMouseEnter:jn},Ie.createElement(Ye,{prefixCls:fe,height:Cn,offsetX:Pe,offsetY:Un,scrollWidth:pt,onInnerResize:Wi,ref:$i,innerProps:Ln,rtl:ji,extra:wi},Ui))),bi&&Cn>ce&&Ie.createElement(Ot,{ref:Pt,prefixCls:fe,scrollOffset:Dn,scrollRange:Cn,rtl:ji,onScroll:li,onStartMove:yt,onStopMove:Dt,spinSize:cn,containerSize:Mt.height,style:_n==null?void 0:_n.verticalScrollBar,thumbStyle:_n==null?void 0:_n.verticalScrollBarThumb,showScrollBar:hi}),bi&&pt>Mt.width&&Ie.createElement(Ot,{ref:At,prefixCls:fe,scrollOffset:Pe,scrollRange:pt,rtl:ji,onScroll:li,onStartMove:yt,onStopMove:Dt,spinSize:on,containerSize:Mt.width,horizontal:!0,style:_n==null?void 0:_n.horizontalScrollBar,thumbStyle:_n==null?void 0:_n.horizontalScrollBarThumb,showScrollBar:hi}))}var $t=Ie.forwardRef(an);$t.displayName="List";var Bt=$t,Tt=Bt},48136:function(mn,rn,he){"use strict";var we=Object.defineProperty,ct=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,Oe=(a,y,b)=>y in a?we(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Ce=(a,y)=>{for(var b in y||(y={}))Se.call(y,b)&&Oe(a,b,y[b]);if(st)for(var b of st(y))Be.call(y,b)&&Oe(a,b,y[b]);return a},Me=(a,y)=>ct(a,Re(y)),Ne=a=>typeof a=="symbol"?a:a+"",ht=(a,y)=>{var b={};for(var E in a)Se.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&st)for(var E of st(a))y.indexOf(E)<0&&Be.call(a,E)&&(b[E]=a[E]);return b};function Ie(a){return Array.isArray(a)}var He={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function mt(){return"window"in globalThis&&"document"in globalThis}function Ye(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function ot(){return typeof navigator.vibrate=="function"}function rt(){var a,y;if(!mt())return"other";const b=(y=(a=navigator.userAgentData)==null?void 0:a.platform)!=null?y:navigator.platform;return/^mac/i.test(b)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(b)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Et(){if(!mt())return!0;if(/firefox/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/firefox\/(\d+)/i);return a?parseInt(a[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/edg\/(\d+)/i);return a?parseInt(a[1])>=79:!1}return!0}function Zt(){return HTMLElement.prototype.hasOwnProperty("popover")}var Je={strings:He,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Je._locale||(Je._locale=mt()?navigator.language.slice(0,5):"en-US"),Je._locale},set locale(a){Je._locale=a,Je._numberFormatter=void 0,Je.dirty=!0},get numberFormatter(){return Je._numberFormatter||(Je._numberFormatter=new Intl.NumberFormat(Je.locale)),Je._numberFormatter},merge(a,y){if(typeof a=="string"&&y)Je.strings[a]=Ce(Ce({},Je.strings[a]),y),Je.dirty=!0;else for(const b of Object.keys(a))Je.merge(b,a[b])},get dirty(){return Je._dirty},set dirty(a){Je._dirty||Je._dirty===a||(Je._dirty=!0,setTimeout(()=>{Je._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return Je._subscribers.push(a),Je._subscribers.length-1},unsubscribe(a){a<0||a>=Je._subscribers.length||(Je._subscribers[a]=void 0)},update(a){let y=a.querySelectorAll("[data-l10n-tooltip]");for(const b of y){const E=b.getAttribute("data-l10n-tooltip");if(E){const ee=lt(E);ee&&b.setAttribute("data-tooltip",ee)}}y=a.querySelectorAll("[data-l10n-arial-label]");for(const b of y){const E=b.getAttribute("data-l10n-arial-label");if(E){const ee=lt(E);ee&&b.setAttribute("aria-label",ee)}}}};function lt(a,...y){if(a===void 0)return;let b="";const E=Je.locale;Je.strings[E]&&(b=Je.strings[E][a]);const ee=E.slice(0,2);if(!b&&Je.strings[ee]&&(b=Je.strings[ee][a]),b||(b=Je.strings.en[a]),!b)return;const ie=/(%@|%([0-9]+)\$@)/g;let ae=ie.exec(b),ue=0;for(;ae;){if(y[ue++]){const me=ae[2]?parseInt(ae[2],10)-1:ue-1;let ye=y[me];typeof ye=="number"&&(ye=Je.numberFormatter.format(ye)),b=b.replace(ae[1],ye)}ae=ie.exec(b)}return b=b.replace(/%%/g,"%"),b}var We={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},Ee={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ve={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"},Xe={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"},bt={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"},je={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 It(a){var y,b,E,ee,ie,ae;const ue=a.split("!");let de,me,ye,Te=255,ze=255,nt=255,ut=-1;const nn=ue.length>0&&ue[0].startsWith("-");nn&&(ue[0]=ue[0].slice(1));for(let Nn=0;Nn<ue.length;Nn++){de=Te,me=ze,ye=nt;const Yt=(y=ue[Nn].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],Sn=Yt==null?void 0:Yt.toLowerCase(),Wn=Yt&&(ae=(ie=(ee=(E=(b=Xe[Sn])!=null?b:Xe[bt[Yt]])!=null?E:Ee[Yt])!=null?ee:je[Yt])!=null?ie:We[Yt])!=null?ae:ue[Nn].trim();let En=Wn.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(En!=null&&En[1]&&En[2]&&En[3])Te=Math.max(0,Math.min(255,Number.parseInt(En[1],16))),ze=Math.max(0,Math.min(255,Number.parseInt(En[2],16))),nt=Math.max(0,Math.min(255,Number.parseInt(En[3],16)));else if(En=Wn.match(/^#([\da-f]{3})$/i),En!=null&&En[1]){const Li=Number.parseInt(En[1][0],16),Ni=Number.parseInt(En[1][1],16),Oi=Number.parseInt(En[1][2],16);Te=Math.max(0,Math.min(255,Li*16+Li)),ze=Math.max(0,Math.min(255,Ni*16+Ni)),nt=Math.max(0,Math.min(255,Oi*16+Oi))}else if(En=Wn.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),En!=null&&En[1]&&En[2]&&En[3])Te=Math.max(0,Math.min(255,Number.parseInt(En[1]))),ze=Math.max(0,Math.min(255,Number.parseInt(En[2]))),nt=Math.max(0,Math.min(255,Number.parseInt(En[3])));else return;ut>=0&&(Te=(1-ut)*Te+ut*de,ze=(1-ut)*ze+ut*me,nt=(1-ut)*nt+ut*ye,ut=-1),Nn+1<ue.length&&(ut=Math.max(0,Math.min(100,Number.parseInt(ue[++Nn])))/100)}return ut>=0&&(Te=ut*Te+(1-ut)*de,ze=ut*ze+(1-ut)*me,nt=ut*nt+(1-ut)*ye),nn&&(Te=255-Te,ze=255-ze,nt=255-nt),"#"+("00"+Math.round(Te).toString(16)).slice(-2)+("00"+Math.round(ze).toString(16)).slice(-2)+("00"+Math.round(nt).toString(16)).slice(-2)}function at(a){var y,b;return a=a.trim(),(b=(y=Ve[a.toLowerCase()])!=null?y:Ve[bt[a]])!=null?b:It(a)}function Ct(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&y.a===void 0&&(y.a=1),y}function qe(a,y,b){return b<0&&(b+=6),b>=6&&(b-=6),b<1?(y-a)*b+a:b<3?y:b<4?(y-a)*(4-b)+a:a}function Nt(a){let[y,b,E]=[a.h,a.s,a.l];y=(y+360)%360/60,E=Math.max(0,Math.min(E,1)),b=Math.max(0,Math.min(b,1));const ee=E<=.5?E*(b+1):E+b-E*b,ie=E*2-ee;return{r:Math.round(255*qe(ie,ee,y+2)),g:Math.round(255*qe(ie,ee,y)),b:Math.round(255*qe(ie,ee,y-2))}}function Qt(a){return a<0?0:a>255?255:Math.round(a)}function Vt(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(Qt(y)<<16)+(Qt(b)<<8)+Qt(E)).toString(16).slice(1);return ee[0]===ee[1]&&ee[2]===ee[3]&&ee[4]===ee[5]&&ee[6]===ee[7]&&(ee=ee[0]+ee[2]+ee[4]),"#"+ee}function Gt(a){let{r:y,g:b,b:E}=a;y=y/255,b=b/255,E=E/255;const ee=Math.min(y,b,E),ie=Math.max(y,b,E),ae=ie-ee;let ue,de;ie===ee?ue=0:y===ie?ue=(b-E)/ae:b===ie?ue=2+(E-y)/ae:E===ie&&(ue=4+(y-b)/ae),ue=Math.min(ue*60,360),ue<0&&(ue+=360);const me=(ee+ie)/2;return ie===ee?de=0:me<=.5?de=ae/(ie+ee):de=ae/(2-ie-ee),{h:ue,s:de,l:me}}function Ft(a){let y=Ct(a);if(!y)return a;let{h:b,s:E,l:ee}=Gt(y);return E+=.1,ee-=.1,Vt(Nt({h:b,s:E,l:ee}))}var Fe={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"},xe={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},ft=[{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 qt(a,y,b){if(!/[A-Za-z\d]/.test(a)||(b==="up"&&(b=void 0),!y&&!b))return a;const E=a.codePointAt(0);if(E===void 0)return a;for(const ee of ft)if((!y||ee.variant===y)&&(!b||ee.style===b)&&E>=ee.offset&&E<ee.offset+ee.len){const ie=ee.start+E-ee.offset;return String.fromCodePoint(xe[ie]||ie)}return a}function Ot(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in xe)if(xe[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of ft)if(a>=b.start&&a<b.start+b.len)return{char:String.fromCodePoint(a-b.start+b.offset),variant:b.variant,style:b.style};return{char:String.fromCodePoint(a)}}function Ue(a){var y;let b="";for(const E of a){if("{}<>[]$&#^_%:'\u02DC".includes(E)){b+=E;continue}const ee=(y=E.codePointAt(0))!=null?y:0;let ie=Fe[ee];if(ie)ie.startsWith("\\")?b+=ie+" ":b+=ie;else{const{char:ae,variant:ue,style:de}=Ot(ee);switch(ie=ae,ue){case"double-struck":ie=`\\mathbb{${ie}}`;break;case"fraktur":ie=`\\mathfrak{${ie}}`;break;case"script":ie=`\\mathscr{${ie}}`;break;case"sans-serif":ie=`\\mathsf{${ie}}`;break;case"monospace":ie=`\\mathtt{${ie}}`;break;case"calligraphic":ie=`\\mathcal{${ie}}`;break}switch(de){case"bold":ie=`\\mathbf{${ie}}`;break;case"italic":ie=`\\mathit{${ie}}`;break;case"bolditalic":ie=`\\mathbfit{${ie}}`;break}b+=ie}}return b}function Ge(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var wt={},dn=Ce({},Fe),Rt={},an={},$t={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}"},Bt={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}},Tt={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}},ge={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},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`\u220C}",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:Tt},"amsmath.sty":{package:Bt,primitive:!0},"texvc.sty":{package:$t,primitive:!1}},se={" ":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,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},oe=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,fe,ve;Et()?(fe=new RegExp("\\p{Letter}","u"),ve=new RegExp("[0-9\\p{Letter}]","u")):(fe=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,ve=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function ce(a,y,b="mord",E){y!==void 0&&(wt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},dn[y]||(dn[y]=a))}function $e(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);ce(ee,ee.codePointAt(0))}return}for(const[E,ee,ie,ae]of a)ce(E,ee,ie!=null?ie:y,ae!=null?ae:b)}function xt(a,y){for(let b=a;b<=y;b++)ce(String.fromCodePoint(b),b)}function Ut(a){var y;return(y=an[a])!=null?y:null}function Ht(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in Rt)ae.startsWith(y)&&!Rt[ae].infix&&ee.push({match:ae,frequency:(b=Rt[ae].frequency)!=null?b:0});for(const ae in wt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=wt[ae].frequency)!=null?E:0});const ie=y.substring(1);for(const ae of Object.keys(a.options.macros))ae.startsWith(ie)&&ee.push({match:"\\"+ae,frequency:0});return ee.sort((ae,ue)=>{var de,me;return ae.frequency===ue.frequency?ae.match.length===ue.match.length?ae.match<ue.match?-1:1:ae.match.length-ue.match.length:((de=ue.frequency)!=null?de:0)-((me=ae.frequency)!=null?me:0)}),ee.map(ae=>ae.match)}function Jt(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function en(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:Jt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...en(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:Jt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...en(b[E]))}return y}function hn(a){if(!a)return"";let y="",b=!0;for(const E of a)typeof E.value=="string"?y+=E.value:b=!1;return b?y:""}function pn(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)an[E]=b}function bn(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:en(y),createAtom:b};for(const ie of a)an[ie]=ee}function pt(a,y,b){var E,ee;b||(b={});const ie={definitionType:"function",params:en(y),ifMode:b.ifMode,isFunction:(E=b.isFunction)!=null?E:!1,applyMode:b.applyMode,infix:(ee=b.infix)!=null?ee:!1,parse:b.parse,createAtom:b.createAtom,applyStyle:b.applyStyle,serialize:b.serialize,render:b.render};if(typeof a=="string")Rt["\\"+a]=ie;else for(const ae of a)Rt["\\"+ae]=ie}var sn;function zn(a){return sn||(sn=vt(ge)),a?vt(Ce(Ce({},sn),a)):sn}function tt(a,y){var b,E,ee,ie;if(typeof a=="string"){let ae=0;const ue=a;return/(^|[^\\])#1/.test(ue)&&(ae=1),/(^|[^\\])#2/.test(ue)&&(ae=2),/(^|[^\\])#3/.test(ue)&&(ae=3),/(^|[^\\])#4/.test(ue)&&(ae=4),/(^|[^\\])#5/.test(ue)&&(ae=5),/(^|[^\\])#6/.test(ue)&&(ae=6),/(^|[^\\])#7/.test(ue)&&(ae=7),/(^|[^\\])#8/.test(ue)&&(ae=8),/(^|[^\\])#9/.test(ue)&&(ae=9),{expand:(b=y==null?void 0:y.expand)!=null?b:!0,captureSelection:(E=y==null?void 0:y.captureSelection)!=null?E:!0,args:ae,def:ue}}return Ce({expand:(ee=y==null?void 0:y.expand)!=null?ee:!0,captureSelection:(ie=y==null?void 0:y.captureSelection)!=null?ie:!0,args:0},a)}function vt(a){if(!a)return{};const y={};for(const b of Object.keys(a)){const E=a[b];if(E==null)delete y[b];else if(typeof E=="object"&&"package"in E)for(const ee of Object.keys(E.package))y[ee]=tt(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=tt(E)}return y}function Lt(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=Rt[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=wt[a]:se[a]&&(b={definitionType:"symbol",type:"mord",codepoint:se[a]})}else if(y==="math"){if(b=wt[a],!b&&a.length===1){const E=Mn("math",a.codePointAt(0));return E.startsWith("\\")?Me(Ce({},Lt(E,"math")),{command:E}):null}}else se[a]?b={definitionType:"symbol",type:"mord",codepoint:se[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Ln(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Mn(a,y){if(y===void 0)return"";if(a==="math"&&dn[y])return dn[y];if(a==="text"){const b=Object.keys(se).find(E=>se[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var _n=[0,.68889,0,0,.72222],ti=[0,.68889,0,0,.66667],hi=[0,.68889,0,0,.77778],pi=[0,.68889,0,0,.61111],Bi=[.16667,.68889,0,0,.77778],_i=[0,.68889,0,0,.55556],Zn=[0,0,0,0,.25],Fi=[0,.825,0,0,2.33334],Wi=[0,.9,0,0,2.33334],Gi=[0,.68889,0,0,.54028],nr=[-.03598,.46402,0,0,.5],Pi=[-.13313,.36687,0,0,1],Yi=[.01354,.52239,0,0,1],bi=[.01354,.52239,0,0,1.11111],ji=[0,.54986,0,0,1],Ji=[0,.69224,0,0,.5],Vi=[0,.43056,0,0,1],ir=[.08198,.58198,0,0,.77778],$i=[.19444,.69224,0,0,.41667],si=[.1808,.675,0,0,1],fi=[.19444,.69224,0,0,.83334],kn=[.13667,.63667,0,0,1],Dn=[-.064,.437,0,0,1.334],mi=[.08167,.58167,0,0,.77778],Qe=[0,.69224,0,0,.72222],ke=[0,.69224,0,0,.66667],Pe=[-.13313,.36687,0,0,.77778],Le=[.06062,.54986,0,0,.77778],De=[0,.69224,0,0,.77778],Ke=[.25583,.75583,0,0,.77778],it=[.25142,.75726,0,0,.77778],kt=[.20576,.70576,0,0,.77778],yt=[.30274,.79383,0,0,.77778],Dt=[.22958,.72958,0,0,.77778],Xt=[.1808,.675,0,0,.77778],tn=[.13667,.63667,0,0,.77778],un=[.13597,.63597,0,0,.77778],gt=[.03517,.54986,0,0,.77778],jt=[0,.675,0,0,.77778],Bn=[.19444,.69224,0,0,.61111],yn=[0,.54986,0,0,.76042],Tn=[0,.54986,0,0,.66667],Cn=[.0391,.5391,0,0,.77778],Yn=[.03517,.54986,0,0,1.33334],ln=[.38569,.88569,0,0,.77778],Un=[.23222,.74111,0,0,.77778],Ze=[.19444,.69224,0,0,.77778],St=[0,.37788,0,0,.5],Mt=[0,.54986,0,0,.72222],Kt=[0,.69224,0,0,.83334],_t=[.11111,.69224,0,0,.66667],Pt=[.26167,.75726,0,0,.77778],At=[.48256,.98256,0,0,.77778],on=[.28481,.79383,0,0,.77778],cn=[.08167,.58167,0,0,.22222],xn=[.08167,.58167,0,0,.38889],Vn=[0,.43056,.04028,0,.66667],ni=[.41951,.91951,0,0,.77778],gi=[.24982,.74947,0,0,.38865],ii=[.08319,.58283,0,0,.75623],Kn=[0,.10803,0,0,.27764],vi=[0,.47534,0,0,.50181],ui=[.18906,.47534,0,0,.50181],ci=[0,.69141,0,0,.50181],Fn=[.24982,.74947,0,0,.27764],Jn=[0,.69141,0,0,.21471],li=[.25,.75,0,0,.44722],Qn=[0,.64444,0,0,.575],Di=[.08556,.58556,0,0,.89444],Hi=[0,.69444,0,0,.89444],ai=[0,.68611,0,0,.9],wn=[0,.68611,0,0,.86944],fn=[.25,.75,0,0,.575],ri=[.25,.75,0,0,.31944],jn=[0,.69444,0,0,.63889],yi=[0,.69444,0,0,.31944],Ti=[0,.44444,0,0,.63889],wi=[0,.44444,0,0,.51111],Ui=[0,.69444,0,0,.575],Ii=[.13333,.63333,0,0,.89444],fr=[0,.44444,0,0,.31944],Gn=[0,.69444,0,0,.86944],Hn=[0,.68611,0,0,.69166],Mi=[0,.68611,0,0,.83055],Ai=[0,.68611,0,0,.89444],sr=[0,.69444,0,0,.60278],qr=[.19444,.69444,0,0,.51111],Ar=[0,.69444,0,0,.83055],Xi=[-.10889,.39111,0,0,1.14999],yr=[.19444,.69444,0,0,.575],pr=[.19444,.69444,0,0,1.14999],Rn=[.19444,.69444,0,0,.70277],In=[.05556,.75,0,0,.575],Pn=[0,.68611,0,0,.95833],Xn=[.08556,.58556,0,0,.76666],qi=[-.02639,.47361,0,0,.575],hr=[0,.44444,0,0,.89444],br=[0,.55556,0,0,.76666],mr=[-.10889,.39111,0,0,.89444],ar=[.00222,.50222,0,0,.89444],wr=[.19667,.69667,0,0,.89444],Kr=[.08556,.58556,0,0,1.14999],Br=[0,.69444,0,0,.70277],pa=[-.02778,.47222,0,0,.575],ea=[.25,.75,0,0,.51111],Or=[-.13889,.36111,0,0,1.14999],Qa=[.19444,.69444,0,0,1.02222],Ma=[.12963,.69444,0,0,.89444],ma=[.19444,.69444,0,0,.44722],ta=[0,.64444,.13167,0,.59111],Sr=[.19444,.64444,.13167,0,.59111],ki=[0,.68611,.17208,0,.8961],Zi=[.19444,.44444,.105,0,.53222],Ri=[0,.44444,.085,0,.82666],Si=[0,.69444,.06709,0,.59111],tr=[0,.69444,.12945,0,.35555],Qi=[0,.69444,0,0,.94888],Pr=[0,.69444,.11472,0,.59111],Rr=[0,.68611,.10778,0,.88555],Nr=[0,.69444,.07939,0,.62055],Yr=[0,.69444,.12417,0,.30667],ur=[0,.64444,.13556,0,.51111],lr=[.19444,.64444,.13556,0,.51111],Hr=[0,.68333,.16389,0,.74333],aa=[.19444,.43056,.08847,0,.46],ia=[0,.43056,.07514,0,.71555],Xr=[0,.69444,.06646,0,.51111],ts=[0,.69444,0,0,.83129],ao=[0,.69444,.1225,0,.51111],oo=[0,.68333,.09403,0,.76666],eo=[0,.68333,.11111,0,.76666],Ss=[0,.69444,.06961,0,.51444],fo=[0,.69444,0,0,.27778],ka=[.25,.75,0,0,.38889],ua=[0,.64444,0,0,.5],bo=[0,.69444,0,0,.77778],ko=[0,.68333,0,0,.75],Eo=[0,.68333,0,0,.77778],ns=[0,.68333,0,0,.68056],Ro=[0,.68333,0,0,.72222],Ua=[.25,.75,0,0,.5],Ia=[.25,.75,0,0,.27778],Er=[0,.69444,0,0,.5],Lo=[0,.69444,0,0,.55556],is=[0,.43056,0,0,.44445],Do=[0,.43056,0,0,.5],gr=[.19444,.43056,0,0,.55556],or=[0,.43056,0,0,.55556],Ir=[.08333,.58333,0,0,.77778],Ea=[0,.43056,0,0,.27778],Wr=[0,.66786,0,0,.27778],Oa=[0,.69444,0,0,.75],Fa=[0,.66786,0,0,.5],to=[0,.68333,0,0,.625],Ra=[.19444,.69444,0,0,.44445],so=[0,.69444,0,0,.72222],lo=[.19444,.69444,0,0,.5],La=[.19444,.69444,0,0,1],bl=[.011,.511,0,0,1.126],Vo=[.19444,.69444,0,0,.61111],Ys=[.05556,.75,0,0,.5],Kl=[0,.68333,0,0,.83334],Hl=[.0391,.5391,0,0,.66667],Cs=[-.05555,.44445,0,0,.5],Mu=[0,.43056,0,0,.77778],rs=[0,.55556,0,0,.66667],xl=[-.03625,.46375,0,0,.77778],jo=[-.01688,.48312,0,0,.77778],as=[.0391,.5391,0,0,1],_r=[0,.69444,0,0,.61111],kr=[-.03472,.46528,0,0,.5],Fr=[.25,.75,0,0,.44445],Xa=[-.14236,.35764,0,0,1],Da=[.244,.744,0,0,.412],xo=[.19444,.69444,0,0,.88889],po=[.12963,.69444,0,0,.77778],$a=[.19444,.69444,0,0,.38889],Ao=[.011,.511,0,0,1.638],To=[.19444,.69444,0,0,0],wo=[0,.44444,0,0,.575],os=[.19444,.44444,0,0,.575],Wl=[0,.68611,0,0,.75555],wl=[0,.69444,0,0,.66759],Mc=[0,.68611,0,0,.80555],kc=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],ku=[.19444,.44444,0,0,.6118],Sl=[.19444,.43056,0,0,.5],Ec=[0,.68333,.02778,.08334,.76278],Eu=[0,.68333,.08125,.05556,.83125],Js=[0,.43056,0,.05556,.48472],Vl=[.19444,.43056,0,.08334,.51702],Lc=[.25,.75,0,0,.42778],Aa=[0,.69444,0,0,.55],ss=[0,.69444,0,0,.73334],_s=[0,.69444,0,0,.79445],Rd=[0,.69444,0,0,.51945],jl=[0,.69444,0,0,.70278],Lu=[0,.69444,0,0,.76389],Qs=[.25,.75,0,0,.34306],el=[0,.69444,0,0,.56111],Nd=[0,.69444,0,0,.25556],Gl=[.19444,.45833,0,0,.56111],Dc=[0,.45833,0,0,.56111],Ms=[0,.69444,0,0,.30556],Ac=[0,.69444,0,0,.58056],ks=[0,.69444,0,0,.67223],tl=[0,.69444,0,0,.85556],ls=[0,.69444,0,0,.55834],mo=[0,.65556,.11156,0,.5],Es=[0,.69444,.08094,0,.70834],Du=[.17014,0,0,0,.44445],Tc=[0,.69444,.0799,0,.5],Bc=[0,.69444,0,0,.73752],Fd=[0,.69444,.09205,0,.5],Ls=[0,.69444,.09031,0,.77778],us=[0,.69444,.07816,0,.27778],$d=[0,.69444,.00316,0,.5],zd=[.19444,.69444,0,0,.83334],Kd=[.05556,.75,0,0,.83334],Hd=[0,.75,0,0,.5],Wd=[.125,.08333,0,0,.27778],Zd=[0,.08333,0,0,.27778],ca=[0,.65556,0,0,.5],xa=[0,.69444,0,0,.47222],oa=[0,.69444,0,0,.66667],Ta=[0,.69444,0,0,.59722],nl=[0,.69444,0,0,.54167],Pc=[0,.69444,0,0,.70834],Ul=[.25,.75,0,0,.28889],Ic=[0,.69444,0,0,.51667],Vd=[0,.44444,0,0,.44445],jd=[.19444,.44444,0,0,.51667],Au=[0,.44444,0,0,.38333],Oc=[0,.44444,0,0,.51667],Tu=[0,.69444,0,0,.83334],Gd=[.35001,.85,0,0,.45834],Bu=[.35001,.85,0,0,.57778],Pu=[.35001,.85,0,0,.41667],Rc=[.35001,.85,0,0,.58334],Xl=[0,.72222,0,0,.55556],Iu=[1e-5,.6,0,0,.66667],Nc=[1e-5,.6,0,0,.77778],Cl=[.25001,.75,0,0,.94445],Ud=[.306,.805,.19445,0,.47222],ql=[.30612,.805,.19445,0,.47222],za=[.25001,.75,0,0,.83334],il=[.35001,.85,0,0,.47222],Fc=[.25001,.75,0,0,1.11111],$c=[.65002,1.15,0,0,.59722],go=[.65002,1.15,0,0,.81111],Tr=[.65002,1.15,0,0,.47222],Bo=[.65002,1.15,0,0,.66667],No=[0,.75,0,0,1],cs=[.55001,1.05,0,0,1.27778],zc=[.862,1.36,.44445,0,.55556],Ou=[.86225,1.36,.44445,0,.55556],rl=[.55001,1.05,0,0,1.11111],Ru=[.65002,1.15,0,0,.52778],Nu=[.65002,1.15,0,0,.61111],al=[.55001,1.05,0,0,1.51112],Kc=[.95003,1.45,0,0,.73611],Fu=[.95003,1.45,0,0,1.04445],ds=[.95003,1.45,0,0,.52778],Yl=[.95003,1.45,0,0,.75],Jl=[0,.75,0,0,1.44445],$u=[.95003,1.45,0,0,.58334],Ql=[1.25003,1.75,0,0,.79167],zu=[1.25003,1.75,0,0,1.27778],Hc=[1.25003,1.75,0,0,.58334],Ku=[1.25003,1.75,0,0,.80556],eu=[0,.825,0,0,1.8889],Hu=[1.25003,1.75,0,0,.63889],Wu=[.64502,1.155,0,0,.875],tu=[1e-5,.6,0,0,.875],Zu=[-99e-5,.601,0,0,.66667],Vu=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Wc=[.65002,1.15,0,0,.88889],ol=[.90001,0,0,0,.88889],ju=[-.00499,.605,0,0,1.05556],sl=[0,.12,0,0,.45],Ei=[0,.61111,0,0,.525],So=[.08333,.69444,0,0,.525],Zc=[-.08056,.53055,0,0,.525],qd=[-.05556,.55556,0,0,.525],no=[0,.43056,0,0,.525],wa=[.22222,.43056,0,0,.525],nu=[0,0,0,0,.525],Yd={"AMS-Regular":{32:Zn,65:_n,66:ti,67:_n,68:_n,69:ti,70:pi,71:hi,72:hi,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:hi,76:ti,77:[0,.68889,0,0,.94445],78:_n,79:Bi,80:pi,81:Bi,82:_n,83:_i,84:ti,85:_n,86:_n,87:[0,.68889,0,0,1],88:_n,89:_n,90:ti,107:_i,160:Zn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:_i,295:Gi,710:Fi,732:Wi,770:Fi,771:Wi,989:mi,1008:Vn,8245:[0,.54986,0,0,.275],8463:Gi,8487:_n,8498:_i,8502:ti,8503:[0,.68889,0,0,.44445],8504:ti,8513:[0,.68889,0,0,.63889],8592:nr,8594:nr,8602:Pi,8603:Pi,8606:Yi,8608:Yi,8610:bi,8611:bi,8619:ji,8620:ji,8621:[-.13313,.37788,0,0,1.38889],8622:Pi,8624:Ji,8625:Ji,8630:Vi,8631:Vi,8634:ir,8635:ir,8638:$i,8639:$i,8642:$i,8643:$i,8644:si,8646:si,8647:si,8648:fi,8649:si,8650:fi,8651:Yi,8652:Yi,8653:Pi,8654:Pi,8655:Pi,8666:kn,8667:kn,8669:[-.13313,.37788,0,0,1],8672:Dn,8674:Dn,8705:[0,.825,0,0,.5],8708:_i,8709:mi,8717:[0,.43056,0,0,.42917],8722:nr,8724:[.08198,.69224,0,0,.77778],8726:mi,8733:De,8736:Qe,8737:Qe,8738:[.03517,.52239,0,0,.72222],8739:cn,8740:[.25142,.74111,0,0,.27778],8741:xn,8742:[.25142,.74111,0,0,.5],8756:ke,8757:ke,8764:Pe,8765:[-.13313,.37788,0,0,.77778],8769:Pe,8770:xl,8774:yt,8776:jo,8778:mi,8782:Le,8783:Le,8785:ir,8786:ir,8787:ir,8790:De,8791:Dt,8796:[.08198,.91667,0,0,.77778],8806:Ke,8807:Ke,8808:it,8809:it,8812:[.25583,.75583,0,0,.5],8814:kt,8815:kt,8816:yt,8817:yt,8818:Dt,8819:Dt,8822:Xt,8823:Xt,8828:tn,8829:tn,8830:Dt,8831:Dt,8832:kt,8833:kt,8840:yt,8841:yt,8842:un,8843:un,8847:gt,8848:gt,8858:ir,8859:ir,8861:ir,8862:jt,8863:jt,8864:jt,8865:jt,8872:[0,.69224,0,0,.61111],8873:Qe,8874:[0,.69224,0,0,.88889],8876:pi,8877:pi,8878:_n,8879:_n,8882:gt,8883:gt,8884:tn,8885:tn,8888:[0,.54986,0,0,1.11111],8890:gr,8891:Bn,8892:Bn,8901:[0,.54986,0,0,.27778],8903:mi,8905:mi,8906:mi,8907:De,8908:De,8909:[-.03598,.46402,0,0,.77778],8910:yn,8911:yn,8912:gt,8913:gt,8914:Tn,8915:Tn,8916:ke,8918:Cn,8919:Cn,8920:Yn,8921:Yn,8922:ln,8923:ln,8926:tn,8927:tn,8928:yt,8929:yt,8934:Un,8935:Un,8936:Un,8937:Un,8938:kt,8939:kt,8940:yt,8941:yt,8994:Ze,8995:Ze,9416:[.15559,.69224,0,0,.90222],9484:Ji,9488:Ji,9492:St,9496:St,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:jt,9633:jt,9650:Mt,9651:Mt,9654:gt,9660:Mt,9661:Mt,9664:gt,9674:_t,9733:[.19444,.69224,0,0,.94445],10003:Kt,10016:Kt,10731:_t,10846:[.19444,.75583,0,0,.61111],10877:tn,10878:tn,10885:Ke,10886:Ke,10887:un,10888:un,10889:Pt,10890:Pt,10891:At,10892:At,10901:tn,10902:tn,10933:it,10934:it,10935:Pt,10936:Pt,10937:Pt,10938:Pt,10949:Ke,10950:Ke,10955:on,10956:on,57350:cn,57351:xn,57352:mi,57353:Vn,57356:it,57357:it,57358:ni,57359:yt,57360:yt,57361:ni,57366:it,57367:it,57368:it,57369:it,57370:un,57371:un},"Caligraphic-Regular":{32:Zn,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:Zn},"Fraktur-Regular":{32:Zn,33:[0,.69141,0,0,.29574],34:Jn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:gi,41:gi,42:[0,.62119,0,0,.27764],43:ii,44:Kn,45:ii,46:Kn,47:[.24982,.74947,0,0,.50181],48:vi,49:vi,50:vi,51:ui,52:ui,53:ui,54:ci,55:ui,56:ci,57:ui,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:Fn,93:Fn,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:Zn,8216:Jn,8217:Jn,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:Zn,33:[0,.69444,0,0,.35],34:sr,35:[.19444,.69444,0,0,.95833],36:In,37:[.05556,.75,0,0,.95833],38:Hi,39:yi,40:li,41:li,42:[0,.75,0,0,.575],43:Ii,44:[.19444,.15556,0,0,.31944],45:Au,46:[0,.15556,0,0,.31944],47:fn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,58:fr,59:[.19444,.44444,0,0,.31944],60:Di,61:mr,62:Di,63:[0,.69444,0,0,.54305],64:Hi,65:wn,66:[0,.68611,0,0,.81805],67:Mi,68:[0,.68611,0,0,.88194],69:Wl,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ai,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Hn,77:[0,.68611,0,0,1.09166],78:ai,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:wn,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:ri,92:fn,93:ri,94:Ui,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:jn,99:wi,100:jn,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:jn,105:yi,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:yi,109:[0,.44444,0,0,.95833],110:Ti,111:wo,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:Ti,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:wi,123:fn,124:ri,125:fn,126:[.35,.34444,0,0,.575],160:Zn,163:[0,.69444,0,0,.86853],168:Ui,172:[0,.44444,0,0,.76666],176:Gn,177:Ii,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Ii,216:[.04861,.73472,0,0,.89444],223:Ta,230:[0,.44444,0,0,.83055],247:Ii,248:[.09722,.54167,0,0,.575],305:fr,338:[0,.68611,0,0,1.16944],339:hr,567:[.19444,.44444,0,0,.35139],710:Ui,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Ui,715:Ui,728:Ui,729:yi,730:Gn,732:Ui,733:Ui,915:Hn,916:Pn,920:Ai,923:Mc,926:Zl,928:ai,931:Mi,933:Ai,934:Mi,936:Ai,937:Mi,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:yi,8217:yi,8220:sr,8221:sr,8224:qr,8225:qr,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:wl,8465:Ar,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ar,8501:Br,8592:Xi,8593:yr,8594:Xi,8595:yr,8596:Xi,8597:fn,8598:pr,8599:pr,8600:pr,8601:pr,8636:Xi,8637:Xi,8640:Xi,8641:Xi,8656:Xi,8657:Rn,8658:Xi,8659:Rn,8660:Xi,8661:[.25,.75,0,0,.70277],8704:jn,8706:[0,.69444,.06389,0,.62847],8707:jn,8709:In,8711:Pn,8712:Xn,8715:Xn,8722:Ii,8723:Ii,8725:fn,8726:fn,8727:pa,8728:qi,8729:qi,8730:[.18,.82,0,0,.95833],8733:hr,8734:[0,.44444,0,0,1.14999],8736:Qe,8739:ri,8741:fn,8743:br,8744:br,8745:br,8746:br,8747:[.19444,.69444,.12778,0,.56875],8764:mr,8768:[.19444,.69444,0,0,.31944],8771:ar,8776:[.02444,.52444,0,0,.89444],8781:ar,8801:ar,8804:wr,8805:wr,8810:Kr,8811:Kr,8826:Di,8827:Di,8834:Di,8835:Di,8838:wr,8839:wr,8846:br,8849:wr,8850:wr,8851:br,8852:br,8853:Ii,8854:Ii,8855:Ii,8856:Ii,8857:Ii,8866:Br,8867:Br,8868:Hi,8869:Hi,8900:qi,8901:[-.02639,.47361,0,0,.31944],8902:pa,8968:ea,8969:ea,8970:ea,8971:ea,8994:Or,8995:Or,9651:Qa,9657:pa,9661:Qa,9667:pa,9711:pr,9824:Ma,9825:Ma,9826:Ma,9827:Ma,9837:[0,.75,0,0,.44722],9838:ma,9839:ma,10216:li,10217:li,10815:ai,10927:wr,10928:wr,57376:To},"Main-BoldItalic":{32:Zn,33:[0,.69444,.11417,0,.38611],34:Nr,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:tr,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:ta,49:ta,50:ta,51:ta,52:Sr,53:ta,54:ta,55:Sr,56:ta,57:ta,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Pr,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:ki,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:ki,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:Si,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:Zi,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:Zi,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:Zn,168:[0,.69444,.11473,0,.59111],176:Qi,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:Ri,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Ri,567:[.19444,.44444,.04611,0,.385],710:Si,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:tr,730:Qi,732:Pr,733:Pr,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:ki,931:[0,.68611,.11431,0,.82666],933:Rr,934:[0,.68611,.05632,0,.82666],936:Rr,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:tr,8217:tr,8220:[0,.69444,.16772,0,.62055],8221:Nr},"Main-Italic":{32:Zn,33:Yr,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Yr,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:ur,49:ur,50:ur,51:ur,52:lr,53:ur,54:ur,55:lr,56:ur,57:ur,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:ao,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:Hr,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:Hr,79:oo,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:Hr,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:Xr,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:aa,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:aa,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:Zn,168:[0,.66786,.10474,0,.51111],176:ts,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:ia,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:ia,710:Xr,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:ts,732:[0,.66786,.11585,0,.51111],733:ao,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:oo,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Hr,931:[0,.68333,.12028,0,.71555],933:eo,934:[0,.68333,.05986,0,.71555],936:eo,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Yr,8217:Yr,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Gi},"Main-Regular":{32:Zn,33:fo,34:Er,35:zd,36:Ys,37:Kd,38:bo,39:fo,40:ka,41:ka,42:Hd,43:Ir,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Ua,48:ua,49:ua,50:ua,51:ua,52:ua,53:ua,54:ua,55:ua,56:ua,57:ua,58:Ea,59:[.19444,.43056,0,0,.27778],60:Cn,61:Pe,62:Cn,63:xa,64:bo,65:ko,66:[0,.68333,0,0,.70834],67:Ro,68:[0,.68333,0,0,.76389],69:ns,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:ko,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Eo,76:to,77:[0,.68333,0,0,.91667],78:ko,79:Eo,80:ns,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Ro,85:ko,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ko,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Ia,92:Ua,93:Ia,94:Er,95:[.31,.12056,.02778,0,.5],97:Do,98:Lo,99:is,100:Lo,101:is,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Lo,105:Wr,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fo,109:[0,.43056,0,0,.83334],110:or,111:Do,112:gr,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:or,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:is,123:Ua,124:Ia,125:Ua,126:[.35,.31786,0,0,.5],160:Zn,163:[0,.69444,0,0,.76909],167:Ra,168:Fa,172:[0,.43056,0,0,.66667],176:Oa,177:Ir,182:Vo,184:Du,198:[0,.68333,0,0,.90278],215:Ir,216:[.04861,.73194,0,0,.77778],223:Er,230:[0,.43056,0,0,.72222],247:Ir,248:[.09722,.52778,0,0,.5],305:Ea,338:[0,.68333,0,0,1.01389],339:Mu,567:[.19444,.43056,0,0,.30556],710:Er,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Er,715:Er,728:Er,729:Wr,730:Oa,732:Fa,733:Er,915:to,916:Kl,920:Eo,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ko,931:Ro,933:Eo,934:Ro,936:Eo,937:Ro,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fo,8217:fo,8220:Er,8221:Er,8224:Ra,8225:Ra,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Gi,8465:so,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:so,8501:_r,8592:Pi,8593:lo,8594:Pi,8595:lo,8596:Pi,8597:Ua,8598:La,8599:La,8600:La,8601:La,8614:[.011,.511,0,0,1],8617:bl,8618:bl,8636:Pi,8637:Pi,8640:Pi,8641:Pi,8652:[.011,.671,0,0,1],8656:Pi,8657:Vo,8658:Pi,8659:Vo,8660:Pi,8661:[.25,.75,0,0,.61111],8704:Lo,8706:[0,.69444,.05556,.08334,.5309],8707:Lo,8709:Ys,8711:Kl,8712:Hl,8715:Hl,8722:Ir,8723:Ir,8725:Ua,8726:Ua,8727:kr,8728:Cs,8729:Cs,8730:[.2,.8,0,0,.83334],8733:Mu,8734:Vi,8736:Qe,8739:Ia,8741:Ua,8743:rs,8744:rs,8745:rs,8746:rs,8747:[.19444,.69444,.11111,0,.41667],8764:Pe,8768:[.19444,.69444,0,0,.27778],8771:xl,8773:[-.022,.589,0,0,1],8776:jo,8781:xl,8784:[-.133,.67,0,0,.778],8801:xl,8804:un,8805:un,8810:as,8811:as,8826:Cn,8827:Cn,8834:Cn,8835:Cn,8838:un,8839:un,8846:rs,8849:un,8850:un,8851:rs,8852:rs,8853:Ir,8854:Ir,8855:Ir,8856:Ir,8857:Ir,8866:_r,8867:_r,8868:bo,8869:bo,8872:[.249,.75,0,0,.867],8900:Cs,8901:[-.05555,.44445,0,0,.27778],8902:kr,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:Fr,8969:Fr,8970:Fr,8971:Fr,8994:Xa,8995:Xa,9136:Da,9137:Da,9651:xo,9657:kr,9661:xo,9667:kr,9711:La,9824:po,9825:po,9826:po,9827:po,9837:[0,.75,0,0,.38889],9838:$a,9839:$a,10216:ka,10217:ka,10222:Da,10223:Da,10229:[.011,.511,0,0,1.609],10230:Ao,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:Ao,10815:ko,10927:un,10928:un,57376:To},"Math-BoldItalic":{32:Zn,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:Qn,55:os,56:Qn,57:os,65:wn,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:kc,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Wl,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:wl,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:Od,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:Zn,915:[0,.68611,.15972,0,.65694],916:Pn,920:[0,.68611,.03194,0,.86722],923:Mc,926:[0,.68611,.07458,0,.84125],928:kc,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Zl,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:Od,960:[0,.44444,.03704,0,.68241],961:ku,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:ku,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Zn,48:Do,49:Do,50:Do,51:Sl,52:Sl,53:Sl,54:ua,55:Sl,56:ua,57:Sl,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:Eu,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:Ec,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:Js,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:Zn,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ec,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Eu,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:Js,960:[0,.43056,.03588,0,.57003],961:Vl,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:Vl,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:Zn,33:[0,.69444,0,0,.36667],34:ls,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:Ms,40:Lc,41:Lc,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:Aa,49:Aa,50:Aa,51:Aa,52:Aa,53:Aa,54:Aa,55:Aa,56:Aa,57:Aa,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Rd,64:ss,65:ss,66:ss,67:jl,68:_s,69:[0,.69444,0,0,.64167],70:_r,71:ss,72:_s,73:[0,.69444,0,0,.33056],74:Rd,75:Lu,76:Ac,77:[0,.69444,0,0,.97778],78:_s,79:_s,80:jl,81:[.10556,.69444,0,0,.79445],82:jl,83:_r,84:ss,85:Lu,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:ss,89:[0,.69444,.0275,0,.73334],90:ks,91:Qs,93:Qs,94:Aa,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:el,99:[0,.45833,0,0,.48889],100:el,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:el,105:Nd,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Nd,109:[0,.45833,0,0,.86667],110:Dc,111:[0,.45833,0,0,.55],112:Gl,113:Gl,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Dc,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:Zn,168:Aa,176:ss,180:Aa,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Aa,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Aa,729:Ms,730:ss,732:Aa,733:Aa,915:Ac,916:[0,.69444,0,0,.91667],920:tl,923:ks,926:ss,928:_s,931:_s,933:tl,934:_s,936:tl,937:_s,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Ms,8217:Ms,8220:ls,8221:ls},"SansSerif-Italic":{32:Zn,33:[0,.69444,.05733,0,.31945],34:$d,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:us,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:Wd,45:[0,.44444,.01946,0,.33333],46:Zd,47:[.25,.75,.13164,0,.5],48:mo,49:mo,50:mo,51:mo,52:mo,53:mo,54:mo,55:mo,56:mo,57:mo,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:oa,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:Es,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:nl,77:[0,.69444,.08094,0,.875],78:Es,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:Tc,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:Zn,168:[0,.67937,.06385,0,.5],176:Bc,184:Du,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Tc,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Fd,715:Er,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Bc,732:[0,.67659,.08826,0,.5],733:Fd,915:[0,.69444,.13372,0,.54167],916:Tu,920:[0,.69444,.07555,0,.77778],923:_r,926:[0,.69444,.12816,0,.66667],928:Es,931:[0,.69444,.11983,0,.72222],933:Ls,934:[0,.69444,.04603,0,.72222],936:Ls,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:us,8217:us,8220:[0,.69444,.14205,0,.5],8221:$d},"SansSerif-Regular":{32:Zn,33:[0,.69444,0,0,.31945],34:Er,35:zd,36:Ys,37:Kd,38:[0,.69444,0,0,.75834],39:fo,40:ka,41:ka,42:Hd,43:Ir,44:Wd,45:[0,.44444,0,0,.33333],46:Zd,47:Ua,48:ca,49:ca,50:ca,51:ca,52:ca,53:ca,54:ca,55:ca,56:ca,57:ca,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:xa,64:oa,65:oa,66:oa,67:jn,68:[0,.69444,0,0,.72223],69:Ta,70:[0,.69444,0,0,.56945],71:oa,72:Pc,73:fo,74:xa,75:[0,.69444,0,0,.69445],76:nl,77:[0,.69444,0,0,.875],78:Pc,79:[0,.69444,0,0,.73611],80:jn,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Lo,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:oa,89:[0,.69444,.025,0,.66667],90:_r,91:Ul,93:Ul,94:Er,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Ic,99:Vd,100:Ic,101:Vd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Ic,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:Oc,111:[0,.44444,0,0,.5],112:jd,113:jd,114:[0,.44444,.01389,0,.34167],115:Au,116:[0,.57143,0,0,.36111],117:Oc,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:Zn,168:[0,.67937,0,0,.5],176:oa,184:Du,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Er,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Er,715:Er,728:Er,729:[0,.67937,0,0,.27778],730:oa,732:[0,.67659,0,0,.5],733:Er,915:nl,916:Tu,920:bo,923:_r,926:oa,928:Pc,931:so,933:bo,934:so,936:bo,937:so,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:fo,8217:fo,8220:Er,8221:Er},"Script-Regular":{32:Zn,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:Zn},"Size1-Regular":{32:Zn,40:Gd,41:Gd,47:Bu,91:Pu,92:Bu,93:Pu,123:Rc,125:Rc,160:Zn,710:Xl,732:Xl,770:Xl,771:Xl,8214:[-99e-5,.601,0,0,.77778],8593:Iu,8595:Iu,8657:Nc,8659:Nc,8719:Cl,8720:Cl,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:ql,8748:Ud,8749:Ud,8750:ql,8896:za,8897:za,8898:za,8899:za,8968:il,8969:il,8970:il,8971:il,9168:Zu,10216:il,10217:il,10752:Fc,10753:Fc,10754:Fc,10756:za,10758:za},"Size2-Regular":{32:Zn,40:$c,41:$c,47:go,91:Tr,92:go,93:Tr,123:Bo,125:Bo,160:Zn,710:No,732:No,770:No,771:No,8719:cs,8720:cs,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Ou,8748:zc,8749:zc,8750:Ou,8896:rl,8897:rl,8898:rl,8899:rl,8968:Ru,8969:Ru,8970:Ru,8971:Ru,10216:Nu,10217:Nu,10752:al,10753:al,10754:al,10756:rl,10758:rl},"Size3-Regular":{32:Zn,40:Kc,41:Kc,47:Fu,91:ds,92:Fu,93:ds,123:Yl,125:Yl,160:Zn,710:Jl,732:Jl,770:Jl,771:Jl,8730:[.95003,1.45,0,0,1],8968:$u,8969:$u,8970:$u,8971:$u,10216:Yl,10217:Yl},"Size4-Regular":{32:Zn,40:Ql,41:Ql,47:zu,91:Hc,92:zu,93:Hc,123:Ku,125:Ku,160:Zn,710:eu,732:eu,770:eu,771:eu,8730:[1.25003,1.75,0,0,1],8968:Hu,8969:Hu,8970:Hu,8971:Hu,9115:Wu,9116:tu,9117:Wu,9118:Wu,9119:tu,9120:Wu,9121:Vu,9122:Zu,9123:Vu,9124:Vu,9125:Zu,9126:Vu,9127:Xd,9128:Wc,9129:ol,9130:[0,.3,0,0,.88889],9131:Xd,9132:Wc,9133:ol,9143:[.88502,.915,0,0,1.05556],10216:Ku,10217:Ku,57344:ju,57345:ju,57680:sl,57681:sl,57682:sl,57683:sl},"Typewriter-Regular":{32:nu,33:Ei,34:Ei,35:Ei,36:So,37:So,38:Ei,39:Ei,40:So,41:So,42:[0,.52083,0,0,.525],43:Zc,44:[.13889,.125,0,0,.525],45:Zc,46:[0,.125,0,0,.525],47:So,48:Ei,49:Ei,50:Ei,51:Ei,52:Ei,53:Ei,54:Ei,55:Ei,56:Ei,57:Ei,58:no,59:[.13889,.43056,0,0,.525],60:qd,61:[-.19549,.41562,0,0,.525],62:qd,63:Ei,64:Ei,65:Ei,66:Ei,67:Ei,68:Ei,69:Ei,70:Ei,71:Ei,72:Ei,73:Ei,74:Ei,75:Ei,76:Ei,77:Ei,78:Ei,79:Ei,80:Ei,81:[.13889,.61111,0,0,.525],82:Ei,83:Ei,84:Ei,85:Ei,86:Ei,87:Ei,88:Ei,89:Ei,90:Ei,91:So,92:So,93:So,94:Ei,95:[.09514,0,0,0,.525],96:Ei,97:no,98:Ei,99:no,100:Ei,101:no,102:Ei,103:wa,104:Ei,105:Ei,106:[.22222,.61111,0,0,.525],107:Ei,108:Ei,109:no,110:no,111:no,112:wa,113:wa,114:no,115:no,116:[0,.55358,0,0,.525],117:no,118:no,119:no,120:no,121:wa,122:no,123:So,124:So,125:So,126:Ei,127:Ei,160:nu,176:Ei,184:[.19445,0,0,0,.525],305:no,567:wa,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Ei,715:Ei,728:Ei,730:Ei,770:Ei,771:Ei,776:Ei,915:Ei,916:Ei,920:Ei,923:Ei,926:Ei,928:Ei,931:Ei,933:Ei,934:Ei,936:Ei,937:Ei,8216:Ei,8217:Ei,8242:Ei,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,ll=10,io=.25,Gu=1.2,hs=.431,Vc={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[hs,hs,hs],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:[io,io,io],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]},Uu=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ds=5,jc={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function fs(a,y){a===void 0&&(a=77);const b=Yd[y][a];if(b)return{defaultMetrics:!1,depth:b[0],height:b[1],italic:b[2],skew:b[3],width:b[4]};if(a===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const E=String.fromCodePoint(a);if(E in jc)a=jc[E].codePointAt(0);else if(Jd.test(E))return a=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 Xu={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]},ul={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]},Qd={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 _l(a){if(ul[a]){const[me,ye,Te]=ul[a],ze=`<span class="stretchy" style="height:${Te}em"><svg width="100%" height="${Te}em" viewBox="0 0 ${me} ${ye}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Te/2)/100}em;min-width:0">${ze}</span>`}const[y,b,E,ee]=Xu[a];let ie,ae;const ue=E/1e3;y.length===3?(ie=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],ae=["xMinYMin","xMidYMin","xMaxYMin"]):y.length===2?(ie=["slice-1-of-2","slice-2-of-2"],ae=["xMinYMin","xMaxYMin"]):(ie=["slice-1-of-1"],ae=[ee]);const de=y.map((me,ye)=>`<span class="${ie[ye]}" style=height:${ue}em><svg width=400em height=${ue}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[ye]} slice"><path fill="currentcolor" d="${Qd[me]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${ue}em;min-width:${b}em;">${de}</span>`}function eh(a){return Xu[a]?Xu[a][2]/1e3:ul[a][2]}function th(a){const y=[];for(let b=0;b<a.length;b++){let E=a.charCodeAt(b);if(E===13&&a.charCodeAt(b+1)===10&&(E=10,b++),(E===13||E===12)&&(E=10),E===0&&(E=65533),E>=55296&&E<=56319){const ee=a.charCodeAt(b+1);if(ee>=56320&&ee<=57343){const ie=E-55296,ae=ee-56320;E=qs(2,16)+ie*qs(2,10)+ae,b++}}y.push(E)}return y}var iu=8205,ru=[[iu,1],[65038,2],[127995,5],[129456,4],[917536,96]],As,Ml=[127462,127487];function kl(a){var y;if(As===void 0){As={};for(const b of ru)for(let E=b[0];E<=b[0]+b[1]-1;E++)As[E]=!0}return(y=As[a])!=null?y:!1}function nh(a){return a>=Ml[0]&&a<=Ml[1]}function ih(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=th(a);let E=0;for(;E<b.length;){const ee=b[E++],ie=b[E];if(ie===iu){const ae=E-1;for(E+=2;b[E]===iu;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(kl(ie)){const ae=E-1;for(;kl(b[E]);)E+=b[E]===iu?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nh(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var rh=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=ih(a)}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(a){const y=typeof this.s=="string"?a.exec(this.s.slice(this.pos)):a.exec(this.s.slice(this.pos).join(""));return y!=null&&y[0]?(this.pos+=y[0].length,y[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>";const a=this.get();if(a==="\\"){if(!this.end()){let y=this.match(/^[a-zA-Z\*]+/);return y?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):y=this.get(),"\\"+y}}else{if(a==="{")return"<{>";if(a==="}")return"<}>";if(a==="^"){if(this.peek()==="^"){this.get();const y=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(y)return String.fromCodePoint(Number.parseInt(y.slice(y.lastIndexOf("^")+1),16))}return a}else if(a==="#"){if(!this.end()){let y=!1;if(/[\d?@]/.test(this.peek())&&(y=!0,this.pos+1<this.s.length)){const b=this.s[this.pos+1];y=/[^\dA-Za-z]/.test(b)}return y?"#"+this.get():"#"}}else if(a==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return a}};function Ts(a,y){var b,E,ee,ie;const ae=[];let ue=a.next();if(ue&&ue!=="\\relax"){if(ue==="\\noexpand")ue=a.next(),ue&&ae.push(ue);else if(ue==="\\obeyspaces")a.obeyspaces=!0;else if(ue==="\\bgroup")ae.push("<{>");else if(ue==="\\egroup")ae.push("<}>");else if(ue==="\\string"){if(ue=a.next(),ue)if(ue.startsWith("\\"))for(const de of ue)ae.push(de==="\\"?"\\backslash":de);else ue==="<{>"?ae.push("\\{"):ue==="<space>"?ae.push("~"):ue==="<}>"&&ae.push("\\}")}else if(ue==="\\csname"){for(;a.peek()==="<space>";)a.next();let de="",me=!1,ye=[];do{if(ye.length===0)if(/^#[\d?@]$/.test(a.peek())){const Te=a.get().slice(1);ye=ps((E=(b=y==null?void 0:y(Te))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),ue=ye[0]}else ue=a.next(),ye=ue?[ue]:[];me=ye.length===0,!me&&ue==="\\endcsname"&&(me=!0,ye.shift()),me||(me=ue==="<$>"||ue==="<$$>"||ue==="<{>"||ue==="<}>"||typeof ue=="string"&&ue.length>1&&ue.startsWith("\\")),me||(de+=ye.shift())}while(!me);de&&ae.push("\\"+de),ae.push(...ye)}else if(ue!=="\\endcsname")if(ue.length>1&&ue.startsWith("#")){const de=ue.slice(1);ae.push(...ps((ie=(ee=y==null?void 0:y(de))!=null?ee:y==null?void 0:y("?"))!=null?ie:"\\placeholder{}",y))}else ae.push(ue)}return ae}function ps(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const ue=ae.match(/((?:\\%)|[^%])*/);ue!==null&&b.push(ue[0])}const ee=new rh(Ue(b.join(""))),ie=[];do ie.push(...Ts(ee,y));while(!ee.end());return ie}function cr(a){let y="";const b=[];for(const E of a)E&&(y&&/^[a-zA-Z\*]/.test(E)&&b.push(y),b.push(E),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(E)&&b.push(" "),y=/\\[a-zA-Z]+\*?$/.test(E)?" ":"");return b.join("")}function Jr(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:cr([a,...y.map(b=>`{${b}}`)])}function Bs(a){return cr(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var ah=class Id{constructor(y){Id._registry[y]=this}static createAtom(y,b,E){return Id._registry[y].createAtom(b,Lt(b,y),E)}static serialize(y,b){var E;if(!y||y.length===0)return"";if((E=b.skipStyles)!=null&&E){const ee=[];for(const ie of oh(y)){const ae=Id._registry[ie[0].mode];ee.push(...ae.serialize(ie,b))}return cr(ee)}return cr(ef(y,b))}static getFont(y,b,E){return Id._registry[y].getFont(b,E)}};ah._registry={};var Co=ah;function oh(a){const y=[];let b=[],E="NONE";for(const ee of a)ee.type!=="first"&&(ee.mode!==E?(b.length>0&&y.push(b),b=[ee],E=ee.mode):b.push(ee));return b.length>0&&y.push(b),y}function ga(a,y){const b=[];let E=[],ee;for(const ie of a)if(ie.type!=="first"&&ie.style){let ae;y==="variant"?(ae=ie.style.variant,ie.style.variantStyle&&ie.style.variantStyle!=="up"&&(ae+="-"+ie.style.variantStyle)):ae=ie.style[y],ae===ee?E.push(ie):(E.length>0&&b.push(E),E=[ie],ee=ae)}return E.length>0&&b.push(E),b}function Gc(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,ie=[];for(const ae of oh(a)){const ue=y.defaultMode;for(const de of ga(ae,"color")){const me=de[0].computedStyle,ye=Co._registry[de[0].mode].serialize(de,Me(Ce({},y),{defaultMode:ue==="text"?"text":"math"}));!y.skipStyles&&me.color&&me.color!=="none"&&(!E||ee!==me.color)?ie.push(Jr("\\textcolor",(b=me.verbatimColor)!=null?b:me.color,cr(ye))):ie.push(cr(ye))}}return ie}function Qh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return ga(a,"backgroundColor").map(ee=>{var ie;if(ee.length>0||ee[0].type!=="box"){const ae=ee[0].computedStyle;if(ae.backgroundColor&&ae.backgroundColor!=="none"&&(!b||E!==ae.backgroundColor))return Jr("\\colorbox",(ie=ae.verbatimBackgroundColor)!=null?ie:ae.backgroundColor,cr(Gc(ee,Me(Ce({},y),{defaultMode:"text"}))))}return cr(Gc(ee,y))})}function ef(a,y){if(a.length===0)return[];const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.fontSize,ee=[];for(const ie of ga(a,"fontSize")){const ae=ie[0].computedStyle.fontSize,ue=Qh(ie,y);ue&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...ue):ee.push(...ue))}return ee}function Uc(a){return a?{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"}[a]:void 0}function El(a){if(a.length===0)return"ord";const y=Uc(a[0].type),b=Uc(a[a.length-1].type);return y&&y===b?y:"ord"}function Ll(a,y){if(typeof a=="string")return a;if(typeof a=="number"){console.assert(Number.isFinite(a));const b=Math.ceil(100*a)/100;return b===0?"0":b.toString()+(y!=null?y:"")}return""}var $n=class _p{constructor(y,b){var E,ee,ie,ae,ue;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Ie(y)?this.children=y.filter(me=>me!==null):y&&y instanceof _p&&(this.children=[y]),this.children)for(const me of this.children)me.parent=this;this.type=(E=b==null?void 0:b.type)!=null?E:"ignore",this.isSelected=(b==null?void 0:b.isSelected)===!0,b!=null&&b.caret&&(this.caret=b.caret),this.classes=(ee=b==null?void 0:b.classes)!=null?ee:"",this.isTight=(ie=b==null?void 0:b.isTight)!=null?ie:!1,b!=null&&b.attributes&&(this.attributes=b.attributes);let de=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(de=(ue=Co.getFont((ae=b.mode)!=null?ae:"math",this,Me(Ce({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?ue:void 0),de||(de="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,(b==null?void 0:b.maxFontSize)!==void 0&&(this.maxFontSize=b.maxFontSize),au(this,de)}set atomID(y){y===void 0||y.length===0||(this.id=y)}selected(y){if(this.isSelected!==y&&(this.isSelected=y,this.children))for(const b of this.children)b.selected(y)}setStyle(y,b,E){if(b===void 0)return;const ee=Ll(b,E);ee.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[y]=ee)}setTop(y){Number.isFinite(y)&&Math.abs(y)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Ll(y,"em"),this.height-=y,this.depth+=y)}get left(){var y;return(y=this.cssProperties)!=null&&y["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Ll(y,"em")))}set right(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Ll(y,"em")))}set bottom(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Ll(y,"em")))}get width(){return this._width*this.scale}set width(y){this._width=y,this.hasExplicitWidth=!0}set softWidth(y){}get height(){return this._height*this.scale}set height(y){this._height=y}get depth(){return this._depth*this.scale}set depth(y){this._depth=y}wrap(y){const b=y.parent;if(!b)return this;y.isPhantom&&this.setStyle("opacity",0);const E=y.color;E&&E!==b.color&&this.setStyle("color",E);let ee=y.backgroundColor;this.isSelected&&(ee=Ft(ee)),ee&&ee!==b.backgroundColor&&(this.setStyle("background-color",ee),this.setStyle("display","inline-block"));const ie=y.scalingFactor;return this.scale=ie,this.skew*=ie,this.italic*=ie,this}toMarkup(){var y,b,E,ee;let ie=(y=this.value)!=null?y:"";if(this.children)for(const nt of this.children)ie+=nt.toMarkup();let ae="";if(this.svgBody)ae=_l(this.svgBody);else if(this.svgOverlay){ae='<span style="',ae+="display: inline-block;",ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,ae+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,ae+='">',ae+=ie,ae+="</span>",ae+='<svg style="position:absolute;overflow:visible;',ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const nt=(b=this.cssProperties)==null?void 0:b.padding;nt?(ae+=`top:${nt};`,ae+=`left:${nt};`,ae+=`width:calc(100% - 2 * ${nt} );`):ae+="top:0;left:0;width:100%;",ae+="z-index:2;",ae+='"',this.svgStyle&&(ae+=this.svgStyle),ae+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,ae+=`>${this.svgOverlay}</svg>`}let ue="";const de=this.classes.split(" ");de.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&de.push("ML__latex-caret"),this.isSelected&&de.push("ML__selected");const me=de.length===1?de[0]:de.filter((nt,ut,nn)=>nt.length>0&&nn.indexOf(nt)===ut).join(" ");if(me.length>0&&(ue+=` class="${me}"`),this.id&&(ue+=` data-atom-id=${this.id}`),this.cssId&&(ue+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(ue+=" "+Object.keys(this.attributes).map(nt=>`${nt}="${this.attributes[nt]}"`).join(" ")),this.htmlData){const nt=this.htmlData.split(",");for(const ut of nt){const nn=ut.match(/([^=]+)=(.+$)/);if(nn){const Nn=nn[1].trim().replace(/ /g,"-");Nn&&(ue+=` data-${Nn}="${nn[2]}" `)}else{const Nn=ut.trim().replace(/ /g,"-");Nn&&(ue+=` data-${Nn} `)}}}const ye=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&ye.width===void 0&&(ye.width=`${Math.ceil(this._width*100)/100}em`);const Te=Object.keys(ye).map(nt=>`${nt}:${ye[nt]}`);if(this.scale!==void 0&&this.scale!==1&&(ie.length>0||ae.length>0)&&Te.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const nt=this.htmlStyle.split(";");let ut="";for(const nn of nt){const Nn=nn.match(/([^=]+):(.+$)/);if(Nn){const Yt=Nn[1].trim().replace(/ /g,"-");Yt&&(ut+=`${Yt}:${Nn[2]};`)}}ut&&(ue+=` style="${ut}"`)}Te.length>0&&(ue+=` style="${Te.join(";")}"`);let ze="";return ue.length>0||ae.length>0?ze=`<span${ue}>${ie}${ae}</span>`:ze=ie,this.caret==="text"?ze+='<span class="ML__text-caret"></span>':this.caret==="math"&&(ze+='<span class="ML__caret"></span>'),ze}tryCoalesceWith(y){if(this.svgBody||!this.value||y.svgBody||!y.value)return!1;const b=this.children&&this.children.length>0,E=y.children&&y.children.length>0;if(b||E)return!1;if(y.cssProperties||this.cssProperties){for(const de of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&de in y.cssProperties||this.cssProperties&&de in this.cssProperties)return!1}const ee=this.cssProperties?Object.keys(this.cssProperties).length:0,ie=y.cssProperties?Object.keys(y.cssProperties).length:0;if(ee!==ie)return!1;if(ee>0){for(const de of Object.keys(this.cssProperties))if(this.cssProperties[de]!==y.cssProperties[de])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),ue=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==ue.length)return!1;ae.sort(),ue.sort();for(const[de,me]of ae.entries())if(me==="vertical-separator"||me!==ue[de])return!1;return this.value+=y.value,this.height=Math.max(this.height,y.height),this.depth=Math.max(this.depth,y.depth),this._width=this._width+y._width,this.maxFontSize=Math.max(this.maxFontSize,y.maxFontSize),this.italic=y.italic,!0}};function Xc(a){if(!a||a.length===0)return[];a[0].children=Xc(a[0].children);const y=[a[0]];for(let b=1;b<a.length;b++)y[y.length-1].tryCoalesceWith(a[b])||(a[b].children=Xc(a[b].children),y.push(a[b]));return y}function qu(a){return a.children&&(a.children=Xc(a.children)),a}function Yu(a,y){if(!a)return new $n(null,y);const b=new $n(null,{classes:"ML__strut",type:"ignore"});b.setStyle("height",Math.max(0,a.height),"em");const E=[b];if(a.depth!==0){const ee=new $n(null,{classes:"ML__strut--bottom",type:"ignore"});ee.setStyle("height",a.height+a.depth,"em"),ee.setStyle("vertical-align",-a.depth,"em"),E.push(ee)}return E.push(a),new $n(E,Me(Ce({},y),{type:"lift"}))}function Fo(a){const y=eh(a)/2,b=new $n(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function au(a,y){var b;if(a.type==="latex"){a.height=.9,a.depth=.2,a._width=1;return}if(a.value){a.height=-1/0,a.depth=-1/0,a._width=0,a.skew=-1/0,a.italic=-1/0;for(let E=0;E<a.value.length;E++){const ee=fs(a.value.codePointAt(E),y);a.height=Math.max(a.height,ee.height),a.depth=Math.max(a.depth,ee.depth),a._width+=ee.width,a.skew=ee.skew,a.italic=ee.italic}return}if(a.children&&a.children.length>0){let E=-1/0,ee=-1/0,ie=0;for(const ae of a.children)ae.height>E&&(E=ae.height),ae.depth>ee&&(ee=ae.depth),ie=Math.max(ie,(b=ae.maxFontSize)!=null?b:0);a.height=E,a.depth=ee,a._width=a.children.reduce((ae,ue)=>ae+ue.width,0),a.maxFontSize=ie}}function Ju(a){if("individualShift"in a){const y=a.individualShift;let b=y[0];const E=[b],ee=-b.shift-b.box.depth;let ie=ee;for(let ae=1;ae<y.length;ae++){const ue=y[ae],de=-ue.shift-ie-ue.box.depth,me=de-(b.box.height+b.box.depth);ie=ie+de,E.push(me),E.push(ue),b=ue}return[E,ee]}if("top"in a){let y=a.top;for(const b of a.children)y-=typeof b=="number"?b:b.box.height+b.box.depth;return[a.children,y]}else{if("bottom"in a)return[a.children,-a.bottom];if("firstBaseline"in a){const y=a.firstBaseline[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.firstBaseline,-y.box.depth]}else if("shift"in a){const y=a.children[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.children,-y.box.depth-a.shift]}}return[null,0]}function ou(a){var y;const[b,E]=Ju(a);if(!b)return[[],0,0];const ee=new $n(null,{classes:"pstrut"});let ie=0;for(const ut of b)if(typeof ut!="number"){const nn=ut.box;ie=Math.max(ie,nn.maxFontSize,nn.height)}ie+=2,ee.height=ie,ee.setStyle("height",ie,"em");const ae=[];let ue=E,de=E,me=E,ye=0;for(const ut of b){if(typeof ut=="number")me+=ut;else{const nn=ut.box,Nn=(y=ut.classes)!=null?y:[],Yt=new $n([ee,nn],{classes:Nn.join(" "),style:ut.style});nn.setStyle("height",nn.height+nn.depth,"em"),nn.setStyle("display","inline-block"),Yt.setStyle("top",-ie-me-nn.depth,"em"),ut.marginLeft&&Yt.setStyle("margin-left",ut.marginLeft,"em"),ut.marginRight&&Yt.setStyle("margin-right",ut.marginRight,"em"),ae.push(Yt),me+=nn.height+nn.depth,ye=Math.max(ye,Yt.width)}ue=Math.min(ue,me),de=Math.max(de,me)}ae.forEach(ut=>{ut.softWidth=ye});const Te=new $n(ae,{classes:"vlist"});if(Te.softWidth=ye,Te.height=de,Te.setStyle("height",de,"em"),ue>=0)return[[new $n(Te,{classes:"vlist-r"})],de,-ue];const ze=new $n(new $n(null),{classes:"vlist"});ze.height=-ue,ze.setStyle("height",-ue,"em");const nt=new $n(8203,{classes:"vlist-s",maxFontSize:0});return nt.softWidth=0,nt.height=0,nt.depth=0,[[new $n([Te,nt],{classes:"vlist-r"}),new $n(ze,{classes:"vlist-r"})],de,-ue]}var Zr=class extends $n{constructor(a,y){var b;const[E,ee,ie]=ou(a);super(E.length===1?E[0]:E,{type:y==null?void 0:y.type,classes:((b=y==null?void 0:y.classes)!=null?b:"")+" vlist-t"+(E.length===2?" vlist-t2":"")}),this.height=ee,this.depth=ie,this.softWidth=E.reduce((ae,ue)=>Math.max(ae,ue.width),0)}};function tf(a,y){var b,E,ee,ie,ae;const ue=a.metrics,de=new $n(y.base),me=(b=y.baseShift)!=null?b:0,ye=(E=y.slant)!=null?E:0;let Te=0,ze=0;y.above&&(Te=(ee=y.aboveShift)!=null?ee:Math.max(ue.bigOpSpacing1,ue.bigOpSpacing3-y.above.depth)),y.below&&(ze=(ie=y.belowShift)!=null?ie:Math.max(ue.bigOpSpacing2,ue.bigOpSpacing4-y.below.height));let nt=null;if(y.below&&y.above){const ut=ue.bigOpSpacing5+y.below.height+y.below.depth+ze+de.depth+me;nt=new Zr({bottom:ut,children:[ue.bigOpSpacing5,{box:y.below,marginLeft:-ye,classes:["ML__center"]},ze,{box:de,classes:["ML__center"]},Te,{box:y.above,marginLeft:ye,classes:["ML__center"]},ue.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)nt=new Zr({top:de.height-me,children:[ue.bigOpSpacing5,{box:y.below,marginLeft:-ye,classes:["ML__center"]},ze,{box:de,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const ut=de.depth+me;nt=new Zr({bottom:ut,children:[{box:de,classes:["ML__center"]},Te,{box:y.above,marginLeft:ye,classes:["ML__center"]},ue.bigOpSpacing5]}).wrap(a)}else{const ut=de.depth+me;nt=new Zr({bottom:ut,children:[{box:de},ue.bigOpSpacing5]}).wrap(a)}return new $n(nt,{type:(ae=y.type)!=null?ae:"op"})}var qc=7,ms=6,su=5,Ps=4,cl=3,ro=2,Po=1,Ka=0,Go=class{constructor(a,y,b){this.id=a,this.sizeDelta=y,this.cramped=b;const E={"-4":2,"-3":1,0:0}[y];this.metrics=Object.keys(Vc).reduce((ee,ie)=>Me(Ce({},ee),{[ie]:Vc[ie][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Uo[[Ka,Po,Ka,Po,ro,cl,ro,cl][this.id]]}get sub(){return Uo[[Ka,Ka,Ka,Ka,ro,ro,ro,ro][this.id]]}get fracNum(){return Uo[[Ka,Po,Ka,Po,ro,cl,Ps,su][this.id]]}get fracDen(){return Uo[[Ka,Ka,Ka,Ka,ro,ro,Ps,Ps][this.id]]}get cramp(){return Uo[[Ka,Ka,ro,ro,Ps,Ps,ms,ms][this.id]]}get isTight(){return this.sizeDelta<0}},dl={7:new Go(qc,0,!1),6:new Go(ms,0,!0),5:new Go(su,0,!1),4:new Go(Ps,0,!0),3:new Go(cl,-3,!1),2:new Go(ro,-3,!0),1:new Go(Po,-4,!1),0:new Go(Ka,-4,!0)},Uo=Me(Ce({},dl),{displaystyle:dl[qc],textstyle:dl[su],scriptstyle:dl[cl],scriptscriptstyle:dl[Po]});function Dl(a,y){var b;if(!a)return 0;const E={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:ll,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(b=a.unit)!=null?b:"pt"];if(Number.isFinite(y)){const ee=qs(10,y);return Math.round(a.dimension/ll*E*ee)/ee}return a.dimension*E}function Yc(a,y){if(a===null)return 0;const b=Dl(a)/ll;if(Number.isFinite(y)){const E=qs(10,y);return Math.round(b*E)/E}return b}function Jc(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function sh(a){let y=Jc(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${Jc(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${Jc(a.shrink)}`),y}function Sa(a){var y,b;if(a==null)return null;let E="";if("dimension"in a&&(E=`${a.dimension}${(y=a.unit)!=null?y:"pt"}`),"glue"in a&&(E=sh(a)),"number"in a)if(!("base"in a)||a.base==="decimal")E=Number(a.number).toString();else if(a.base==="alpha")E=`\`${String.fromCodePoint(a.number)}`;else{const ee=Math.round(a.number)>>>0;a.base==="hexadecimal"?(E=Number(ee).toString(16).toUpperCase(),ee<=255?E=E.padStart(2,"0"):ee<=65535?E=E.padStart(4,"0"):ee<=16777215?E=E.padStart(6,"0"):E=E.padStart(8,"0"),E=`"${E}`):a.base==="octal"&&(E=Number(ee).toString(8),ee<=63?E=E.padStart(2,"0"):ee<=30583?E=E.padStart(4,"0"):E=E.padStart(8,"0"),E=`'${E}`)}return"register"in a&&("factor"in a&&(a.factor===-1?E="-":a.factor!==1&&(E=Number(a.factor).toString())),"global"in a&&a.global&&(E+="\\global"),E+=`\\${a.register}`),"string"in a&&(E=a.string),(b=a.relax)!=null&&b&&(E+="\\relax"),E}function Xo(a,y){return a==null?null:"number"in a?Me(Ce({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?Me(Ce({},a),{factor:a.factor*y}):Me(Ce({},a),{factor:y}):"dimension"in a?Me(Ce({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y),grow:Xo(a.grow,y)}:a.shrink?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y)}:a.grow?{glue:Xo(a.glue,y),grow:Xo(a.grow,y)}:{glue:Xo(a.glue,y)}:null}var nf={"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 Al(){return Ce({},nf)}function Qu(){return{registers:Al(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Je.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:It,backgroundColorMap:at,getMacro:a=>Ln(a,zn())}}var xr=class Mp{constructor(y,b){var E,ee,ie,ae,ue,de,me,ye,Te,ze,nt,ut,nn,Nn,Yt;let Sn;y!=null&&y.parent?(this.parent=y.parent,Sn=y.parent,this.registers={}):(Sn=Ce(Ce({},Qu()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=Sn.registers),Sn.atomIdsSettings&&(this.atomIdsSettings=Ce({},Sn.atomIdsSettings)),this.renderPlaceholder=Sn.renderPlaceholder,this.isPhantom=(ae=(ie=y==null?void 0:y.isPhantom)!=null?ie:(ee=this.parent)==null?void 0:ee.isPhantom)!=null?ae:!1,this.letterShapeStyle=Sn.letterShapeStyle,this.minFontScale=Sn.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(de=(ue=this.parent)==null?void 0:ue.color)!=null?de:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(ye=(me=this.parent)==null?void 0:me.backgroundColor)!=null?ye:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Te=this.parent)==null?void 0:Te.size)?this.size=b.fontSize:this.size=(nt=(ze=this.parent)==null?void 0:ze.size)!=null?nt:Ds;let Wn=(nn=(ut=this.parent)==null?void 0:ut.mathstyle)!=null?nn:Uo.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(Sn instanceof Mp)switch(y.mathstyle){case"cramp":Wn=Wn.cramp;break;case"superscript":Wn=Wn.sup;break;case"subscript":Wn=Wn.sub;break;case"numerator":Wn=Wn.fracNum;break;case"denominator":Wn=Wn.fracDen;break}switch(y.mathstyle){case"textstyle":Wn=Uo.textstyle;break;case"displaystyle":Wn=Uo.displaystyle;break;case"scriptstyle":Wn=Uo.scriptstyle;break;case"scriptscriptstyle":Wn=Uo.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=Wn,this.smartFence=Sn.smartFence,this.placeholderSymbol=Sn.placeholderSymbol,this.colorMap=(Nn=Sn.colorMap)!=null?Nn:En=>En,this.backgroundColorMap=(Yt=Sn.backgroundColorMap)!=null?Yt:En=>En,this.getMacro=Sn.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}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)}`;const y=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,y}scale(y){return y*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===qc||this.mathstyle.id===ms}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Uu[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(y){var b;if((b=this.registers)!=null&&b[y])return this.registers[y];if(this.parent)return this.parent.getRegister(y)}getRegisterAsNumber(y){const b=this.getRegister(y);if(typeof b=="number")return b;if(typeof b=="string")return Number(b)}getRegisterAsGlue(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E:typeof E=="object"&&"dimension"in E?{glue:{dimension:E.dimension}}:typeof E=="number"?{glue:{dimension:E}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(y)}getRegisterAsEm(y,b){return Yc(this.getRegisterAsDimension(y),b)}getRegisterAsDimension(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E.glue:typeof E=="object"&&"dimension"in E?E:typeof E=="number"?{dimension:E}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(y)}setRegister(y,b){if(b===void 0){delete this.registers[y];return}this.registers[y]=b}evaluate(y){if(!y||!("register"in y))return y;let b=this;if("global"in y&&y.global)for(;b.parent;)b=b.parent;let E=1;"factor"in y&&y.factor!==1&&y.factor!==void 0&&(E=y.factor);const ee=b.getRegister(y.register);if(ee===void 0)return;if(typeof ee=="string")return{string:Number(ee).toString()+ee};if(typeof ee=="number")return{number:E*ee};const ie=b.evaluate(ee);if(ie!==void 0)return"string"in ie?{string:Number(ee).toString()+ie.string}:"number"in ie?{number:E*ie.number}:"dimension"in ie?Me(Ce({},ie),{dimension:E*ie.dimension}):"glue"in ie?Me(Ce({},ie),{glue:Me(Ce({},ie.glue),{dimension:E*ie.glue.dimension}),shrink:ie.shrink?Me(Ce({},ie.shrink),{dimension:E*ie.shrink.dimension}):void 0,grow:ie.grow?Me(Ce({},ie.grow),{dimension:E*ie.grow.dimension}):void 0}):y}toDimension(y){const b=this.evaluate(y);return b===void 0?null:"dimension"in b?b:"glue"in b?b.glue:"number"in b?{dimension:b.number}:null}toEm(y,b){if(y===null)return 0;const E=this.toDimension(y);return E===null?0:Dl(E,b)/ll}toNumber(y){if(y===null)return null;const b=this.evaluate(y);return b===void 0?null:"number"in b?b.number:"dimension"in b?b.dimension:"glue"in b?b.glue.dimension:"string"in b?Number(b.string):null}toColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.colorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}toBackgroundColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.backgroundColorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}},Tl=["body","above","below","superscript","subscript"];function gs(a){return typeof a=="string"&&Tl.includes(a)}function lu(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var gn=class vl{constructor(y){var b,E,ee,ie,ae,ue;this.type=y.type,typeof y.value=="string"&&(this.value=y.value),this.command=(E=(b=y.command)!=null?b:this.value)!=null?E:"",this.mode=(ee=y.mode)!=null?ee:"math",y.isFunction&&(this.isFunction=!0),y.limits&&(this.subsupPlacement=y.limits),this.style=Ce({},y.style),this.displayContainsHighlight=(ie=y.displayContainsHighlight)!=null?ie:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(ue=y.skipBoundary)!=null?ue:!1,y.verbatimLatex!==void 0&&y.verbatimLatex!==null&&(this.verbatimLatex=y.verbatimLatex),y.args&&(this.args=y.args),y.body&&(this.body=y.body),this._changeCounter=0}static createBox(y,b,E){var ee;if(!b)return null;const ie=lh(b),ae=[];for(const de of ie){const me=de[0].style,ye=uh(y,de,{style:{color:me.color,backgroundColor:me.backgroundColor,fontSize:me.fontSize}});ye&&ae.push(ye)}if(ae.length===0)return null;const ue=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!ue&&!(E!=null&&E.type)?ae[0].wrap(y):new $n(ae,{classes:ue,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Co.serialize(y,b)}static commonAncestor(y,b){if(y===b||y.parent===b.parent)return y.parent;const E=new WeakSet;let{parent:ee}=y;for(;ee;)E.add(ee),ee=ee.parent;for(ee=b.parent;ee;){if(E.has(ee))return ee;ee=ee.parent}console.assert(!!ee)}static fromJson(y){return typeof y=="string"?new vl({type:"mord",value:y,mode:"math"}):new vl(y)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const y={};if(this.type&&(y.type=this.type),this.mode!=="math"&&(y.mode=this.mode),this.command&&this.command!==this.value&&(y.command=this.command),this.value!==void 0&&(y.value=this.value),this.style&&Object.keys(this.style).length>0&&(y.style=Ce({},this.style)),this.verbatimLatex!==void 0&&(y.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(y.explicitSubsupPlacement=!0),this.isFunction&&(y.isFunction=!0),this.displayContainsHighlight&&(y.displayContainsHighlight=!0),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.skipBoundary&&(y.skipBoundary=!0),this.captureSelection&&(y.captureSelection=!0),this.args&&(y.args=ed(this.args)),this._branches)for(const b of Object.keys(this._branches))this._branches[b]&&(y[b]=this._branches[b].filter(E=>E.type!=="first").map(E=>E.toJson()));return y.type==="mord"&&Object.keys(y).length===2&&"value"in y?y.value:y}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(y){if(y){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:b}=this;for(;b;)b.parent||b._changeCounter++,"verbatimLatex"in b&&(b.verbatimLatex=void 0),b._children=void 0,b=b.parent}}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?cr([Jr(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?cr([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Co.serialize(this.body,Me(Ce({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Co.serialize(this.above,y)}belowToLatex(y){return Co.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=Me(Ce({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Co.serialize(this.subscript,y);E.length===0?b+="_{}":E.length===1?/^[0-9]$/.test(E)?b+=`_${E}`:b+=`_{${E}}`:b+=`_{${E}}`}if(this.branch("superscript")!==void 0){const E=Co.serialize(this.superscript,y);E.length===0?b+="^{}":E.length===1?E==="\u2032"?b+="^\\prime ":E==="\u2033"?b+="^\\doubleprime ":/^[0-9]$/.test(E)?b+=`^${E}`:b+=`^{${E}}`:b+=`^{${E}}`}return b}get treeDepth(){let y=1,b=this.parent;for(;b;)b=b.parent,y+=1;return y}get inCaptureSelection(){let y=this;for(;y;){if(y.captureSelection)return!0;y=y.parent}return!1}get parentPrompt(){let y=this.parent;for(;y;){if(y.type==="prompt"&&!y.captureSelection)return y;y=y.parent}return null}branch(y){if(gs(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of Tl)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(gs(y)),gs(y)?(this._branches?this._branches[y]||(this._branches[y]=[this.makeFirstAtom(y)]):this._branches={[y]:[this.makeFirstAtom(y)]},this.isDirty=!0,this._branches[y]):[]}get row(){return lu(this.parentBranch)?this.parentBranch[0]:-1}get col(){return lu(this.parentBranch)?this.parentBranch[1]:-1}get body(){var y;return(y=this._branches)==null?void 0:y.body}set body(y){this.setChildren(y,"body")}get superscript(){var y;return(y=this._branches)==null?void 0:y.superscript}set superscript(y){this.setChildren(y,"superscript")}get subscript(){var y;return(y=this._branches)==null?void 0:y.subscript}set subscript(y){this.setChildren(y,"subscript")}get above(){var y;return(y=this._branches)==null?void 0:y.above}set above(y){this.setChildren(y,"above")}get below(){var y;return(y=this._branches)==null?void 0:y.below}set below(y){this.setChildren(y,"below")}get computedStyle(){var y,b;const E=typeof this.style.verbatimColor=="string",ee=typeof this.style.verbatimBackgroundColor=="string",ie=Ce(Ce({},(b=(y=this.parent)==null?void 0:y.computedStyle)!=null?b:{}),this.style);return delete ie.variant,delete ie.variantStyle,ee||delete ie.verbatimBackgroundColor,E||delete ie.verbatimColor,ie}applyStyle(y){this.isDirty=!0,this.style=Ce(Ce({},this.style),y),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(const b of this.children)b.applyStyle(y)}getInitialBaseElement(){var y,b,E;return this.hasEmptyBranch("body")?this:(console.assert(((y=this.body)==null?void 0:y[0].type)==="first"),(E=(b=this.body[1])==null?void 0:b.getInitialBaseElement())!=null?E: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(y){const b=this.branch(y);return b?(console.assert(b.length>0),console.assert(b[0].type==="first"),b.length===1):!0}setChildren(y,b){var E;if(!y||(console.assert(gs(b)),!gs(b)))return;console.assert(((E=y[0])==null?void 0:E.type)!=="first");const ee=[this.makeFirstAtom(b),...y];this._branches?this._branches[b]=ee:this._branches={[b]:ee};for(const ie of y)ie.parent=this,ie.parentBranch=b;this.isDirty=!0}makeFirstAtom(y){const b=new vl({type:"first",mode:this.mode});return b.parent=this,b.parentBranch=y,b}addChild(y,b){console.assert(y.type!=="first"),this.createBranch(b).push(y),this.isDirty=!0,y.parent=this,y.parentBranch=b}addChildBefore(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b),0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildAfter(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildren(y,b){const E=this.createBranch(b);for(const ee of y)ee.parent=this,ee.parentBranch=b,E.push(ee);this.isDirty=!0}addChildrenAfter(y,b){console.assert(y.length===0||y[0].type!=="first"),console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,...y),this.isDirty=!0;for(const ee of y)ee.parent=this,ee.parentBranch=b.parentBranch;return y[y.length-1]}removeBranch(y){const b=this.branch(y);if(gs(y)&&(this._branches[y]=void 0),!b)return[];for(const E of b)E.parent=void 0,E.parentBranch=void 0;return console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}removeChild(y){if(console.assert(y.parent===this),y.type==="first")return;const b=this.branch(y.parentBranch),E=b.indexOf(y);console.assert(E>=0),b.splice(E,1),this.isDirty=!0,y.parent=void 0,y.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:y}=this;return y[y.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:y}=this;return y[y.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const y=[];for(const b of Tl)if(this._branches[b])for(const E of this._branches[b])y.push(...E.children),y.push(E);return this._children=y,y}render(y){if(this.type==="first"&&!y.atomIdsSettings)return null;const b=Lt(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new xr({parent:y},this.style);let ee=this.createBox(E,{classes:this.parent?"":"ML__base"});return ee?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(ee=this.attachSupsub(E,{base:ee})),ee.wrap(E)):null}attachSupsub(y,b){var E;const ee=b.base,ie=this.superscript,ae=this.subscript;if(!ie&&!ae)return ee;let ue=null,de=null;const me=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let ye=0;if(ie){const nn=new xr({parent:y,mathstyle:"superscript"});ue=vl.createBox(nn,ie),me||(ye=ee.height-y.metrics.supDrop*nn.scalingFactor)}let Te=0;if(ae){const nn=new xr({parent:y,mathstyle:"subscript"});de=vl.createBox(nn,ae),me||(Te=ee.depth+y.metrics.subDrop*nn.scalingFactor)}let ze;y.isDisplayStyle?ze=y.metrics.sup1:y.isCramped?ze=y.metrics.sup3:ze=y.metrics.sup2;const nt=.5/ll/y.scalingFactor;let ut=null;if(de&&ue){ye=Math.max(ye,ze,ue.depth+.25*y.metrics.xHeight),Te=Math.max(Te,y.metrics.sub2);const nn=y.metrics.defaultRuleThickness;if(ye-ue.depth-(de.height-Te)<4*nn){Te=4*nn-(ye-ue.depth)+de.height;const Yt=.8*y.metrics.xHeight-(ye-ue.depth);Yt>0&&(ye+=Yt,Te-=Yt)}const Nn=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;ut=new Zr({individualShift:[{box:de,shift:Te,marginLeft:Nn},{box:ue,shift:-ye}]}).wrap(y)}else de&&!ue?(Te=Math.max(Te,y.metrics.sub1,de.height-.8*hs),ut=new Zr({shift:Te,children:[{box:de,marginRight:nt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!de&&ue&&(ye=Math.max(ye,ze,ue.depth+.25*hs),ut=new Zr({shift:-ye,children:[{box:ue,marginRight:nt}]}));return new $n([ee,new $n(ut,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?vl.createBox(new xr({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?vl.createBox(new xr({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):tf(y,Me(Ce({},b),{above:E,below:ee}))}bind(y,b){if(!b||y.isPhantom||this.value==="\u200B")return b;let E=this.parent;for(;E&&!E.captureSelection;)E=E.parent;return E!=null&&E.captureSelection||(this.id||(this.id=y.makeID()),b.atomID=this.id),b}createBox(y,b){var E,ee,ie,ae;const ue=(E=this.value)!=null?E:this.body,de=(ee=b==null?void 0:b.boxType)!=null?ee:Uc(this.type);let me=(ie=b==null?void 0:b.classes)!=null?ie:"";this.mode==="text"&&(me+=" ML__text");const ye=typeof ue=="string"||ue===void 0?new $n(ue!=null?ue:null,{type:de,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:Me(Ce({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:me}):(ae=vl.createBox(y,ue,{type:de,classes:me}))!=null?ae:new $n(null);return y.isTight&&(ye.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(ye.italic=0),ye.right=ye.italic,this.bind(y,ye),this.caret&&!this.superscript&&!this.subscript&&(ye.caret=this.caret),ye}isDigit(){var y;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((y=this.body)==null?void 0:y.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var y;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((y=this.body)==null?void 0:y.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function lh(a){let y;const b=[];let E=[];for(const ee of a)if(!y&&!ee.style)E.push(ee);else{const ie=ee.computedStyle;y&&ie.color===y.color&&ie.backgroundColor===y.backgroundColor&&ie.fontSize===y.fontSize?E.push(ee):(E.length>0&&b.push(E),E=[ee],y=ie)}return E.length>0&&b.push(E),b}function uh(a,y,b){var E,ee,ie,ae,ue;if(!y||y.length===0)return null;const de=new xr({parent:a},b.style),me=!((E=de.atomIdsSettings)!=null&&E.groupNumbers);let ye=[];if(y.length===1){const ze=y[0],nt=ze.render(de);nt&&(me&&ze.isSelected&&nt.selected(!0),ye=[nt])}else{let ze="",nt=!0;for(const ut of y){(ee=de.atomIdsSettings)!=null&&ee.groupNumbers&&ze&&(nt&&ut.isDigit()||!nt&&Qc(ut))&&(de.atomIdsSettings.overrideID=ze);const nn=ut.render(de);de.atomIdsSettings&&(de.atomIdsSettings.overrideID=void 0),nn&&((ie=de.atomIdsSettings)!=null&&ie.groupNumbers&&((ut.isDigit()||Qc(ut))&&(!ze||nt!==ut.isDigit())&&(nt=ut.isDigit(),ze=(ae=ut.id)!=null?ae:""),ze&&(!(ut.isDigit()||Qc(ut))||!ut.hasEmptyBranch("superscript")||!ut.hasEmptyBranch("subscript"))&&(ze="")),me&&ut.isSelected&&nn.selected(!0),ye.push(nn))}}if(ye.length===0)return null;const Te=new $n(ye,Me(Ce({isTight:de.isTight},b),{type:(ue=b.type)!=null?ue:"lift"}));return Te.isSelected=ye.every(ze=>ze.isSelected),Te.wrap(de)}function Qc(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof gn?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class kp extends gn{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new kp(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:Mn("text",this.value.codePointAt(0))}};function uu(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&rf(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function rf(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function Ha(a){let y=1/0,b=-1/0;for(const E of a.ranges)y=Math.min(y,E[0],E[1]),b=Math.max(b,E[0],E[1]);return[y,b]}function Is(a){return typeof a=="number"&&!Number.isNaN(a)}function ec(a){return Array.isArray(a)&&a.length===2}function tc(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function af(a,y){const b=a.at(y);let E;if(b){E=b.mode;let ee=b.parent;for(;!E&&ee;)ee&&(E=ee.mode),ee=ee.parent}return E}function ch(a,y){if(!y)return"";if(typeof y=="string")return y;if(!a||y.after===void 0)return y.value;let b=!1,E=!1,ee=!1,ie=!1,ae=!1,ue=!1,de=!1,me=!1,ye=!1,Te=!1,ze=!1,nt=!1,ut=!1,nn=!1,Nn=!1,Yt=a[0],Sn=0;for(;Yt!=null&&Yt.type&&/^(subsup|placeholder)$/.test(Yt.type);)Sn+=1,Yt=a[Sn];return b=!Yt||Yt.type==="first",Yt&&(nn=Yt.mode==="text",E=!nn&&Yt.type==="mord"&&fe.test(Yt.value),ee=!nn&&Yt.type==="mord"&&/\d+$/.test(Yt.value),ie=!nn&&Yt.isFunction,ae=Yt.type==="genfrac",ue=Yt.type==="surd",de=Yt.type==="mbin",me=Yt.type==="mrel",ye=Yt.type==="mop"||Yt.type==="operator"||Yt.type==="extensible-symbol",Te=Yt.type==="mpunct"||Yt.type==="minner",ze=Yt.type==="array",nt=Yt.type==="mopen",ut=Yt.type==="mclose"||Yt.type==="leftright",Nn=Yt.type==="space"),y.after.includes("nothing")&&b||y.after.includes("letter")&&E||y.after.includes("digit")&&ee||y.after.includes("function")&&ie||y.after.includes("frac")&&ae||y.after.includes("surd")&&ue||y.after.includes("binop")&&de||y.after.includes("relop")&&me||y.after.includes("operator")&&ye||y.after.includes("punct")&&Te||y.after.includes("array")&&ze||y.after.includes("openfence")&&nt||y.after.includes("closefence")&&ut||y.after.includes("text")&&nn||y.after.includes("space")&&Nn?y.value:""}function td(a,y,b){return b?ch(a,b[y]):""}var dh={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\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","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function cu(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=fh(a)),E==="ascii-math"?(a=a.replace(/\u2061/gu,""),a=a.replace(/\u3016/gu,"{"),a=a.replace(/\u3017/gu,"}"),a=a.replace(/([^\\])sinx/g,"$1\\sin x"),a=a.replace(/([^\\])cosx/g,"$1\\cos x "),a=a.replace(/\u2013/g,"-"),["ascii-math",qa(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function qa(a,y){var b,E,ee;if(!a)return"";let ie=!1,ae;const ue=(b=y.inlineShortcuts)!=null?b:dh;if(!ie&&(a.startsWith("^")||a.startsWith("_"))&&(ae=Os(a.slice(1),{inlineShortcuts:ue,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=qa(ae.rest,y),ie=!0),ie||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:ue,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=qa(ae.rest,y),ie=!0)),ie||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:ue,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=qa(ae.rest,y),ie=!0)),ie||(ae=a.match(/^abs(.*)/),ae&&(ae=Os(ae[1],{inlineShortcuts:ue,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=qa(ae.rest,y),ie=!0)),ie||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=qa(ae[2],y),ie=!0)),ie||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hh(ae[1],ue),a+=qa(ae[2],y),ie=!0)),!ie&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=Os(a.slice(1),{inlineShortcuts:ue,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=qa(ae.rest,y),ie=!0),ie||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hh(ae[1],ue),a+=qa(ae[2],y),ie=!0)),!ie)if(ae=Os(a,{inlineShortcuts:ue,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const de=Os(ae.rest.slice(1),{inlineShortcuts:ue,noWrap:!0});de.match&&(a="\\frac{"+ae.match+"}{"+de.match+"}"+qa(de.rest,y)),ie=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+qa(ae.rest,y):ae.match+qa(ae.rest,y),ie=!0);return ie||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+qa(ae[2],y),ie=!0)),a}function Os(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),ie={"(":")","{":"}","[":"]"}[ee];if(ie){let ae=1,ue=1;for(;ue<a.length&&ae>0;)a[ue]===ee&&ae++,a[ue]===ie&&ae--,ue++;ae===0?(y.noWrap&&ee==="("?b=qa(a.substring(1,ue-1),y):(ee==="{"&&ie==="}"&&(ee="\\{",ie="\\}"),b="\\left"+ee+qa(a.substring(1,ue-1),y)+"\\right"+ie),E=a.slice(Math.max(0,ue))):(b=a.substring(1,ue),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let ue=td(null,a,y.inlineShortcuts);if(ue)return ue=ue.replace("_{#?}",""),ue=ue.replace("^{#?}",""),{match:ue,rest:a.slice(ue.length)}}if(ae=a.match(/^([a-zA-Z])/),ae)return{match:ae[1],rest:a.slice(1)};if(ae=a.match(/^(-)?\d+(\.\d*)?/),ae)return{match:ae[0],rest:a.slice(ae[0].length)};/^\\(left|right)/.test(a)||(ae=a.match(/^(\\[a-zA-Z]+)/),ae&&(E=a.slice(ae[1].length),b=ae[1]))}return{match:b,rest:E}}function hh(a,y){let b=td(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var nd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Rs(a){const y=a.trim();for(const b of nd)if(y.startsWith(b[0])&&y.endsWith(b[1]))return[!0,y.substring(b[0].length,y.length-b[1].length)];return[!1,a]}function fh(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=Rs(a),y?["latex",a]:a.startsWith("`")&&a.endsWith("`")?(a=a.substring(1,a.length-1),["ascii-math",a]):a.includes("\\")?["latex",a]:/\$.+\$/.test(a)?["latex",`\\text{${a}}`]:[void 0,a]}var nc="$$",of="$$",sf=(a,y,b)=>(nd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${nc} ${y} ${of}`),y),ph=class Jh{constructor(y){Jh._modes[y]=this}static onPaste(y,b,E){var ee;if(!b.contentEditable&&b.userSelect==="none")return b.model.announce("plonk"),!1;if(typeof E=="string"){const ae=new DataTransfer;ae.setData("text/plain",E),E=ae}const ie=new ClipboardEvent("paste",{clipboardData:E,cancelable:!0});return(ee=b.host)!=null&&ee.dispatchEvent(ie)?Jh._modes[y].onPaste(b,E):!1}static copyToClipboard(y,b){if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const E=y.model,ee=E.selectionIsCollapsed?[0,E.lastOffset]:Ha(E.selection),ie=E.getValue(ee,b);navigator.clipboard.writeText(ie).then(()=>{},()=>y.model.announce("plonk"))}static onCopy(y,b){var E;if(!b.clipboardData)return;if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const ee=y.model,ie=ee.selectionIsCollapsed?[0,ee.lastOffset]:Ha(ee.selection);let ae=ee.getAtoms(ie);if(ae.every(ue=>ue.mode==="text"||!ue.mode))b.clipboardData.setData("text/plain",ae.filter(ue=>ue instanceof vs).map(ue=>ue.value).join(""));else if(ae.every(ue=>ue.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(ie,{includeChildren:!0}).map(ue=>{var de;return(de=ue.value)!=null?de:""}).join(""));else{let ue;ae.length===1&&ae[0].verbatimLatex!==void 0?ue=ae[0].verbatimLatex:ue=ee.getValue(ie,"latex-expanded"),b.clipboardData.setData("application/x-latex",ue);try{b.clipboardData.setData("text/plain",y.options.onExport(y,ue,ie))}catch(de){}if(ae.length===1){const de=ae[0];(de.type==="root"||de.type==="group")&&(ae=de.body.filter(me=>me.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(de=>de.toJson())))}catch(de){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const de=window.MathfieldElement.computeEngine;if(de)try{const me=de.jsonSerializationOptions;de.jsonSerializationOptions={metadata:["latex"]};const ye=de.parse(ee.getValue(ie,"latex-unstyled"));de.jsonSerializationOptions=me;const Te=JSON.stringify(ye.json);Te&&b.clipboardData.setData("application/json",Te)}catch(me){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const ie=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return Jh._modes[ie].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};ph._modes={};var er=ph,lf=[{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","^"]}],id={"\\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 $o(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function zo(a){var y,b;return(b=(y=a.querySelector(".ML__caret"))!=null?y:a.querySelector(".ML__text-caret"))!=null?b:a.querySelector(".ML__latex-caret")}function Ns(a){const y=zo(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function rd(a){var y;if(!a.parent)return"root";let b=(y=a.parent.id)!=null?y:"";return b+=typeof a.parentBranch=="string"?"-"+a.parentBranch:`-${a.parentBranch[0]}/${a.parentBranch[0]}`,b}function ad(a,y,b){if(!y)return null;const E=a.field.getBoundingClientRect(),ee=y.right-y.left,ie=y.bottom-y.top,ae=Math.ceil(y.left-E.left+a.field.scrollLeft*b),ue=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:ue,bottom:ue+ie}}function od(a){const y=a.getBoundingClientRect(),b=parseInt(getComputedStyle(a).marginRight),E={top:y.top-1,bottom:y.bottom,left:y.left,right:y.right-1+b};if(a.children.length===0||a.tagName.toUpperCase()==="SVG")return E;for(const ee of a.children)if(ee.nodeType===1&&"atomId"in ee.dataset&&!ee.classList.contains("pstrut")){const ie=od(ee);E.left=Math.min(E.left,ie.left),E.right=Math.max(E.right,ie.right),E.top=Math.min(E.top,ie.top),E.bottom=Math.max(E.bottom,ie.bottom)}return E}function Bl(a,y){var b,E;if(!y.id)return null;let ee=(E=(b=a.atomBoundsCache)==null?void 0:b.get(y.id))!=null?E:null;if(ee!==null)return ee;const ie=a.field.querySelector(`[data-atom-id="${y.id}"]`);return ee=ie?od(ie):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function mh(a,y,b){const E=new Map;for(const ee of a.model.getAtoms(y,{includeChildren:!0})){if(b!=null&&b.excludeAtomsWithBackground&&ee.style.backgroundColor)continue;const ie=a.field,ae=ie.offsetWidth;let de=Math.floor(ie.getBoundingClientRect().width)/ae;de=isNaN(de)?1:de;const me=ad(a,Bl(a,ee),de);if(me){const ye=rd(ee);if(E.has(ye)){const Te=E.get(ye);E.set(ye,{left:Math.min(Te.left,me.left),right:Math.max(Te.right,me.right),top:Math.min(Te.top,me.top),bottom:Math.max(Te.bottom,me.bottom)})}else E.set(ye,me)}}return[...E.values()]}function sd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...mh(a,E,y)),[])}function ld(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function ic(a){let y=0,b=0;const E=a.offsetWidth,ee=a.offsetHeight;for(;a instanceof HTMLElement;)y+=a.offsetTop,b+=a.offsetLeft,a=a.offsetParent;return new DOMRect(b,y,E,ee)}var gh=`@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;
}
`,$r=`.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);
}
`,vh=`#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);
}
`,uf=`/* 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;
}
`,Pl=`/* 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);*/
}
`,cf=`.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));
}
`,rc=`: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', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', 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', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', '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',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
: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;
}
`,df=`.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;
}
`,Vr;function hl(a){let y="";switch(a){case"mathfield-element":y=`
: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":y=$r;break;case"mathfield":y=gh;break;case"environment-popover":y=vh;break;case"suggestion-popover":y=uf;break;case"keystroke-caption":y=Pl;break;case"virtual-keyboard":y=cf;break;case"ui":y=rc;break;case"menu":y=df;break;default:debugger}return y}function Il(a){return Vr||(Vr={}),Vr[a]||(Vr[a]=new CSSStyleSheet,Vr[a].replaceSync(hl(a))),Vr[a]}var ys;function Io(a){var y;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${a}`))return;const b=window.document.createElement("style");b.id=`mathlive-style-${a}`,b.append(window.document.createTextNode(hl(a))),window.document.head.appendChild(b);return}if(ys||(ys={}),((y=ys[a])!=null?y:0)!==0)ys[a]+=1;else{const b=Il(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ys[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ys!=null&&ys[a]&&(ys[a]-=1,ys[a]<=0)){const y=Vr[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class Ep extends gn{constructor(y){var b;super(Me(Ce({},y),{type:"accent",body:(b=y.body)!=null?b:void 0})),y.accentChar?this.accent=y.accentChar:this.svgAccent=y==null?void 0:y.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(y){return new Ep(y)}toJson(){return Me(Ce({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new xr({parent:y,mathstyle:"cramp"},this.style),ee=(b=gn.createBox(E,this.body))!=null?b:new $n("\u25A2",{style:this.style});let ie=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(ie=ee.skew);let ae=Math.min(ee.height,hs),ue;if(this.svgAccent)ue=Fo(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const me=new $n(this.accent,{fontFamily:"Main-Regular"});me.italic=0;const ye=this.accent===8407?" ML__accent-vec":"";ue=new $n(new $n(me),{classes:"ML__accent-body"+ye})}ue=new Zr({shift:0,children:[{box:new $n(ee)},-ae,{box:ue,marginLeft:ee.left+2*ie,classes:["ML__center"]}]});const de=new $n(ue,{type:"lift"});return this.caret&&(de.caret=this.caret),this.bind(E,de.wrap(E)),this.attachSupsub(E,{base:de})}},ne={"(":")","{":"}","[":"]","|":"|","\\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"},te=Object.fromEntries(Object.entries(ne).map(([a,y])=>[y,a]));function re(a){var y;return(y={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[a])!=null?y:a.codePointAt(0)}function le(a,y,b,E){var ee;const ae=new $n(re(a),{fontFamily:"Main-Regular",isSelected:E.isSelected,classes:"ML__small-delim "+((ee=E.classes)!=null?ee:"")}).wrap(y);return b&&ae.setTop((1-y.scalingFactor)*io),ae}function pe(a,y,b,E,ee){var ie,ae;const ue=new xr({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),de=new $n(re(a),{fontFamily:`Size${y}-Regular`,isSelected:ee.isSelected,classes:((ie=ee.classes)!=null?ie:"")+` ML__delim-size${y}`,type:(ae=ee.type)!=null?ae:"ignore"}).wrap(ue);return b&&de.setTop((1-ue.scalingFactor)*io),de}function be(a,y,b,E,ee){var ie;let ae,ue,de,me;ae=de=me=re(a),ue=null;let ye="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?de=ae=me=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?de=ae=me=8741:a==="\\uparrow"?de=me=9168:a==="\\Uparrow"?de=me=8214:a==="\\downarrow"?ae=de=9168:a==="\\Downarrow"?ae=de=8214:a==="\\updownarrow"?(ae=8593,de=9168,me=8595):a==="\\Updownarrow"?(ae=8657,de=8214,me=8659):a==="["||a==="\\lbrack"?(ae=9121,de=9122,me=9123,ye="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,de=9125,me=9126,ye="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(de=ae=9122,me=9123,ye="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,de=me=9122,ye="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(de=ae=9125,me=9126,ye="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,de=me=9125,ye="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,de=9116,me=9117,ye="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,de=9119,me=9120,ye="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,ue=9128,me=9129,de=9130,ye="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,ue=9132,me=9133,de=9130,ye="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,me=9129,de=9130,ye="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,me=9133,de=9130,ye="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,me=9133,de=9130,ye="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,me=9129,de=9130,ye="Size4-Regular"):a==="\\surd"?(ae=57345,me=9143,de=57344,ye="Size4-Regular"):a==="\\ulcorner"?(ae=9484,de=me=32):a==="\\urcorner"?(ae=9488,de=me=32):a==="\\llcorner"?(me=9492,de=ae=32):a==="\\lrcorner"&&(ae=9496,de=ae=32);const Te=fs(ae,ye),ze=Te.height+Te.depth,nt=fs(de,ye),ut=nt.height+nt.depth,nn=fs(me,ye),Nn=nn.height+nn.depth;let Yt=0,Sn=1;if(ue!==null){const ja=fs(ue,ye);Yt=ja.height+ja.depth,Sn=2}const Wn=ze+Nn+Yt,En=Math.max(0,Math.ceil((y-Wn)/(Sn*ut))),Li=Wn+En*Sn*ut;let Ni=io;b&&(Ni=Ni*E.scalingFactor);const Oi=Li/2-Ni,Cr=.008,zr=[];zr.push({box:new $n(me,{fontFamily:ye})}),zr.push(-Cr);const ei=new $n(de,{fontFamily:ye});if(ue===null)for(let ja=0;ja<En;ja++)zr.push({box:ei});else{for(let ja=0;ja<En;ja++)zr.push({box:ei});zr.push(-Cr),zr.push({box:new $n(ue,{fontFamily:ye})}),zr.push(-Cr);for(let ja=0;ja<En;ja++)zr.push({box:ei})}zr.push(-Cr),zr.push({box:new $n(ae,{fontFamily:ye})});let Wo="";ye==="Size1-Regular"?Wo=" delim-size1":ye==="Size4-Regular"&&(Wo=" delim-size4");const Vs=new Zr({bottom:Oi,children:zr},{classes:Wo});return new $n(Vs,Me(Ce({},ee!=null?ee:{}),{classes:((ie=ee==null?void 0:ee.classes)!=null?ie:"")+" ML__delim-mult"}))}var _e=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Ae=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),et=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),dt=[0,1.2,1.8,2.4,3];function Wt(a,y,b,E){return a===void 0||a==="."?Ci(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),_e.has(a)||et.has(a)?pe(a,y,!1,b,E):Ae.has(a)?be(a,dt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var zt=[{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}],vn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],An=[{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 qn(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function di(a,y,b,E){const ee={"-4":0,"-3":1,0:2}[E.mathstyle.sizeDelta];for(let ie=ee;ie<b.length&&b[ie].type!=="stack";ie++){const ae=fs(a,qn(b[ie]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let ue=ae.height+ae.depth;if(b[ie].type==="small"&&(b[ie].mathstyle==="scriptscriptstyle"?ue*=Math.max(Uu[Math.max(1,E.size-2)],E.minFontScale):b[ie].mathstyle==="scriptstyle"&&(ue*=Math.max(Uu[Math.max(1,E.size-1)],E.minFontScale))),ue>y)return b[ie]}return b[b.length-1]}function xi(a,y,b,E,ee,ie){if(!y||y.length===0||y===".")return Ci(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;et.has(y)?ae=zt:_e.has(y)?ae=An:ae=vn;const ue=di(re(y),b,ae,ee),de=new xr({parent:ee,mathstyle:ue.mathstyle},ie==null?void 0:ie.style);return ue.type==="small"?le(y,de,E,Me(Ce({},ie),{type:a})):ue.type==="large"?pe(y,ue.size,E,de,Me(Ce({},ie),{type:a})):(console.assert(ue.type==="stack"),be(y,b,E,de,Me(Ce({},ie),{type:a})))}function oi(a,y,b,E,ee,ie){if(y===".")return Ci(ee,ie==null?void 0:ie.classes);const ae=io*ee.scalingFactor,ue=901,de=5/ll,me=Math.max(b-ae,E+ae),ye=Math.max(me/500*ue,2*me-de);return xi(a,y,ye,!0,ee,ie)}function Ci(a,y){const b=new $n(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new xr({parent:a,mathstyle:"textstyle"}))}var zi=class Lp extends gn{constructor(y){var b;super({type:"placeholder",command:"\\placeholder",mode:(b=y==null?void 0:y.mode)!=null?b:"math",style:y==null?void 0:y.style}),this.captureSelection=!0}static fromJson(y){return new Lp(y)}toJson(){return super.toJson()}render(y){let b;return this.value=y.placeholderSymbol,typeof y.renderPlaceholder=="function"?b=y.renderPlaceholder(y):b=this.createBox(y),this.caret&&(b.classes+=" ML__placeholder-selected"),b}_serialize(y){return y.skipPlaceholders?"":"\\placeholder{}"}},Ki=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],dr=["cases","dcases","rcases"],jr=["align","align*","aligned","gather","gathered","split"],Na=["array","subequations","eqnarray"];function sa(a){return Na.concat(jr).concat(dr).concat(Ki).includes(a)}function uo(a){return Ki.includes(a)}function co(a){return dr.includes(a)}function Ca(a){return jr.includes(a)}function ho(a,y,b){let E=0;for(const me of b)"align"in me&&(E+=1);let ee=0;const ie=[];for(const me of y){let ye=0;for(ee=Math.max(ee,Math.min(me.length,E));ye<me.length;){const Te=[],ze=Math.min(me.length,ye+E);for(;ye<ze;){const nt=me[ye];nt.length===0?Te.push([new gn({type:"first",mode:a.mode})]):nt[0].type!=="first"?Te.push([new gn({type:"first",mode:a.mode}),...nt]):(console.assert(!nt.slice(1).some(ut=>ut.type==="first")),Te.push(nt)),ye+=1}ie.push(Te)}}ie.length>0&&ie[ie.length-1].length===1&&ie[ie.length-1][0].length===1&&ie[ie.length-1][0][0].type==="first"&&ie.pop();const ae=[];for(const me of ie){if(me.length!==ee)for(let ye=me.length;ye<ee;ye++)me.push([new gn({type:"first",mode:a.mode}),new zi]);ae.push(me)}let ue=0,de=0;for(const me of ae){de=0;for(const ye of me){for(const Te of ye)Te.parent=a,Te.parentBranch=[ue,de];de+=1}ue+=1}return a.isDirty=!0,ae}var rr=class Dp extends gn{constructor(y,b,E,ee={}){var ie;super({type:"array"}),this.environmentName=y,this.rowGaps=E,ee.mathstyleName&&(this.mathstyleName=ee.mathstyleName),ee.columns&&(ee.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=ee.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=ho(this,b,this.colFormat),ee.leftDelim&&(this.leftDelim=ee.leftDelim),ee.rightDelim&&(this.rightDelim=ee.rightDelim),ee.arraycolsep!==void 0&&(this.arraycolsep=ee.arraycolsep),this.colSeparationType=ee.colSeparationType,ee.arraystretch!==void 0&&(this.arraystretch=ee.arraystretch),this.minColumns=(ie=ee.minColumns)!=null?ie:1}static fromJson(y){return new Dp(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=Me(Ce({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(b=>b.map(E=>E.map(ee=>ee.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(y.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(y.arraycolsep=this.arraycolsep),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}branch(y){var b;if(lu(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return lu(y)?(this.isDirty=!0,(b=this.branch(y))!=null?b:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(y=>!!y.align).length}removeBranch(y){if(gs(y))return super.removeBranch(y);const b=this.branch(y);return this.array[y[0]][y[1]]=void 0,b.forEach(E=>{E.parent=void 0,E.parentBranch=void 0}),console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}get hasChildren(){return this.children.length>0}get children(){const y=[];for(const b of this.array)for(const E of b)if(E)for(const ee of E)y.push(...ee.children),y.push(ee);return[...y,...super.children]}render(y){var b,E,ee,ie,ae,ue;const de=new xr({parent:y,mathstyle:this.mathstyleName},this.style),me=de.getRegisterAsEm("arrayrulewidth"),ye=de.getRegisterAsEm("arraycolsep"),Te=de.getRegisterAsEm("doublerulesep"),ze=(E=(b=this.arraystretch)!=null?b:de.getRegisterAsNumber("arraystretch"))!=null?E:1;let nt=typeof this.arraycolsep=="number"?this.arraycolsep:ye;this.colSeparationType==="small"&&(nt=.2778*(new xr({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const ut=ze*Gu,nn=.7*ut,Nn=.3*ut;let Yt=0;const Sn=[];let Wn=0;const En=this.array.length;for(let Ur=0;Ur<En;++Ur){const ba=this.array[Ur];Wn=Math.max(Wn,ba.length);const Ga=new xr({parent:de,mathstyle:this.mathstyleName},this.style);let js=nn/Ga.scalingFactor,Gs=Nn/Ga.scalingFactor;const Us={cells:[],height:0,depth:0,pos:0};for(const ws of ba){const e0=(ee=gn.createBox(Ga,ws,{type:"ignore"}))!=null?ee:new $n(null,{type:"ignore"});Gs=Math.max(Gs,e0.depth),js=Math.max(js,e0.height),Us.cells.push(e0)}let Xs=(ie=Yc(this.rowGaps[Ur]))!=null?ie:0;Xs>0&&(Xs+=Nn,Gs=Math.max(Gs,Xs),Xs=0),Ur<En-1&&!uo(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Gs+=de.getRegisterAsEm("jot")),Us.height=js,Us.depth=Gs,Yt+=js,Us.pos=Yt,Yt+=Gs+Xs,Sn.push(Us)}const Li=Yt/2+io,Ni=[];for(let Ur=0;Ur<Wn;Ur++){const ba=[];for(const Ga of Sn){const js=Ga.cells[Ur];js.depth=Ga.depth,js.height=Ga.height,ba.push({box:js,shift:Ga.pos-Li})}ba.length>0&&Ni.push(new Zr({individualShift:ba}))}const Oi=[];let Cr=!1,zr=!1,ei=0,Wo=!this.leftDelim;const{colFormat:Vs}=this;for(const Ur of Vs){if("align"in Ur&&ei>=Ni.length)break;if("align"in Ur)Cr?Oi.push(la(2*nt)):(zr||Wo)&&Oi.push(la(nt)),Oi.push(new $n(Ni[ei],{classes:"col-align-"+Ur.align})),ei++,Cr=!0,zr=!1,Wo=!1;else if("gap"in Ur){if(typeof Ur.gap=="number")Oi.push(la(Ur.gap));else{const ba=ha(y,Sn,Li,Ur.gap);ba&&Oi.push(ba)}Cr=!1,zr=!1,Wo=!1}else if("separator"in Ur){const ba=new $n(null,{classes:"vertical-separator"});ba.height=Yt,ba.setStyle("height",Yt,"em"),ba.setStyle("border-right",`${me}em ${Ur.separator} currentColor`),ba.setStyle("vertical-align",-(Yt-Li),"em");let Ga=0;zr?Ga=Te-me:Cr&&(Ga=nt-me),ba.left=Ga,Oi.push(ba),Cr=!1,zr=!0,Wo=!1}}Cr&&!this.rightDelim&&Oi.push(la(nt));const Qo=new $n(Oi,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Qo.caret=this.caret),this.bind(y,Qo);const ja=Qo.height,Zo=Qo.depth,Mo=this.bind(y,new $n([this.bind(y,oi("open",(ae=this.leftDelim)!=null?ae:".",ja,Zo,de,{isSelected:this.isSelected})),Qo,this.bind(y,oi("close",(ue=this.rightDelim)!=null?ue:".",ja,Zo,de,{isSelected:this.isSelected}))],{type:"ord"}));return Mo?(Mo.setStyle("display","inline-block"),this.caret&&(Mo.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:Mo}))):null}_serialize(y){var b;const E=[];if(this.environmentName==="lines"?E.push("{\\displaylines"):E.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(E.push("{"),this.colFormat!==void 0)for(const ee of this.colFormat)"align"in ee&&typeof ee.align=="string"?E.push(ee.align):"separator"in ee&&ee.separator==="solid"?E.push("|"):"separator"in ee&&ee.separator==="dashed"&&E.push(":");E.push("}")}for(let ee=0;ee<this.array.length;ee++){for(let ie=0;ie<this.array[ee].length;ie++)ie>0&&E.push(" & "),E.push(gn.serialize(this.array[ee][ie],y));if(ee<this.array.length-1){const ie=this.rowGaps[ee];ie!=null&&ie.dimension?E.push(`\\\\[${ie.dimension} ${(b=ie.unit)!=null?b:"pt"}] `):E.push("\\\\ ")}}return this.environmentName==="lines"?E.push("}"):E.push(`\\end{${this.environmentName}}`),cr(E)}getCell(y,b){return this.array[y][b]}setCell(y,b,E){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[y][b]!==void 0);for(const ie of this.array[y][b])ie.parent=void 0,ie.parentBranch=void 0;let ee=E;(E.length===0||E[0].type!=="first")&&(ee=[new gn({type:"first",mode:this.mode}),...E]),this.array[y][b]=ee;for(const ie of ee)ie.parent=this,ie.parentBranch=[y,b];this.isDirty=!0}addRowBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(da(this));this.array.splice(y,0,b);for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const ie=this.array[E][ee];if(ie)for(const ae of ie)ae.parentBranch=[E,ee]}this.isDirty=!0}addRowAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(da(this));this.array.splice(y+1,0,b);for(let E=y+1;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const ie=this.array[E][ee];if(ie)for(const ae of ie)ae.parentBranch=[E,ee]}this.isDirty=!0}removeRow(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>y);const b=this.array.splice(y,1);for(const E of b)for(const ee of E)if(ee)for(const ie of ee)ie.parent=void 0,ie.parentBranch=void 0;for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const ie=this.array[E][ee];if(ie)for(const ae of ie)ae.parentBranch=[E,ee]}this.isDirty=!0}addColumnBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y,0,da(this));for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const ie of ee)ie.parentBranch=[b,E]}this.isDirty=!0}addColumnAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y+1,0,da(this));for(let b=0;b<this.rowCount;b++)for(let E=y+1;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const ie of ee)ie.parentBranch=[b,E]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>y);for(const b of this.array){const E=b.splice(y,1);for(const ee of E)if(ee)for(const ie of ee)ie.parent=void 0,ie.parentBranch=void 0}for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const ie of ee)ie.parentBranch=[b,E]}this.isDirty=!0}get cells(){const y=[];for(const b of this.array)for(const E of b)E&&y.push(E.filter(ee=>ee.type!=="first"));return y}};function da(a){const y=new gn({type:"first",mode:a.mode});y.parent=a;const b=new zi;return b.parent=a,[y,b]}function la(a){const y=new $n(null,{classes:"arraycolsep"});return y.width=a,y}function ha(a,y,b,E){if(!E)return null;const ee=[];for(const ie of y){const ae=gn.createBox(a,E,{type:"ignore"});ae&&(ae.depth=ie.depth,ae.height=ie.height,ee.push({box:ae,shift:ie.pos-b}))}return new Zr({individualShift:ee}).wrap(a)}var va=class Ap extends gn{constructor(y){super({mode:y.mode,command:y.command,style:y.style,body:y.body,type:"box"}),this.framecolor=y.framecolor,this.backgroundcolor=y.backgroundcolor,this.padding=y.padding,this.offset=y.offset,this.border=y.border}static fromJson(y){return new Ap(y)}toJson(){return Me(Ce({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(y){var b,E,ee,ie;const ae=gn.createBox(y,this.body,{type:"lift"});if(!ae)return null;const ue=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=ue,ae.setStyle("display","inline-block"),ae.setStyle("position","relative"),ae.setStyle("height",Math.floor(100*ae.height+ae.depth)/100,"em"),ae.setStyle("vertical-align",-Math.floor(100*ae.height)/100,"em");const de=new xr({parent:y},this.style),me=de.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),ye=new $n(null,{classes:"ML__box"});ye.height=ae.height+me,ye.depth=ae.depth+me,ye.setStyle("box-sizing","border-box"),ye.setStyle("position","absolute"),ye.setStyle("top",-me+.3,"em"),ye.setStyle("left",0),ye.setStyle("height",ye.height+ye.depth,"em"),ye.setStyle("width","100%"),this.backgroundcolor&&ye.setStyle("background-color",(ee=de.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&ye.setStyle("border",`${de.getRegisterAsEm("fboxrule",2)}em solid ${(ie=de.toColor(this.framecolor))!=null?ie:"black"}`),this.border&&ye.setStyle("border",this.border);const Te=new $n([ye,ae],{type:"lift"});return Te.setStyle("display","inline-block"),Te.setStyle("position","relative"),Te.setStyle("line-height",0),Te.height=ae.height+me+(ue>0?ue:0),Te.depth=ae.depth+me+(ue<0?-ue:0),Te.setStyle("padding-left",me,"em"),Te.setStyle("padding-right",me,"em"),Te.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*me+Math.abs(ue)))/100,"em"),Te.setStyle("margin-top",-me,"em"),Te.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*me-ue))/100,"em"),Te.setStyle("vertical-align",Math.floor(100*(ae.depth+2*me))/100,"em"),this.caret&&(Te.caret=this.caret),this.attachSupsub(y,{base:Te})}_serialize(y){return y.skipStyles?cr([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Tp extends gn{constructor(y,b){var E;super({type:"composition",mode:(E=b==null?void 0:b.mode)!=null?E:"math",value:y})}static fromJson(y){return new Tp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new $n(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},vo=class Bp extends gn{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Bp(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Wa=class Pp extends gn{constructor(y,b,E){super({type:"group",mode:b,style:E}),this.body=y,this.boxType=y.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,y&&y.length===1&&y[0].command===","&&(this.captureSelection=!0)}static fromJson(y){return new Pp(y.body,y.mode,y.style)}render(y){const b=gn.createBox(y,this.body,{type:this.boxType});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Lr=class Ip extends gn{constructor(y,b,E){super({type:"leftright",style:E.style,displayContainsHighlight:!0}),this.variant=y,this.body=b,this.leftDelim=E.leftDelim,this.rightDelim=E.rightDelim}static fromJson(y){var b;return new Ip((b=y.variant)!=null?b:"",y.body,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}_serialize(y){var b,E;const ee=this.matchingRightDelim();return this.variant==="left...right"?cr(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?cr(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):cr([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(y),ee])}matchingRightDelim(){var y,b;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const E=(y=this.leftDelim)!=null?y:".";return(b=ne[E])!=null?b:E}render(y){var b,E;const ee=new xr({parent:y},this.style);console.assert(this.body!==void 0);const ie=new xr({parent:y,mathstyle:"textstyle"},this.style),ae=(b=gn.createBox(ee,this.body,{type:"inner"}))!=null?b:new $n(null,{type:"inner"}),ue=ae.height/ie.scalingFactor,de=ae.depth/ie.scalingFactor,me=[];if(this.leftDelim&&me.push(this.bind(ie,oi("open",this.leftDelim,ue,de,ie,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Ba(ae.children,this,ee,ue,de),me.push(ae)),this.rightDelim){let nt=this.containsCaret?" ML__contains-caret":"",ut=this.rightDelim;ut==="?"&&(ee.smartFence?(ut=this.matchingRightDelim(),nt+=" ML__smart-fence__close"):ut="."),me.push(this.bind(ie,oi("close",ut,ue,de,ie,{isSelected:this.isSelected,classes:nt+" ML__close",mode:this.mode,style:this.style})))}let ye=this.variant==="mleft...mright";const Te=this.leftSibling;Te&&(!ye&&Te.isFunction&&(ye=!0),!ye&&Te.type==="subsup"&&((E=Te.leftSibling)!=null&&E.isFunction)&&(ye=!0));const ze=new $n(me,{type:ye?"close":"inner",classes:"left-right"});return ze.setStyle("margin-top",`${-ae.depth}em`),ze.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(ze.caret=this.caret),this.bind(ee,ze.wrap(ee))}};function Ba(a,y,b,E,ee){if(a)for(let ie=0;ie<a.length;ie++){const ae=a[ie];ae.type==="middle"?(a[ie]=y.bind(b,oi("inner",ae.value,E,ee,b,{isSelected:y.isSelected})),a[ie].caret=ae.caret,a[ie].isSelected=ae.isSelected,a[ie].cssId=ae.cssId,a[ie].htmlData=ae.htmlData,a[ie].htmlStyle=ae.htmlStyle,a[ie].attributes=ae.attributes,a[ie].cssProperties=ae.cssProperties):ae.children&&Ba(ae.children,y,b,E,ee)}}var ac=class Op extends gn{constructor(y,b){var E;super({type:"macro",command:y,style:b.style}),this.body=b.body,b.captureSelection===void 0?b.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=b.captureSelection,this.macroArgs=b.args,this.expand=(E=b.expand)!=null?E:!1}static fromJson(y){return new Op(y.command,y)}toJson(){const y=super.toJson();return this.expand&&(y.expand=!0),this.captureSelection!==void 0&&(y.captureSelection=this.captureSelection),this.macroArgs&&(y.args=this.macroArgs),y}_serialize(y){var b;return y.expandMacro&&this.expand?this.bodyToLatex(y):this.command+((b=this.macroArgs)!=null?b:"")}render(y){const b=gn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class Rp extends gn{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Rp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},Fs=class Np extends gn{constructor(y,b,E=!1,ee,ie){var ae;super({type:"prompt",mode:(ae=ie==null?void 0:ie.mode)!=null?ae:"math",style:ie==null?void 0:ie.style,command:"\\placeholder"}),this.body=ee,this.correctness=b,this.placeholderId=y,this.locked=E,this.captureSelection=this.locked}static fromJson(y){return new Np(y.placeholderId,y.correctness,y.locked,y.body,y)}toJson(){const y=super.toJson();return this.placeholderId&&(y.placeholderId=this.placeholderId),this.body||delete y.body,this.body&&(y.body=this.body.filter(b=>b.type!=="first").map(b=>b.toJson())),this.correctness&&(y.correctness=this.correctness),y.locked=this.locked,y}render(y){const b=new xr({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,ie=E,ae=gn.createBox(y,this.body);if(!ae)return null;ae.height||(ae.height=b.metrics.xHeight),ae.setStyle("vertical-align",-ae.height,"em"),this.correctness==="correct"?ae.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&ae.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const ue=new $n(ae,{type:"ord"});ue.setStyle("display","inline-block"),ue.setStyle("height",ae.height+ae.depth,"em"),ue.setStyle("vertical-align",-ie,"em");let de="ML__prompt ";this.locked?de+=" ML__lockedPromptBox ":de+=" ML__editablePromptBox ",this.correctness==="correct"?de+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(de+=" ML__incorrectPromptBox "),this.containsCaret&&(de+=" ML__focusedPromptBox ");const me=new $n(null,{classes:de,attributes:{part:"prompt"}});me.height=ue.height+ie,me.depth=ue.depth+ie,me.width=ue.width+2*ee,me.setStyle("box-sizing","border-box"),me.setStyle("position","absolute"),me.setStyle("height",ue.height+ue.depth+2*ie,"em"),ee===0&&me.setStyle("width","100%"),ee!==0&&(me.setStyle("width",`calc(100% + ${2*ee}em)`),me.setStyle("top",E,"em"),me.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(me.width=3*ee,me.setStyle("width",`calc(100% + ${3*ee}em)`),me.setStyle("left",-1.5*ee,"em"));let ye="";this.correctness==="incorrect"&&(ye+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),ye&&(me.svgOverlay=ye);const Te=new $n([me,ue],{classes:"ML__prompt-atom"});return Te.setStyle("position","relative"),Te.setStyle("display","inline-block"),Te.setStyle("line-height",0),Te.height=ue.height+ie+.2,Te.depth=ue.depth+ie,Te.left=ee,Te.right=ee,Te.setStyle("height",ue.height+ie,"em"),Te.setStyle("top",ue.depth-ue.height,"em"),Te.setStyle("vertical-align",ue.depth+ie,"em"),Te.setStyle("margin-left",.5,"em"),Te.setStyle("margin-right",.5,"em"),this.caret&&(Te.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Te}))}_serialize(y){var b;const E=(b=this.bodyToLatex(y))!=null?b:"";if(y.skipPlaceholders)return E;let ee="\\placeholder";return this.placeholderId&&(ee+=`[${this.placeholderId}]`),this.correctness==="correct"?ee+="[correct]":this.correctness==="incorrect"&&(ee+="[incorrect]"),this.locked&&(ee+="[locked]"),Jr(ee,E)}},qo=class Fp extends gn{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Fp(y);for(const E of Tl)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new xr({parent:y,isPhantom:!0}),ee=this.leftSibling,ie=(b=ee.render(E))!=null?b:new $n(null),ae=new $n(null);return ae.height=ie.height,ae.depth=ie.depth,this.attachSupsub(y,{base:ae,isCharacterBox:ee.isCharacterBox(),type:"ignore"})}_serialize(y){return this.supsubToLatex(y)}};function _a(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var pl=class{constructor(a,y,b){this.errors=[],this.index=0,this.endCount=0;var E,ee,ie,ae;b!=null||(b={}),this.tokens=a,this.context=y instanceof xr&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new xr({from:y,mathstyle:b.mathstyle},b.style),this.args=(E=b.args)!=null?E:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(ee=b.style)!=null?ee:{},parseMode:(ie=b.parseMode)!=null?ie:"math",mathstyle:(ae=b.mathstyle)!=null?ae:"displaystyle",tabular:!1}}beginContext(a){var y,b,E;const ee=this.parsingContext,ie={parent:ee,mathlist:[],style:Ce({},ee.style),parseMode:(y=a==null?void 0:a.mode)!=null?y:ee.parseMode,mathstyle:(b=a==null?void 0:a.mathstyle)!=null?b:ee.mathstyle,tabular:(E=a==null?void 0:a.tabular)!=null?E:!1};this.parsingContext=ie}endContext(){this.parsingContext=this.parsingContext.parent}onError(a){this.errors.push(Ce({before:Bs(this.tokens.slice(this.index,this.index+10)),after:Bs(this.tokens.slice(Math.max(0,this.index-10),this.index))},a))}get mathlist(){return this.parsingContext.mathlist}set mathlist(a){this.parsingContext.mathlist=a}get parseMode(){return this.parsingContext.parseMode}set parseMode(a){this.parsingContext.parseMode=a}get tabularMode(){return this.parsingContext.tabular}get style(){let a=this.parsingContext;for(;a;){if(a.style)return Ce({},a.style);a=a.parent}return{}}set style(a){this.parsingContext.style=a}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(a){return this.tokens[this.index]===a?(this.index++,!0):!1}lastSubsupAtom(){let a;return this.mathlist.length>0&&(a=this.mathlist[this.mathlist.length-1],a.type==="subsup"||a.subsupPlacement!==void 0)||(a=new qo({style:this.style}),this.mathlist.push(a)),a}hasPattern(a){return a.test(this.tokens[this.index])}hasInfixCommand(){var a;const{index:y}=this;if(y<this.tokens.length&&this.tokens[y].startsWith("\\")){const b=Lt(this.tokens[y],this.parseMode);return!b||b.definitionType==="symbol"||b.ifMode&&!b.ifMode.includes(this.parseMode)?!1:(a=b.infix)!=null?a:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const a=this.peek();return a!=="\\\\"&&a!=="\\cr"&&a!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var a;const y=(a=this.args)==null?void 0:a.call(this,"?");return y?Za(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new zi({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(a){let y=this.tokens[this.index];for(;y&&y!==a;)y=this.tokens[++this.index];y===a&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(a){const y=this.index;let b=this.end(),E="";for(;!b;){const ie=this.get();_a(ie)?(E+=ie,b=this.end()||E.length>=a.length):b=!0}const ee=a.toUpperCase()===E.toUpperCase();return ee||(this.index=y),ee}scanString(){let a="";for(;!this.end();){const y=this.peek();if(y==="]")return a;if(y==="<space>")a+=" ";else if(y.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),a+=y.substring(1);else if(_a(y))a+=y;else return a;this.next()}return a}scanBalancedString(){let a="",y=this.end(),b=1;for(;!y;){const E=this.get();E==="<space>"?a+=" ":E==="<{>"?(a+="{",b+=1):E==="<}>"?(b-=1,b>0?a+="}":this.index-=1):E==="<$>"?a+="$":E==="<$$>"?a+="$$":a+=E,y=b===0||this.end()}return a}scanLiteralGroup(){var a;if(!this.match("<{>"))return"";let y="",b=1;for(;b>0&&!this.end();){const E=this.get();E==="<}>"?(b-=1,b>0&&(y+="}")):E==="<{>"?(b+=1,y+="{"):(/\\[a-zA-Z]+$/.test(y)&&/^[a-zA-Z]/.test(E)&&(y+=" "),y+=(a={"<space>":" ","<$$>":"$$","<$>":"$"}[E])!=null?a:E)}return y}scanNumber(a=!0){var y,b;let E=!1,ee=this.peek();for(;ee==="<space>"||ee==="+"||ee==="-";)this.get(),ee==="-"&&(E=!E),ee=this.peek();a=!!a;let ie=10,ae=/\d/;if(this.match("'"))ie=8,ae=/[0-7]/,a=!0;else if(this.match('"'))ie=16,ae=/[\dA-F]/,a=!0;else if(this.match("x"))ie=16,ae=/[\dA-Fa-f]/,a=!0;else if(this.match("`"))return ee=this.get(),ee?ee.length===2&&ee.startsWith("\\")?{number:(E?-1:1)*((y=ee.codePointAt(1))!=null?y:0),base:"alpha"}:{number:(E?-1:1)*((b=ee.codePointAt(0))!=null?b:0),base:"alpha"}:null;let ue="";for(;this.hasPattern(ae);)ue+=this.get();if(!a&&(this.match(".")||this.match(",")))for(ue+=".";this.hasPattern(ae);)ue+=this.get();const de=a?Number.parseInt(ue,ie):Number.parseFloat(ue);return Number.isNaN(de)?null:{number:E?-de:de,base:ie===16?"hexadecimal":ie===8?"octal":"decimal"}}scanRegister(){var a;const y=this.index,b=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return b;let E=!1;if(b===null)for(;;){const ie=this.peek();if(ie==="-")E=!E;else if(ie!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const ie=this.get();return ie.startsWith("\\")?b?{register:ie,global:!0,factor:(E?-1:1)*b.number}:E?{register:ie,global:!0,factor:-1}:{register:ie,global:!0}:(this.index=y,null)}let ee=this.get();return ee!=null&&ee.startsWith("\\")?(ee=ee.substring(1),this.context.registers[ee]?!E||b!==null?{register:ee,factor:(E?-1:1)*((a=b==null?void 0:b.number)!=null?a:1)}:{register:ee}:(this.index=y,null)):(this.index=y,null)}scanValue(){const a=this.scanRegister();if(a)return a;const y=this.index,b=this.scanGlueOrDimen();if(b&&("unit"in b||"glue"in b&&"unit"in b.glue))return b;this.index=y;const E=this.scanNumber();if(E)return E;if(this.end()||!_a(this.peek()))return null;const ee=this.scanString();return ee.length>0?{string:ee}:null}scanDimen(){const a=this.scanNumber(!1);if(a===null)return null;const y=a.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let b;return this.matchKeyword("pt")?b="pt":this.matchKeyword("mm")?b="mm":this.matchKeyword("cm")?b="cm":this.matchKeyword("ex")?b="ex":this.matchKeyword("px")?b="px":this.matchKeyword("em")?b="em":this.matchKeyword("bp")?b="bp":this.matchKeyword("dd")?b="dd":this.matchKeyword("pc")?b="pc":this.matchKeyword("in")?b="in":this.matchKeyword("mu")&&(b="mu"),b?{dimension:y,unit:b}:{dimension:y}}scanGlueOrDimen(){const a=this.scanDimen();if(a===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return a;const y={glue:a};if(this.matchKeyword("plus")){const b=this.scanDimen();if(b)y.grow=b;else return y}if(this.skipWhitespace(),this.match("\\relax"))return y;if(this.skipWhitespace(),this.matchKeyword("minus")){const b=this.scanDimen();if(b)y.shrink=b;else return y}return!y.grow&&!y.shrink?a:y}scanColspec(){this.skipWhitespace();const a=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const y=this.get();y==="c"||y==="r"||y==="l"?a.push({align:y}):y==="|"?a.push({separator:"solid"}):y===":"?a.push({separator:"dashed"}):y==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),a.push({gap:this.scan(b=>b==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return a}scanModeSet(){let a;if(this.match("\\(")&&(a="textstyle"),!a&&this.match("\\[")&&(a="displaystyle"),!a)return null;this.beginContext({mode:"math",mathstyle:a});const y=this.scan(b=>b===(a==="displaystyle"?"\\]":"\\)"));return this.match(a==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanModeShift(){let a="";if(this.match("<$>")&&(a="<$>"),!a&&this.match("<$$>")&&(a="<$$>"),!a)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const y=this.scan(b=>b===a);return this.match(a)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanEnvironment(){if(!this.match("\\begin"))return null;const a=this.scanArgument("string");if(!a)return null;const y=Ut(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const ue of y.params)if(ue.isOptional)b.push(this.scanOptionalArgument(ue.type));else{const de=this.scanArgument(ue.type);de||this.onError({code:"missing-argument",arg:a}),b.push(de)}this.beginContext({tabular:y.tabular});const E=[],ee=[];let ie=[],ae=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae&&this.match("\\end")&&(this.scanArgument("string")!==a&&this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae)if(this.matchColumnSeparator())ie.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){ie.push(this.mathlist),this.mathlist=[];let ue=null;this.skipWhitespace(),this.match("[")&&(ue=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(ue!=null?ue:{dimension:0}),E.push(ie),ie=[]}else this.mathlist.push(...this.scan(ue=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(ue)));while(!ae);return ie.push(this.mathlist),ie.length>0&&E.push(ie),this.endContext(),y.createAtom(a,E,ee,b)}scanExpression(){const a=this.mathlist;if(this.mathlist=[],this.parseExpression()){const y=this.mathlist;return this.mathlist=a,y}return this.mathlist=a,null}scan(a){this.beginContext(),a||(a=ae=>ae==="<}>");let y="",b=null,E=[],ee=null;for(;!this.end()&&!a(this.peek());)this.hasInfixCommand()&&!y?(y=this.get(),b=Lt(y,"math"),b&&(E=this.scanArguments(b)[1]),ee=this.mathlist,this.mathlist=[]):this.parseExpression();let ie;return y?(console.assert(!!b),E.unshift(this.mathlist),ee&&E.unshift(ee),ie=[b.createAtom({command:y,args:E,style:this.style,mode:this.parseMode})]):ie=this.mathlist,this.endContext(),ie}scanGroup(){const a=this.index;if(!this.match("<{>"))return null;const y=this.scan(E=>E==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const b=new Wa(y,this.parseMode,this.style);return b.verbatimLatex=Bs(this.tokens.slice(a,this.index)),b}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let a=1;for(;!this.end()&&a!==0;)this.match("(")&&(a+=1),this.match(")")&&(a-=1),a!==0&&this.parseExpression();const y=new Lr("",this.mathlist,{leftDelim:"(",rightDelim:a===0?")":"?"});return this.endContext(),y}scanDelim(){this.skipWhitespace();const a=this.peek();if(!a)return this.onError({code:"unexpected-end-of-string"}),null;if(!_a(a)&&!a.startsWith("\\"))return null;this.next();const y=Lt(a,"math");return y?y.definitionType==="function"&&y.ifMode&&!y.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:a}),null):y.definitionType==="symbol"&&(y.type==="mopen"||y.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(a)?a:(this.onError({code:"unexpected-delimiter",arg:a}),null):(this.onError({code:"unknown-command",arg:a}),null)}scanLeftRight(){var a;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new vo("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new vo("\\mright");let y="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;y="\\mright"}const b=this.scanDelim();if(!b)return this.onError({code:"unexpected-delimiter"}),new vo(y==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(y);)this.parseExpression();const E=this.mathlist;this.endContext();const ee=(a=this.scanDelim())!=null?a:".";return new Lr(y==="\\right"?"left...right":"mleft...mright",E,{leftDelim:b,rightDelim:ee,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let a=this.peek();if(a!=="^"&&a!=="_"&&a!=="'")return!1;const y=this.lastSubsupAtom();for(;a==="^"||a==="_"||a==="'";)this.match("'")?this.match("'")?y.addChild(new gn({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new gn({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(Ge(this.scanArgument("expression")),a==="_"?"subscript":"superscript"),a=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const a=this.match("\\limits"),y=!a&&this.match("\\nolimits"),b=!y&&!a&&this.match("\\displaylimits");if(!a&&!y&&!b)return!1;const E=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return E===null?!1:(E.explicitSubsupPlacement=!0,a&&(E.subsupPlacement="over-under"),y&&(E.subsupPlacement="adjacent"),b&&(E.subsupPlacement="auto"),!0)}scanArguments(a){if(!(a!=null&&a.params))return[void 0,[]];let y;const b=[];let E=a.infix?2:0;for(;E<a.params.length;){const ee=a.params[E];ee.type==="rest"?b.push(this.scan(ie=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(ie))):ee.isOptional?b.push(this.scanOptionalArgument(ee.type)):ee.type.endsWith("*")?y=ee.type.slice(0,-1):b.push(this.scanArgument(ee.type)),E+=1}return[y,b]}scanSymbolOrLiteral(){const a=this.peek();if(!a)return null;this.next();let y;if(_a(a)){const b=Co.createAtom(this.parseMode,a,Ce({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Lt(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=Ce({},this.style);b.variant&&(E.variant=b.variant),y=new gn({type:b.type,command:a,style:E,value:String.fromCodePoint(b.codepoint),mode:this.parseMode,verbatimLatex:a})}else{if(b.applyMode||b.applyStyle||b.infix)return this.onError({code:"invalid-command",arg:a}),[new vo(a)];b.createAtom&&(y=b.createAtom({command:a,args:[],style:this.style,mode:this.parseMode}))}}return y?[y]:null}scanArgument(a){var y;this.skipFiller();const b=this.parseMode;if(a==="auto"&&(a=b),!this.match("<{>")){if(a==="string")return this.scanString();if(a==="value")return this.scanValue();if(a==="delim")return(y=this.scanDelim())!=null?y:".";if(a==="expression")return this.scanExpression();if(a==="math"){a!==b&&this.beginContext({mode:"math"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}if(a==="text"){a!==b&&this.beginContext({mode:"text"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}return a==="balanced-string"||console.assert(!1),null}if(a==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}if(a==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}let E=null;if(a==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}return a==="string"?E=this.scanString():a==="balanced-string"?E=this.scanBalancedString():a==="colspec"?E=this.scanColspec():a==="value"&&(E=this.scanValue()),this.skipUntilToken("<}>"),E}scanOptionalArgument(a){if(a=a==="auto"?this.parseMode:a,this.skipFiller(),!this.match("["))return null;let y=null;for(;!this.end()&&!this.match("]");)if(a==="string")y=this.scanString();else if(a==="value")y=this.scanValue();else if(a==="colspec")y=this.scanColspec();else if(a==="bbox"){const b={},E=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const ee of E){const ie=ee.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(ie)b.padding={dimension:parseInt(ie[1]),unit:ie[2]};else{const ae=ee.match(/^\s*border\s*:\s*(.*)/);ae?b.border=ae[1]:b.backgroundcolor={string:ee}}}y=b}else a==="math"&&(this.beginContext({mode:"math"}),y=this.mathlist.concat(this.scan(b=>b==="]")),this.endContext());return y}scanSymbolOrCommand(a){var y,b,E;if(a==="\\placeholder"){const ue=this.scanOptionalArgument("string"),de=this.scanOptionalArgument("math"),me=gn.serialize(de,{defaultMode:"math"});let ye=[],Te;!Te&&me==="correct"?Te="correct":!Te&&me==="incorrect"?Te="incorrect":me!==""&&(ye=de);const ze=this.scanOptionalArgument("string")==="locked",nt=this.scanArgument("auto");let ut;return nt&&Array.isArray(nt)&&nt.length>0?ut=nt:nt&&typeof nt=="object"&&"group"in nt?ut=nt.group:ut=ye,ue?[new Fs(ue,Te,ze,ut!=null?ut:ye,{mode:this.parseMode,style:this.style})]:[new zi({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const ue=this.index,de=this.scanLiteralGroup()||this.next();if(!de)return null;if(this.context.registers[de.substring(1)]){const me=this.scanArgument("string");me!==null&&(this.context.registers[de.substring(1)]=me);const ye=cr([a,Bs(this.tokens.slice(ue,this.index))]);return[new gn({type:"text",value:"",verbatimLatex:ye})]}}let ee=this.scanMacro(a);if(ee)return[ee];const ie=Lt(a,this.parseMode);if(!ie)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(ue=>new gn({type:"text",value:ue,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new vo(a)]);const ae=this.index;if(ie.definitionType==="symbol"){const ue=Ce({},this.style);ie.variant&&(ue.variant=ie.variant),ee=new gn({type:ie.type,command:a,style:ue,value:String.fromCodePoint(ie.codepoint),mode:this.parseMode})}else{if(ie.ifMode&&!ie.ifMode.includes(this.parseMode))return[];const ue=this.parseMode;ie.applyMode&&(this.parseMode=ie.applyMode);let de,me=[];if(ie.parse?me=ie.parse(this):[de,me]=this.scanArguments(ie),this.parseMode=ue,ie.applyMode&&!ie.applyStyle&&!ie.createAtom)return Ge(me[0]);if(ie.infix)return this.onError({code:"too-many-infix-commands",arg:a}),null;if(typeof ie.createAtom=="function")ee=ie.createAtom({command:a,args:me,style:this.style,mode:this.parseMode}),de&&(ee.body=Ge(this.scanArgument(de)));else if(typeof ie.applyStyle=="function"){const ye=Ce(Ce({},this.style),ie.applyStyle(a,me,this.context)),Te=this.parseMode;if(ie.applyMode&&(this.parseMode=ie.applyMode),de){const ze=this.style;this.style=ye;const nt=this.scanArgument(de);return this.style=ze,this.parseMode=Te,Ge(nt)}this.style=ye}else ee=new gn({type:"mord",command:(b=ie.command)!=null?b:a,style:Ce({},this.style),value:a,mode:(E=ie.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof gn&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const ue=cr([a,Bs(this.tokens.slice(ae,this.index))]);ue&&(ee.verbatimLatex=ue)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const ue=this.scanSmartFence();if(ue)return[ee,ue]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(_a(a)){const y=Co.createAtom(this.parseMode,a,Ce({},this.style));if(!y)return null;if(y.isFunction&&this.smartFence){const b=this.scanSmartFence();if(b)return[y,b]}return[y]}return a.startsWith("\\")?this.scanSymbolOrCommand(a):a==="<space>"?this.parseMode==="text"?[new vs(" "," ",this.style)]:null:(a==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a}),null)}scanMacro(a){var y;const b=this.context.getMacro(a);if(!b)return null;const E=this.index,ee=b.args,ie={"?":(y=this.args)==null?void 0:y.call(this,"?")};for(let ae=1;ae<=ee;ae++){let ue=this.scanLiteralGroup();if(!ue){const de=this.index;this.scanExpression(),ue=Bs(this.tokens.slice(de,this.index))}ie[ae]=ue}return new ac(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:Bs(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:Za(b.def,{context:this.context,parseMode:this.parseMode,args:ae=>ie[ae],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var a,y,b,E;let ee=(E=(b=(y=(a=this.scanEnvironment())!=null?a:this.scanModeShift())!=null?y:this.scanModeSet())!=null?b:this.scanGroup())!=null?E:this.scanLeftRight();if(ee===null){if(this.parseSupSub()||this.parseLimits())return!0;ee=this.scanSymbolCommandOrLiteral()}return ee?(Array.isArray(ee)?this.mathlist.push(...ee):this.mathlist.push(ee),!0):!1}};function Za(a,y){var b,E,ee,ie;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,ue=new pl(ps(a,ae),y==null?void 0:y.context,{args:ae,mathstyle:(E=y==null?void 0:y.mathstyle)!=null?E:"displaystyle",parseMode:(ee=y==null?void 0:y.parseMode)!=null?ee:"math",style:(ie=y==null?void 0:y.style)!=null?ie:{}}),de=[];for(;!ue.end();)de.push(...ue.scan(()=>!1));return de}function t0(a,y){var b;const E=new pl(ps(a,null),y==null?void 0:y.context,{mathstyle:"displaystyle",parseMode:(b=y==null?void 0:y.parseMode)!=null?b:"math"});for(;!E.end();)E.scan();return E.errors}var n0=class $p extends gn{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=ra.go(On.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=Za(E),this._verbatimLatex=y+"{"+b+"}",this.arg=b,this.captureSelection=!0}static fromJson(y){return new $p(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return Me(Ce({},super.toJson()),{arg:this.arg})}render(y){const b=gn.createBox(y,this.body,{type:"inner"});return this.caret&&(b.caret=this.caret),this.bind(y,b)}_serialize(y){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};pt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var On={go:function(a,y){if(!a)return[];y===void 0&&(y="ce");var b="0",E={};E.parenthesisLevel=0,a=a.replace(/\n/g," "),a=a.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),a=a.replace(/[\u2026]/g,"...");for(var ee,ie=10,ae=[];;){ee!==a?(ie=10,ee=a):ie--;var ue=On.stateMachines[y],de=ue.transitions[b]||ue.transitions["*"];e:for(var me=0;me<de.length;me++){var ye=On.patterns.match_(de[me].pattern,a);if(ye){for(var Te=de[me].task,ze=0;ze<Te.action_.length;ze++){var nt;if(ue.actions[Te.action_[ze].type_])nt=ue.actions[Te.action_[ze].type_](E,ye.match_,Te.action_[ze].option);else if(On.actions[Te.action_[ze].type_])nt=On.actions[Te.action_[ze].type_](E,ye.match_,Te.action_[ze].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Te.action_[ze].type_+")"];On.concatArray(ae,nt)}if(b=Te.nextState||b,a.length>0){if(Te.revisit||(a=ye.remainder),!Te.toContinue)break e}else return ae}}if(ie<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(a,y){if(y)if(Object.prototype.toString.call(y)==="[object Array]")for(var b=0;b<y.length;b++)a.push(y[b]);else a.push(y)},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(a){var y=a.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 y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"(-)(9)^(-9)":function(a){var y=a.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"state of aggregation $":function(a){var y=On.patterns.findObserveGroups(a,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(y&&y.remainder.match(/^($|[\s,;\)\]\}])/))return y;var b=a.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return b?{match_:b[0],remainder:a.substr(b[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(a){return On.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return On.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return On.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return On.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return On.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return On.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return On.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return On.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return On.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return On.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return On.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return On.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return On.patterns.findObserveGroups(a,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\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(a){return On.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return On.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return On.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return On.patterns.findObserveGroups(a,"",/^\\[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(a){return On.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return On.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return On.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return On.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return On.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return On.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return On.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return On.patterns.findObserveGroups(a,"\\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(a){var y;if(y=a.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))/),y)return{match_:y[0],remainder:a.substr(y[0].length)};var b=On.patterns.findObserveGroups(a,"","$","$","");return b&&(y=b.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),y)?{match_:y[0],remainder:a.substr(y[0].length)}:null},amount2:function(a){return this.amount(a)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(a){if(a.match(/^\([a-z]+\)$/))return null;var y=a.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return y?{match_:y[0],remainder:a.substr(y[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(a,y,b,E,ee,ie,ae,ue,de,me){var ye=function(Yt,Sn){if(typeof Sn=="string")return Yt.indexOf(Sn)!==0?null:Sn;var Wn=Yt.match(Sn);return Wn?Wn[0]:null},Te=function(Yt,Sn,Wn){for(var En=0;Sn<Yt.length;){var Li=Yt.charAt(Sn),Ni=ye(Yt.substr(Sn),Wn);if(Ni!==null&&En===0)return{endMatchBegin:Sn,endMatchEnd:Sn+Ni.length};if(Li==="{")En++;else if(Li==="}"){if(En===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];En--}Sn++}return En>0,null},ze=ye(a,y);if(ze===null||(a=a.substr(ze.length),ze=ye(a,b),ze===null))return null;var nt=Te(a,ze.length,E||ee);if(nt===null)return null;var ut=a.substring(0,E?nt.endMatchEnd:nt.endMatchBegin);if(ie||ae){var nn=this.findObserveGroups(a.substr(nt.endMatchEnd),ie,ae,ue,de);if(nn===null)return null;var Nn=[ut,nn.match_];return{match_:me?Nn.join(""):Nn,remainder:nn.remainder}}else return{match_:ut,remainder:a.substr(nt.endMatchEnd)}},match_:function(a,y){var b=On.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return On.patterns.patterns[a](y);var E=y.match(b);if(E){var ee;return E[2]?ee=[E[1],E[2]]:E[1]?ee=E[1]:ee=E[0],{match_:ee,remainder:y.substr(E[0].length)}}return null}},actions:{"a=":function(a,y){a.a=(a.a||"")+y},"b=":function(a,y){a.b=(a.b||"")+y},"p=":function(a,y){a.p=(a.p||"")+y},"o=":function(a,y){a.o=(a.o||"")+y},"q=":function(a,y){a.q=(a.q||"")+y},"d=":function(a,y){a.d=(a.d||"")+y},"rm=":function(a,y){a.rm=(a.rm||"")+y},"text=":function(a,y){a.text_=(a.text_||"")+y},insert:function(a,y,b){return{type_:b}},"insert+p1":function(a,y,b){return{type_:b,p1:y}},"insert+p1+p2":function(a,y,b){return{type_:b,p1:y[0],p2:y[1]}},copy:function(a,y){return y},rm:function(a,y){return{type_:"rm",p1:y||""}},text:function(a,y){return On.go(y,"text")},"{text}":function(a,y){var b=["{"];return On.concatArray(b,On.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return On.go(y,"tex-math")},"tex-math tight":function(a,y){return On.go(y,"tex-math tight")},bond:function(a,y,b){return{type_:"bond",kind_:b||y}},"color0-output":function(a,y){return{type_:"color0",color:y[0]}},ce:function(a,y){return On.go(y)},"1/2":function(a,y){var b=[];y.match(/^[+\-]/)&&(b.push(y.substr(0,1)),y=y.substr(1));var E=y.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return E[1]=E[1].replace(/\$/g,""),b.push({type_:"frac",p1:E[1],p2:E[2]}),E[3]&&(E[3]=E[3].replace(/\$/g,""),b.push({type_:"tex-math",p1:E[3]})),b},"9,9":function(a,y){return On.go(y,"9,9")}},createTransitions:function(a){var y,b,E,ee,ie={};for(y in a)for(b in a[y])for(E=b.split("|"),a[y][b].stateArray=E,ee=0;ee<E.length;ee++)ie[E[ee]]=[];for(y in a)for(b in a[y])for(E=a[y][b].stateArray||[],ee=0;ee<E.length;ee++){var ae=a[y][b];if(ae.action_){ae.action_=[].concat(ae.action_);for(var ue=0;ue<ae.action_.length;ue++)typeof ae.action_[ue]=="string"&&(ae.action_[ue]={type_:ae.action_[ue]})}else ae.action_=[];for(var de=y.split("|"),me=0;me<de.length;me++)if(E[ee]==="*")for(var ye in ie)ie[ye].push({pattern:de[me],task:ae});else ie[E[ee]].push({pattern:de[me],task:ae})}return ie},stateMachines:{}};On.stateMachines={ce:{transitions:On.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(a,y){var b;if((a.d||"").match(/^[0-9]+$/)){var E=a.d;a.d=void 0,b=this.output(a),a.b=E}else b=this.output(a);return On.actions["o="](a,y),b},"d= kv":function(a,y){a.d=y,a.dType="kv"},"charge or bond":function(a,y){if(a.beginsWithBond){var b=[];return On.concatArray(b,this.output(a)),On.concatArray(b,On.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=On.patterns.match_("orbital",a.o||""),ee=On.patterns.match_("one lowercase greek letter $",a.o||""),ie=On.patterns.match_("one lowercase latin letter $",a.o||""),ae=On.patterns.match_("$one lowercase latin letter$ $",a.o||""),ue=y==="-"&&(E&&E.remainder===""||ee||ie||ae);ue&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&ie&&(a.o="$"+a.o+"$");var de=[];return ue?(On.concatArray(de,this.output(a)),de.push({type_:"hyphen"})):(E=On.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(On.concatArray(de,On.actions["d="](a,y)),On.concatArray(de,this.output(a))):(On.concatArray(de,this.output(a)),On.concatArray(de,On.actions.bond(a,y,"-")))),de},"a to o":function(a){a.o=a.a,a.a=void 0},"sb=true":function(a){a.sb=!0},"sb=false":function(a){a.sb=!1},"beginsWithBond=true":function(a){a.beginsWithBond=!0},"beginsWithBond=false":function(a){a.beginsWithBond=!1},"parenthesisLevel++":function(a){a.parenthesisLevel++},"parenthesisLevel--":function(a){a.parenthesisLevel--},"state of aggregation":function(a,y){return{type_:"state of aggregation",p1:On.go(y,"o")}},comma:function(a,y){var b=y.replace(/\s*$/,""),E=b!==y;return E&&a.parenthesisLevel===0?{type_:"comma enumeration L",p1:b}:{type_:"comma enumeration M",p1:b}},output:function(a,y,b){var E;if(!a.r)E=[],!a.a&&!a.b&&!a.p&&!a.o&&!a.q&&!a.d&&!b||(a.sb&&E.push({type_:"entitySkip"}),!a.o&&!a.q&&!a.d&&!a.b&&!a.p&&b!==2?(a.o=a.a,a.a=void 0):!a.o&&!a.q&&!a.d&&(a.b||a.p)?(a.o=a.a,a.d=a.b,a.q=a.p,a.a=a.b=a.p=void 0):a.o&&a.dType==="kv"&&On.patterns.match_("d-oxidation$",a.d||"")?a.dType="oxidation":a.o&&a.dType==="kv"&&!a.q&&(a.dType=void 0),E.push({type_:"chemfive",a:On.go(a.a,"a"),b:On.go(a.b,"bd"),p:On.go(a.p,"pq"),o:On.go(a.o,"o"),q:On.go(a.q,"pq"),d:On.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=On.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=On.go(a.rd);var ie;a.rqt==="M"?ie=On.go(a.rq,"tex-math"):a.rqt==="T"?ie=[{type_:"text",p1:a.rq||""}]:ie=On.go(a.rq),E={type_:"arrow",r:a.r,rd:ee,rq:ie}}for(var ae in a)ae!=="parenthesisLevel"&&ae!=="beginsWithBond"&&delete a[ae];return E},"oxidation-output":function(a,y){var b=["{"];return On.concatArray(b,On.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:On.go(y[0]),p2:On.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:On.go(y[0]),p2:On.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:On.go(y[0]),p2:On.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:On.go(y[0]),p2:On.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:On.go(y[1])}},"r=":function(a,y){a.r=y},"rdt=":function(a,y){a.rdt=y},"rd=":function(a,y){a.rd=y},"rqt=":function(a,y){a.rqt=y},"rq=":function(a,y){a.rq=y},operator:function(a,y,b){return{type_:"operator",kind_:b||y}}}},a:{transitions:On.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:On.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:On.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(a){if(a.text_){var y={type_:"text",p1:a.text_};for(var b in a)delete a[b];return y}}}},pq:{transitions:On.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(a,y){return{type_:"state of aggregation subscript",p1:On.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:On.go(y[1],"pq")}}}},bd:{transitions:On.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(a,y){return{type_:"color",color1:y[0],color2:On.go(y[1],"bd")}}}},oxidation:{transitions:On.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(a,y){return{type_:"roman numeral",p1:y||""}}}},"tex-math":{transitions:On.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"tex-math tight":{transitions:On.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(a,y){a.o=(a.o||"")+"{"+y+"}"},output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"9,9":{transitions:On.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:On.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(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),y[1]&&(On.concatArray(b,On.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?On.concatArray(b,On.go(y[2],"pu-9,9")):b.push(y[2])),(y[3]||y[4])&&(y[3]==="e"||y[4]==="*"?b.push({type_:"cdot"}):b.push({type_:"times"}))),y[5]&&b.push("10^{"+y[5]+"}"),b},"number^":function(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),On.concatArray(b,On.go(y[1],"pu-9,9")),b.push("^{"+y[2]+"}"),b},operator:function(a,y,b){return{type_:"operator",kind_:b||y}},space:function(){return{type_:"pu-space-1"}},output:function(a){var y,b=On.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=On.patterns.match_("{(...)}",a.q||"");if(E&&E.remainder===""&&(a.q=E.match_),a.d&&(a.d=a.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.d=a.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),a.q){a.q=a.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.q=a.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var ee={d:On.go(a.d,"pu"),q:On.go(a.q,"pu")};a.o==="//"?y={type_:"pu-frac",p1:ee.d,p2:ee.q}:(y=ee.d,ee.d.length>1||ee.q.length>1?y.push({type_:" / "}):y.push({type_:"/"}),On.concatArray(y,ee.q))}else y=On.go(a.d,"pu-2");for(var ie in a)delete a[ie];return y}}},"pu-2":{transitions:On.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(a,y){a.rm+="^{"+y+"}"},space:function(){return{type_:"pu-space-2"}},output:function(a){var y=[];if(a.rm){var b=On.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=On.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:On.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(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){var b=a.text_.length%3;b===0&&(b=3);for(var E=a.text_.length-3;E>0;E-=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(0,b)),y.reverse()}else y.push(a.text_);for(var ee in a)delete a[ee];return y},"output-o":function(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){for(var b=a.text_.length-3,E=0;E<b;E+=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(E))}else y.push(a.text_);for(var ee in a)delete a[ee];return y}}}};var ra={go:function(a,y){if(!a)return"";for(var b="",E=!1,ee=0;ee<a.length;ee++){var ie=a[ee];typeof ie=="string"?b+=ie:(b+=ra._go2(ie),ie.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&ra.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:ra._goInner(a.a),b:ra._goInner(a.b),p:ra._goInner(a.p),o:ra._goInner(a.o),q:ra._goInner(a.q),d:ra._goInner(a.d)};b.a&&(b.a.match(/^[+\-]/)&&(b.a="{"+b.a+"}"),y+=b.a+"\\,"),(b.b||b.p)&&(y+="{\\vphantom{X}}",y+="^{\\hphantom{"+(b.b||"")+"}}_{\\hphantom{"+(b.p||"")+"}}",y+="{\\vphantom{X}}",y+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(b.b||"")+"}}",y+="_{\\vphantom{2}\\llap{\\smash[t]{"+(b.p||"")+"}}}"),b.o&&(b.o.match(/^[+\-]/)&&(b.o="{"+b.o+"}"),y+=b.o),a.dType==="kv"?((b.d||b.q)&&(y+="{\\vphantom{X}}"),b.d&&(y+="^{"+b.d+"}"),b.q&&(y+="_{\\smash[t]{"+b.q+"}}")):a.dType==="oxidation"?(b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"),b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}")):(b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}"),b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"));break;case"rm":y="\\mathrm{"+a.p1+"}";break;case"text":a.p1.match(/[\^_]/)?(a.p1=a.p1.replace(" ","~").replace("-","\\text{-}"),y="\\mathrm{"+a.p1+"}"):y="\\text{"+a.p1+"}";break;case"roman numeral":y="\\mathrm{"+a.p1+"}";break;case"state of aggregation":y="\\mskip2mu "+ra._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+ra._goInner(a.p1);break;case"bond":if(y=ra._getBond(a.kind_),!y)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+a.kind_+")"];break;case"frac":var E="\\frac{"+a.p1+"}{"+a.p2+"}";y="\\mathchoice{\\textstyle"+E+"}{"+E+"}{"+E+"}{"+E+"}";break;case"pu-frac":var ee="\\frac{"+ra._goInner(a.p1)+"}{"+ra._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+ra._goInner(a.p1)+"}{"+ra._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+ra._goInner(a.p1)+"}{"+ra._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+ra._goInner(a.p1)+"}{"+ra._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+ra._goInner(a.p1)+"}_{"+ra._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+ra._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var ie={rd:ra._goInner(a.rd),rq:ra._goInner(a.rq)},ae=ra._getArrow(a.r);ie.rd||ie.rq?a.r==="<=>"||a.r==="<=>>"||a.r==="<<=>"||a.r==="<-->"?(ae="\\long"+ae,ie.rd&&(ae="\\overset{"+ie.rd+"}{"+ae+"}"),ie.rq&&(a.r==="<-->"?ae="\\underset{\\lower2mu{"+ie.rq+"}}{"+ae+"}":ae="\\underset{\\lower6mu{"+ie.rq+"}}{"+ae+"}"),ae=" {}\\mathrel{"+ae+"}{} "):(ie.rq&&(ae+="[{"+ie.rq+"}]"),ae+="{"+ie.rd+"}",ae=" {}\\mathrel{\\x"+ae+"}{} "):ae=" {}\\mathrel{\\long"+ae+"}{} ",y=ae;break;case"operator":y=ra._getOperator(a.kind_);break;case"1st-level escape":y=a.p1+" ";break;case"space":y=" ";break;case"entitySkip":y="~";break;case"pu-space-1":y="~";break;case"pu-space-2":y="\\mkern3mu ";break;case"1000 separator":y="\\mkern2mu ";break;case"commaDecimal":y="{,}";break;case"comma enumeration L":y="{"+a.p1+"}\\mkern6mu ";break;case"comma enumeration M":y="{"+a.p1+"}\\mkern3mu ";break;case"comma enumeration S":y="{"+a.p1+"}\\mkern1mu ";break;case"hyphen":y="\\text{-}";break;case"addition compound":y="\\,{\\cdot}\\,";break;case"electron dot":y="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":y="{\\times}";break;case"prime":y="\\prime ";break;case"cdot":y="\\cdot ";break;case"tight cdot":y="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":y="\\times ";break;case"circa":y="{\\sim}";break;case"^":y="uparrow";break;case"v":y="downarrow";break;case"ellipsis":y="\\ldots ";break;case"/":y="/";break;case" / ":y="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return y},_getArrow:function(a){switch(a){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(a){switch(a){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(a){switch(a){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."]}}};function M1(a){}function k1(a){}var i0=class zp extends gn{constructor(y){super(Me(Ce({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return Me(Ce({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new $n(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):Jr(this.command,this.value)}},r0=class Kp extends gn{constructor(y){super(Me(Ce({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return Me(Ce({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=Wt(this.value,this.size,y,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return b?(b=this.bind(y,b),this.caret&&(b.caret=this.caret),b):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):Jr(this.command,this.value)}},ud=class Hp extends gn{constructor(y,b,E,ee){var ie,ae;super({type:"enclose",command:y,style:ee.style}),this.body=b,this.backgroundcolor=ee.backgroundcolor,E.updiagonalarrow&&(E.updiagonalstrike=!1),E.box&&(E.left=!1,E.right=!1,E.bottom=!1,E.top=!1),this.notation=E,this.shadow=(ie=ee.shadow)!=null?ie:"none",this.strokeWidth=(ae=ee.strokeWidth)!=null?ae:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=ee.strokeStyle,this.svgStrokeStyle=ee.svgStrokeStyle,this.strokeColor=ee.strokeColor,this.borderStyle=ee.borderStyle,this.padding=ee.padding,this.captureSelection=!1}static fromJson(y){return new Hp(y.command,y.body,y.notation,y)}toJson(){return Me(Ce({},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(y){var b;if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Lt(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);let ee=(b=this.command)!=null?b:"";if(this.command==="\\enclose"){ee+="{"+Object.keys(this.notation).join(" ")+"}";let ie="",ae="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(ie+=ae+'mathbackground="'+this.backgroundcolor+'"',ae=","),this.shadow&&this.shadow!=="auto"&&(ie+=ae+'shadow="'+this.shadow+'"',ae=","),this.strokeWidth||this.strokeStyle!=="solid"?(ie+=ae+this.borderStyle,ae=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(ie+=ae+'mathcolor="'+this.strokeColor+'"',ae=","),ie&&(ee+=`[${ie}]`)}return Jr(ee,this.bodyToLatex(y))}render(y){const b=new xr({parent:y},this.style),E=gn.createBox(b,this.body);if(!E)return null;const ee=rm(this.borderStyle),ie=b.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});E.setStyle("position","relative"),E.setStyle("display","inline-block"),E.setStyle("top",ie,"em"),E.setStyle("height",E.height+E.depth,"em"),E.setStyle("width",E.width,"em");const ae=new $n(null,{classes:"ML__notation"});let ue=E.height+E.depth+2*ie;const de=E.width+2*ie;let me="";if(this.notation.horizontalstrike&&(me+=this.line(3,50,97,50)),this.notation.verticalstrike&&(me+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(me+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(me+=this.line(3,3,97,97)),this.notation.updiagonalarrow){me+=this.line(ie.toString(),(ie+E.depth+E.height).toString(),(ie+E.width).toString(),ie.toString());const ut=.03*Math.sqrt(de*de+ue*ue)*1,nn=E.width*ut,Nn=(E.depth+E.height)*ut,Yt=ie+E.width;let Sn=ie;Sn+Nn-.4*nn<0&&(Sn=.4*nn-Nn),me+='<polygon points="',me+=`${Yt},${Sn} ${Yt-nn-.4*Nn},${Sn+Nn-.4*nn} `,me+=`${Yt-.7*nn},${Sn+.7*Nn} ${Yt-nn+.4*Nn},${Sn+Nn+.4*nn} `,me+=`${Yt},${Sn}`,me+=`" stroke='none' fill="${this.strokeColor}"`,me+="/>"}let ye=0;if(this.notation.phasorangle){const ze=a0(b),nt=(E.height+E.depth+2*ze+ie).toString(),ut=(E.height+E.depth)/2;me+=this.line(ie.toString(),nt,(ie+ut+E.width).toString(),nt),me+=this.line(ie.toString(),nt,(ie+ut).toString(),(ie-ze).toString()),ue+=ze,ye=ut,E.left+=ue/2-ie}if(this.notation.longdiv){const ze=a0(b);ue+=ze,me+=this.line(ie.toString(),ie.toString(),(ie+E.width).toString(),ie.toString());const nt=.3;ye=nt+ze,E.left+=nt+ze,E.setTop(ie+ze),me+='<path d="',me+=`M ${ie} ${ie} a${nt} ${(E.depth+E.height+2*ze)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*ze} "`,me+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,me+="/>"}if(ae.width=E.width+2*ie+ye,ae.height=E.height+ie,ae.depth=E.depth+ie,ae.setStyle("box-sizing","border-box"),ae.setStyle("left",`calc(-${ee} / 2 )`),ae.setStyle("height",`${Math.floor(100*ue)/100}em`),ae.setStyle("top",`calc(${ee} / 2 )`),this.backgroundcolor&&ae.setStyle("background-color",this.backgroundcolor),this.notation.box&&ae.setStyle("border","1px solid red"),this.notation.actuarial&&(ae.setStyle("border-top",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(ae.setStyle("border-bottom",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(ae.setStyle("border-radius","8px"),ae.setStyle("border",this.borderStyle)),this.notation.circle&&(ae.setStyle("border-radius","50%"),ae.setStyle("border",this.borderStyle)),this.notation.top&&ae.setStyle("border-top",this.borderStyle),this.notation.left&&ae.setStyle("border-left",this.borderStyle),this.notation.right&&ae.setStyle("border-right",this.borderStyle),this.notation.bottom&&ae.setStyle("border-bottom",this.borderStyle),me){let ze="";this.shadow==="auto"&&(ze+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(ze+=`filter: drop-shadow(${this.shadow})`),ze+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,ze+=' stroke-linecap="round"',this.svgStrokeStyle&&(ze+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=ze,ae.svgOverlay=me}const Te=new $n([ae,E]);return Te.setStyle("position","relative"),Te.setStyle("vertical-align",ie,"em"),Te.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*ie))/100}em`),Te.setStyle("display","inline-block"),Te.height=ae.height,Te.depth=ae.depth,Te.width=ae.width-2*ie,Te.left=ie,Te.right=ie,this.caret&&(Te.caret=this.caret),Te.wrap(b)}line(y,b,E,ee){return`<line x1="${yh(y)}" y1="${yh(b)}" x2="${yh(E)}" y2="${yh(ee)}" vector-effect="non-scaling-stroke"></line>`}};function yh(a){return typeof a=="number"?`${Math.floor(100*a)/100}%`:a}function rm(a){if(!a)return"1px";const y=a.match(/([0-9][a-zA-Z\%]+)/);return y===null?"1px":y[1]}function am(a){return(Math.floor(100*a.metrics.sqrtRuleThickness/a.scalingFactor)/100/10).toString()+"em"}function a0(a){const y=a.isDisplayStyle?hs:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var oc=class Wp extends gn{constructor(y,b,E){var ee,ie;super(Me(Ce({},E),{type:"genfrac",displayContainsHighlight:!0})),this.above=y,this.below=b,this.hasBarLine=(ee=E==null?void 0:E.hasBarLine)!=null?ee:!0,this.continuousFraction=(ie=E==null?void 0:E.continuousFraction)!=null?ie:!1,this.numerPrefix=E==null?void 0:E.numerPrefix,this.denomPrefix=E==null?void 0:E.denomPrefix,this.mathstyleName=E==null?void 0:E.mathstyleName,this.leftDelim=E==null?void 0:E.leftDelim,this.rightDelim=E==null?void 0:E.rightDelim,this.fractionNavigationOrder=E==null?void 0:E.fractionNavigationOrder}static fromJson(y){return new Wp(y.above,y.below,y)}toJson(){const y={};return this.continuousFraction&&(y.continuousFraction=!0),this.numerPrefix&&(y.numerPrefix=this.numerPrefix),this.denomPrefix&&(y.denomPrefix=this.denomPrefix),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),this.hasBarLine||(y.hasBarLine=!1),this.mathstyleName&&(y.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(y.fractionNavigationOrder=this.fractionNavigationOrder),Ce(Ce({},super.toJson()),y)}get children(){if(this._children)return this._children;const y=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const b of this.below)y.push(...b.children),y.push(b);for(const b of this.above)y.push(...b.children),y.push(b)}else{for(const b of this.above)y.push(...b.children),y.push(b);for(const b of this.below)y.push(...b.children),y.push(b)}return this._children=y,y}render(y){var b,E;const ee=new xr({parent:y,mathstyle:this.mathstyleName},this.style),ie=ee.metrics,ae=new xr({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),ue=this.numerPrefix?new $n([new $n(this.numerPrefix),gn.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=gn.createBox(ae,this.above,{type:"ignore"}))!=null?b:new $n(null,{type:"ignore"}),de=new xr({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),me=this.denomPrefix?new $n([new $n(this.denomPrefix),gn.createBox(de,this.below,{type:"ignore"})]):(E=gn.createBox(de,this.below,{type:"ignore"}))!=null?E:new $n(null,{type:"ignore"}),ye=this.hasBarLine?ie.defaultRuleThickness:0;let Te,ze=0,nt;ee.isDisplayStyle?(Te=ae.metrics.num1,ze=ye>0?3*ye:7*ye,nt=de.metrics.denom1):(ye>0?(Te=ae.metrics.num2,ze=ye):(Te=ae.metrics.num3,ze=3*ie.defaultRuleThickness),nt=de.metrics.denom2);const ut=[];this.isSelected&&ut.push("ML__selected");const nn=ue.depth,Nn=me.height;let Yt;if(ye<=0){const Oi=Te-nn-(Nn-nt);Oi<ze&&(Te+=(ze-Oi)/2,nt+=(ze-Oi)/2),Yt=new Zr({individualShift:[{box:ue,shift:-Te,classes:[...ut,"ML__center"]},{box:me,shift:nt,classes:[...ut,"ML__center"]}]}).wrap(ee)}else{const Oi=new $n(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Oi.softWidth=Math.max(ue.width,me.width),Oi.height=ye/2,Oi.depth=ye/2;const Cr=io+ye/2;Te<ze+nn+Cr&&(Te=ze+nn+Cr);const zr=io-ye/2;nt<ze+Nn-zr&&(nt=ze+Nn-zr),Yt=new Zr({individualShift:[{box:me,shift:nt,classes:[...ut,"ML__center"]},{box:Oi,shift:-zr,classes:ut},{box:ue,shift:-Te,classes:[...ut,"ML__center"]}]}).wrap(ee)}const Sn=ee.isDisplayStyle?ie.delim1:ie.delim2,Wn=this.leftDelim?this.bind(y,xi("open",this.leftDelim,Sn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Ci(ee,"open");let En=null;this.continuousFraction?En=new $n(null,{type:"close"}):this.rightDelim?En=this.bind(y,xi("close",this.rightDelim,Sn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):En=Ci(ee,"close");const Li=new $n([Wn,Yt,En],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Ni=this.bind(y,Li);return this.caret&&(Ni.caret=this.caret),this.attachSupsub(y,{base:Ni})}},Ya=class Zp extends gn{constructor(y,b){var E;super({type:"latex",value:y,mode:"latex"}),this.isSuggestion=(E=b==null?void 0:b.isSuggestion)!=null?E:!1,this.isError=!1}static fromJson(y){const b=new Zp(y.value);return y.isSuggestion&&(b.isSuggestion=!0),y.isError&&(b.isError=!0),b}toJson(){const y={};return this.isSuggestion&&(y.isSuggestion=!0),this.isError&&(y.isError=!0),Ce({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new $n(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},cd=class Vp extends gn{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new Ya(b)),this.skipBoundary=!1}static fromJson(y){return new Vp("")}toJson(){return super.toJson()}render(y){const b=gn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){var b,E;return(E=(b=this.body)==null?void 0:b.map(ee=>ee.value).join(""))!=null?E:""}},hf=class jp extends gn{constructor(y,b){super(Me(Ce({},b),{type:"extensible-symbol",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new jp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.value&&(y.symbol=this.value),y}render(y){var b;const E=y.isDisplayStyle&&this.value!=="\\smallint",ee=new $n(this.value,{fontFamily:E?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(E?"large-op":"small-op"),type:"op",maxFontSize:y.scalingFactor,isSelected:this.isSelected});if(!ee)return null;ee.right=ee.italic;const ie=(ee.height-ee.depth)/2-io*y.scalingFactor,ae=ee.italic;ee.setTop(ie);let ue=ee;if(this.superscript||this.subscript){const de=(b=this.subsupPlacement)!=null?b:"auto";ue=de==="over-under"||de==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:ie,slant:ae}):this.attachSupsub(y,{base:ee})}return new $n(this.bind(y,ue),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[];return E.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),cr(E)}},du=class Gp extends gn{constructor(y){const b=y.body;super(Me(Ce({},y),{type:"overlap",body:typeof b=="string"?[new gn({value:b})]:b,style:y==null?void 0:y.style})),this.skipBoundary=!0,this.align=y==null?void 0:y.align,this.boxType=y==null?void 0:y.boxType}static fromJson(y){return new Gp(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),Ce(Ce({},super.toJson()),y)}render(y){const b=gn.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new $n([b,new $n(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Yo=class Up extends gn{constructor(y){var b,E,ee,ie;super({type:"overunder",command:y.command,style:y.style,mode:y.mode,body:y.body,skipBoundary:(b=y.skipBoundary)!=null?b:!0}),this.subsupPlacement=y.supsubPlacement,this.svgAbove=y.svgAbove,this.svgBelow=y.svgBelow,this.svgBody=y.svgBody,this.above=y.above,this.below=y.below,this.boxType=(E=y.boxType)!=null?E:"ord",this.paddedBody=(ee=y.paddedBody)!=null?ee:!1,this.paddedLabels=(ie=y.paddedLabels)!=null?ie:!1}static fromJson(y){return new Up(y)}toJson(){const y=super.toJson();return this.skipBoundary||(y.skipBoundary=!1),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.svgAbove&&(y.svgAbove=this.svgAbove),this.svgBelow&&(y.svgBelow=this.svgBelow),this.svgBody&&(y.svgBody=this.svgBody),this.boxType!=="ord"&&(y.boxType=this.boxType),this.paddedBody&&(y.paddedBody=!0),this.paddedLabels&&(y.paddedLabels=!0),y}render(y){let b=this.svgBody?Fo(this.svgBody):gn.createBox(y,this.body,{type:"ignore"});const E=new xr({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Fo(this.svgAbove):this.above&&(ee=gn.createBox(E,this.above,{type:"ignore"}));let ie=null;this.svgBelow?ie=Fo(this.svgBelow):this.below&&(ie=gn.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new $n([Ci(y,"open"),b,Ci(y,"close")],{type:"ignore"}));let ae=om(y,{base:b,above:ee,below:ie,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return ae?(this.subsupPlacement==="over-under"?ae=this.attachLimits(y,{base:ae,type:ae.type}):ae=this.attachSupsub(y,{base:ae}),this.caret&&(ae.caret=this.caret),this.bind(y,ae)):null}};function om(a,y){if(!y.base)return null;if(!y.above&&!y.below){const ue=new $n(y.base,{type:y.type});return ue.setStyle("position","relative"),ue}let b=0;y.above&&(b=a.metrics.bigOpSpacing5);let E=null;const ee=y.base,ie=0,ae=["ML__center"];if(y.paddedAboveBelow&&ae.push("ML__label_padding"),y.below&&y.above){const ue=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+ie;E=new Zr({bottom:ue,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]})}else y.below?E=new Zr({top:ee.height-ie,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Zr({bottom:ee.depth+ie,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new $n(E,{type:y.type})}var dd=class Xp extends gn{constructor(y){var b,E,ee,ie;super(Me(Ce({},y),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(b=y.isInvisible)!=null?b:!1,this.smashDepth=(E=y.smashDepth)!=null?E:!1,this.smashHeight=(ee=y.smashHeight)!=null?ee:!1,this.smashWidth=(ie=y.smashWidth)!=null?ie:!1}static fromJson(y){return new Xp(y)}toJson(){const y={};return this.isInvisible&&(y.isInvisible=!0),this.smashDepth&&(y.smashDepth=!0),this.smashHeight&&(y.smashHeight=!0),this.smashWidth&&(y.smashWidth=!0),Ce(Ce({},super.toJson()),y)}render(y){const b=new xr({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),gn.createBox(b,this.body,{classes:"inner"});const E=gn.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new $n(null,{classes:"fix"});return new $n([E,ee],{classes:"rlap"}).wrap(y)}if(!this.smashHeight&&!this.smashDepth)return E;if(this.smashHeight&&(E.height=0),this.smashDepth&&(E.depth=0),E.children)for(const ee of E.children)this.smashHeight&&(ee.height=0),this.smashDepth&&(ee.depth=0);return new Zr({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},hd=class qp extends gn{constructor(y){var b;super(Ce({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new qp(y)}toJson(){const y=super.toJson();return this.width!==void 0&&(y.width=this.width),this._braced&&(y.braced=!0),y}render(y){var b;if(this.command==="space")return new $n(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new $n(null,{classes:"mspace"}),E.left=y.toEm(this.width);else{const ee=(b={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?b:"mediumspace";E=new $n(null,{classes:ee})}return E=this.bind(y,E),this.caret&&(E.caret=this.caret),E}_serialize(y){var b;if(!y.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Lt(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);const ee=(b=this.command)!=null?b:"";return this.width===void 0?ee:this._braced&&!("register"in this.width)?`${ee}{${Sa(this.width)}}`:`${ee}${Sa(this.width)}`}},o0=class Yp extends gn{constructor(y){var b;super(Me(Ce({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new Yp(Me(Ce({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=this.command,ee=this.bodyToLatex(y);return this.above&&!this.hasEmptyBranch("above")?Jr(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:Jr(E,ee)}get children(){if(this._children)return this._children;const y=[];if(this.above)for(const b of this.above)y.push(...b.children),y.push(b);if(this.body)for(const b of this.body)y.push(...b.children),y.push(b);return this._children=y,y}render(y){var b;const E=new xr({parent:y,mathstyle:"cramp"},this.style),ee=(b=gn.createBox(E,this.body,{type:"inner"}))!=null?b:new $n(null),ie=E.scalingFactor,ae=E.metrics.defaultRuleThickness/ie,ue=y.isDisplayStyle?hs:ae,de=new $n(null,{classes:"ML__sqrt-line",style:this.style});de.height=ae,de.softWidth=ee.width;let me=ie*(ae+ue/4);const Te=Math.max(ie*2*ue,ee.height+ee.depth)+me+ae,ze=new xr({parent:y},this.style),nt=this.bind(ze,new $n(xi("inner","\\surd",Te,!1,ze,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!nt)return null;const ut=nt.height+nt.depth-ae;ut>ee.height+ee.depth+me&&(me=(me+ut-(ee.height+ee.depth))/2),nt.setTop(nt.height-ee.height-me);const nn=this.bind(y,new Zr({firstBaseline:[{box:new $n(ee)},me-2*ae,{box:de},ae]})),Nn=gn.createBox(new xr({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!Nn){const Wn=new $n([nt,nn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return Wn.setStyle("display","inline-block"),Wn.setStyle("height",Wn.height+Wn.depth,"em"),this.caret&&(Wn.caret=this.caret),this.bind(y,Wn)}const Yt=new Zr({shift:-.6*(Math.max(nt.height,nn.height)-Math.max(nt.depth,nn.depth)),children:[{box:Nn}]}),Sn=new $n([new $n(Yt,{classes:"ML__sqrt-index",type:"ignore"}),nt,nn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Sn.height=nt.height,Sn.depth=nt.depth,this.caret&&(Sn.caret=this.caret),this.bind(y,Sn)}},sm=class extends $n{constructor(a){super(null,{type:"skip"}),this._width=a}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function bh(a,y){if(!a.parent)return;const b=a.parent.children,E=b.indexOf(a);let ee=E-1;for(;ee>=0&&b[ee].type==="ignore";)ee-=1;if(ee<0&&a.parent.parent&&a.parent.type==="lift"){bh(a.parent,y);return}E>0&&b[E-1].type==="skip"?b[E-1].width+=y:b.splice(E,0,new sm(y))}var lm={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}},um={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function cm(a){pd(a,(y,b)=>{b.type==="bin"&&(!y||/^(middle|bin|op|rel|open|punct)$/.test(y.type))&&(b.type="ord"),(y==null?void 0:y.type)==="bin"&&/^(rel|close|punct)$/.test(b.type)&&(y.type="ord"),b.type!=="ignore"&&(y=b)})}function fd(a,y){if(!a.children)return a;const b=a.children;cm(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),ie=y.getRegisterAsEm("thickmuskip");return pd(b,(ae,ue)=>{var de,me,ye;if(!ae)return;const Te=ae.type,ze=ue.isTight?(de=um[Te])!=null?de:null:(me=lm[Te])!=null?me:null,nt=(ye=ze==null?void 0:ze[ue.type])!=null?ye:null;nt===3&&bh(ue,E),nt===4&&bh(ue,ee),nt===5&&bh(ue,ie)}),a}function pd(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=pd(E.children,y,b):E.type==="ignore"?pd(E.children,y):(y(b,E),pd(E.children,y),b=E);return b}var ff=class Jp extends gn{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new gn({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(Me(Ce({},y),{tooltip:Ol(y.tooltip)}))}toJson(){var y;const b=(y=this.tooltip.body)==null?void 0:y.filter(E=>E.type!=="first").map(E=>E.toJson());return Me(Ce({},super.toJson()),{tooltip:b})}render(y){const b=gn.createBox(new xr,this.body);if(!b)return null;const E=new xr({parent:y,mathstyle:"displaystyle"},{fontSize:Ds}),ee=qu(fd(new $n(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),ie=new $n([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(ie.caret=this.caret),this.bind(y,ie)}},hu=class Qp extends gn{constructor(y,b){super(Me(Ce({},b),{type:"operator",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.variantStyle=b==null?void 0:b.variantStyle,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Qp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.variantStyle&&(y.variantStyle=this.variantStyle),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.value&&(y.symbol=this.value),y}render(y){var b;const E=new $n(this.value,{type:"op",mode:"math",maxFontSize:y.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:y.letterShapeStyle});let ee=E;if(this.superscript||this.subscript){const ie=(b=this.subsupPlacement)!=null?b:"auto";ee=ie==="over-under"||ie==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:E}):this.attachSupsub(y,{base:E})}return new $n(this.bind(y,ee),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Lt(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),cr(E)}};function Ol(a){if(Ie(a))return a.map(E=>Ol(E));if(typeof a=="string")return gn.fromJson(a);a=Ce({},a);for(const E of Tl)a[E]&&(a[E]=Ol(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=Ol(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=rr.fromJson(a)),y==="box"&&(b=va.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=fl.fromJson(a)),y==="delim"&&(b=i0.fromJson(a)),y==="enclose"&&(b=ud.fromJson(a)),y==="error"&&(b=vo.fromJson(a)),y==="extensible-symbol"&&(b=hf.fromJson(a)),y==="genfrac"&&(b=oc.fromJson(a)),y==="group"&&(b=Wa.fromJson(a)),y==="latex"&&(b=Ya.fromJson(a)),y==="latexgroup"&&(b=cd.fromJson(a)),y==="leftright"&&(b=Lr.fromJson(a)),y==="macro"&&(b=ac.fromJson(a)),y==="macro-argument"&&(b=bs.fromJson(a)),y==="operator"&&(b=hu.fromJson(a)),y==="overlap"&&(b=du.fromJson(a)),y==="overunder"&&(b=Yo.fromJson(a)),y==="placeholder"&&(b=zi.fromJson(a)),y==="prompt"&&(b=Fs.fromJson(a)),y==="phantom"&&(b=dd.fromJson(a)),y==="sizeddelim"&&(b=r0.fromJson(a)),y==="spacing"&&(b=hd.fromJson(a)),y==="subsup"&&(b=qo.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=vs.fromJson(a)),y==="tooltip"&&(b=ff.fromJson(a)),b||(console.assert(!y||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(y),`MathLive 0.98.5: an unexpected atom type "${y}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),b=gn.fromJson(a));for(const E of Tl)a[E]&&b.setChildren(a[E],E);return a.verbatimLatex!==void 0&&(b.verbatimLatex=a.verbatimLatex),a.subsupPlacement&&(b.subsupPlacement=a.subsupPlacement),a.explicitSubsupPlacement&&(b.explicitSubsupPlacement=!0),a.isFunction&&(b.isFunction=!0),a.isExtensibleSymbol&&(b.isExtensibleSymbol=!0),a.skipBoundary&&(b.skipBoundary=!0),a.captureSelection&&(b.captureSelection=!0),b}function dm(a){if(a&&Array.isArray(a))return a.map(y=>y==="<null>"?null:typeof y=="object"&&"group"in y?{group:y.group.map(b=>Ol(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>Ol(b)):y)}var s0={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"]},pf={"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]$/},l0=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,hm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,fm=[/^[a-z]$/,/^[A-Z]$/,l0,hm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Co{constructor(){super("math")}createAtom(a,y,b){var E,ee,ie,ae;if(y===null)return new gn({type:"mord",mode:"math",command:a,value:a,style:b});const ue=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const me=new gn({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(ie=y.command)!=null?ie:a,value:String.fromCodePoint(y.codepoint),style:b});return ue&&(me.isFunction=!0),a.startsWith("\\")&&(me.verbatimLatex=a),me}const de=new gn({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return ue&&(de.isFunction=!0),a.startsWith("\\")&&(de.verbatimLatex=a),de}serialize(a,y){const b=gm(a,Me(Ce({},y),{defaultMode:"math"}));return b.length===0||y.defaultMode!=="text"?b:["$ ",...b," $"]}getFont(a,y){console.assert(y.variant!==void 0);let{variant:b}=y,{variantStyle:E}=y;b==="normal"&&!E&&/[\u00A3\u0131\u0237]/.test(a.value)&&(b="main",E="italic"),b==="normal"&&!E&&a.value.length===1&&fm.forEach((ue,de)=>{var me;ue.test(a.value)&&pm[(me=y.letterShapeStyle)!=null?me:"tex"][de]==="it"&&(E="italic")}),E==="up"&&(E=void 0);const ee=E?b+"-"+E:b;console.assert(s0[ee]!==void 0);const[ie,ae]=s0[ee];return pf[b]&&!pf[b].test(a.value)?(a.value=qt(a.value,b,E),null):(l0.test(a.value)&&(a.classes+=" lcGreek"),ae&&(a.classes+=" "+ae),ie)}};function gm(a,y){const{parent:b}=a[0],E=u0(b);return ga(a,"variant").map(ee=>{const ie=u0(ee[0]);let ae="";ie&&ie!==E&&(ae={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"}[ie],console.assert(ae!==void 0));const ue=cr(ee.map(de=>de._serialize(y)));return ae?Jr(ae,ue):ue})}function u0(a){if(!a)return"";const{style:y}=a;if(y.variant===void 0)return"";let b=y.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(y.variant)&&y.variantStyle&&y.variantStyle!=="up"&&(b+="-"+y.variantStyle),b}new mm;function vm(a,y){return a.map(b=>b._serialize(y))}function ym(a,y){return ga(a,"fontShape").map(b=>{const E=vm(b,y),{fontShape:ee}=b[0].style;let ie="";return ee==="it"&&(ie="\\textit"),ee==="sl"&&(ie="\\textsl"),ee==="sc"&&(ie="\\textsc"),ee==="n"&&(ie="\\textup"),!ie&&ee?`{${Jr("\\fontshape",ee)}${cr(E)}}`:ie?Jr(ie,cr(E)):cr(E)})}function bm(a,y){return ga(a,"fontSeries").map(b=>{const E=ym(b,y),{fontSeries:ee}=b[0].style;let ie="";return ee==="b"&&(ie="\\textbf"),ee==="l"&&(ie="\\textlf"),ee==="m"&&(ie="\\textmd"),ee&&!ie?`{${Jr("\\fontseries",ee)}${cr(E)}}`:ie?Jr(ie,cr(E)):cr(E)})}function xm(a,y){return ga(a,"fontSize").map(b=>{var E,ee;const ie=bm(b,y),ae=(ee=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(E=b[0].style.fontSize)!=null?E:""])!=null?ee:"";return ae?`${ae} ${cr(ie)}`:cr(ie)})}function wm(a,y,b){return ga(a,"fontFamily").map(E=>{var ee,ie;const ae=xm(E,y),ue=(ie={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?ie:"";return ue?`\\${ue}{${cr(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${cr(ae)}}`:b?`\\text{${cr(ae)}}`:cr(ae)})}var c0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Co{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new vs(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,Me(Ce({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,ie,ae;const{fontFamily:ue}=y;if(c0[ue]?a.classes+=" "+c0[ue]:ue&&a.setStyle("font-family",ue),y.fontShape&&(a.classes+=" ",a.classes+=(b={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[y.fontShape])!=null?b:""),y.fontSeries){const de=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);de&&(a.classes+=" ",a.classes+=(ee={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(E=de[1])!=null?E:""])!=null?ee:"",a.classes+=" ",a.classes+=(ae={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"}[(ie=de[2])!=null?ie:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Co{constructor(){super("latex")}createAtom(a){return new Ya(a)}serialize(a,y){return a.filter(b=>b instanceof Ya&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var _m={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},mf={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},d0={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},h0={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Mm={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},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","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Em={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Lm={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Dm={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Am={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Tm={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Bm={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Pm={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function f0(a){const y=a.split("+"),b={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:y.pop()};return y.includes("shift")&&(b.shift=!0),y.includes("alt")&&(b.alt=!0),y.includes("ctrl")&&(b.ctrl=!0),y.includes("cmd")&&(b.cmd=!0),y.includes("win")&&(b.win=!0),y.includes("meta")&&(b.meta=!0),b}function sc(a){let y="";return a.shift&&(y+="shift+"),a.alt&&(y+="alt+"),a.ctrl&&(y+="ctrl+"),a.cmd&&(y+="cmd+"),a.win&&(y+="win+"),a.meta&&(y+="meta+"),y+a.key}var Im={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]"},md=[],gd;function gf(){switch(rt()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ko(a){(!a.platform||a.platform===gf())&&md.push(a)}function Om(a,y){var b;const E={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!a)return E;for(const[ee,ie]of Object.entries(y.mapping)){if(ie[0]===a)return E.key=`[${ee}]`,E;if(ie[1]===a)return E.shift=!0,E.key=`[${ee}]`,E;if(ie[2]===a)return E.alt=!0,E.key=`[${ee}]`,E;if(ie[3]===a)return E.shift=!0,E.alt=!0,E.key=`[${ee}]`,E}return E.key=(b=Im[a])!=null?b:"",E}function Rm(a){if(a.code)return a;const y=Object.entries(vd().mapping);let b=!1,E=!1,ee="";for(let ie=0;ie<4;ie++){for(const[ae,ue]of y)if(ue[ie]===a.key){ee=ae,ie===3?(b=!0,E=!0):ie===2?b=!0:ie===1&&(E=!0);break}if(ee)break}return new KeyboardEvent(a.type,Me(Ce({},a),{altKey:b,shiftKey:E,code:ee}))}function Nm(a){var y,b;if(!a||a.key==="Unidentified"||a.key==="Dead")return;const E=a.shiftKey&&a.altKey?3:a.altKey?2:a.shiftKey?1:0;for(const ee of md)((y=ee.mapping[a.code])==null?void 0:y[E])===a.key?ee.score+=1:(b=ee.mapping[a.code])!=null&&b[E]&&(ee.score=0);md.sort((ee,ie)=>ie.score-ee.score)}function Fm(a){gd=md.find(y=>a.startsWith(y.locale))}function vd(){return gd!=null?gd:md[0]}function $m(){switch(gf()){case"apple":return mf;case"windows":return d0;case"linux":return h0}return mf}switch(gf()){case"apple":Ko(mf),Ko(Mm),Ko(Tm),Ko(Lm);break;case"windows":Ko(d0),Ko(km),Ko(Bm),Ko(Dm);break;case"linux":Ko(h0),Ko(Em),Ko(Pm),Ko(Am);break}Ko(_m);function vf(a){var y;const b=/macos|ios/.test(rt()),E=a.split("+");let ee="";for(const ie of E)ee&&(ee+=b?"\u2009":'<span class="ML__shortcut-join">+</span>'),ie.startsWith("[Key")?ee+=ie.slice(4,5):ie.startsWith("Key")?ee+=ie.slice(3,4):ie.startsWith("[Digit")?ee+=ie.slice(6,7):ie.startsWith("Digit")?ee+=ie.slice(5,6):ee+=(y={cmd:"\u2318",meta:b?"\u2318":"Ctrl",shift:b?"\u21E7":"Shift",alt:b?"\u2325":"Alt",ctrl:b?"\u2303":"Ctrl","\n":b?"\u23CE":"Return","[return]":b?"\u23CE":"Return","[enter]":b?"\u2324":"Enter","[tab]":b?"\u21E5":"Tab","[escape]":"Esc","[backspace]":b?"\u232B":"Backspace","[delete]":b?"\u2326":"Del","[pageup]":b?"\u21DE":"Page Up","[pagedown]":b?"\u21DF":"Page Down","[home]":b?"\u2912":"Home","[end]":b?"\u2913":"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:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[ie.toLowerCase()])!=null?y:ie.toUpperCase();return ee}function xh(a){if(a instanceof MouseEvent||a instanceof PointerEvent)return{x:a.clientX,y:a.clientY};if(a instanceof TouchEvent){const y=[...a.touches].reduce((E,ee)=>({x:E.x+ee.clientX,y:E.y+ee.clientY}),{x:0,y:0}),b=a.touches.length;return{x:y.x/b,y:y.y/b}}}function fu(a){const y={alt:!1,control:!1,shift:!1,meta:!1};return(a instanceof MouseEvent||a instanceof PointerEvent||a instanceof TouchEvent||a instanceof KeyboardEvent)&&(a.altKey&&(y.alt=!0),a.ctrlKey&&(y.control=!0),a.metaKey&&(y.meta=!0),a.shiftKey&&(y.shift=!0)),y}function zm(a,y){return!a&&y||a&&!y?!1:!a||!y?!0:a.alt===y.alt&&a.control===y.control&&a.shift===y.shift&&a.meta===y.meta}var Km=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 wh(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Sh(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var $s=class yl{static get scrim(){return yl._scrim||(yl._scrim=new yl),yl._scrim}static open(y){yl.scrim.open(y)}static close(){yl.scrim.close()}static get state(){return yl.scrim.state}static get element(){return yl.scrim.element}constructor(y){var b,E;this.lightDismiss=(b=y==null?void 0:y.lightDismiss)!=null?b:!0,this.translucent=(E=y==null?void 0:y.translucent)!=null?E:!1,this.state="closed"}get element(){if(this._element)return this._element;const y=document.createElement("div");return y.setAttribute("role","presentation"),y.style.position="fixed",y.style.contain="content",y.style.top="0",y.style.left="0",y.style.right="0",y.style.bottom="0",y.style.zIndex="var(--scrim-zindex, 10099)",y.style.outline="none",this.translucent?(y.style.background="rgba(255, 255, 255, .2)",y.style.backdropFilter="contrast(40%)"):y.style.background="transparent",this._element=y,y}open(y){var b;if(this.state!=="closed")return;this.state="opening",this.onDismiss=y==null?void 0:y.onDismiss,this.savedActiveElement=Sh();const{element:E}=this;((b=y==null?void 0:y.root)!=null?b:document.body).appendChild(E),E.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const ee=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const ie=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${ie+ee}px`,y!=null&&y.child&&E.append(y.child),this.state="open"}close(){var y,b,E,ee;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:ie}=this;ie.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),ie.remove(),document.body.style.overflow=(y=this.savedOverflow)!=null?y:"",document.body.style.marginRight=(b=this.savedMarginRight)!=null?b:"",Sh()!==this.savedActiveElement&&((ee=(E=this.savedActiveElement)==null?void 0:E.focus)==null||ee.call(E)),ie.innerHTML="",this.state="closed"}handleEvent(y){this.lightDismiss&&(y.target===this._element&&y.type==="click"?(this.close(),y.preventDefault(),y.stopPropagation()):y.target===document&&(y.type==="touchmove"||y.type==="scroll")&&(this.close(),y.preventDefault(),y.stopPropagation()))}};function Hm(a,y,b){let E=null,ee=null,ie=!1,ae=!1,ue=!1;const de=new AbortController,me=de.signal;return a.addEventListener("keydown",ye=>{if(ie||ye.key==="Process"||ye.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(ye.code)){E=null;return}E=ye,ee=null,b.onKeystroke(ye)?a.textContent="":E=null},{capture:!0,signal:me}),a.addEventListener("keypress",ye=>{ie||(E&&ee&&b.onKeystroke(E),ee=ye)},{capture:!0,signal:me}),a.addEventListener("compositionstart",ye=>{a.textContent="",ie=!0,b.onCompositionStart(ye.data)},{capture:!0,signal:me}),a.addEventListener("compositionupdate",ye=>{ie&&b.onCompositionUpdate(ye.data)},{capture:!0,signal:me}),a.addEventListener("compositionend",ye=>{a.textContent="",ie&&(ie=!1,b.onCompositionEnd(ye.data))},{capture:!0,signal:me}),a.addEventListener("beforeinput",ye=>ye.stopImmediatePropagation(),{signal:me}),a.addEventListener("input",ye=>{var Te;if(!ie&&(a.textContent="",ye.inputType!=="insertCompositionText")){if(ye.inputType==="insertFromPaste"){ye.preventDefault(),ye.stopPropagation();return}b.onInput((Te=ye.data)!=null?Te:""),ye.preventDefault(),ye.stopPropagation()}},{signal:me}),a.addEventListener("paste",ye=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(ye)||ye.preventDefault(),ye.stopImmediatePropagation()},{signal:me}),a.addEventListener("cut",ye=>b.onCut(ye),{capture:!0,signal:me}),a.addEventListener("copy",ye=>b.onCopy(ye),{capture:!0,signal:me}),a.addEventListener("blur",ye=>{var Te,ze;if(((ze=(Te=ye.relatedTarget)==null?void 0:Te._mathfield)==null?void 0:ze.element)===y){a.focus({preventScroll:!0}),ye.preventDefault(),ye.stopPropagation();return}const nt=$s.state;if(nt==="open"||nt==="opening"){ye.preventDefault(),ye.stopPropagation();return}if(ye.relatedTarget===ye.target.getRootNode().host){ye.preventDefault(),ye.stopPropagation();return}ue||ae||(ue=!0,E=null,ee=null,b.onBlur(),ue=!1)},{capture:!0,signal:me}),a.addEventListener("focus",ye=>{ue||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:me}),{dispose:()=>de.abort(),cancelComposition:()=>{ie&&(a.blur(),requestAnimationFrame(()=>a.focus({preventScroll:!0})))},blur:()=>{typeof a.blur=="function"&&a.blur()},focus:()=>{!ae&&typeof a.focus=="function"&&a.focus({preventScroll:!0})},hasFocus:()=>Sh()===a,setAriaLabel:ye=>a.setAttribute("aria-label",ye),setValue:ye=>{var Te;a.textContent=ye,a.style.left="-1000px",(Te=window.getSelection())==null||Te.selectAllChildren(a)},moveTo:(ye,Te)=>{a.style.top=`${Te}px`,a.style.left=`${ye}px`}}}function lc(a){var y;if(!a||!wh(a))return"";let b;return a.key==="Unidentified"&&a.target&&(b=a.target.value),b=(y=b!=null?b:a.key)!=null?y:a.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(b)&&(b=""),b}function p0(a){a=Rm(a);const y=[];return a.ctrlKey&&y.push("ctrl"),a.metaKey&&y.push("meta"),a.altKey&&y.push("alt"),a.shiftKey&&y.push("shift"),y.length===0?`[${a.code}]`:(y.push(`[${a.code}]`),y.join("+"))}function Wm(a){if(mt()){const y=rt(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Zm(a,y,b){if(a.length===0)return"";const E=sc(f0(p0(b))),ee=sc({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(rt()),cmd:!1,win:!1});for(let ie=a.length-1;ie>=0;ie--)if((a[ie].key===E||a[ie].key===ee)&&(!a[ie].ifMode||a[ie].ifMode===y))return a[ie].command;return""}function m0(a){let y=a;return Ie(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function Vm(a,y){let b=[];if(typeof y=="string"){const ie=id[y];Ie(ie)?b=ie.slice():ie&&b.push(ie)}const E=m0(y),ee=new RegExp("^"+E.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const ie of a)ee.test(m0(ie.command))&&b.push(ie.key);return b.map(vf)}function jm(a,y){if(a.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(a.ifPlatform))throw new Error(`Unexpected platform "${a.ifPlatform}" for keybinding ${a.key}`);if(a.ifLayout!==void 0&&(y.score===0||!a.ifLayout.includes(y.id)))return;const b=f0(a.key);let E=a.ifPlatform;if(b.cmd){if(E&&E!=="macos"&&E!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+E+`"
"cmd" modifier can only be used with macOS or iOS platform.`);E||(E=rt()==="ios"?"ios":"macos"),b.win=!1,b.cmd=!1,b.meta=!0}if(b.win){if(E&&E!=="windows")throw new Error('Unexpected "win" modifier with platform "'+E+`"
"win" modifier can only be used with Windows platform.`);E="windows",b.win=!1,b.cmd=!1,b.meta=!0}if(E&&!Wm(E))return;if(/^\[.+\]$/.test(b.key))return Me(Ce({},a),{key:sc(b)});const ee=Om(b.key,y);if(!ee)return Me(Ce({},a),{key:sc(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yf(a.command)}) is conflicting with the key combination ${sc(ee)} using the ${y.displayName} keyboard layout`);return ee.shift=ee.shift||b.shift,ee.alt=ee.alt||b.alt,ee.meta=b.meta,ee.ctrl=b.ctrl,Me(Ce({},a),{key:sc(ee)})}function yf(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function Gm(a,y){const b=[],E=[];for(const ee of a)try{const ie=jm(ee,y);if(!ie)continue;const ae=E.find(ue=>ue.key===ie.key&&ue.ifMode===ie.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yf(ee.command)}) matches ${ae.key} (${yf(ae.command)}) with the ${y.displayName} keyboard layout`);E.push(ie)}catch(ie){ie instanceof Error&&b.push(ie.message)}return[E,b]}var Um=class extends er{constructor(){super("latex")}createAtom(a){return new Ya(a)}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("application/x-latex")||y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),fa(a)),a.startRecording(),!0):!1}insert(a,y,b){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b||(b={}),b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Ha(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const ie=[];for(const de of y)oe.test(de)&&ie.push(new Ya(de));let ae=a.at(a.position);if(ae instanceof cd&&(ae=ae.lastChild),!(ae.parent instanceof cd)){const de=new cd("");ae.parent.addChildAfter(de,ae),ae=de.firstChild}const ue=ae.parent.addChildrenAfter(ie,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(ue)):ue&&(a.position=a.offsetOf(ue))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function yd(a){var y,b;const E=a.atoms.find(ee=>ee.type==="latexgroup");return E?(b=(y=E.body)==null?void 0:y.filter(ee=>ee.type==="latex"))!=null?b:[]:[]}function g0(a,y){var b;let E=0,ee=!1;const ie=Number.isFinite(y==null?void 0:y.before)?(b=y==null?void 0:y.before)!=null?b:0:a.lastOffset;for(;E<=ie&&!ee;){const de=a.at(E);ee=de instanceof Ya&&de.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,ue=!1;for(;ae<=ie&&!ue;){const de=a.at(ae);ue=!(de instanceof Ya&&de.isSuggestion),ue||ae++}return[E-1,ae-1]}new Um;function Ch(a){const y=yd(a.model).filter(b=>b.isSuggestion);if(y.length!==0){a.model.position=a.model.offsetOf(y[0].leftSibling);for(const b of y)b.parent.removeChild(b)}}function bd(a,y){var b;const{model:E}=a;Ch(a);for(const ye of yd(E))ye.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){cc(a);return}const ee=[];let ie=E.at(E.position);for(;ie&&ie instanceof Ya&&/^[a-zA-Z\*]$/.test(ie.value);)ie=ie.leftSibling;if(ie&&ie instanceof Ya&&ie.value==="\\")for(ee.push(ie),ie=ie.rightSibling;ie&&ie instanceof Ya&&/^[a-zA-Z\*]$/.test(ie.value);)ee.push(ie),ie=ie.rightSibling;const ae=ee.map(ye=>ye.value).join(""),ue=Ht(a,ae);if(ue.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const ye of ee)ye.isError=!0;cc(a);return}const de=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=de<0?ue.length-1:de%ue.length;const me=ue[a.suggestionIndex];if(me!==ae){const ye=ee[ee.length-1];ye.parent.addChildrenAfter([...me.slice(ae.length-me.length)].map(Te=>new Ya(Te,{isSuggestion:!0})),ye),pu(a,{interactive:!0})}Ym(a,ue)}function v0(a){const[y,b]=g0(a,{before:a.position});if(y===void 0||b===void 0)return!1;let E=!1;return a.getAtoms([y,b]).forEach(ee=>{ee.isSuggestion&&(ee.isSuggestion=!1,E=!0)}),E}function uc(a,y="accept",b){var E,ee;cc(a);const ie=Xm(a.model);if(!ie)return!1;if(y==="accept-suggestion"||y==="accept-all"){const me=yd(a.model).filter(ye=>ye.isSuggestion);if(me.length!==0){for(const ye of me)ye.isSuggestion=!1;a.model.position=a.model.offsetOf(me[me.length-1])}if(y==="accept-suggestion")return me.length!==0}const ue=yd(a.model).filter(me=>!me.isSuggestion).map(me=>me.value).join(""),de=ie.leftSibling;return ie.parent.removeChild(ie),a.model.position=a.model.offsetOf(de),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(er.insert(a.model,ue,{selectionMode:(ee=b==null?void 0:b.selectItem)!=null&&ee?"item":"placeholder",format:"latex",mode:"math"}),a.snapshot(),a.model.announce("replacement"),a.switchMode("math")),!0}function _h(a){var y;let b=document.getElementById(a);return b?b.dataset.refcount=Number(Number.parseInt((y=b.dataset.refcount)!=null?y:"0")+1).toString():(b=document.createElement("div"),b.setAttribute("aria-hidden","true"),b.dataset.refcount="1",b.id=a,document.body.append(b)),b}function bf(a){var y;const b=document.getElementById(a);if(!b)return;const E=Number.parseInt((y=b.getAttribute("data-refcount"))!=null?y:"0");E<=1?b.remove():b.dataset.refcount=Number(E-1).toString()}function qm(a,y){const b=new xr({from:a.context}),E=new gn({mode:"math",type:"root",body:Za(y,{context:b})}),ee=qu(fd(new $n(E.render(b),{classes:"ML__base"}),b));return Yu(ee,{classes:"ML__latex"}).toMarkup()}function Ym(a,y){var b;if(y.length===0){cc(a);return}let E="";for(const[ie,ae]of y.entries()){const ue=ae,de=qm(a,ae),me=Vm(a.keybindings,ue).join("<br>");E+=`<li role="button" data-command="${ue}" ${ie===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${ue}</span><span class="ML__popover__command">${de}</span>`,me&&(E+=`<span class="ML__popover__keybinding">${me}</span>`),E+="</li>"}const ee=Jm(a,`<ul>${E}</ul>`);xf()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var ie;ee&&!xf()&&(ee.classList.add("is-visible"),Mh(a),(ie=ee.querySelector(".ML__popover__current"))==null||ie.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xf(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function Mh(a,y){var b;if(!a.element||a.element.mathfield!==a||!xf())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){cc(a);return}if(y!=null&&y.deferred){setTimeout(()=>Mh(a),32);return}const E=Ns(a.field);if(!E)return;const ee=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,ie=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ae=window.innerWidth-document.documentElement.clientWidth,ue=window.innerHeight-document.documentElement.clientHeight,de=window.mathVirtualKeyboard.boundingRect.height,me=document.getElementById("mathlive-suggestion-popover");E.x+me.offsetWidth/2>ie-ae?me.style.left=`${ie-me.offsetWidth-ae}px`:E.x-me.offsetWidth/2<0?me.style.left="0":me.style.left=`${E.x-me.offsetWidth/2}px`;const ye=E.y-E.height;ee-ue-de-E.y<ye?(me.classList.add("ML__popover--reverse-direction"),me.classList.remove("top-tip"),me.classList.add("bottom-tip"),me.style.top=`${E.y-E.height-me.offsetHeight-15}px`):(me.classList.remove("ML__popover--reverse-direction"),me.classList.add("top-tip"),me.classList.remove("bottom-tip"),me.style.top=`${E.y+15}px`)}function cc(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function Jm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=_h("mathlive-suggestion-popover"),Io("suggestion-popover"),Io("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(uc(a,"reject"),er.insert(a.model,ee.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),a.dirty=!0,a.focus())})),b.innerHTML=window.MathfieldElement.createHTML(y),b}function Qm(){document.getElementById("mathlive-suggestion-popover")&&(bf("mathlive-suggestion-popover"),x("suggestion-popover"),x("core"))}function eg(){const a=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(a.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 y=a[1],b=y.match(/http.*\.ts[\?:]/);return b&&(y=a[2]),b=y.match(/(https?:.*):[0-9]+:[0-9]+/),b||(b=y.match(/at (.*(\.ts))[\?:]/),b||(b=y.match(/at (.*(\.mjs|\.js))[\?:]/))),b?b[1]:(console.error(a),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${y}").`),"")}var kh=null,y0,b0,wf=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return zl(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(kh===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(kh=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,kh!=null?kh:wf).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Ho="not-loaded";function ng(){return zl(this,null,function*(){return Ho="not-loaded",Eh()})}function Eh(){return zl(this,null,function*(){var a;if(Ho!=="not-loaded")return;if(Ho="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Ho="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const b=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],E=Array.from(document.fonts).map(ae=>ae.family);if(b.every(ae=>E.includes(ae))){Ho="ready";return}if(!window.MathfieldElement.fontsDirectory){Ho="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Ho="error";return}const ie=[["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(ae=>tg(ae[0].replace(/-[a-zA-Z]+$/,""),`${ee}/${ae[0]}`,ae[1]));try{(yield Promise.all(ie.map(ue=>{try{return ue.load()}catch(de){}}))).forEach(ue=>document.fonts.add(ue)),Ho="ready";return}catch(ae){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${ee}"`,{cause:ae}),document.body.classList.add("ML__fonts-did-not-load")}Ho="error"}})}function ig(a){let y=0;for(let b=0;b<a.length;b++)y=y*31+a.charCodeAt(b),y=y|0;return Math.abs(y)}function fa(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{$o(a)&&a.dirty&&(a.atomBoundsCache=new Map,pu(a,y),a.atomBoundsCache=void 0)})))}function rg(a,y){var b;y=y!=null?y:{};const E=new xr({from:Me(Ce({},a.context),{atomIdsSettings:{seed:y.forHighlighting?ig(gn.serialize([a.model.root],{expandMacro:!1,defaultMode:a.options.defaultMode})):"random",groupNumbers:(b=y.forHighlighting)!=null?b:!1},letterShapeStyle:a.options.letterShapeStyle}),mathstyle:a.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),ee=a.model.root.render(E);return Yu(fd(ee,E),{classes:a.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function w0(a,y){const{model:b}=a;b.root.caret=void 0,b.root.isSelected=!1,b.root.containsCaret=!0;for(const ee of b.atoms)ee.caret=void 0,ee.isSelected=!1,ee.containsCaret=!1;if(b.selectionIsCollapsed){const ee=b.at(b.position);ee.caret=a.model.mode;let ie=ee.parent;for(;ie;)ie.containsCaret=!0,ie=ie.parent}else{const ee=b.getAtoms(b.selection,{includeChildren:!0});for(const ie of ee)ie.isSelected=!0}return rg(a,y).toMarkup()}function pu(a,y){if(!$o(a))return;y!=null||(y={});const b=a.element.querySelector("[part=virtual-keyboard-toggle]");b&&(b.style.display=a.hasEditableContent?"":"none");const E=a.field;if(!E)return;const ee=a.isSelectionEditable&&a.hasFocus(),ie=E.classList.contains("ML__focused");ie&&!ee?E.classList.remove("ML__focused"):!ie&&ee&&E.classList.add("ML__focused");let ae=w0(a,y);const ue=a.element.querySelector("[part=menu-toggle]");if(ue&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?ue.style.display="none":ue.style.display=""),a.model.atoms.length<=1){const de=a.options.contentPlaceholder;de&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Va(de)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Lh(a,y.interactive),a.dirty=!1}function Lh(a,y){const b=a.field;if(!b)return;for(const ue of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))ue.remove();!(y!=null&&y)&&Ho!=="error"&&Ho!=="ready"&&setTimeout(()=>{Ho==="ready"?Lh(a):setTimeout(()=>Lh(a),128)},32);const E=a.model,ee=b.offsetWidth,ie=b.getBoundingClientRect().width;let ae=Math.floor(ie)/ee;if(ae=isNaN(ae)?1:ae,E.selectionIsCollapsed){Mh(a,{deferred:!0});let ue=E.at(E.position);for(;ue&&ue.type!=="prompt"&&!(ue.containsCaret&&ue.displayContainsHighlight);)ue=ue.parent;if(ue!=null&&ue.containsCaret&&ue.displayContainsHighlight){const de=ad(a,Bl(a,ue),ae);if(de){de.left/=ae,de.right/=ae,de.top/=ae,de.bottom/=ae;const me=document.createElement("div");me.classList.add("ML__contains-highlight"),me.style.position="absolute",me.style.left=`${de.left+1}px`,me.style.top=`${Math.ceil(de.top)}px`,me.style.width=`${Math.ceil(de.right-de.left)}px`,me.style.height=`${Math.ceil(de.bottom-de.top)}px`,b.insertBefore(me,b.childNodes[0])}}return}for(const ue of ag(sd(a,{excludeAtomsWithBackground:!0}))){ue.left/=ae,ue.right/=ae,ue.top/=ae,ue.bottom/=ae;const de=document.createElement("div");de.classList.add("ML__selection"),de.style.position="absolute",de.style.left=`${ue.left}px`,de.style.top=`${ue.top}px`,de.style.width=`${Math.ceil(ue.right-ue.left)}px`,de.style.height=`${Math.ceil(ue.bottom-ue.top-1)}px`,b.insertBefore(de,b.childNodes[0])}}function ag(a){let y=[];for(const b of a){let E=!1;for(const ee of y)if(b.left===ee.left&&b.right===ee.right&&b.top===ee.top&&b.bottom===ee.bottom){E=!0;break}E||y.push(b)}a=y,y=[];for(const b of a){let E=0;for(const ee of a)if(b.left>=ee.left&&b.right<=ee.right&&b.top>=ee.top&&b.bottom<=ee.bottom&&(E+=1,E>1))break;E===1&&y.push(b)}return y}var S0=3,zs;function Oo(a,y){y=Ce({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),zs||(zs={});for(const b of Object.keys(a))console.assert(!zs[b],"Selector already defined: ",b),zs[b]=Me(Ce({},y),{fn:a[b]})}function Sf(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sf(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),zs[y]}function dc(a){var y;return(y=Sf(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],ie=!1,ae=!1;Ie(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,me=>me[1].toUpperCase());const ue=zs[E],de=ue==null?void 0:ue.target;if(de==="model"){if(!a.isSelectionEditable&&(ue!=null&&ue.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Ch(a),zs[E].fn(a.model,...ee),bd(a),ae=!0,ie=!0}else if(de==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,ie=!0;else if(zs[E]){if(!a.isSelectionEditable&&(ue!=null&&ue.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=zs[E].fn(a,...ee),ie=!0}else throw new Error(`Unknown command "${E}"`);return de!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||ue!=null&&ue.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),ue!=null&&ue.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&fa(a),ie}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&ot()&&navigator.vibrate(S0);const E=Sf(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Oo({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return bd(a,{atIndex:a.suggestionIndex+1}),!1}function ug(a){return bd(a,{atIndex:a.suggestionIndex-1}),!1}Oo({complete:uc},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Oo({nextSuggestion:lg,previousSuggestion:ug},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Dh="mathlive#virtual-keyboard-message";function Cf(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Dh}var cg=class em{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 em),this._singleton}set alphabeticLayout(y){this.sendMessage("update-setting",{alphabeticLayout:y})}set layouts(y){this.sendMessage("update-setting",{layouts:y})}get normalizedLayouts(){return[]}set editToolbar(y){this.sendMessage("update-setting",{editToolbar:y})}set actionKeycap(y){this.sendMessage("update-setting",{actionKeycap:y})}set shiftKeycap(y){this.sendMessage("update-setting",{shiftKeycap:y})}set backspaceKeycap(y){this.sendMessage("update-setting",{backspaceKeycap:y})}set tabKeycap(y){this.sendMessage("update-setting",{tabKeycap:y})}set container(y){throw new Error("Container inside an iframe cannot be changed")}show(y){this.sendMessage("show",y)}hide(y){this.sendMessage("hide",y)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(y){y?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(y){return this.sendMessage("execute-command",{command:y}),!0}updateToolbar(y){this.sendMessage("update-toolbar",y)}update(y){this.sendMessage("update-setting",y)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}handleEvent(y){if(Cf(y)){if(!ld(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");this.handleMessage(y.data)}}handleMessage(y){const{action:b}=y;if(b==="execute-command"){const{command:E}=y;dc(E)==="virtual-keyboard"&&this.executeCommand(E);return}if(b==="synchronize-proxy"){this._boundingRect=y.boundingRect,this._isShifted=y.isShifted;return}if(b==="geometry-changed"){this._boundingRect=y.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(y,b={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(Ce({type:Dh,action:y},b),this.targetOrigin)}},C0={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&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;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Ah={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"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],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:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},xd;function _0(a,y){var b,E,ee;const ie=Rl.singleton;if(!ie)return;const ae=hc(a),ue=(E=(b=ie.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof ue=="string"&&!M0(ue)||Array.isArray(ue)&&ue.length===0){y==null||y();return}const de={};let me="";for(const nn of hg(ue)){const Nn=E0(nn),Yt=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);de[Yt]=Nn;const[Sn,Wn]=Th(Nn);me+=`<div id=${Yt} class="item ${Wn}">${Sn}</div>`}const ye=document.createElement("div");ye.setAttribute("aria-hidden","true"),ye.className="MLK__variant-panel",ye.style.height="auto";const Te=Object.keys(de).length;let ze=5;Te===1?ze=1:Te===2||Te===4?ze=2:Te===3||Te===5||Te===6?ze=3:Te>=7&&Te<14&&(ze=4),ye.style.width=`calc(var(--variant-keycap-length) * ${ze} + 12px)`,ye.innerHTML=vp.createHTML(me),$s.open({root:(ee=ie==null?void 0:ie.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:ye}),xd=new AbortController;const{signal:nt}=xd,ut=a==null?void 0:a.getBoundingClientRect();if(ut){ut.top-ye.clientHeight<0&&(ye.style.width="auto",Te<=6?ye.style.height="56px":Te<=12?ye.style.height="108px":Te<=18?ye.style.height="205px":ye.classList.add("compact"));const nn=Math.max(0,Math.min(window.innerWidth-ye.offsetWidth,(ut.left+ut.right-ye.offsetWidth)/2)),Nn=ut.top-ye.clientHeight+5;ye.style.transform=`translate(${nn}px, ${Nn}px)`,ye.classList.add("is-visible"),requestAnimationFrame(()=>{ye.addEventListener("pointerup",Yt=>{const Sn=hc(Yt.target);!(Sn!=null&&Sn.id)||!de[Sn.id]||(_f(de[Sn.id]),wd(),y==null||y(),Yt.preventDefault())},{capture:!0,passive:!1,signal:nt}),ye.addEventListener("pointerenter",Yt=>{const Sn=hc(Yt.target);!(Sn!=null&&Sn.id)||!de[Sn.id]||Sn.classList.add("is-active")},{capture:!0,signal:nt}),ye.addEventListener("pointerleave",Yt=>{const Sn=hc(Yt.target);!(Sn!=null&&Sn.id)||!de[Sn.id]||Sn.classList.remove("is-active")},{capture:!0,signal:nt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:nt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:nt})})}}function wd(){xd==null||xd.abort(),xd=null,$s.state==="open"&&$s.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(Xe))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Xe[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Ve))y.push({class:"swatch-button",label:'<span style="background:'+Ve[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function M0(a){return Ah[a]!==void 0}function hg(a){var y;return typeof a!="string"?a:(Ah[a]||(Ah[a]=(y=dg(a))!=null?y:[]),Ah[a])}function fg(a){return typeof a=="string"?a:Object.entries(a).map(([y,b])=>`${y}:${b} !important`).join(";")}function pg(a){return Object.keys(a).map(y=>`${y} {${fg(a[y])}}`).join("")}function Sd(a){if(!a)return"";const y=new xr,b=new gn({mode:"math",type:"root",body:Za(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=qu(fd(new $n(b.render(y),{classes:"ML__base"}),y));return Yu(E,{classes:"ML__latex"}).toMarkup()}function Cd(a){var y;if(Array.isArray(a))return a.map(E=>Cd(E)).flat();const b=typeof a=="string"?{markup:a}:a;return"rows"in b&&Array.isArray(b.rows)&&(b.rows=b.rows.map(E=>E.map(ee=>E0(ee)))),(y=b.id)!=null||(b.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[b]}function mg(){var a,y;let E=window.mathVirtualKeyboard.alphabeticLayout;if(E==="auto"){const ue=vd();ue&&(E=ue.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Je.locale.slice(0,2)])!=null?a:"qwerty")}const ee={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},ie=(y=ee[E])!=null?y:ee.qwerty,ae=E==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},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(const ue of ie){const de=[];for(const me of ue)/[a-z]/.test(me)?de.push({label:me,class:"hide-shift",shift:{label:me.toUpperCase()},variants:M0(me)?me:void 0}):me==="~"?E!=="dvorak"?de.push("[backspace]"):de.push({label:"[backspace]",width:1}):me==="^"?de.push("[shift]"):me===" "&&de.push("[separator-5]");ae.push(de)}return ae.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:Cd({rows:ae})}}function k0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),k0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:ie}=ee,ae=ht(ee,["rows"]);y=Me(Ce({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:ie}=ee,ae=ht(ee,["markup"]);y=Me(Ce({},ae),{layers:Cd(a.markup)})}else y=Ce({},a),"layers"in a?y.layers=Cd(a.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let b=!1,E=!1;for(const ee of y.layers)if(ee.rows)for(const ie of ee.rows.flat()){fc(ie)&&(b=!0);const ae=ie.command;typeof ae=="string"&&["undo","redo","cut","copy","paste"].includes(ae)&&(E=!0)}return(!("displayShiftedKeycaps"in a)||a.displayShiftedKeycaps===void 0)&&(y.displayShiftedKeycaps=b),(!("displayEditToolbar"in a)||a.displayEditToolbar===void 0)&&(y.displayEditToolbar=!E),y}function gg(a,y){var b,E;let ee='<div class="left">';if(a.normalizedLayouts.length>1)for(const[ie,ae]of a.normalizedLayouts.entries()){const ue=ae,de=[ie===y?"selected":"layer-switch"];ue.tooltip&&de.push("MLK__tooltip"),ue.labelClass&&de.push(...ue.labelClass.split(" ")),ee+=`<div class="${de.join(" ")}"`,ue.tooltip&&(ee+=" data-tooltip='"+((b=lt(ue.tooltip))!=null?b:ue.tooltip)+"' "),ie!==y&&(ee+=`data-layer="${ue.layers[0].id}"`),ee+=`>${(E=ue.label)!=null?E:"untitled"}</div>`}return ee+="</div>",ee}function vg(a,y){let b="";if(a.editToolbar==="none")return"";const ee=[];y.selectionIsCollapsed?ee.push("undo","redo","pasteFromClipboard"):ee.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const ie={undo:`<div class='action ${y.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${lt("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${lt("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${lt("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${lt("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${lt("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return b+=ee.map(ae=>ie[ae]).join(""),b}function yg(a){for(const y of a)bg(y)}function bg(a){const y=Rl.singleton;if(!y)return;const b={};if(!a.id){if(a.hasAttribute("data-label")&&(b.label=a.dataset.label),a.hasAttribute("data-latex")&&(b.latex=a.dataset.latex),a.hasAttribute("data-key")&&(b.key=a.dataset.key),a.hasAttribute("data-insert")&&(b.insert=a.dataset.insert),a.hasAttribute("data-variants")&&(b.variants=a.dataset.variants),a.hasAttribute("data-aside")&&(b.aside=a.dataset.aside),a.className&&(b.class=a.className),!b.label&&!b.latex&&!b.key&&!b.insert&&(b.latex=a.innerText,b.label=a.innerHTML),a.hasAttribute("data-command"))try{b.command=JSON.parse(a.dataset.command)}catch(E){}a.id=y.registerKeycap(b)}if(!a.innerHTML){const[E,ee]=Th(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){Io("virtual-keyboard"),Io("core"),Eh()}function wg(){x("core"),x("virtual-keyboard")}var Sg=`<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 Cg(a){a.resetKeycapRegistry(),xg();const y=document.createElement("div");y.className="ML__keyboard";const b=document.createElement("div");b.className="MLK__plate",b.innerHTML=window.MathfieldElement.createHTML(Sg+a.normalizedLayouts.map((ae,ue)=>_g(a,ae,ue)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",ue=>{var de,me;let ye=ue.target,Te="";for(;ye&&!Te;)Te=(de=ye==null?void 0:ye.getAttribute("data-command"))!=null?de:"",ye=(me=ye==null?void 0:ye.parentElement)!=null?me:null;Te&&a.executeCommand(JSON.parse(Te))});yg(y.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const ie=y.querySelectorAll(".MLK__layer");console.assert(ie.length>0,"No virtual keyboards available");for(const ae of ie)ae.addEventListener("pointerdown",ue=>ue.preventDefault());return a.currentLayer=a.latentLayer,y}function _g(a,y,b){const E=[];if(!("layers"in y))return"";for(const ee of y.layers)E.push(`<div tabindex="-1" class="MLK__layer" id="${ee.id}">`),(a.normalizedLayouts.length>1||y.displayEditToolbar)&&(E.push("<div class='MLK__toolbar' role='toolbar'>"),E.push(gg(a,b)),y.displayEditToolbar&&E.push('<div class="ML__edit-toolbar right"></div>'),E.push("</div>")),E.push(Mg(a,ee)),E.push("</div>");return E.join("")}function Mg(a,y){if(typeof y=="string")return y;let b="";if(typeof y.style=="string"?b+=`<style>${y.style}</style>`:typeof y.style=="object"&&(b+=`<style>${pg(y.style)}</style>`),y.backdrop&&(b+=`<div class='${y.backdrop}'>`),y.container&&(b+=`<div class='${y.container}'>`),y.rows){b+="<div class=MLK__rows>";for(const E of y.rows){b+="<div dir='ltr' class=MLK__row>";for(const ee of E)if(ee){const ie=a.registerKeycap(ee),[ae,ue]=Th(ee);/(^|\s)separator/.test(ue)?b+=`<div class="${ue}"`:b+=`<div tabindex="-1" id="${ie}" class="${ue}"`,ee.tooltip&&(b+=` data-tooltip="${ee.tooltip}"`),b+=`>${ae}</div>`}b+="</div>"}b+="</div>"}else y.markup&&(b+=y.markup);return y.container&&(b+="</div>"),y.backdrop&&(b+="</div>"),b}function Th(a,y={shifted:!1}){var b,E,ee,ie,ae,ue,de;let me="",ye=(b=a.class)!=null?b:"";if(y.shifted&&fc(a)&&(ye+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?me=Sd(a.shift):typeof a.shift=="object"&&(me=a.shift.label?a.shift.label:(E=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(ye=(ie=(ee=a.shift.class)!=null?ee:a.class)!=null?ie:"");else{if(me=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Te;typeof a.shift=="string"?Te=Sd(a.shift):a.shift.label?Te=a.shift.label:Te=(ue=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?ue:"",me+=`<span class="MLK__shift">${Te}</span>`}a.aside&&(me+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(ye)&&(ye+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(ye)||(ye+=" MLK__keycap"),!/\bw[0-9]+\b/.test(ye)&&a.width&&(ye+=(de={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?de:""),[me,ye||"MLK__keycap"]}var mu={"[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:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<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:"\u2260",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 E0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!mu[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&mu[a.label]&&(b=Me(Ce(Ce({},mu[a.label]),a),{label:mu[a.label].label})),"key"in a&&a.key&&mu[a.key]&&(b=Me(Ce(Ce({},mu[a.key]),a),{key:mu[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var _d;function kg(a){var y;if(a.button!==0)return;const b=Rl.singleton;if(!b)return;let E=a.target;for(;E&&!E.getAttribute("data-layer");)E=E.parentElement;if(E){b.currentLayer=(y=E.getAttribute("data-layer"))!=null?y:"",a.preventDefault();return}const ee=hc(a.target);if(!(ee!=null&&ee.id))return;const ie=b.getKeycap(ee.id);if(!ie)return;console.assert(a.type==="pointerdown");const ae=new AbortController,ue=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Bh(ae),{capture:!0,signal:ue}),ee.addEventListener("pointerleave",Bh(ae),{capture:!0,signal:ue}),ee.addEventListener("pointercancel",Bh(ae),{signal:ue}),ee.addEventListener("pointerup",Bh(ae),{signal:ue}),fc(ie)&&(ee.classList.add("is-active"),b.shiftPressCount++),ie.variants&&(_d&&clearTimeout(_d),_d=setTimeout(()=>{ee.classList.contains("is-pressed")&&(ee.classList.remove("is-pressed"),ee.classList.add("is-active"),a.target&&"releasePointerCapture"in a.target&&a.target.releasePointerCapture(a.pointerId),_0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Bh(a){return y=>{const b=hc(y.target);if(!(b!=null&&b.id))return;const E=Rl.singleton;if(!E)return;const ee=E.getKeycap(b.id);if(ee){if(y.type==="pointerenter"&&y.target===b&&y.isPrimary&&b.classList.add("is-pressed"),y.type==="pointercancel"){b.classList.remove("is-pressed"),fc(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted)),a.abort();return}if(y.type==="pointerleave"&&y.target===b){b.classList.remove("is-pressed"),fc(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){_d&&clearTimeout(_d),fc(ee)?b.classList.toggle("is-active",E.isShifted):b.classList.contains("is-pressed")&&(b.classList.remove("is-pressed"),E.isShifted&&ee.shift?typeof ee.shift=="string"?E.executeCommand(["insert",ee.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):_f(ee.shift):_f(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function _f(a){var y;let b=a.command;!b&&a.insert&&(b=["insert",a.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!b&&a.key&&(b=["typedText",a.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!b&&a.latex&&(b=["insert",a.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),b||(b=["typedText",a.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(y=Rl.singleton)==null||y.executeCommand(b)}function Eg(a){if(a.nodeType!==1)return!1;const y=a.classList;return y.contains("MLK__keycap")||y.contains("shift")||y.contains("action")||y.contains("fnbutton")||y.contains("bigfnbutton")}function hc(a){if(!a)return;let y=a;for(;y&&!Eg(y);)y=y.parentElement;return y!=null?y:void 0}function fc(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var Rl=class tm{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var y,b,E;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(b=(y=window.document)==null?void 0:y.body)!=null?b:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(ee=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(E=window.top)==null||E.addEventListener("message",this)}catch(ee){window.addEventListener("message",this)}document.body.addEventListener("focusin",ee=>{const ie=ee.target;ie!=null&&ie.isConnected&&setTimeout(()=>{const ae=L0();ae&&!ae.readOnly&&ae.mathVirtualKeyboardPolicy==="auto"&&Ye()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>k0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=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(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[ie,ae]=Th(ee,{shifted:this.isShifted});E.innerHTML=window.MathfieldElement.createHTML(ie),E.className=ae}}}show(y){var b;if(this._visible)return;const E=this.container;if(E&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const ee=this._element.getElementsByClassName("MLK__plate")[0];if(ee&&this.observer.observe(ee),E===window.document.body){const ie=E.style.paddingBottom;this.originalContainerBottomPadding=ie;const ae=ee.offsetHeight-1;E.style.paddingBottom=ie?`calc(${ie} + ${ae}px)`:`${ae}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,y!=null&&y.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var ee;return(ee=this._element)==null?void 0:ee.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(y){var b;const E=this.container;if(E&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const ee=this._element.getElementsByClassName("MLK__plate")[0];ee&&this.observer.unobserve(ee),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}),wd(),wg(),(b=this._element)==null||b.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(E.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var y,b;return(b=(y=this.element)==null?void 0:y.offsetHeight)!=null?b:0}buildAndAttachElement(){var y;console.assert(!this.element),this.element=Cg(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",b=>{b.shiftKey||((b.ctrlKey||b.button===2)&&_0(b.target),b.preventDefault(),b.stopPropagation())},{capture:!0}),(y=this.container)==null||y.appendChild(this.element)}handleEvent(y){if(Cf(y)){if(!ld(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");y.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:y.data.action!=="update-setting"&&y.data.action!=="proxy-created"&&y.data.action!=="execute-command"&&(console.assert(y.source!==void 0),this.connectedMathfieldWindow=y.source),this.handleMessage(y.data,y.source)}if(this._element)switch(y.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":y.button!==2&&y.preventDefault();break;case"keydown":{y.key==="Shift"&&!y.repeat&&(this.shiftPressCount=1);break}case"keyup":{(y.key==="Shift"||!y.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(y,b){const{action:E}=y;if(E==="execute-command"){const{command:ee}=y,ie=dc(ee);if(window.top!==void 0&&ie!=="virtual-keyboard")return;this.executeCommand(ee);return}if((E==="connect"||E==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b),E!=="disconnect"&&window===window.top){if(E==="show"){typeof y.animate!="undefined"?this.show({animate:y.animate}):this.show();return}if(E==="hide"){typeof y.animate!="undefined"?this.hide({animate:y.animate}):this.hide();return}if(E==="update-setting"){y.alphabeticLayout&&(this.alphabeticLayout=y.alphabeticLayout),y.layouts&&(this.layouts=y.layouts),y.editToolbar&&(this.editToolbar=y.editToolbar);return}if(E==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b);return}}}sendMessage(y,b,E){if(E||(E=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||E===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:Ce({type:Dh,action:y},b)}));return}if(E)E.postMessage(Ce({type:Dh,action:y},b),{targetOrigin:this.targetOrigin});else if(b.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:b.command})),y==="execute-command"&&Array.isArray(b.command)&&b.command[0]==="insert"){const ee=b.command[1].split("");for(const ie of ee)this.dispatchEvent(new KeyboardEvent("keydown",{key:ie,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:ie,bubbles:!0}))}}stateWillChange(y){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:y},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(y){const b=this._element;if(!b)return;b.classList.toggle("is-math-mode",y.mode==="math"),b.classList.toggle("is-text-mode",y.mode==="text"),b.classList.toggle("can-undo",y.canUndo),b.classList.toggle("can-redo",y.canRedo),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-paste",!0);const E=b.querySelectorAll(".ML__edit-toolbar");if(E)for(const ee of E)ee.innerHTML=vg(this,y)}update(y){this._style=y.style,this.updateToolbar(y)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(y){let b,E=[],ee=dc(y);return Ie(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=dc(y)),E=y.slice(1)):b=y,b=b.replace(/-\w/g,ie=>ie[1].toUpperCase()),ee==="virtual-keyboard"?zs[b].fn(void 0,...E):(this.sendMessage("execute-command",{command:y}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function L0(){var a,y;let b=Sh(),E=null;for(;b;){if("host"in b&&((y=(a=b.host)==null?void 0:a.tagName)==null?void 0:y.toLowerCase())==="math-field"){E=b.host;break}b=b.parentNode}return E}if(mt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>cg.singleton,configurable:!0});function Ph(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Ie(E))y.scriptDepth=[E[0],E[1]];else if(typeof E=="number")y.scriptDepth=[E,E];else if(typeof E=="string"){const[ie,ae]=E.split(",").map(ue=>parseInt(ue.trim()));y.scriptDepth=[ie,ae]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let ee=a.mathVirtualKeyboardPolicy.toLowerCase();if(ee==="sandboxed"){if(window!==window.top){const ie=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ie})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?Je.locale.startsWith("fr")?y.letterShapeStyle="french":y.letterShapeStyle="tex":y.letterShapeStyle=a.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(a.defaultMode)?y.defaultMode=a.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),y.defaultMode="math");break;case"macros":y.macros=vt(a.macros);break;default:Ie(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Ce({},a[b]):y[b]=a[b]}return y}function gu(a,y){let b;typeof y=="string"?b=[y]:y===void 0?b=Object.keys(a):b=y;const E={};for(const ee of b)a[ee]===null?E[ee]=null:Ie(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Ce({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Ih(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:It,backgroundColorMap:at,letterShapeStyle:Je.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:a=>["\\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(a),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:lf,inlineShortcuts:dh,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sf,value:""}}function D0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function Nl(a,y){!a||!y||(Ie(a)?a.forEach(b=>Nl(b,y)):typeof a=="object"&&!a.style.color&&!a.style.backgroundColor&&!a.style.fontFamily&&!a.style.fontShape&&!a.style.fontSeries&&!a.style.fontSize&&!a.style.variant&&!a.style.variantStyle&&(a.applyStyle(y),Nl(a.body,y),Nl(a.above,y),Nl(a.below,y),Nl(a.subscript,y),Nl(a.superscript,y)))}function Mf(a,y,b,E){function ee(ae,ue){for(const de of ie)if(de.style[ae]!==ue)return!1;return!0}if(y=a.normalizeRange(y),y[0]===y[1])return!1;const ie=a.getAtoms(y,{includeChildren:!0});E.operation==="toggle"&&(b.color&&ee("color",b.color)&&(b.color="none",delete b.verbatimColor),b.backgroundColor&&ee("backgroundColor",b.backgroundColor)&&(b.backgroundColor="none",delete b.verbatimBackgroundColor),b.fontFamily&&ee("fontFamily",b.fontFamily)&&(b.fontFamily="none"),b.fontSeries&&ee("fontSeries",b.fontSeries)&&(b.fontSeries="auto"),b.fontShape&&ee("fontShape",b.fontShape)&&(b.fontShape="auto"),b.fontSize&&ee("fontSize",b.fontSize)&&(b.fontSize=Ds),b.variant&&ee("variant",b.variant)&&(b.variant="normal"),b.variantStyle&&ee("variantStyle",b.variantStyle)&&(b.variantStyle=""));for(const ae of ie)ae.applyStyle(b);return!0}function Lg(a,y){const b=a.at(a.position);if(b.type==="composition")b.value=y;else{const{caret:E}=b;b.caret=void 0;const ee=new fl(y,{mode:b.mode});ee.caret=E,b.parent.addChildAfter(ee,b),a.position+=1}}function Dg(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}pn(["math","displaymath"],Jo),pn("center",Jo),pt("displaylines","",{parse:a=>{const y=[];let b=[];a.beginContext({tabular:!0});do{if(a.end()||a.match("<}>"))break;a.matchColumnSeparator()||a.matchRowSeparator()?(y.push([b]),b=[]):b.push(...a.scan(E=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(E)))}while(!0);return a.endContext(),y.push([b]),y},createAtom:a=>new rr("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),bn("array","{columns:colspec}",(a,y,b,E)=>new rr(a,kf(y),b,{columns:E[0],mathstyleName:"textstyle"})),bn(["equation","equation*","subequations"],"",(a,y,b)=>new rr(a,kf(y),b,{columns:[{align:"c"}]})),bn(["multline","multline*"],"",Jo),bn(["align","align*","aligned","eqnarray"],"",Jo),bn("split","",Jo),bn(["gather","gathered"],"",Jo),bn(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Jo),bn(["smallmatrix","smallmatrix*"],"[columns:colspec]",Jo),bn(["cases","dcases","rcases"],"",Jo);function Ag(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function kf(a,y=1){return Ag(a)?Array(y).fill([[new gn({type:"first"}),new zi]]):a.map(b=>b.length===0?[[new gn({type:"first"})]]:b.map(E=>E.length===0?[new gn({type:"first"})]:(E[0].type!=="first"&&E.unshift(new gn({type:"first"})),E)))}function Jo(a,y=[[[]]],b=[],E=[]){switch(y=kf(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new rr(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new rr(a,y,b,{mathstyleName:"textstyle"});case"center":return new rr(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new rr(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new rr(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new rr(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:vu(E[0])});case"bmatrix":case"bmatrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:vu(E[0])});case"Bmatrix":case"Bmatrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:vu(E[0])});case"vmatrix":case"vmatrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:vu(E[0])});case"Vmatrix":case"Vmatrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:vu(E[0])});case"matrix":case"matrix*":return new rr(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:vu(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new rr(a,y,b,{mathstyleName:"scriptstyle",columns:vu(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new rr(a,y,b,{mathstyleName:a==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new rr(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new rr(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const ue of y)ee=Math.max(ee,ue.length);const ie=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let ae=2;for(;ae<ee;)ie.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),ae+=2;return ie.push({gap:0}),new rr(a,y,b,{arraycolsep:0,columns:ie,minColumns:2})}}return new rr(a,y,b,{mathstyleName:"textstyle"})}function vu(a){return a!=null?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Tg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof rr);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof rr)){const E=a.at(a.position);if(b=E,!b.parent.parent){let ee=a.extractAtoms([a.position,a.lastOffset]),ie=a.extractAtoms([0,a.position]);ie.length===0&&(ie=Nh()),ee.length===0&&(ee=Nh());let ae;return y.endsWith("column")?(ae=Jo("split",[[ie,ee]]),a.root=ae,yu(ae,0,0)?bu(a,ae,0,0):yu(ae,0,1)?bu(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Jo("lines",[[ie],[ee]]),a.root=ae,yu(ae,0,0)?bu(a,ae,0,0):yu(ae,1,0)?bu(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Lr){const ee=b.parent;let ie=a.extractAtoms([a.position,a.offsetOf(ee.lastChild)]),ae=a.extractAtoms([a.offsetOf(ee.firstChild),a.position]);ae.length===0&&(ae=Nh()),ie.length===0&&(ie=Nh());let ue="pmatrix";const de=ee.leftDelim,me=ee.rightDelim;de==="("&&(me===")"||me==="?")?ue="pmatrix":(de==="["||de==="\\lbrack")&&(me==="]"||me==="\\rbrack"||me==="?")?ue="bmatrix":de==="\\vert"&&me==="\\vert"?ue="vmatrix":de==="\\Vert"&&me==="\\Vert"?ue="Vmatrix":(de==="{"||de==="\\lbrace")&&(me==="."||me==="?")&&(ue="cases");const ye=Jo(ue,y.endsWith("column")?[[ae,ie]]:[[ae],[ie]]);return ee.parent.addChildBefore(ye,ee),ee.parent.removeChild(ee),yu(ye,0,0)?bu(a,ye,0,0):y.endsWith("column")?yu(ye,0,1)?bu(a,ye,0,1):a.position=a.offsetOf(b):yu(ye,1,0)?bu(a,ye,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof rr?[b.parent,b.parentBranch]:[void 0,[0,0]]}function yu(a,y,b){const E=a.getCell(y,b);return!E||E.length!==2?!1:E[1].type==="placeholder"}function Bg(a,y,b,E){const ee=y.getCell(b,E);return ee?[a.offsetOf(ee[0]),a.offsetOf(ee[ee.length-1])]:-1}function bu(a,y,b,E){const ee=Bg(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Oh(a,y,b,E,ee){const ie=y.getCell(b,E);ie&&a.setPositionHandlingPlaceholder(a.offsetOf(ie[ee==="start"?0:ie.length-1]))}function Rh(a,y){const[b,[E,ee]]=Tg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Oh(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Oh(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Oh(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Oh(a,b,E,ee,"start");break}}function A0(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Ig(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function B0(a,y){if(!a.contentWillChange({}))return!1;a.mathfield.snapshot();let b=".",E=".";switch(y){case"pmatrix":case"pmatrix*":b="(",E=")";break;case"bmatrix":case"bmatrix*":b="[",E="]";break;case"Bmatrix":case"Bmatrix*":b="\\lbrace",E="\\rbrace";break;case"vmatrix":case"vmatrix*":b="\\vert",E="\\vert";break;case"Vmatrix":case"Vmatrix*":b="\\Vert",E="\\Vert";break;case"matrix":case"matrix*":b=".",E=".";break;case"cases":case"dcases":b="\\lbrace";break;case"rcases":E="\\rbrace";break}const ee=a.at(a.position),ie=ee.type==="array"?ee:a.parentEnvironment;return ie.environmentName=y,ie.leftDelim=b,ie.rightDelim=E,a.contentDidChange({}),!0}function P0(a,y){let b=a.at(a.position);for(;b&&!(Array.isArray(b.parentBranch)&&b.parent instanceof rr);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof rr){const E=b.parent,ee=b.parentBranch;let ie;switch(y){case"row":if(E.rowCount>1){E.removeRow(ee[0]);const ae=E.getCell(Math.max(0,ee[0]-1),ee[1]);ie=a.offsetOf(ae[ae.length-1])}break;case"column":if(E.colCount>E.minColumns){E.removeColumn(ee[1]);const ae=E.getCell(ee[0],Math.max(0,ee[1]-1));ie=a.offsetOf(ae[ae.length-1])}break}ie&&a.setPositionHandlingPlaceholder(ie)}}function Og(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Oo({addRowAfter:A0,addColumnAfter:T0,addRowBefore:Pg,addColumnBefore:Ig,removeRow:Og,removeColumn:Rg,setEnvironment:B0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Nh(){return[new zi]}var I0=class nm{constructor(y){this.recording=!1,this.model=y,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(y){y&&this.index>=0&&(this.stack[this.index].selection=y),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(y){return this.recording?(y&&y===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>nm.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=y!=null?y:"",!0):!1}};I0.maximumDepth=1e3;var Ng=I0;function Ef(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(ve.test(a.at(y).value)){let ie=y,ae;do ae=a.at(ie).mode==="text"&&ve.test(a.at(ie).value),ie+=E;while(a.at(ie)&&ae);ee=a.at(ie)?ie-2*E:ie-E}else if(/\s/.test(a.at(y).value)){let ie=y;for(;a.at(ie)&&a.at(ie).mode==="text"&&/\s/.test(a.at(ie).value);)ie+=E;if(!a.at(ie))ee=ie-E;else{let ae=!0;do ae=a.at(ie).mode==="text"&&!/\s/.test(a.at(ie).value),ie+=E;while(a.at(ie)&&ae);ee=a.at(ie)?ie-2*E:ie-E}}else{let ie=y;for(;a.at(ie)&&a.at(ie).mode==="text"&&!/\s/.test(a.at(ie).value);)ie+=E;ee=a.at(ie)?ie:ie-E;let ae=!0;for(;a.at(ie)&&ae;)ae=a.at(ie).mode==="text"&&/\s/.test(a.at(ie).value),ae&&(ee=ie),ie+=E;ee=a.at(ie)?ie-2*E:ie-E}return ee-(E>0?0:1)}function pc(a,y,b){var E,ee,ie,ae,ue,de,me;const ye=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Te=a.at(a.position);if(y==="forward"&&(Te.type==="subsup"?(Te=Te.rightSibling,Te||(Te=a.at(a.position+1))):Te=a.at(a.position+1)),!Te)return a.announce("plonk"),!1;let ze=a.offsetOf(Te);if(Te instanceof vs)ze=Ef(a,ze,y);else if(Te instanceof Ya)if(Te.isSuggestion)for(console.assert(y==="forward");Te&&Te instanceof Ya;)Te.isSuggestion=!1,ze=a.offsetOf(Te),Te=Te.rightSibling;else if(y==="forward"){if(Te=Te.rightSibling,!Te||!(Te instanceof Ya))return a.announce("plonk"),!1;for(;Te&&Te instanceof Ya&&/[a-zA-Z\*]/.test(Te.value);)ze=a.offsetOf(Te),Te=Te.rightSibling}else{if(Te=Te.leftSibling,!Te||!(Te instanceof Ya))return a.announce("plonk"),!1;for(;Te&&Te instanceof Ya&&/[a-zA-Z\*]/.test(Te.value);)ze=a.offsetOf(Te),Te=Te.leftSibling}else if(y==="forward"&&Te.type==="mopen"){let nt=0;do Te.type==="mopen"?nt+=1:Te.type==="mclose"&&(nt-=1),Te=Te.rightSibling;while(!Te.isLastSibling&&nt!==0);ze=a.offsetOf(Te.leftSibling)}else if(y==="backward"&&Te.type==="mclose"){let nt=0;do Te.type==="mopen"?nt+=1:Te.type==="mclose"&&(nt-=1),Te=Te.leftSibling;while(!Te.isFirstSibling&&nt!==0);ze=a.offsetOf(Te)}else if(y==="backward")if(Te.type==="first")for(;ze>0&&Te.type==="first";)ze-=1,Te=a.at(ze);else{const nt=Te.type;Te.type==="subsup"&&(ze=a.offsetOf(a.at(ze).leftSibling)),ze-=1;let ut=(ee=a.at(ze))==null?void 0:ee.type;for(;ze>=0&&ut===nt;)((ie=a.at(ze))==null?void 0:ie.type)==="subsup"?ze=a.offsetOf(a.at(ze).leftSibling):ze-=1,ut=a.at(ze).type}else{const{type:nt}=Te;let ut=(ae=a.at(ze))==null?void 0:ae.type;const{lastOffset:nn}=a;for(;ze<=nn&&(ut===nt||ut==="subsup");){for(;((ue=a.at(ze).rightSibling)==null?void 0:ue.type)==="subsup";)ze=a.offsetOf(a.at(ze).rightSibling);ze+=1,ut=(de=a.at(ze))==null?void 0:de.type}ze-=1}if((me=b==null?void 0:b.extend)!=null&&me){if(!a.setSelection(a.anchor,ze))return a.announce("plonk"),!1}else{if(ze===a.position)return a.announce("plonk"),!1;a.position=ze}return a.announce("move",ye),a.mathfield.stopCoalescingUndo(),!0}function Ks(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[ue,de]=g0(a);ue!==void 0&&de!==void 0&&a.deleteAtoms([ue,de])}if(y==="upward")return $g(a,b);if(y==="downward")return zg(a,b);if(b.extend){let ue=Fh(a,a.position,y);ue<0&&(ue=0),ue>a.lastOffset&&(ue=a.lastOffset);const de=a.setSelection(a.anchor,ue);return a.mathfield.stopCoalescingUndo(),de}if(a.selectionIsPlaceholder){a.collapseSelection(y);const ue=Ks(a,y);return a.mathfield.stopCoalescingUndo(),ue}let ie=a.position;const ae=ie;if(a.collapseSelection(y)?(ie=a.position,O0(a,ie)||(ie=Fh(a,ie,y))):ie=Fh(a,ie,y),ie<0||ie>a.lastOffset){let ue=!0;return a.silenceNotifications||(ue=(ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0),ue&&a.announce("plonk"),ue}return a.setPositionHandlingPlaceholder(ie),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function Fh(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:Fh(a,y,b)}function O0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function Fg(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const ie=ic(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-ie);if(ae<=E)E=ae;else break}return y[ee-1]}function $h(a,y,b,E,ee){const ie=a.mathfield.hasEditablePrompts,ae=ie?b.filter(me=>me.type==="prompt"&&!me.captureSelection):b,ue=ic(a.mathfield.getHTMLElement(y)).right,de=a.offsetOf(Fg(a.mathfield,ae,ue))-(ie?1:0);if(E){const[me,ye]=a.selection.ranges[0];let Te;de<(ee==="up"?me:ye)?Te={ranges:[[de,ye]],direction:"backward"}:Te={ranges:[[me,de]],direction:"forward"},a.setSelection(Te)}else a.setPositionHandlingPlaceholder(de);a.announce(`move ${ee}`)}function $g(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const ie=()=>{var de,me;let ye=!0;return a.silenceNotifications||(ye=(me=(de=a.mathfield.host)==null?void 0:de.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?me:!0),a.announce(ye?"plonk":"line"),ye},ae=a.at(a.position);let ue=ae;for(;ue&&ue.parentBranch!=="below"&&!(Array.isArray(ue.parentBranch)&&ue.parent instanceof rr);)ue=ue.parent;if(Array.isArray(ue==null?void 0:ue.parentBranch)&&ue.parent instanceof rr){const de=ue.parent;if(ue.parentBranch[0]<1)return ie();const me=ue.parentBranch[0]-1,ye=de.array[me][ue.parentBranch[1]];if(!ye.some(ze=>ze.type==="prompt"&&!ze.captureSelection)&&a.mathfield.hasEditablePrompts)return ie();$h(a,ae,ye,ee,"up")}else if(ue){const de=(E=ue.parent.branch("above"))!=null?E:ue.parent.createBranch("above");if(!de.some(ye=>ye.type==="prompt"&&ye.placeholderId)&&a.mathfield.hasEditablePrompts)return ie();$h(a,ae,de,ee,"up")}else return ie();return a.mathfield.stopCoalescingUndo(),!0}function zg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("forward");const ie=()=>{var de,me;let ye=!0;return a.silenceNotifications||(ye=(me=(de=a.mathfield.host)==null?void 0:de.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?me:!0),a.announce(ye?"plonk":"line"),ye},ae=a.at(a.position);let ue=ae;for(;ue&&ue.parentBranch!=="above"&&!(Array.isArray(ue.parentBranch)&&ue.parent instanceof rr);)ue=ue.parent;if(Array.isArray(ue==null?void 0:ue.parentBranch)&&ue.parent instanceof rr){const de=ue.parent;if(ue.parentBranch[0]+1>de.array.length-1)return ie();const me=ue.parentBranch[0]+1,ye=de.array[me][ue.parentBranch[1]];if(!ye.some(ze=>ze.type==="prompt"&&!ze.captureSelection)&&a.mathfield.hasEditablePrompts)return ie();$h(a,ae,ye,ee,"down")}else if(ue){const de=(E=ue.parent.branch("below"))!=null?E:ue.parent.createBranch("below");if(!de.some(ye=>ye.type==="prompt")&&a.mathfield.hasEditablePrompts)return ie();$h(a,ae,de,ee,"down")}else return ie();return!0}function R0(a){const y=a.position,b=a.at(y).parent;return b!=null&&b.parent?(a.position=a.offsetOf(b),a.mathfield.stopCoalescingUndo(),a.announce("move",y),!0):(a.announce("plonk"),!1)}function Kg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!1):E=!0,b=b.parent;return E?y:0}function Hg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!0):E=!1,b=b.parent;return E?y:0}function N0(a){var y;if(a.collapseSelection(),Kg(a)>=a.mathfield.options.scriptDepth[1])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=b.rightSibling)==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new qo({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function F0(a){var y;if(a.collapseSelection(),Hg(a)>=a.mathfield.options.scriptDepth[0])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=a.at(a.position+1))==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new qo({style:a.at(a.position).computedStyle}),b),b=a.at(a.position+1)),b.createBranch("subscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.subscript[0]))),!0}function Wg(){function a(de){const me=[],ye=[];return[...de.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((ze,nt)=>{const ut=E(ze);ut===0?me.push(ze):ye.push({documentOrder:nt,tabIndex:ut,node:ze})}),ye.sort((ze,nt)=>ze.tabIndex===nt.tabIndex?ze.documentOrder-nt.documentOrder:ze.tabIndex-nt.tabIndex).map(ze=>ze.node).concat(me)}function y(de){return!(!b(de)||ee(de)||E(de)<0)}function b(de){return!(de.disabled||de.type==="hidden"&&de.tagName.toUpperCase()==="INPUT"||ue(de))}function E(de){var me;const ye=Number.parseInt((me=de.getAttribute("tabindex"))!=null?me:"NaN",10);return Number.isNaN(ye)?de.contentEditable==="true"||(de.nodeName==="AUDIO"||de.nodeName==="VIDEO")&&de.getAttribute("tabindex")===null?0:de.tabIndex:ye}function ee(de){return de.tagName.toUpperCase()==="INPUT"&&de.type==="radio"&&!ae(de)}function ie(de,me){for(const ye of de)if(ye.checked&&ye.form===me)return ye;return null}function ae(de){var me;if(!de.name)return!0;const Te=((me=de.form)!=null?me:de.ownerDocument).querySelectorAll('input[type="radio"][name="'+de.name+'"]'),ze=ie(Te,de.form);return!ze||ze===de}function ue(de){if(!mt()||de===document.activeElement||de.contains(document.activeElement))return!1;if(getComputedStyle(de).visibility==="hidden")return!0;const me=de.getBoundingClientRect();if(me.width===0||me.height===0)return!0;for(;de;){if(getComputedStyle(de).display==="none")return!0;de=de.parentElement}return!1}return mt()?a(document.body):[]}function yo(a,y,b="forward"){const E=a.position;if(Array.isArray(y)){const ee=a.offsetOf(y[0]),ie=a.offsetOf(y[y.length-1]);return b==="forward"?a.setSelection(ee,ie):a.setSelection(ie,ee),a.announce("move",E),a.mathfield.stopCoalescingUndo(),!0}return b==="forward"?yo(a,[y.leftSibling,y]):yo(a,[y,y.leftSibling])}function xs(a,y){const b=a.position;if(typeof y=="number"&&(y=a.at(y)),y.type==="prompt")a.setSelection(a.offsetOf(y.firstChild),a.offsetOf(y.lastChild));else{const E=a.offsetOf(y);y.type==="placeholder"?a.setSelection(E-1,E):a.position=E}return a.announce("move",b),a.mathfield.stopCoalescingUndo(),!0}function zh(a,y,b=!0){var E,ee;const ie=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Ks(a,y);let ae;const ue=a.at(a.anchor).parentPrompt;ue?y==="forward"?ae=a.offsetOf(ue)+1:ae=a.offsetOf(ue.leftSibling):ae=Math.max(a.position+ie,0);const de=Lf(a,ae,y);if(!de||y==="forward"&&a.offsetOf(de)<ae||y==="backward"&&a.offsetOf(de)>ae){if(!b||!((ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))==null||ee))return a.announce("plonk"),!1;const ye=Wg();if(!document.activeElement||ye.length<=1)return a.announce("plonk"),!1;let Te=ye.indexOf(document.activeElement)+ie;return Te<0&&(Te=ye.length-1),Te>=ye.length&&(Te=0),ye[Te].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,de),!0}function Lf(a,y=0,b="forward"){return a.findAtom(E=>E.type==="placeholder"||E.type==="prompt"||!a.mathfield.readOnly&&E.treeDepth>2&&E.isFirstSibling&&E.isLastSibling,y,b)}Oo({moveToOpposite:a=>{const y={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},b=a.at(a.position),{parent:E}=b;if(!E)return a.announce("plonk"),!1;const ee=b.parentBranch;let ie;if(typeof ee=="string"&&(ie=y[ee]),!ie){const ue=b.subsupPlacement?F0(a):N0(a);return a.mathfield.stopCoalescingUndo(),ue}E.branch(ie)||E.createBranch(ie);const ae=a.setSelection(a.getBranchRange(a.offsetOf(E),ie));return a.mathfield.stopCoalescingUndo(),ae},moveBeforeParent:a=>{const{parent:y}=a.at(a.position);return y?(a.position=a.offsetOf(y),a.mathfield.stopCoalescingUndo(),!0):(a.announce("plonk"),!1)},moveAfterParent:a=>R0(a),moveToNextChar:a=>Ks(a,"forward"),moveToPreviousChar:a=>Ks(a,"backward"),moveUp:a=>Ks(a,"upward"),moveDown:a=>Ks(a,"downward"),moveToNextWord:a=>pc(a,"forward"),moveToPreviousWord:a=>pc(a,"backward"),moveToGroupStart:a=>{const y=a.offsetOf(a.at(a.position).firstSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:a=>{const y=a.offsetOf(a.at(a.position).lastSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:a=>{var y,b,E,ee;if(a.position===a.lastOffset&&a.anchor===a.lastOffset)return zh(a,"forward");const ie=a.at(a.position);if(ie.mode==="text"){if(a.selectionIsCollapsed){let ze=ie;for(;ze&&ze.mode==="text";)ze=ze.leftSibling;let nt=ie;for(;((y=nt.rightSibling)==null?void 0:y.mode)==="text";)nt=nt.rightSibling;if(ze&&nt)return yo(a,[ze,nt])}if(ie.rightSibling.mode==="text"){let ze=ie;for(;ze&&ze.mode==="text";)ze=ze.rightSibling;return ze?(xs(a,(b=ze.leftSibling)!=null?b:ze),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const ue=a.at(a.anchor).parentPrompt,de=ue?a.offsetOf(ue)+1:Math.max(a.position+1,0),me=Lf(a,de,"forward");if(me)return xs(a,me);const ye=$0(a,ie,ze=>ze.type==="leftright"||ze.type==="text","forward");if(ye){if(ye.mode==="text"){let ze=ye;for(;ze&&ze.mode==="text";)ze=ze.rightSibling;return yo(a,[(E=ye.leftSibling)!=null?E:ye,(ee=ze.leftSibling)!=null?ee:ze])}return yo(a,ye)}const Te=ie.parent;if(Te){if(Te.type==="leftright"||Te.type==="surd")return yo(a,Te);if(ie.parentBranch==="superscript"&&Te.subscript)return yo(a,Te.subscript);if(ie.parentBranch==="above"&&Te.below)return yo(a,Te.below);if(ie.parentBranch==="superscript"||ie.parentBranch==="subscript")return xs(a,Te);if(ie.parentBranch==="above"||ie.parentBranch==="below")return yo(a,Te)}return xs(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return zh(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let ue=b;for(;ue&&ue.mode==="text";)ue=ue.leftSibling;let de=b;for(;((y=de.rightSibling)==null?void 0:y.mode)==="text";)de=de.rightSibling;if(ue&&de)return yo(a,[ue,de])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?xs(a,b):xs(a,0)}const ee=a.at(a.anchor).parentPrompt,ie=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lf(a,ie,"backward");if(ae)return xs(a,ae);if(E==="math"){const ue=$0(a,b,me=>me.type==="leftright"||me.type==="text","backward");if(ue){if(ue.mode==="text"){let me=ue;for(;me&&me.mode==="text";)me=me.leftSibling;return yo(a,[ue,me])}return yo(a,ue)}const de=b.parent;if(de){if(de.type==="leftright"||de.type==="surd")return yo(a,de);if(b.parentBranch==="subscript"&&de.superscript)return yo(a,de.superscript);if(b.parentBranch==="below"&&de.above)return yo(a,de.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,de);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,de)}return xs(a,0)}return!1},moveToMathfieldStart:a=>a.selectionIsCollapsed&&a.position===0?(a.announce("plonk"),!1):(a.position=0,a.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:a=>a.selectionIsCollapsed&&a.position===a.lastOffset?(a.announce("plonk"),!1):(a.position=a.lastOffset,a.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:N0,moveToSubscript:F0},{target:"model",changeSelection:!0}),Oo({moveToNextPlaceholder:a=>zh(a,"forward"),moveToPreviousPlaceholder:a=>zh(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function $0(a,y,b,E){if(E==="forward"){let ie=y.rightSibling;for(;ie&&!b(ie);)ie=ie.rightSibling;return ie}let ee=y.leftSibling;for(;ee&&!b(ee);)ee=ee.leftSibling;return ee}function Kh(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1,ie="";for(;!ee;){const ae=a.at(E);ee=y===0||ae===void 0||ae.type==="first"||ae.mode!=="math"||!(ae.type&&/mord|mpunct|operator/.test(ae.type)||ae.type==="mop"&&/[a-zA-Z ]+/.test(ae.value))||!ae.hasEmptyBranch("superscript")||!ae.hasEmptyBranch("subscript")||typeof b=="function"&&!b(ae),ee||(ae.mode="text",ae.command=ae.value,ae.verbatimLatex=void 0,ie+=ae.value),E-=1,y-=1}a.contentDidChange({data:ie,inputType:"insertText"})}function xu(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1;const ie=[];for(;!ee;){const ae=a.at(E);ee=y===0||!ae||ae.type==="first"||ae.isFirstSibling||ae.mode!=="text"||ae.value===" "||typeof b=="function"&&!b(ae),ee||(ie.push(gn.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Df(a),a.contentDidChange({data:cr(ie),inputType:"insertText"})}function Df(a){var y;let b=a.position-1;for(;b>=0&&((y=a.at(b))==null?void 0:y.mode)==="math";)b-=1;if(!(b<0)&&a.at(b).mode==="text"&&a.at(b).value===" "&&a.at(b-1).mode==="math"){a.at(b-1).parent.removeChild(a.at(b-1));const E=a.silenceNotifications;a.silenceNotifications=!0,a.position-=1,a.silenceNotifications=E,a.contentDidChange({inputType:"deleteContent"})}}function Zg(a){let y="",b=a.position,E=!1;for(;!E;){const ee=a.at(b);E=!(ee&&(ee.mode==="text"||ee.mode==="math"&&ee.type&&/mord|mpunct/.test(ee.type))),E||(y=ee.value+y),b-=1}return y}function Vg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!wh(b))return!1;const ee=lc(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const ie=Zg(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(ie)&&xu(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:ue}=E.at(E.position);if(ae&&ue instanceof Lr&&ue.leftDelim===ae)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(ie))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(ee))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(ie))return xu(E,1),!1;if(/\D\.[^\d\s]$/.test(ie)){xu(E,1);const de=E.at(E.position);return de.value="\u22C5",de.style.variant="normal",de.command="\\cdot",de.verbatimLatex=void 0,E.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(ie)||/\.\d$/.test(ie)||/\([\d+\-.]$/.test(ie))return xu(E,1),!0;if(/\([a-z][,;]$/.test(ie))return xu(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Df(E),!0}else{if(y==="[Space]")return Kh(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(ie)&&!/(dxd|abc|xyz|uvw)$/.test(ie))return Kh(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(ie))return Kh(E,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(ie)&&!/(αβγ)$/.test(ie))return Kh(E,void 0,ae=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(ae.value)),!0;if(ee==="?"||ee==="."&&!/[\d-+]\.$/.test(ie))return!0}return!1}function jg(a,y){if(!a.isSelectionEditable||!a.keystrokeCaptionVisible)return;const b=z0(),E=a.element.getBoundingClientRect();b.style.left=`${E.left}px`,b.style.top=`${E.top-64}px`,b.innerHTML=window.MathfieldElement.createHTML("<span>"+(vf(y)||y)+"</span>"+b.innerHTML),b.style.visibility="visible",setTimeout(()=>{b.childNodes.length>0&&b.childNodes[b.childNodes.length-1].remove(),b.childNodes.length===0&&(b.style.visibility="hidden")},3e3)}function Gg(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=_h("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(Io("keystroke-caption"),Io("core"),_h("mathlive-keystroke-caption-panel"))}function Ug(){document.getElementById("mathlive-keystroke-caption-panel")&&(bf("mathlive-keystroke-caption-panel"),x("core"),x("keystroke-caption"))}function K0(a,y){var b,E,ee;const{model:ie}=a,ae=p0(y);if(y.isTrusted){Nm(y);const nt=vd();a.keyboardLayout!==nt.id&&(a.keyboardLayout=nt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,jg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let ue,de="",me;const ye=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(ie.mode==="math")if(ae==="[Backspace]")ye.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const nt=lc(y),ut=[...(E=(b=ye[ye.length-1])==null?void 0:b.keystrokes)!=null?E:[],nt];ye.push({state:ie.getState(),keystrokes:ut,leftSiblings:Xg(a)});let nn=0,Nn="";for(;!ue&&nn<ut.length;)me=ye.length-(ut.length-nn),Nn=ut.slice(nn).join(""),ue=td(ye[me].leftSiblings,Nn,a.options.inlineShortcuts),!ue&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(Nn)&&(ue=a.options.onInlineShortcut(a,Nn)),nn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(ue?a.switchMode("math"):Vg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[ie.mode]),de=""))}if(!ue){if(de||(de=Zm(a.keybindings,ie.mode,y)),!de&&(ae==="[Enter]"||ae==="[Return]")){let nt=!1;return ie.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(nt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),nt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),ie.contentDidChange({inputType:"insertLineBreak"})),nt}if((!de||ae==="[Space]")&&ie.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return er.insert(ie,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),de="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const nt=ie.at(ie.position+1),ut=ie.at(ie.position-1);if((nt==null?void 0:nt.mode)==="text"||(ut==null?void 0:ut.mode)==="text")return er.insert(ie," ",{mode:"text"}),a.snapshot("insert-space"),a.dirty=!0,a.scrollIntoView(),!1}(ee=ie.at(ie.position))!=null&&ee.isDigit()&&window.MathfieldElement.decimalSeparator===","&&lc(y)===","&&(de="insertDecimalSeparator")}}if(!ue&&!de){if(ie.mathfield.smartFence){if(Tf(ie,lc(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:nt}=ie.at(ie.position);if(nt instanceof Lr&&nt.rightDelim==="?"&&ie.at(ie.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),nt.isDirty=!0,nt.rightDelim=ae,ie.position+=1,ie.selectionDidChange(),ie.contentDidChange({data:lc(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!ie.selectionIsCollapsed){const ut=lc(y);if(ut==="("||ut==="{"||ut==="["){const nn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[ut],Nn={"(":")","{":"\\rbrace","[":"\\rbrack"}[ut],[Yt,Sn]=Ha(ie.selection);return a.snapshot(),ie.position=Sn,er.insert(ie,Nn,{format:"latex"}),ie.position=Yt,er.insert(ie,nn,{format:"latex"}),ie.setSelection(Yt+1,Sn+1),ie.contentDidChange({data:ut,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Te=ie.at(Math.max(ie.position,ie.anchor)),{parent:ze}=Te;if(de==="moveAfterParent"&&(ze==null?void 0:ze.type)==="leftright"&&Te.isLastSibling&&a.options.smartFence&&Tf(ie,".",a.defaultStyle)&&(de="",fa(a)),a.keyboardDelegate.cancelComposition(),de)a.executeCommand(de);else if(ue){const nt=a.effectiveStyle;ie.setState(ye[me].state);const ut=ye[ye.length-1].keystrokes;for(const nn of ut)er.insert(ie,nn,{silenceNotifications:!0,style:nt});a.snapshot("insert-shortcut"),ie.setState(ye[me].state),ie.deferNotifications({content:!0,selection:!0,data:ue,type:"insertText"},()=>(er.insert(ie,ue,{format:"latex",style:nt}),Df(a.model),ue.endsWith(" ")&&(a.switchMode("text"),er.insert(ie," ",{style:nt,mode:"text"})),a.snapshot(),ie.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,ie.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Af(a,y,b){const{model:E}=a;if(!a.isSelectionEditable){E.announce("plonk");return}b!=null||(b={}),b.focus&&a.focus(),b.feedback&&window.MathfieldElement.playSound("keypress"),typeof b.mode=="string"&&(a.switchMode(b.mode),a.snapshot());let ee=ih(y);const ie=window.mathVirtualKeyboard;if(ie!=null&&ie.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(de=>de.toUpperCase())),b.simulateKeystroke){let de=!0;for(const me of ee)K0(a,new KeyboardEvent("keypress",{key:me}))&&(de=!1);if(de)return}const ae=E.at(E.position),ue=Ce(Ce({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(Ha(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Ch(a);for(const de of ee)er.insert(E,de);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const de of ee)er.insert(E,de,{style:ue});a.snapshot("insert-text")}else if(E.mode==="math")for(const de of ee)qg(a,de,ue,ae);a.dirty=!0,a.scrollIntoView()}function Xg(a){const y=a.model,b=[];let E=y.at(Math.min(y.position,y.anchor));for(;E.type!=="first";)b.push(E),E=E.leftSibling;return b}function qg(a,y,b,E){const ee=a.model;let ie={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[y];if(y===" "&&a.options.mathModeSpace&&(ie=["insert",a.options.mathModeSpace]),ie){a.executeCommand(ie);return}if(/\d/.test(y)&&a.options.smartSuperscript&&E.parentBranch==="superscript"&&E.parent.type!=="mop"&&E.parent.type!=="operator"&&E.parent.type!=="extensible-symbol"&&E.hasNoSiblings){Yg(ee),er.insert(ee,y,{style:b}),a.snapshot(),R0(ee),a.snapshot();return}if(/[a-zA-Z0-9]/.test(y)&&a.adoptStyle!=="none"){const ae=a.adoptStyle==="left"?E:E.parent?E.rightSibling:null;(ae==null?void 0:ae.type)==="mord"&&/[a-zA-Z0-9]/.test(ae.value)&&(b=Ce({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}er.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Yg(a){a.selectionIsCollapsed||(a.deleteAtoms(Ha(a.selection)),a.mathfield.snapshot("delete"))}function Tf(a,y,b){if(!y||a.mode!=="math")return!1;const E=a.at(a.position),{parent:ee}=E,ie={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[y];if(!ie)return!1;const ae=te[ie],ue=ne[ie];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[de,me]=Ha(a.selection),ye=a.extractAtoms([de,me]),Te=ee.addChildrenAfter([new Lr("left...right",ye,{leftDelim:ie,rightDelim:ue})],a.at(de));return a.setSelection(a.offsetOf(Te.firstChild),a.offsetOf(Te.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:ie,inputType:"insertText"}),!0}if(ie==="|"){const de=ee instanceof Lr?ee.leftDelim+ee.rightDelim:"";if(de==="\\lbrace\\rbrace"||de==="\\{\\}"||de==="\\lbrace?")return a.mathfield.snapshot(),er.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:ie,inputType:"insertText"}),!0}if(ue){if(ee instanceof Lr&&ee.firstChild===E&&(ee.leftDelim==="?"||ee.leftDelim==="."))return ee.leftDelim=ie,ee.isDirty=!0,a.mathfield.snapshot(),a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(!(ee instanceof Lr)){let Te=E;for(;Te&&!(Te.type==="mclose"&&Te.value===ue);)Te=Te.rightSibling;if(Te){a.mathfield.snapshot();const ze=a.extractAtoms([a.offsetOf(E),a.offsetOf(Te)]);return ze.pop(),ee.addChildrenAfter([new Lr("left...right",ze,{leftDelim:ie,rightDelim:ue})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const de=a.offsetOf(E.lastSibling);let me;for(me=a.position;me<=de;me++){const Te=a.at(me);if(Te instanceof Lr&&(Te.leftDelim==="?"||Te.leftDelim===".")&&H0(ie,Te.rightDelim))break}const ye=a.at(me);if(me<=de&&ye instanceof Lr){ye.leftDelim=ie,a.mathfield.snapshot();let Te=a.extractAtoms([a.position,me-1]);return Te=Te.filter(ze=>ze.type!=="first"),ye.addChildren(Te,ye.parentBranch),a.position+=1,a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Lr&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(ie,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=ie,a.mathfield.snapshot();const Te=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const ze of Te)ee.parent.addChildBefore(ze,ee);return a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Lr&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),er.insert(a,`\\left${ie}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Te=a.offsetOf(E.lastSibling),ze=a.extractAtoms([a.position,Te]);a.at(a.position).body=ze,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let de=E;for(;de;){if(de.type==="mopen"&&de.value===ae){a.mathfield.snapshot();const nt=de.leftSibling,ut=a.extractAtoms([a.offsetOf(de.leftSibling),a.offsetOf(E)]);ut.shift();const nn=new Lr("left...right",ut,{leftDelim:ae,rightDelim:ie});return ee.addChildrenAfter([nn],nt),a.position=a.offsetOf(nn),a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}de=de.leftSibling}if(ee instanceof Lr&&E.isLastSibling&&Bf(ee.leftDelim,ie))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=ie,a.position+=1,a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const me=a.offsetOf(E.firstSibling);let ye;for(ye=a.position;ye>=me;ye--){const nt=a.at(ye);if(nt instanceof Lr&&(nt.rightDelim==="?"||nt.rightDelim===".")&&Bf(nt.leftDelim,ie))break}const Te=a.at(ye);if(ye>=me&&Te instanceof Lr)return a.mathfield.snapshot(),Te.rightDelim=ie,Te.addChildren(a.extractAtoms([ye,a.position]),Te.parentBranch),a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Lr&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Bf(ee.leftDelim,ie))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=ie,ee.parent.addChildren(a.extractAtoms([a.position,a.offsetOf(E.lastSibling)]),ee.parentBranch),a.position=a.offsetOf(ee),a.contentDidChange({data:ie,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const ze=ee.parent;return ze instanceof Lr&&(ze.rightDelim==="?"||ze.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(ze),Tf(a,ie,b)):!1}return!1}function Bf(a,y){return a?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y):ne[a]===y:!0}function H0(a,y){return y?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a):te[y]===a:!0}Oo({undo:a=>(a.undo(),!0),redo:a=>(a.redo(),!0),scrollIntoView:a=>(a.scrollIntoView(),!0),scrollToStart:a=>(a.field.scroll(0,0),!0),scrollToEnd:a=>{const y=a.field.getBoundingClientRect();return a.field.scroll(y.left-window.scrollX,0),!0},toggleKeystrokeCaption:Gg,toggleContextMenu:a=>{const y=a.toggleContextMenu();return y||a.model.announce("plonk"),y},plonk:a=>(a.model.announce("plonk"),!0),switchMode:(a,y,b,E)=>(a.switchMode(y,b,E),!0),insert:(a,y,b)=>a.insert(y,b),typedText:(a,y,b)=>(Af(a,y,b),!0),insertDecimalSeparator:a=>{const y=a.model;return y.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&y.at(Math.max(y.position,y.anchor)).isDigit()?(a.insert("{,}",{format:"latex"}),a.snapshot("insert-mord"),!0):(a.insert("."),!0)},commit:a=>{var y;return a.model.contentWillChange({inputType:"insertLineBreak"})&&((y=a.host)==null||y.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),a.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(a,y,b)=>{const E=a.getPrompts();let ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),ie=0;for(;E.includes(ee)&&ie<100;){if(ie===99)return console.error("could not find a unique ID after 100 tries"),!1;ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),ie++}return a.insert(`\\placeholder[${y!=null?y:ee}]{}`,b),!0}}),Oo({copyToClipboard:a=>(a.focus(),a.model.selectionIsCollapsed&&a.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Oo({cutToClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(y=>{y&&a.model.contentWillChange({inputType:"insertFromPaste",data:y})?(a.stopCoalescingUndo(),a.stopRecording(),a.insert(y,{mode:a.model.mode})&&(bd(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),fa(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function Jg(a,y){a.flushInlineShortcutBuffer(),a.stopCoalescingUndo();const b=Pf(a,y),{model:E}=a;return E.selectionIsCollapsed?(a.defaultStyle.fontSeries&&b.fontSeries===a.defaultStyle.fontSeries&&(b.fontSeries="auto"),b.fontShape&&b.fontShape===a.defaultStyle.fontShape&&(b.fontShape="auto"),b.color&&b.color===a.defaultStyle.color&&(b.color="none"),b.backgroundColor&&b.backgroundColor===a.defaultStyle.backgroundColor&&(b.backgroundColor="none"),b.fontSize&&b.fontSize===a.defaultStyle.fontSize&&(b.fontSize="auto"),a.defaultStyle=Ce(Ce({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>Mf(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Oo({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function Pf(a,y){var b,E,ee,ie,ae,ue,de,me,ye,Te;const ze={};if(typeof y.color=="string"){const ut=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";ut!==y.color&&(ze.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),ze.color=ut}if(typeof y.backgroundColor=="string"){const ut=(ae=a.backgroundColorMap((ie=y.backgroundColor)!=null?ie:y.verbatimBackgroundColor))!=null?ae:"none";ut!==y.backgroundColor&&(ze.verbatimBackgroundColor=(ue=y.verbatimBackgroundColor)!=null?ue:y.backgroundColor),ze.backgroundColor=ut}typeof y.fontFamily=="string"&&(ze.fontFamily=y.fontFamily),typeof y.series=="string"&&(ze.fontSeries=y.series),typeof y.fontSeries=="string"&&(ze.fontSeries=y.fontSeries.toLowerCase()),ze.fontSeries&&(ze.fontSeries=(de={bold:"b",medium:"m",normal:"m"}[ze.fontSeries])!=null?de:ze.fontSeries),typeof y.shape=="string"&&(ze.fontShape=y.shape),typeof y.fontShape=="string"&&(ze.fontShape=y.fontShape.toLowerCase()),ze.fontShape&&(ze.fontShape=(me={italic:"it",up:"n",upright:"n",normal:"n"}[ze.fontShape])!=null?me:ze.fontShape),y.variant&&(ze.variant=y.variant.toLowerCase()),y.variantStyle&&(ze.variantStyle=y.variantStyle.toLowerCase());const nt=(ye=y.size)!=null?ye:y.fontSize;return typeof nt=="number"?ze.fontSize=Math.max(1,Math.min(10,nt)):typeof nt=="string"&&(ze.fontSize=(Te={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[nt.toLowerCase()])!=null?Te:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[nt]),ze}function If(a){let[y,b]=Ha(a.selection);if(y=W0(a,y,"backward"),b=W0(a,b,"forward"),y===b){const E=a.at(y);if(E.type==="leftright")return a.setSelection(a.offsetOf(E.firstChild)-1,b);if(E.type==="first"&&(E.parent.type==="leftright"||E.parent.type==="surd"))return a.setSelection(y-1,a.offsetOf(E.parent.lastChild)+1);a.setSelection(y-1,b)}else a.setSelection(y,b);return!0}function W0(a,y,b){var E,ee,ie;let ae=a.at(y);if(!ae)return y;const ue=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!ve.test(ae.value));)y+=ue,ae=a.at(y);return b==="backward"?y-1:y}if(ae.mode==="latex"){if(/[a-zA-Z\*]/.test(ae.value))if(b==="backward")for(;ae&&ae.mode==="latex"&&ae.value!=="\\"&&/[a-zA-Z]/.test(ae.value);)y+=ue,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=ue,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=ue,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=ue,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+ue))!=null&&E.isDigit();)y+=ue;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let de=(ee=a.at(y))==null?void 0:ee.style;for(;de&&de.variant===ae.style.variant&&de.variantStyle===ae.style.variantStyle;)de=(ie=a.at(y+ue))==null?void 0:ie.style,y+=ue;return b==="backward"?y-1:y}return y}return y}Oo({selectGroup:a=>{const y=If(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Ks(a,"forward",{extend:!0}),extendSelectionBackward:a=>Ks(a,"backward",{extend:!0}),extendToNextWord:a=>pc(a,"forward",{extend:!0}),extendToPreviousWord:a=>pc(a,"backward",{extend:!0}),extendSelectionUpward:a=>Ks(a,"upward",{extend:!0}),extendSelectionDownward:a=>Ks(a,"downward",{extend:!0}),extendToNextBoundary:a=>pc(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>pc(a,"backward",{extend:!0}),extendToGroupStart:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).firstSibling));return y||a.announce("plonk"),y},extendToGroupEnd:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).lastSibling));return y||a.announce("plonk"),y},extendToMathFieldStart:a=>{const y=a.setSelection(a.anchor,0);return y||a.announce("plonk"),y},extendToMathFieldEnd:a=>{const y=a.setSelection(a.anchor,a.lastOffset);return y||a.announce("plonk"),y}},{target:"model",changeSelection:!0});var wu=null,Md=0,Hh=class es{static start(y,b,E,ee){var ie;es.element=y,(ie=es.controller)==null||ie.abort(),es.controller=new AbortController;const ae={signal:es.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Of(b)&&(es.pointerId=b.pointerId,y.setPointerCapture(b.pointerId))):(window.addEventListener("mousemove",E,ae),window.addEventListener("blur",ee,ae),window.addEventListener("mouseup",ee,ae))}static stop(){var y;(y=es.controller)==null||y.abort(),es.controller=void 0,typeof es.pointerId=="number"&&(es.element.releasePointerCapture(es.pointerId),es.pointerId=void 0)}};function Of(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function Z0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,ie=!1,ae=!1,ue="none",de=!1,me=!1;const ye=y.clientX,Te=y.clientY,ze=Date.now(),nt=E.field,ut=setInterval(()=>{de?nt.scroll({top:0,left:nt.scrollLeft-16}):me&&nt.scroll({top:0,left:nt.scrollLeft+16})},32);function nn(){Hh.stop(),ie=!1,clearInterval(ut),a.element.classList.remove("tracking"),y&&y.preventDefault()}function Nn(Sn){if(!E.hasFocus()){nn();return}const Wn=Sn.clientX,En=Sn.clientY,Li=Of(Sn)&&Sn.pointerType==="touch"?20:5;if(Date.now()<ze+500&&Math.abs(ye-Wn)<Li&&Math.abs(Te-En)<Li){Sn.preventDefault(),Sn.stopPropagation();return}const Ni=nt.getBoundingClientRect();me=Wn>Ni.right,de=Wn<Ni.left;let Oi=ee;Of(Sn)&&(Sn.isPrimary||(Oi=kd(E,Sn.clientX,Sn.clientY,{bias:0})));const Cr=kd(E,Wn,En,{bias:Wn<=ye?Wn===ye?0:-1:1});Oi>=0&&Cr>=0&&(E.model.extendSelectionTo(Oi,Cr),fa(a)),ae&&If(E.model)}wu&&Math.abs(wu.x-ye)<5&&Math.abs(wu.y-Te)<5&&Date.now()<wu.time+500?(Md+=1,wu.time=ze):(wu={x:ye,y:Te,time:ze},Md=1);const Yt=nt.getBoundingClientRect();if(ye>=Yt.left&&ye<=Yt.right&&Te>=Yt.top&&Te<=Yt.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=kd(a,ye,Te,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const Sn=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||Sn?ue="all":ue="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),ue="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),ue="selection"):(a.model.position=ee,v0(a.model)?ue="all":ue="selection");a.defaultStyle={},y.detail===3||Md>2?(nn(),(y.detail===3||Md===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},ue="all")):ie||(ie=!0,Hh.start(nt,y,Nn,nn),(y.detail===2||Md===2)&&(ae=!0,If(a.model),ue="all"))}a.hasFocus()||(ue="none",a.focus({preventScroll:!0}))}else wu=null;a.stopCoalescingUndo(),ue!=="none"&&(a.model.selectionIsCollapsed&&(ue="all"),fa(a)),y.preventDefault()}function Qg(a,y,b){if(a>=b.left&&a<=b.right&&y>=b.top&&y<=b.bottom)return 0;const E=a-(b.left+b.right)/2,ee=y-(b.top+b.bottom)/2;return E*E+ee*ee}function V0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const ie=Bl(a,b);if(!ie)return[1/0,null];let ae=[1/0,null];if(b.hasChildren&&!b.captureSelection&&E>=ie.left&&E<=ie.right)for(const ue of b.children){const de=V0(a,y,ue,E,ee);de[0]<=ae[0]&&(ae=de)}return ae[1]||(ae=[Qg(E,ee,ie),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=V0(a,new Map,a.model.root,y,b);return E}function kd(a,y,b,E){var ee;const ie=a.field.querySelector(".ML__latex").getBoundingClientRect();if(!ie)return 0;if(y>ie.right||b>ie.bottom+8)return a.model.lastOffset;if(y<ie.left||b<ie.top-8)return 0;E=E!=null?E:{},E.bias=(ee=E.bias)!=null?ee:0;let ae=ev(a,y,b);const ue=[];let de=ae;for(;de;)ue.unshift(de),de=de.parent;for(const ye of ue)if(ye.captureSelection){ae=ye;break}let me=a.model.offsetOf(ae);if(me<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const ye=Bl(a,ae);ye&&y<(ye.left+ye.right)/2&&(me=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(me=a.model.offsetOf(ae.leftSibling));return me}var tv=class extends er{constructor(){super("math")}onPaste(a,y){if(!y||!a.model.contentWillChange({data:typeof y=="string"?y:null,dataTransfer:typeof y=="string"?null:y,inputType:"insertFromPaste"}))return!1;let b="",E="auto",ee=typeof y!="string"?y.getData("application/json+mathlive"):"";if(ee)try{const ie=JSON.parse(ee);if(ie&&Array.isArray(ie)){a.snapshot();const ae=Ol(ie),{model:ue}=a;ue.selectionIsCollapsed||ue.deleteAtoms(Ha(ue.selection));const de=ue.at(ue.position);if(de.parent instanceof rr){console.assert(de.parentBranch!==void 0);const me=[];let ye=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const ut of ae)ut.type==="first"&&ye.length>0?(me.push(ye),ye=[ut]):ye.push(ut);ye.length>0&&me.push(ye);let Te=Number(de.parentBranch[0]),ze=Number(de.parentBranch[1]);const nt=de.parent.maxColumns;for(;de.parent.colCount-ze<me.length&&de.parent.colCount<nt;)de.parent.addColumn();de.parent.addChildrenAfter(me[0],de);for(let ut=1;ut<me.length;ut++)ze++,ze>=nt&&(ze=0,de.parent.addRowAfter(Te),Te++),de.parent.setCell(Te,ze,me[ut])}else de.parent.addChildrenAfter(ae.filter(me=>me.type!=="first"),de);return ue.position=ue.offsetOf(ae[ae.length-1]),ue.contentDidChange({inputType:"insertFromPaste"}),fa(a),!0}}catch(ie){}if(ee=typeof y!="string"?y.getData("application/json"):"",ee&&window.MathfieldElement.computeEngine)try{const ie=JSON.parse(ee);if(typeof ie=="object"&&"latex"in ie&&ie.latex&&(b=ie.latex),!b){const ae=window.MathfieldElement.computeEngine.box(ie);ae&&!ae.has("Error")&&(b=ae.latex)}b||(E="latex")}catch(ie){}if(!b&&typeof y!="string"&&(b=y.getData("application/x-latex"),b&&(E="latex")),b||(b=typeof y=="string"?y:y.getData("text/plain")),b){let ie;return[ie,b]=Rs(b),E==="auto"&&ie&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),fa(a)),a.startRecording(),!0}return!1}insert(a,y,b){var E,ee;const ie=typeof y=="string"?y:(ee=(E=window.MathfieldElement.computeEngine)==null?void 0:E.box(y).latex)!=null?ee:"";if(!b.silenceNotifications&&!a.contentWillChange({data:ie,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:ae}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ue=a.silenceNotifications;a.silenceNotifications=!0;const de={"?":"\\placeholder{}","@":"\\placeholder{}"};de[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Ha(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward"),!a.at(a.position).isLastSibling&&a.at(a.position+1).type==="placeholder"?a.deleteAtoms([a.position,a.position+1]):a.at(a.position).type==="placeholder"&&a.deleteAtoms([a.position-1,a.position]);let me=-1;de[0]?de["@"]=de[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(me=iv(a),me>=0&&(de["@"]=a.getValue(me,a.position,"latex"))),de[0]||(de[0]=de["?"]);let ye=!1;const Te=Wn=>(ye=!0,de[Wn]);let[ze,nt]=j0(a,y,Te,b);if(!nt)return!1;const ut=nt.length===1&&nt[0].type==="genfrac";ut&&me>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(de["@"]=de["?"],ye=!1,[ze,nt]=j0(a,y,Te,b)):me>=0&&a.deleteAtoms([me,a.position]);const{parent:nn}=a.at(a.position),Nn=nn.hasEmptyBranch("body");if(ut&&ze!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&nn instanceof Lr&&nn.leftDelim==="("&&Nn){const Wn=nn.parent,En=nn.parentBranch;Wn.removeChild(nn),Wn.setChildren(nt,En)}const Yt=a.at(a.position);Yt.parent.addChildrenAfter(nt,Yt),ze==="latex"&&typeof y=="string"&&(nn==null?void 0:nn.type)==="root"&&Nn&&!ye&&(nn.verbatimLatex=y),a.silenceNotifications=ue;const Sn=nt[nt.length-1];if(b.selectionMode==="placeholder"){const Wn=nt.flatMap(En=>[En,...En.children]).find(En=>En.type==="placeholder");if(Wn){const En=a.offsetOf(Wn);a.setSelection(En-1,En),a.announce("move")}else Sn&&(a.position=a.offsetOf(Sn))}else b.selectionMode==="before"||(b.selectionMode==="after"?Sn&&(a.position=a.offsetOf(Sn)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(Sn)));return a.contentDidChange({data:ie,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function j0(a,y,b,E){var ee;let ie,ae=[];if(typeof y!="string"||E.format==="math-json"){const ue=window.MathfieldElement.computeEngine;if(!ue)return["math-json",[]];[ie,y]=["latex",ue.box(y).latex],ae=Za(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([ie,y]=cu(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=Za(y,{context:a.mathfield.context}),ie!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([ie,y]=cu(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=Rs(y)),ae=Za(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae));return Nl(ae,E.style),[ie!=null?ie:"latex",ae]}function nv(a){if(!a||(console.assert(a[0].type==="first"),a.length>1))return null;const y=a[0];return y instanceof Lr&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Wh(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof Lr&&b.leftDelim==="("){let E=0,ee=0,ie=0;for(let ae=0;b.body[ae];ae++)b.body[ae].type==="genfrac"&&(E++,ee=ae),ie++;ie===0&&E===1&&(a[y]=b.body[ee])}}for(const y of a){for(const b of y.branches)if(!y.hasEmptyBranch(b)){Wh(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof rr)for(const b of y.cells)Wh(b)}}}function iv(a){let y=a.at(a.position);if(y.mode==="text"){for(;!y.isFirstSibling&&y.mode==="text";)y=y.leftSibling;return a.offsetOf(y)}const b=y;let E=!1;if(y.type==="mclose"){const ee=te[y.value];for(;!y.isFirstSibling&&!(y.type==="mopen"&&y.value===ee);)y=y.leftSibling;y.isFirstSibling||(y=y.leftSibling),E=!0}else y.type==="leftright"&&(y=y.leftSibling,E=!0);if(E)for(;!y.isFirstSibling&&(y.isFunction||G0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(G0(y)||ee.length>0);)y.type==="mclose"&&ee.unshift(y.value),y.type==="mopen"&&ee.length>0&&y.value===te[ee[0]]&&ee.shift(),y=y.leftSibling}return b===y?-1:a.offsetOf(y)}function G0(a){return a.isDigit()?!0:a.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(a.type)?!a.isExtensibleSymbol:!1}new tv;var rv=class extends er{constructor(){super("text")}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.model.contentDidChange({inputType:"insertFromPaste"}),a.startRecording(),a.snapshot("paste"),fa(a)),a.startRecording(),!0):!1}insert(a,y,b={}){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Ha(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const ie=av(y,a.mathfield.context);if(Nl(ie,b.style),!ie)return!1;const ae=a.at(a.position),ue=ae.parent.addChildrenAfter(ie,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(ue)):ue&&(a.position=a.offsetOf(ue))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function av(a,y){return a=a.replace(/\\/g,"\\textbackslash "),a=a.replace(/#/g,"\\#"),a=a.replace(/\$/g,"\\$"),a=a.replace(/%/g,"\\%"),a=a.replace(/&/g,"\\&"),a=a.replace(/_/g,"\\_"),a=a.replace(/{/g,"\\textbraceleft "),a=a.replace(/}/g,"\\textbraceright "),a=a.replace(/lbrace/g,"\\textbraceleft "),a=a.replace(/rbrace/g,"\\textbraceright "),a=a.replace(/\^/g,"\\textasciicircum "),a=a.replace(/~/g,"\\textasciitilde "),a=a.replace(/£/g,"\\textsterling "),Za(a,{context:y,parseMode:"text"})}new rv;function Hs(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var Qr=4,_o=20,Pa=2*(_o+Qr),Zh=(a,y)=>`
<line x1="${a+_o}" y1="${y+_o}"
x2="${a>y?a+_o:7*_o+10*Qr}"
y2="${a<y?y+_o:7*_o+10*Qr}"/>
<svg id="plus" viewBox="0 0 40 40" x="${a}" y="${y}" 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>`,U0=(a,y)=>`
<line x1="${a+_o}" y1="${y+_o}"
x2="${a>y?a+_o:7*_o+10*Qr}"
y2="${a<y?y+_o:7*_o+10*Qr}"/>
<svg id="minus" viewBox="0 0 40 40" x="${a}" y="${y}" 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>`,Vh=(a,y,b)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${b})" 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>`,ov=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*_o+10*Qr+5} ${8*_o+10*Qr+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Pa+Qr}"
height="${3*Pa}"
width="${Pa}"
rx="${Pa/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Pa+Qr}"
y="0"
height="${Pa}"
width="${3*Pa}"
rx="${Pa/2}"/>
<g data-command='"moveDown"'>
${Vh(2*(Qr+Pa),2*Qr+3*Pa,0)}
</g>
<g data-command='"moveUp"'>
${Vh(2*(Qr+Pa),2*Qr+Pa,180)}
</g>
<g data-command='"moveToNextWord"'>
${Vh(2*Qr+3*Pa,2*(Qr+Pa),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Vh(2*Qr+Pa,2*(Qr+Pa),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zh(2*Qr+Pa,Qr)}
</g>
<g data-command='"removeColumn"'>
${U0(2*Qr+2*Pa,Qr)}
</g>
<g data-command='"addColumnAfter"'>
${Zh(2*Qr+3*Pa,Qr)}
</g>
<g data-command='"addRowBefore"'>
${Zh(Qr,2*Qr+Pa)}
</g>
<g data-command='"removeRow"'>
${U0(Qr,2*Qr+2*Pa)}
</g>
<g data-command='"addRowAfter"'>
${Zh(Qr,2*Qr+3*Pa)}
</g>
</svg>`,sv=a=>`
<svg id="matrix" class="${a}" 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>`,lv=a=>`
<svg id="pmatrix" class="${a}" 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>`,X0=a=>`
<svg id="Bmatrix" class="${a}" 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>`,uv=a=>`
<svg id="bmatrix" class="${a}" 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>`,cv=a=>`
<svg id="vmatrix" class="${a}" 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>`,dv=a=>`
<svg id="Vmatrix" class="${a}" 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>`,hv=a=>`
<svg id="cases" class="${a}" 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>`,fv=a=>`
<svg id="rcases" class="${a}" 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>`,Rf={matrix:sv,pmatrix:lv,bmatrix:uv,Bmatrix:X0,vmatrix:cv,Vmatrix:dv},Nf={cases:hv,rcases:fv,Bmatrix:X0};function pv(a){var y,b;const E=(y=a.model.parentEnvironment)==null?void 0:y.array;if(!E)return;let ee=0;E.forEach(ut=>{(!ee||ut.length>ee)&&(ee=ut.length)});let ie=document.getElementById("mathlive-environment-popover");ie||(ie=_h("mathlive-environment-popover"),Io("environment-popover"),Io("core"),ie.setAttribute("aria-hidden","true"));let ae;const ue=ie.querySelector(".MLEP__environment-controls");ue?ae=ue:(ae=document.createElement("div"),ie.innerHTML="",ie.appendChild(ae)),ae.className="MLEP__environment-controls",ae.style.display="flex",ae.style.width="100%",ae.style.height="100%",ae.style.boxSizing="border-box",ae.innerHTML=ov;let de=[],me="";const ye=a.model.parentEnvironment.environmentName;if(uo(ye)){const ut=gv(ye);me=Rf[ut]("active");const nn=Rf,{[ut]:Nn}=nn,Yt=ht(nn,[Ne(ut)]);de=Object.values(Yt).map(Sn=>Sn("inactive"))}else if(co(ye)){const ut=vv(ye);me=Nf[ut]("active");const nn=Nf,{[ut]:Nn}=nn,Yt=ht(nn,[Ne(ut)]);de=Object.values(Yt).map(Sn=>Sn("inactive"))}else Ca(ye)&&(me=Rf.matrix("active"),de=Object.values(Nf).map(ut=>ut("inactive")));const Te=document.createElement("div");Te.className="MLEP__environment-delimiter-controls",Te.style.display="flex",Te.style.flexDirection="column",Te.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${me}
${de.join("")}
</div>`,me&&ae.appendChild(Te),ae.querySelectorAll("[data-command]").forEach(ut=>{const nn=ut.dataset.command;let Nn=nn;try{Nn=JSON.parse(nn)}catch(Yt){}ut.addEventListener("mousedown",Yt=>Yt.preventDefault()),Nn&&ut.addEventListener("click",()=>a.executeCommand(Nn))});const nt=(b=a.field)==null?void 0:b.getBoundingClientRect();nt&&(ie.style.top=`${window.scrollY+(nt.top-ie.clientHeight-15)}px`,ie.style.left=`${nt.left+20}px`,ie.classList.add("is-visible"))}function Ff(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bf("mathlive-environment-popover"),x("environment-popover"),x("core"))}function jh(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&sa(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Ff()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function q0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function Y0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function $f(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="rtl"||b==="end"&&E==="ltr"||b==="top"||b==="right"?Math.max(0,a-y):a}function yv(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="ltr"||b==="end"&&E==="rtl"||b==="top"||b==="right"?a:a-y}function bv(a,y){var b,E,ee;const ie=(b=q0(a))!=null?b:"ltr";a.style.position="fixed",a.style.left="",a.style.top="",a.style.right="",a.style.bottom="",a.style.height="",a.style.width="";const ae=a.getBoundingClientRect(),ue=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let de=Math.min(ue,(E=y.height)!=null?E:ae.height),me=$f(y.location.y,de,y.verticalPos,ie);me+de>window.innerHeight-8&&(y.alternateLocation?(me=$f(y.alternateLocation.y,de,y.verticalPos,ie),me+de>window.innerHeight-8&&(me=void 0)):me=void 0),Number.isFinite(me)||(me=Math.max(8,window.innerHeight-8-de),8+de>window.innerHeight-8&&(a.style.bottom="8px")),de=Math.min(me+de,window.innerHeight-8)-me;const ye=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Te=Math.min(ye,(ee=y.width)!=null?ee:ae.width),ze=$f(y.location.x,Te,y.horizontalPos,ie);ze+Te>window.innerWidth-8&&(y.alternateLocation?(ze=yv(y.alternateLocation.x,Te,y.verticalPos,ie),ze+Te>window.innerWidth-8&&(ze=void 0)):ze=void 0),Number.isFinite(ze)||(ze=Math.max(8,window.innerWidth-8-Te),8+Te>window.innerWidth-8&&(a.style.right="8px")),Te=Math.min(ze+Te,window.innerWidth-8)-ze,ie==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-ze-Te).toString()}px`:a.style.left=`${Math.ceil(ze).toString()}px`,a.style.top=`${Math.ceil(me).toString()}px`,de!==ae.height&&(a.style.height=`${Math.ceil(de).toString()}px`),Te!==ae.width&&(a.style.width=`${Math.ceil(Te).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function mc(a){return"submenu"in a}function Ws(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zf(a){return"type"in a&&a.type==="divider"}function Kf(a){return"type"in a&&a.type==="heading"}var J0={};function Hf(a){let y=J0[a];if(!y){let b;switch(a){case"checkmark":b=`<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":b='<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":b='<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(b){const E=document.createElement("template");E.innerHTML=b,J0[a]=E,y=E}}if(y){if("content"in y)return y.content.cloneNode(!0);const b=document.createElement("svg");return b.innerHTML=y.innerHTML,b}}var Q0=80,ep=class{constructor(a,y){this._element=null;var b;this.parentMenu=y,this._declaration=a,mc(a)?(this.type="submenu",this.submenu=new tp(a.submenu,{parentMenu:y,submenuClass:a.submenuClass,columnCount:a.columnCount})):this.type=(b=a.type)!=null?b:"command",this.hasCheck=Ws(a)&&a.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var a,y;(a=this._abortController)==null||a.abort(),this._abortController=void 0,(y=this._element)==null||y.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var a;return(a=this._label)!=null?a:""}set label(a){a===void 0&&(a=""),a!==this._label&&(this._label=a,this.dirty=!0)}get visible(){return this._visible}set visible(a){a!==this._visible&&(this._visible=a,this.dirty=!0)}get enabled(){return this._enabled}set enabled(a){this._enabled=a,this.element&&(a?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(a){this._checked=a,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(a){a!==this._tooltip&&(this._tooltip=a,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(a){a!==this._ariaLabel&&(this._ariaLabel=a,this.dirty=!0)}get active(){var a,y;return(y=(a=this.element)==null?void 0:a.classList.contains("active"))!=null?y:!1}set active(a){this.element&&this.element.classList.toggle("active",a)}updateState(a){var y,b,E;const ee=this._declaration;if(zf(ee)){this.enabled=!1,this.checked=!1;return}Kf(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ws(ee)&&(this.checked=Ws(ee)&&((y=gc(ee.checked,a))!=null?y:!1)),(Ws(ee)||mc(ee))&&(this.enabled=(b=gc(ee.enabled,a))!=null?b:!0,this.visible=(E=gc(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(Ws(ee)||Kf(ee)||mc(ee))&&(this.label=gc(ee.label,a),this.tooltip=gc(ee.tooltip,a),this.ariaLabel=gc(ee.ariaLabel,a)),this._element&&this.updateElement()}set dirty(a){console.assert(a===!0),a&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const a=this.element;a.textContent="",this.enabled?a.removeAttribute("aria-disabled"):a.setAttribute("aria-disabled","true"),this.checked===!0?(a.setAttribute("aria-checked","true"),a.append(Hf("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hf("mixedmark"))):a.removeAttribute("aria-checked"),this.ariaLabel&&a.setAttribute("aria-label",this.ariaLabel);const y=document.createElement("span");if(y.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&y.classList.add("heading"),y.innerHTML=this.label,a.append(y),this._tooltip&&a.setAttribute("data-tooltip",this._tooltip),Ws(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vf(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hf("trailing-chevron"))}get element(){if(this._element)return this._element;if(zf(this._declaration)){const b=document.createElement("li");return b.setAttribute("part","menu-divider"),b.setAttribute("role","divider"),this._element=b,b}const a=document.createElement("li");this._element=a,(Ws(this._declaration)||Kf(this._declaration)||mc(this._declaration))&&this._declaration.class&&(a.className=this._declaration.class),a.setAttribute("part","menu-item"),a.setAttribute("tabindex","-1"),this.hasCheck?a.setAttribute("role","menuitemcheckbox"):a.setAttribute("role","menuitem"),this.type==="submenu"&&(a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"));const y=this.abortController.signal;return a.addEventListener("pointerenter",this,{signal:y}),a.addEventListener("pointerleave",this,{signal:y}),a.addEventListener("pointerup",this,{signal:y}),a.addEventListener("click",this,{signal:y}),this._element}dispatchSelect(){if(!Ws(this._declaration))return;const a=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(a)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(a){var y;if(!(!this.visible||!this.enabled)){if(a.type==="click"){this.rootMenu.state==="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}if(a.type==="pointerenter"){const b=a;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((y=this.parentMenu.activeMenuItem)!=null&&y.movingTowardSubmenu(b))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(a.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(a.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),a.stopPropagation(),a.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()},Q0)},Q0)}openSubmenu(a){var y;if(this.type!=="submenu"||!this.element)return;if((y=a==null?void 0:a.withDelay)!=null&&y){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const b=this.element.getBoundingClientRect(),E=q0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Y0(b,"trailing",E),y:b.top-4},alternateLocation:{x:Y0(b,"leading",E),y:b.top-4}})}movingTowardSubmenu(a){if(!this.element||this.type!=="submenu")return!1;const y=this.rootMenu.lastMoveEvent;if(!y)return!1;const b=a.timeStamp-y.timeStamp;if(b>500)return!1;const E=a.clientX-y.clientX;if(wv(E,y.clientY-a.clientY,b)<=.2)return!1;let ie="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),ue=this.element.getBoundingClientRect();ae.left<ue.left+ue.width/2&&(ie="left")}return ie==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function gc(a,y){return a===void 0||typeof a!="function"?a:(y!=null||(y={alt:!1,control:!1,shift:!1,meta:!1}),a(y))}var tp=class _c{constructor(y,b){this._element=null,this._activeMenuItem=null,this._dirty=!0;var E,ee;this.parentMenu=(E=b==null?void 0:b.parentMenu)!=null?E:null,this._submenuClass=b==null?void 0:b.submenuClass,this.columnCount=(ee=b==null?void 0:b.columnCount)!=null?ee:1,this.isSubmenuOpen=!1,this.menuItems=y}get children(){return this._menuItems}set menuItems(y){const b=this.parentMenu;this.dispose(),this.parentMenu=b,y=[...y],this._menuItems=y.map(E=>E.onCreate?E.onCreate(E,this):new ep(E,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var y;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(y=this._menuItems)==null||y.forEach(b=>b.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(y){if(y.type==="wheel"&&this._element){const b=y;this._element.scrollBy(0,b.deltaY),y.stopPropagation()}}dispatchEvent(y){return this.rootMenu.dispatchEvent(y)}get rootMenu(){return this.parentMenu.rootMenu}updateState(y){var b,E,ee;this._menuItems.forEach(me=>me.updateState(y));const ie=this.hasCheck;this.hasCheck=this._menuItems.some(me=>me.visible&&me.hasCheck),this.hasCheck!==ie&&this._menuItems.forEach(me=>me.updateState(y));let ae,ue=0;for(const me of this._menuItems)me.type==="heading"?(ae&&ue===0&&(ae.visible=!1),ae=me,ue=0):me.type==="divider"&&ae?(ae.visible=ue>0,ae=void 0,ue=0):ae&&me.visible&&(ue+=1);ae&&(ae.visible=ue>0);let de=!0;for(const me of this._menuItems)me.type==="divider"?(me.visible=!de,de=!0):me.visible&&(de=!1);(b=this.activeMenuItem)!=null&&b.visible||(this.activeMenuItem=null),!((E=this.activeMenuItem)!=null&&E.enabled)&&((ee=this.activeMenuItem)==null?void 0:ee.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible&&y.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible)}set dirty(y){console.assert(y===!0),this._dirty!==y&&y&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var y;if(this._element){this._element.textContent="";for(const{element:b,visible:E}of this._menuItems)b&&E&&this._element.append(b);(y=this._element.querySelector("li:first-of-type"))==null||y.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const y=document.createElement("menu");y.setAttribute("role","menu"),y.setAttribute("tabindex","-1"),y.setAttribute("aria-orientation","vertical"),y.setAttribute("part","ui-menu-container"),this._submenuClass&&y.classList.add(this._submenuClass),y.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const b=this._abortController.signal;return y.addEventListener("focus",this,{signal:b}),y.addEventListener("wheel",this,{passive:!0,signal:b}),this._element=y,this.updateElement(),y}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(y){var b,E,ee,ie;if(this.rootMenu.cancelDelayedOperation(),y!==this._activeMenuItem){if(this.activeMenuItem){const ae=this.activeMenuItem;ae.active=!1,(b=ae.submenu)==null||b.hide()}if(!((E=y==null?void 0:y.visible)==null||E)){this._activeMenuItem=null;return}this._activeMenuItem=y,y&&(y.active=!0)}y?(ee=y.element)==null||ee.focus({preventScroll:!0}):(ie=this._element)==null||ie.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let y=0,b=!1;const E=this._menuItems;for(;!b&&y<=E.length-1;){const ee=E[y];b=ee.type!=="divider"&&ee.visible&&ee.enabled,y+=1}return b?E[y-1]:null}get lastMenuItem(){this.updateIfDirty();const y=this._menuItems;let b=y.length-1,E=!1;for(;!E&&b>=0;){const ee=y[b];E=ee.type!=="divider"&&ee.visible&&ee.enabled,b-=1}return E?y[b+1]:null}nextMenuItem(y){if(y===0)return this._activeMenuItem;if(!this._activeMenuItem)return y>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const b=this._menuItems.indexOf(this.firstMenuItem),E=this._menuItems.indexOf(this.lastMenuItem);let ee=this._menuItems.indexOf(this._activeMenuItem),ie=1;for(;ee>=b&&ee<=E;){ee+=y>0?1:-1;const ae=this._menuItems[ee];if(!ae)break;if(ae.visible&&ae.enabled){if(ie===Math.abs(y))return this._menuItems[ee];ie+=1}}return y>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(y){this.updateIfDirty();const E=this._menuItems.filter(ee=>ee.visible&&ee.enabled).indexOf(y);return E<0?-1:E%this.columnCount}static get collator(){return _c._collator||(_c._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),_c._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(ue=>ue.type!=="divider"&&ue.visible&&ue.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(ue=>ue.label.length))-y.length;if(ee<0)return null;let ie=null,ae=0;for(;ae<ee&&!ie;)ie=(b=E.find(ue=>_c.collator.compare(y,ue.label.substring(ae,y.length))===0))!=null?b:null,ae++;return ie}show(y){return!this.visible||!y.container?!1:(this.updateElement(),y.container.appendChild(this.element),Zt()&&(this.element.popover="manual",this.element.showPopover()),y.location&&bv(this.element,{location:y.location,alternateLocation:y.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var y,b,E,ee,ie;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Zt()&&((y=this._element)!=null&&y.popover)&&this.element.hidePopover(),(E=(b=this.parentMenu)==null?void 0:b.element)==null||E.focus(),(ie=(ee=this._element)==null?void 0:ee.parentNode)==null||ie.removeChild(this._element)}set openSubmenu(y){var b,E,ee,ie;const ae=y!==null;((b=this.activeMenuItem)==null?void 0:b.type)==="submenu"&&((E=this.activeMenuItem.element)==null||E.setAttribute("aria-expanded",ae.toString())),(ie=(ee=this.activeMenuItem)==null?void 0:ee.element)==null||ie.classList.toggle("is-submenu-open",ae),this.isSubmenuOpen=ae}},np=class im extends tp{constructor(y,b){var E;super(y),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(E=b==null?void 0:b.host)!=null?E:null,this.isDynamic=y.some(ip),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(y){zm(this._modifiers,y)||(this._modifiers=y,this.dirty=!0)}get activeSubmenu(){let y=this;for(;y.isSubmenuOpen;)y=y.activeMenuItem.submenu;return y}set dirty(y){this._updating||(console.assert(y===!0),this._dirty!==y&&(this._dirty=!0,y&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(y){this._updating=!0,this.modifiers=y!=null?y:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(y){this.isDynamic&&(this.modifiers=fu(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=fu(y));let ie=!0;const ae=this.activeSubmenu,ue=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":ue==null||ue.select(fu(y));break;case"ArrowRight":if((ue==null?void 0:ue.type)==="submenu")ue.select(fu(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!ue)ae.activeMenuItem=ae.firstMenuItem;else{const de=(b=ae.getMenuItemColumn(ue))!=null?b:-1;if(de>=0&&de<((E=ae.columnCount)!=null?E:1)-1){const me=ae.nextMenuItem(1);me&&(ae.activeMenuItem=me)}}break;case"ArrowLeft":if(ae===this.rootMenu)ue||(ae.activeMenuItem=ae.firstMenuItem);else if((ue&&(ee=ae.getMenuItemColumn(ue))!=null?ee:-1)<=0||!ue){ae.hide();const me=ae.parentMenu.activeMenuItem;if(me){const{element:ye}=me;ye==null||ye.focus(),ye==null||ye.classList.remove("is-submenu-open")}}else{const me=ae.nextMenuItem(-1);me&&(ae.activeMenuItem=me)}break;case"ArrowDown":ae.activeMenuItem=ae.nextMenuItem(ae.columnCount);break;case"ArrowUp":ae.activeMenuItem=ae.nextMenuItem(-ae.columnCount);break;case"Home":case"PageUp":ae.activeMenuItem=ae.firstMenuItem;break;case"End":case"PageDown":ae.activeMenuItem=ae.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const de=ae.findMenuItem(this.typingBuffer);de&&(ae.activeMenuItem=de),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const de=ae.findMenuItem(this.typingBuffer);de&&(ae.activeMenuItem=de),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else ie=!1}ie&&(y.preventDefault(),y.stopPropagation())}handleEvent(y){if(y.type==="keydown")this.handleKeydownEvent(y);else if(y.type==="keyup")this.handleKeyupEvent(y);else if(y.type==="pointermove")this.lastMoveEvent=y;else if(y.type==="pointerup"&&y.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(y.type==="contextmenu"){y.preventDefault(),y.stopPropagation();return}super.handleEvent(y)}dispatchEvent(y){return this._host?this._host.dispatchEvent(y):!0}get scrim(){return $s.element}connectScrim(y){const b=this.scrim;b.addEventListener("pointerup",this),b.addEventListener("contextmenu",this),b.addEventListener("keydown",this),b.addEventListener("keyup",this),b.addEventListener("pointermove",this),$s.open({root:y,onDismiss:()=>this.hide()})}disconnectScrim(){const y=this.scrim;y.removeEventListener("pointerup",this),y.removeEventListener("contextmenu",this),y.removeEventListener("keydown",this),y.removeEventListener("keyup",this),y.removeEventListener("pointermove",this),$s.state==="open"&&$s.scrim.close()}get rootMenu(){return this}show(y){return this._onDismiss=y==null?void 0:y.onDismiss,y!=null&&y.modifiers&&(this.modifiers=y.modifiers),this.updateState(),this.connectScrim(y==null?void 0:y.target),super.show(Me(Ce({},y),{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,$s.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(y){this.cancelDelayedOperation();const b=im.SUBMENU_DELAY;if(b<=0){y();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,y()},b)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};np.SUBMENU_DELAY=120;var Sv=np;function ip(a){return zf(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(Ws(a)||mc(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||Ws(a)&&typeof a.checked=="function"?!0:mc(a)?a.submenu.some(ip):!1}var Gh=class{};Gh.DELAY=300,Gh.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=xh(a);E||y(!1);let ee=E;const ie=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Gh.MAX_DISTANCE)},Gh.DELAY),ae=new AbortController,ue=ae.signal;for(const de of["pointermove","pointerup","pointercancel"])window.addEventListener(de,me=>{if(me.type==="pointerup"||me.type==="pointercancel")clearTimeout(ie),ae.abort(),y(!1);else if(me.type==="pointermove"){const ye=xh(me);ye&&(ee=ye)}},{passive:!0,signal:ue})})}function rp(a,y,b){return zl(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:xh(E),modifiers:fu(E)}))return a.preventDefault(),a.stopPropagation(),!0}if(a.type==="keydown"){const E=a;if(E.code==="ContextMenu"||E.code==="F10"&&E.shiftKey){const ee=y==null?void 0:y.getBoundingClientRect();if(ee&&b.show({target:y,location:{x:Math.ceil(ee.left+ee.width/2),y:Math.ceil(ee.top+ee.height/2)},modifiers:fu(E)}))return a.preventDefault(),a.stopPropagation(),!0}}if(a.type==="pointerdown"&&a.pointerType!=="mouse"&&a.button===0){let E=a.target;for(;E&&y!==E;)E=E.parentNode;if(!E||!b.visible)return!1;const ee=xh(a);if(yield Cv(a))return b.state!=="closed"?!1:(b.show({target:y,location:ee}),!0)}return!1})}var ap={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};pt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(Me(Ce({},a),{body:Ge(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),pt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=hn(Ge(a.args[0]));return new z(Me(Ce({},a),{body:Ge(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),pt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(Me(Ce({},a),{body:Ge(a.args[0]),svgAccent:"overarc"}))}),pt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Yo(Me(Ce({},a),{body:Ge(a.args[0]),svgBelow:"underarc"}))}),pt("utilde","{body:auto}",{createAtom:a=>{const y=Ge(a.args[0]),b=hn(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Yo(Me(Ce({},a),{body:y,svgBelow:E,boxType:El(y)}))}}),pt("^","{:string}",{createAtom:a=>{var y;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[a.args[0]])!=null?y:"^"}))}}),pt("`","{:string}",{createAtom:a=>{var y;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[a.args[0]])!=null?y:"`"}))}}),pt("'","{:string}",{createAtom:a=>{var y;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[a.args[0]])!=null?y:"'"}))}}),pt('"',"{:string}",{createAtom:a=>{var y,b;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[a.args[0]])!=null?b:'"'+a.args[0]:'"'}))}}),pt(".","{:string}",{createAtom:a=>{var y,b;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[a.args[0]])!=null?b:"."+a.args[0]:"."}))}}),pt("=","{:string}",{createAtom:a=>{var y,b;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[a.args[0]])!=null?b:"="+a.args[0]:"="}))}}),pt("~","{:string}",{createAtom:a=>{var y;return new gn(Me(Ce({type:"mord"},a),{isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[a.args[0]])!=null?y:"\xB4"}))}}),pt("c","{:string}",{createAtom:a=>{var y;return new gn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),pt("enclose","{notation:string}[style:string]{body:auto}",{createAtom:a=>{var y,b;const E=a.args,ee={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(y=a.style)!=null?y:{}};if(E[1]){const ae=E[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const ue of ae){const de=ue.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(de)ee.strokeWidth=de[1],ee.strokeStyle=de[2],ee.strokeColor=de[3];else{const me=ue.match(/\s*([a-z]*)\s*=\s*"(.*)"/);me&&(me[1]==="mathbackground"?ee.backgroundcolor=me[2]:me[1]==="mathcolor"?ee.strokeColor=me[2]:me[1]==="padding"?ee.padding=me[2]:me[1]==="shadow"&&(ee.shadow=me[2]))}}ee.strokeStyle==="dashed"?ee.svgStrokeStyle="5,5":ee.strokeStyle==="dotted"&&(ee.svgStrokeStyle="1,5")}ee.borderStyle=`${ee.strokeWidth} ${ee.strokeStyle} ${ee.strokeColor}`;const ie={};return((b=E[0])!=null?b:"").split(/[, ]/).filter(ae=>ae.length>0).forEach(ae=>{ie[ae.toLowerCase()]=!0}),new ud(a.command,Ge(E[2]),ie,ee)}}),pt("cancel","{body:auto}",{createAtom:a=>{var y;return new ud(a.command,Ge(a.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),pt("bcancel","{body:auto}",{createAtom:a=>{var y;return new ud(a.command,Ge(a.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),pt("xcancel","{body:auto}",{createAtom:a=>{var y;return new ud(a.command,Ge(a.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),pt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Yo(Me(Ce({},a),{body:Ge((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),pt("overbrace","{:auto}",{createAtom:a=>new Yo(Me(Ce({},a),{body:Ge(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),pt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Yo(Me(Ce({},a),{body:Ge(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),pt(["underbrace"],"{:auto}",{createAtom:a=>new Yo(Me(Ce({},a),{body:Ge(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),pt(["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:a=>{var y,b,E,ee,ie;return new Yo(Me(Ce({},a),{svgBody:a.command.slice(1),above:((b=Ge((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:Ge((E=a.args)==null?void 0:E[1]),below:(ie=Ge((ee=a.args)==null?void 0:ee[0]))!=null?ie:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(a,y)=>a.command+(a.hasEmptyBranch("below")?"":`[${a.belowToLatex(y)}]`)+`{${a.aboveToLatex(y)}}${a.supsubToLatex(y)}`}),pt(["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:a=>new hu(a.command.slice(1),Me(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),pt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hu({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],Me(Ce({},a),{limits:"over-under",variant:"main"}))}),pt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hu(a.command.slice(1),Me(Ce({},a),{limits:"over-under",variant:"main"}))}),pt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hu(a.command.slice(1),Me(Ce({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),pt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),serialize:(a,y)=>`\\ang{${a.bodyToLatex(y)}}`,render:(a,y)=>{const b=a.createBox(y),E=b.caret;b.caret=void 0;const ee=new $n("\xB0",{style:Me(Ce({},a.style),{variant:"normal",variantStyle:"up"})});return new $n([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),pt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(Me(Ce({},a),{body:Ge(a.args[1]),index:a.args[0]?Ge(a.args[0]):void 0}))}),pt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Ce({},a),b=a.command,E=a.args;switch(b){case"\\dfrac":case"\\frac":case"\\tfrac":y.hasBarLine=!0;break;case"\\atopfrac":y.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":y.hasBarLine=!1,y.leftDelim="(",y.rightDelim=")";break;case"\\cfrac":y.hasBarLine=!0,y.continuousFraction=!0;break;default:}switch(b){case"\\dfrac":case"\\dbinom":y.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":y.mathstyleName="textstyle";break;default:}return new oc(E[0]?Ge(E[0]):[new zi],E[1]?Ge(E[1]):[new zi],y)},serialize:(a,y)=>{const b=a.aboveToLatex(y),E=a.belowToLatex(y);return/^[0-9]$/.test(b)&&/^[0-9]$/.test(E)?`${a.command}${b}${E}`:Jr(a.command,b,E)}}),pt(["brace","brack"],"",{infix:!0,createAtom:a=>new oc(Ge(a.args[0]),Ge(a.args[1]),Me(Ce({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>cr([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),pt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new oc(Ge(E[0]),Ge(E[1]),Me(Ce({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>cr([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),pt(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:a=>{var y,b;const E=a.args;return new oc(Ge(E[0]),Ge(E[1]),Me(Ce({},a),{leftDelim:(y=E[2])!=null?y:".",rightDelim:(b=E[3])!=null?b:".",hasBarLine:!1}))},serialize:(a,y)=>`${a.aboveToLatex(y)} ${a.command}${a.leftDelim}${a.rightDelim}${a.belowToLatex(y)}`}),pt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new oc(Ge(a.args[0]),Ge(a.args[1]),Me(Ce({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),pt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new hf({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[a.command.slice(1)],Me(Ce({},a),{limits:"auto",variant:"main"}))}),pt("smallint","",{ifMode:"math",createAtom:a=>new hu("\u222B",Me(Ce({},a),{limits:"adjacent",variant:"main"}))});var op={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};pt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,Me(Ce({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),pt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hu({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],Me(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),pt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new i0(Me(Ce({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),pt("the","{:value}",{createAtom:a=>new gn(Me(Ce({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new xr({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const ie=E.evaluate(a.args[0]);return new $n(((b=Sa(ie))!=null?b:"").split("").map(ae=>new $n(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:Ce({variant:"main"},a.style)})),{type:"lift",style:a.style,caret:a.caret,isSelected:a.isSelected,classes:ee}).wrap(E)},serialize:a=>{var y;return`\\the${(y=Sa(a.args[0]))!=null?y:"\\relax"}`}}),pt("mathtip","{:auto}{:math}",{createAtom:a=>new ff(Me(Ce({},a),{body:Ge(a.args[0]),tooltip:Ge(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${gn.serialize([a.tooltip],Me(Ce({},y),{defaultMode:"math"}))}}`}),pt("texttip","{:auto}{:text}",{createAtom:a=>new ff(Me(Ce({},a),{body:Ge(a.args[0]),tooltip:Ge(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${gn.serialize([a.tooltip],Me(Ce({},y),{defaultMode:"text"}))}}`}),pt("error","{:math}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),pt("ensuremath","{:math}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(Me(Ce({},y),{defaultMode:"math"}))}}`}),pt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Sa(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),pt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Sa(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),pt("boxed","{content:math}",{createAtom:a=>new va(Me(Ce({},a),{body:Ge(a.args[0]),framecolor:{string:"black"}}))}),pt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Sa(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),pt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new va(Me(Ce({},a),{body:Ge(a.args[2]),framecolor:(y=a.args[0])!=null?y:{string:"blue"},backgroundcolor:(b=a.args[1])!=null?b:{string:"yellow"}}))},serialize:(a,y)=>{var b,E;return y.skipStyles?a.bodyToLatex(Me(Ce({},y),{defaultMode:"text"})):Jr(a.command,(b=Sa(a.framecolor))!=null?b:"",(E=Sa(a.backgroundcolor))!=null?E:"",a.bodyToLatex(Me(Ce({},y),{defaultMode:"text"})))}}),pt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=Ge(a.args[1]);return b?new va(Me(Ce({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new va(Me(Ce({},a),{body:E}))},serialize:(a,y)=>{var b,E;if(y.skipStyles)return a.bodyToLatex(y);let ee=a.command;if(Number.isFinite(a.padding)||a.border!==void 0||a.backgroundcolor!==void 0){const ie=[];a.padding&&ie.push((b=Sa(a.padding))!=null?b:""),a.border&&ie.push(`border: ${a.border}`),a.backgroundcolor&&ie.push((E=Sa(a.backgroundcolor))!=null?E:""),ee+=`[${ie.join(",")}]`}return Jr(ee,a.bodyToLatex(y))}}),pt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),render:(a,y)=>{const b=new xr({parent:y,mathstyle:a.command.slice(1)},a.style),E=gn.createBox(b,a.body,{type:"lift"});return a.caret&&(E.caret=a.caret),a.bind(y,E)},serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{${cr([a.command,a.bodyToLatex(y)])}}`}),pt(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:a=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[a]})}),pt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),pt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),pt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),pt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),pt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),pt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),pt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),pt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),pt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),pt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),pt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),pt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),pt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),pt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),pt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),pt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),pt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),pt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),pt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),pt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),pt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),pt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),pt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),pt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),pt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),pt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),pt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),pt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),pt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),pt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),pt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),pt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),pt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),pt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),pt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),pt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),pt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),pt("mbox","{:text}",{ifMode:"math",createAtom:a=>new gn(Me(Ce({},a),{type:"mord",body:Ge(a.args[0]),mode:"math"})),serialize:(a,y)=>Jr("\\mbox",a.bodyToLatex(Me(Ce({},y),{defaultMode:"text"})))}),pt("text","{:text}",{ifMode:"math",applyMode:"text"}),pt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[1])})),serialize:(a,y)=>!a.args[0]||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`,render:(a,y)=>{var b;return a.createBox(y,{classes:(b=a.args[0])!=null?b:""})}}),pt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.cssId=(b=a.args[0])!=null?b:"",E}}),pt("htmlData","{data:string}{content:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`\\htmlData{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlData=(b=a.args[0])!=null?b:"",E}}),pt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlStyle=(b=a.args[0])!=null?b:"",E}}),pt("em","{:rest}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{\\em ${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})}),pt("emph","{:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[1])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\emph{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})});var sp={"\\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}};pt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new r0(Me(Ce({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),pt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),pt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),pt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new gn(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===su||E===Ps)&&(b=1),(E===cl||E===ro)&&(b=2),(E===Po||E===Ka)&&(b=3);const ee=Ge(a.args[b]);return gn.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${gn.serialize(a.args[0],y)}}{${gn.serialize(a.args[1],y)}}{${gn.serialize(a.args[2],y)}}{${gn.serialize(a.args[3],y)}}`}),pt("mathop","{:auto}",{createAtom:a=>new gn(Me(Ce({},a),{type:"mop",body:Ge(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=gn.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return new $n(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[Jr(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),cr(b)}}),pt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new gn(Me(Ce({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:Ge(a.args[0])}))}),pt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=Ge(a.args[0]).map(b=>{var E;return b.type!=="first"&&(b.type="mord",b.value=(E={"\u2217":"*","\u2212":"-"}[b.value])!=null?E:b.value,b.isFunction=!1,!b.style.variant&&!b.style.variantStyle&&(b.style.variant="main",b.style.variantStyle="up")),b});return new gn(Me(Ce({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=gn.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return a.caret&&(E.caret=a.caret),new $n(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[Jr(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),cr(b)}}),pt(["char","unicode"],"{charcode:value}",{createAtom:a=>new gn(Me(Ce({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Sa((y=a.args[0])!=null?y:{number:10067,base:"hexadecimal"})}`},render:(a,y)=>{let b=y.evaluate(a.args[0]);return(!b||!("number"in b))&&(b={number:10067,base:"hexadecimal"}),a.value=String.fromCodePoint(b.number),a.createBox(y)}}),pt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new gn(a),render:(a,y)=>{var b,E,ee;const ie=new xr({parent:y,mathstyle:"textstyle"},a.style),ae=ie.toEm((b=a.args[0])!=null?b:{dimension:0}),ue=ie.toEm((E=a.args[1])!=null?E:{dimension:10}),de=ie.toEm((ee=a.args[2])!=null?ee:{dimension:10}),me=new $n(null,{classes:"rule",type:"ord"});return me.width=ue,me.height=de+ae,me.depth=-ae,me.setStyle("border-right-width",ue,"em"),me.setStyle("border-top-width",de,"em"),me.setStyle("border-color",a.style.color),me.setStyle("vertical-align",ae,"em"),a.isSelected&&me.setStyle("opacity","50%"),a.bind(ie,me),a.caret&&(me.caret=a.caret),me.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Sa(a.args[0])}]`:""}{${Sa(a.args[1])}}{${Sa(a.args[2])}}`}),pt(["overline","underline"],"{:auto}",{createAtom:a=>new gn(Me(Ce({},a),{body:Ge(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new xr({parent:y,mathstyle:"cramp"},a.style),ee=gn.createBox(E,a.body);if(!ee)return null;const ie=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new $n(null,{classes:b+"-line"});ae.height=ie,ae.maxFontSize=ie*1.125*E.scalingFactor;let ue;return b==="overline"?ue=new Zr({shift:0,children:[{box:ee},3*ie,{box:ae},ie]}):ue=new Zr({top:ee.height,children:[ie,{box:ae},3*ie,{box:ee}]}),a.caret&&(ue.caret=a.caret),new $n(ue,{classes:b,type:"ignore"})}}),pt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=Ge(a.args[1]);return new Yo(Me(Ce({},a),{above:Ge(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>Jr(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),pt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=Ge(a.args[1]);return new Yo(Me(Ce({},a),{below:Ge(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>Jr(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),pt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=Ge(a.args[2]);return new Yo(Me(Ce({},a),{above:Ge(a.args[0]),below:Ge(a.args[1]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>Jr(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),pt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Yo(Me(Ce({},a),{body:Ge(a.args[2]),above:Ge(a.args[1]),below:Ge(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>Jr(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),pt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(Me(Ce({},a),{body:Ge(a.args[1]),smashHeight:(b=(y=a.args[0])==null?void 0:y.includes("t"))!=null?b:!0,smashDepth:(ee=(E=a.args[0])==null?void 0:E.includes("b"))!=null?ee:!0}))}}),pt(["vphantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ge(a.args[0]),isInvisible:!0,smashWidth:!0}))}),pt(["hphantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ge(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),pt(["phantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ge(a.args[0]),isInvisible:!0}))}),pt("not","{:math}",{createAtom:a=>{const y=Ge(a.args[0]);return y.length===0?new gn(Me(Ce({},a),{type:"mrel",value:"\uE020"})):new gn(Me(Ce({},a),{body:[new du(Me(Ce({},a),{body:"\uE020",align:"right"})),...y],captureSelection:!0}))},serialize:(a,y)=>{const b=a.args[0],E=b&&typeof b=="object"&&"group"in b;return a.value!=="\uE020"?E?`\\not{${gn.serialize(b.group,y)}}`:`\\not${gn.serialize(b,y)}`:E?"\\not{}":"\\not"},render:(a,y)=>{if(a.value)return a.createBox(y);const E=a.args[0]&&typeof a.args[0]=="object"&&"group"in a.args[0]?"ord":El(Ge(a.args[0])),ee=gn.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),pt(["ne","neq"],"",{createAtom:a=>new gn(Me(Ce({},a),{type:"mrel",body:[new du(Me(Ce({},a),{body:"\uE020",align:"right",boxType:"rel"})),new gn(Me(Ce({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),pt("rlap","{:auto}",{createAtom:a=>new du(Me(Ce({},a),{body:Ge(a.args[0]),align:"right"}))}),pt("llap","{:auto}",{createAtom:a=>new du(Me(Ce({},a),{body:Ge(a.args[0]),align:"left"}))}),pt("mathrlap","{:math}",{createAtom:a=>new du(Me(Ce({},a),{body:Ge(a.args[0]),align:"left"}))}),pt("mathllap","{:math}",{createAtom:a=>new du(Me(Ce({},a),{body:Ge(a.args[0]),align:"left"}))}),pt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new va(Me(Ce({},a),{body:Ge(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return Jr("\\raisebox",(b=Sa(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),pt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new va(Me(Ce({},a),{body:Ge(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return Jr("\\raise",(b=Sa(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),pt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new va(Me(Ce({},a),{body:Ge(a.args[1]),padding:{dimension:0},offset:(y=Xo(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return Jr("\\lower",(E=Sa(Xo((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),$e("0123456789/@.?!"),xt(65,90),xt(97,122),$e([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),$e([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),$e([["\\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]]),$e([["\\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"),$e([["\\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"]]),$e([["\\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"]]),$e([["\\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"),$e([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),$e([["\\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"),$e([["\\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]]),$e([["=",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"),$e([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),$e([["\\wp",8472],["\\aleph",8501]]),$e([["\\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"),$e([["\\ ",160],["~",160]],"space"),pt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),pt("space","",{createAtom:a=>new hd(a)}),$e([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),$e([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),$e([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Uh="<mo>&#8290;</mo>";function Xh(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Gr(a,y){return!a||!y.generateID?"":` extid="${a}"`}function _v(a,y,b){var E,ee,ie,ae,ue,de,me,ye,Te,ze,nt;let ut=!1;y=y!=null?y:a.atoms.length;let nn="",Nn="",Yt=a.atoms[a.index];const Sn=(ee=(E=Yt.style)==null?void 0:E.variant)!=null?ee:"",Wn=(ae=(ie=Yt.style)==null?void 0:ie.variantStyle)!=null?ae:"";let En="";if(Sn||Wn){const Ni=qt(Yt.value,(ue=Yt.style)==null?void 0:ue.variant,(de=Yt.style)==null?void 0:de.variantStyle);if(Ni!==Yt.value)return a.index+=1,nn=`<mi${Gr(Yt.id,b)}>${Ni}</mi>`,ml(nn,a,b)||(a.mathML+=nn,a.lastType="mi"),!0;En=(me={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"}[Wn+Sn])!=null?me:"",En=` mathvariant="${En}"`}const Li={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(Yt.command==="!")return a.index+=1,nn="<mo>!</mo>",ml(nn,a,b)||(a.mathML+=nn,a.lastType="mo"),!0;if(Li[Yt.command]){a.index+=1;let Ni=`<mi${Gr(Yt.id,b)}${En}>${Li[Yt.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Ni=Uh+Ni),ml(Ni,a,b)||(a.mathML+=Ni,a.lastType="mi"),!0}if(Yt.command==="\\operatorname")Nn=vc(Yt.body),a.index+=1;else if(Sn||Wn)for(;a.index<y&&(Yt.type==="mord"||Yt.type==="macro")&&!Yt.isDigit()&&Sn===((Te=(ye=Yt.style)==null?void 0:ye.variant)!=null?Te:"")&&Wn===((nt=(ze=Yt.style)==null?void 0:ze.variantStyle)!=null?nt:"");)Nn+=vc([Yt]),a.index+=1,Yt=a.atoms[a.index];else(Yt.type==="mord"||Yt.type==="macro")&&!Yt.isDigit()&&(Nn+=vc([Yt]),a.index+=1);if(Nn.length>0){ut=!0,nn=`<mi${En}>${Nn}</mi>`;const Ni=a.lastType;nn.endsWith(">f</mi>")||nn.endsWith(">g</mi>")?(nn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(nn)?"mo":"mi",ml(nn,a,b)||((Ni==="mi"||Ni==="mn"||Ni==="mtext"||Ni==="fence")&&(nn=Uh+nn),a.mathML+=nn)}return ut}function Mv(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const ie=a.atoms[b];E=!ie.isDigit(),ee=!E&&ie.superscript!==void 0,b++}return ee&&(y=b-1),y}function ml(a,y,b){var E;let ee=y.atoms[y.index-1];if(!ee)return!1;if(!ee.superscript&&!ee.subscript)if(((E=y.atoms[y.index])==null?void 0:E.type)==="subsup")ee=y.atoms[y.index],y.index+=1;else return!1;const ie=y.lastType;y.lastType="";const ae=Dr(ee.superscript,b);y.lastType="";const ue=Dr(ee.subscript,b);if(y.lastType=ie,!ae&&!ue)return!1;let de="";return ae&&ue?de=`<msubsup>${a}${ue}${ae}</msubsup>`:ae?de=`<msup>${a}${ae}</msup>`:ue&&(de=`<msub>${a}${ue}</msub>`),y.mathML+=de,y.lastType="",!0}function Ev(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="";for(;a.index<y&&a.atoms[a.index].mode==="text";)ee+=a.atoms[a.index].value?a.atoms[a.index].value:" ",a.index+=1;return ee.length>0?(a.mathML+=`<mtext ${Gr(a.atoms[E].id,b)}>${ee}</mtext>`,a.lastType="mtext",!0):!1}function Lv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="",ie=kv(a);for(ie>=0&&ie<y&&(y=ie);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+Gr(a.atoms[E].id,b)+">"+ee+"</mn>",ie<0&&Mv(a)&&(ie=a.index,a.index+=1),ml(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Dv(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",ie="";if(a.index<y&&a.atoms[a.index].type==="mopen"){let ae=!1,ue=0;const de=a.index;let me=-1,ye=de+1;for(;ye<y&&!ae;)a.atoms[ye].type==="mopen"?ue+=1:a.atoms[ye].type==="mclose"&&(ue-=1),ue===-1&&(ae=!0,me=ye),ye+=1;ae&&(ee="<mrow>",ee+=Su(a.atoms[de],b),ee+=Dr(a.atoms,b,de+1,me),ee+=Su(a.atoms[me],b),ee+="</mrow>",a.index=me+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Uh),ml(ee,a,b)&&(E=!0,a.lastType="",ee=""),ie="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=ie),E}function Av(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",ie="";const ae=a.atoms[a.index];if(!ae)return!1;const ue={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(ue[ae.command]){a.index+=1;const de=`<mo${Gr(ae.id,b)}>${ue[ae.command]}</mo>`;return ml(de,a,b)||(a.mathML+=de,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wf(a.atoms[a.index],b),a.index+=1,ie="mo";else if(a.index<y&&(ae.type==="mop"||ae.type==="operator"||ae.type==="extensible-symbol")){if(ae.subsupPlacement==="over-under"&&(ae.superscript||ae.subscript)){const de=Su(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+de,ee+=Dr(ae.subscript,b),ee+=Dr(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+de,ee+=Dr(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+de,ee+=Dr(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const de=a.atoms[a.index],me=de.value==="\\operatorname",ye=me?'<mi class="MathML-Unit"'+Gr(de.id,b)+">"+vc(de.value)+"</mi>":Su(de,b);ee+=ye,!me&&!/^<mo>(.*)<\/mo>$/.test(ye)?(ee+=lp,ie="applyfunction"):ie=me?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Uh+ee),a.index+=1}return ee.length>0&&(E=!0,ml(ee,a,b)||(a.mathML+=ee,a.lastType=ie)),E}function Dr(a,y,b,E){y!=null||(y={});const ee={atoms:[],index:b!=null?b:0,mathML:"",lastType:""};if(typeof a=="number"||typeof a=="boolean")ee.mathML=a.toString();else if(typeof a=="string")ee.mathML=a;else if(a instanceof gn)ee.mathML=Wf(a,y);else if(Array.isArray(a)){ee.atoms=a;let ie=0;for(E=E||(a?a.length:0);ee.index<E;)if(Ev(ee,E,y)||Lv(ee,E,y)||_v(ee,E,y)||Av(ee,E,y)||Dv(ee,E,y))ie+=1;else if(ee.index<E){let ae=Wf(ee.atoms[ee.index],y);ee.lastType==="mn"&&ae.length>0&&ee.atoms[ee.index].type==="genfrac"&&(ae="<mo>&#x2064;</mo>"+ae),ee.atoms[ee.index].type==="genfrac"?ee.lastType="mfrac":ee.lastType="",ee.index+=1,ml(ae,ee,y)?ie+=1:ae.length>0&&(ee.mathML+=ae,ie+=1)}ie>1&&(ee.mathML="<mrow>"+ee.mathML+"</mrow>")}return ee.mathML}function Su(a,y){let b="";const E=vc(a.value);return E&&(b="<mo"+Gr(a.id,y)+">"+E+"</mo>"),b}function vc(a){if(!a)return"";if(typeof a=="string")return Xh(a);if(!Array.isArray(a)&&typeof a.body=="string")return Xh(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return Xh(y)}function Wf(a,y){var b,E,ee,ie,ae,ue,de,me,ye,Te,ze,nt,ut,nn,Nn,Yt,Sn,Wn,En,Li,Ni,Oi;if(a.mode==="text")return`<mi${Gr(a.id,y)}>${a.value}</mi>`;const Cr={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},zr={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let ei="",Wo="",Vs,Qo,ja,Zo,Mo,Ur;const{command:ba}=a;if(a.command==="\\error")return`<merror${Gr(a.id,y)}>${Dr(a.body,y)}</merror>`;const Ga={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},js={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(a.type){case"first":break;case"group":case"root":ei=Dr(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(ei+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(ei+="<mo>"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>")),ei+="<mtable",a.colFormat){for(ei+=' columnalign="',ja=0;ja<a.colFormat.length;ja++)a.colFormat[ja].align&&(ei+={l:"left",c:"center",r:"right"}[a.colFormat[ja].align]+" ");ei+='"'}for(ei+=">",Qo=0;Qo<a.array.length;Qo++){for(ei+="<mtr>",Vs=0;Vs<a.array[Qo].length;Vs++)ei+="<mtd>"+Dr(a.array[Qo][Vs],y)+"</mtd>";ei+="</mtr>"}ei+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(ei+="<mo>"+(Ga[a.leftDelim]||a.rightDelim)+"</mo>"),ei+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(ei+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(ei+="<mo"+Gr(a.id,y)+">"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(ei+="<mfrac>",ei+=Dr(a.above,y)||"<mi>&nbsp;</mi>",ei+=Dr(a.below,y)||"<mi>&nbsp;</mi>",ei+="</mfrac>"):(ei+="<mtable"+Gr(a.id,y)+">",ei+="<mtr>"+Dr(a.above,y)+"</mtr>",ei+="<mtr>"+Dr(a.below,y)+"</mtr>",ei+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(ei+="<mo"+Gr(a.id,y)+">"+(Ga[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(ei+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(ei+="<msqrt"+Gr(a.id,y)+">",ei+=Dr(a.body,y),ei+="</msqrt>"):(ei+="<mroot"+Gr(a.id,y)+">",ei+=Dr(a.body,y),ei+=Dr(a.above,y),ei+="</mroot>");break;case"leftright":const Gs=a,Us=Gs.leftDelim;ei="<mrow>",Us&&Us!=="."&&(ei+=`<mo${Gr(a.id,y)}>${(b=Ga[Us])!=null?b:Us}</mo>`),a.body&&(ei+=Dr(a.body,y));const Xs=Gs.matchingRightDelim();Xs&&Xs!=="."&&(ei+=`<mo${Gr(a.id,y)}>${(E=Ga[Xs])!=null?E:Xs}</mo>`),ei+="</mrow>";break;case"sizeddelim":case"delim":ei+=`<mo${Gr(a.id,y)}>${Ga[a.value]||a.value}</mo>`;break;case"accent":ei+='<mover accent="true"'+Gr(a.id,y)+">",ei+=Dr(a.body,y),ei+="<mo>"+(js[ba]||a.accent)+"</mo>",ei+="</mover>";break;case"line":case"overlap":break;case"overunder":Mo=a.above,Zo=a.below,(a.svgAbove||Mo)&&(a.svgBelow||Zo)?Ur=a.body:Mo&&Mo.length>0?(Ur=a.body,(ie=(ee=a.body)==null?void 0:ee[0])!=null&&ie.below?(Zo=a.body[0].below,Ur=a.body[0].body):((ue=(ae=a.body)==null?void 0:ae[0])==null?void 0:ue.type)==="first"&&((me=(de=a.body)==null?void 0:de[1])!=null&&me.below)&&(Zo=a.body[1].below,Ur=a.body[1].body)):Zo&&Zo.length>0&&(Ur=a.body,(Te=(ye=a.body)==null?void 0:ye[0])!=null&&Te.above?(Mo=a.body[0].above,Ur=a.body[0].body):((nt=(ze=a.body)==null?void 0:ze[0])==null?void 0:nt.type)==="first"&&((nn=(ut=a.body)==null?void 0:ut[1])!=null&&nn.above)&&(Mo=a.body[1].overscript,Ur=a.body[1].body)),(a.svgAbove||Mo)&&(a.svgBelow||Zo)?(ei+=`<munderover ${Gr(a.id,y)}>`,ei+=(Nn=Cr[a.svgBody])!=null?Nn:Dr(Ur,y),ei+=(Yt=Cr[a.svgBelow])!=null?Yt:Dr(Zo,y),ei+=(Sn=Cr[a.svgAbove])!=null?Sn:Dr(Mo,y),ei+="</munderover>"):a.svgAbove||Mo?(ei+=`<mover ${Gr(a.id,y)}>`+((Wn=Cr[a.svgBody])!=null?Wn:Dr(Ur,y)),ei+=(En=Cr[a.svgAbove])!=null?En:Dr(Mo,y),ei+="</mover>"):(a.svgBelow||Zo)&&(ei+=`<munder ${Gr(a.id,y)}>`+((Li=Cr[a.svgBody])!=null?Li:Dr(Ur,y)),ei+=(Ni=Cr[a.svgBelow])!=null?Ni:Dr(Zo,y),ei+="</munder>");break;case"placeholder":ei+="?";break;case"mord":{ei=typeof a.value=="string"?a.value:ba,ba==="\\char"?ei="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":ei.length>0&&ei.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?ei="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?ei=a.value.charAt(0):(console.error("Did not expect this"),ei=""));const ws=/\d/.test(ei)?"mn":"mi";ei=`<${ws}${Gr(a.id,y)}>${Xh(ei)}</${ws}>`;break}case"mbin":case"mrel":case"minner":ei=Su(a,y);break;case"mpunct":ei='<mo separator="true"'+Gr(a.id,y)+">"+ba+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(ei="<mo"+Gr(a.id,y)+">",ei+=ba==="\\operatorname"?a.body:ba||a.body,ei+="</mo>");break;case"box":ei='<menclose notation="box"',a.backgroundcolor&&(ei+=' mathbackground="'+a.backgroundcolor+'"'),ei+=Gr(a.id,y)+">"+Dr(a.body,y)+"</menclose>";break;case"spacing":ei+='<mspace width="'+((Oi=zr[ba])!=null?Oi:0)+'em"/>';break;case"enclose":ei='<menclose notation="';for(const ws in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ws)&&a.notation[ws]&&(ei+=Wo+ws,Wo=" ");ei+=Gr(a.id,y)+'">'+Dr(a.body,y)+"</menclose>";break;case"prompt":ei='<menclose notation="roundexbox""">'+Dr(a.body,y)+"</menclose>";break;case"space":ei+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":ei+=Su(a,y);break;case"mclose":ei+=Su(a,y);break;case"macro":{const ws=a.command+vc(a.macroArgs);ws&&(ei+=`<mo ${Gr(a.id,y)}>${ws}</mo>`)}break;case"latexgroup":ei+=Dr(a.body,y);break;case"latex":ei+="<mtext"+Gr(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":ei+=Dr(a.body,y);break;case"text":ei+=`<mtext ${Gr(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${Gr(a.id,y)} displaystyle="true">${Dr(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${Gr(a.id,y)} displaystyle="false">${Dr(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return ei}var yc={"\\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 ","\u200B":"","\u2212":"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"},Zf={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 Tv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Ed(a){let y=0;if(Ie(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Bv(a){if(Ie(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function up(a){let y="";if(Ie(a))for(const b of a)b.type!=="first"&&typeof b.value=="string"&&(y+=b.value);return y}function Pv(a){return a?a.map(y=>y.value).join(""):""}function vr(a,y){var b,E,ee,ie,ae;function ue(ye){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(ye)?` <say-as interpret-as="character">${ye}</say-as>`:/[A-Z]/.test(ye)?`capital <say-as interpret-as="character">${ye.toLowerCase()}</say-as>`:ye:/[a-z]/.test(ye)?" '"+ye.toUpperCase()+"'":/[A-Z]/.test(ye)?" 'capital "+ye.toUpperCase()+"'":ye}function de(ye){return"<emphasis>"+ye+"</emphasis>"}if(!y)return"";let me="";if(Ie(y)){let ye=!1,Te=!1;for(let ze=0;ze<y.length;ze++)y[ze].type!=="first"&&(y[ze].mode!=="text"&&(Te=!1),ze<y.length-2&&y[ze].type==="mopen"&&y[ze+2].type==="mclose"&&y[ze+1].type==="mord"?(me+=" of ",me+=de(vr(a,y[ze+1])),ze+=2):y[ze].mode==="text"?Te?me+=(b=y[ze].value)!=null?b:" ":(Te=!0,me+=vr("text",y[ze])):y[ze].isDigit()?ye?me+=y[ze].asDigit():(ye=!0,me+=vr(a,y[ze])):(ye=!1,me+=vr(a,y[ze])))}else if(y.mode==="text")y.id&&a==="math"&&(me+='<mark name="'+y.id.toString()+'"/>'),me+=y.value;else{y.id&&a==="math"&&(me+='<mark name="'+y.id.toString()+'"/>');let ye="",Te="",ze="",nt=!1;const{command:ut}=y;switch(ut){case"\\vec":return"vector "+vr(a,y.body);case"\\acute":return vr(a,y.body)+" acute";case"\\grave":return vr(a,y.body)+" grave";case"\\dot":return"dot over"+vr(a,y.body);case"\\ddot":return"double dot over"+vr(a,y.body);case"\\mathring":return"ring over"+vr(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+vr(a,y.body);case"\\bar":return vr(a,y.body)+" bar";case"\\breve":return vr(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+vr(a,y.body);case"\\hat":case"\\widehat":return"hat over"+vr(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+vr(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+vr(a,y.body)}switch(y.type){case"prompt":const nn=y.body.length>1?'start input . <break time="500ms"/> '+vr(a,y.body)+'. <break time="500ms"/> end input':"blank";me+=' <break time="300ms"/> '+nn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const Nn=y.array,Yt=y.environmentName;if(Object.keys(Zf).includes(Yt)){me+=` begin ${Zf[Yt]} `;for(let En=0;En<Nn.length;En++){En>0&&(me+=","),me+=` row ${En+1} `;for(let Li=0;Li<Nn[En].length;Li++)Li>0&&(me+=","),me+=` column ${Li+1}: `,me+=vr("math",Nn[En][Li])}me+=` end ${Zf[Yt]} `}break;case"group":ut==="\\ne"?me+=" not equal ":(ut==="\\not"&&(me+=" not "),me+=vr("math",y.body));break;case"root":me+=vr("math",y.body);break;case"genfrac":if(ye=vr("math",y.above),Te=vr("math",y.below),Ed(y.above)&&Ed(y.below)){const Li={"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 "}[up(y.above)+"/"+up(y.below)];Li?me=Li:me+=ye+" over "+Te}else me+=' the fraction <break time="150ms"/>'+ye+' over <break time="150ms"/>'+Te+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(ze=vr("math",y.body),y.hasEmptyBranch("above"))me+=Ed(y.body)?" the square root of "+ze+" , ":' the square root of <break time="200ms"/>'+ze+'. <break time="200ms"/> End square root';else{let En=vr("math",y.above);En=En.trim();const Li=En.replace(/<mark([^/]*)\/>/g,"");Li==="3"?me+=' the cube root of <break time="200ms"/>'+ze+'. <break time="200ms"/> End cube root':Li==="n"?me+=' the nth root of <break time="200ms"/>'+ze+'. <break time="200ms"/> End root':me+=' the root with index: <break time="200ms"/>'+En+', of <break time="200ms"/>'+ze+'. <break time="200ms"/> End root'}break;case"leftright":{const En=y;me+=(ee=En.leftDelim?yc[En.leftDelim]:void 0)!=null?ee:En.leftDelim,me+=vr("math",y.body),me+=(ie=En.rightDelim?yc[En.rightDelim]:void 0)!=null?ie:En.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Sn=ut.replace(/^\\/g,""),Wn=zn()[Sn];Wn&&(Wn!=null&&Wn.expand?me+=vr("math",y.body):me+=`${Sn} `);break;case"placeholder":me+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(ut==="\\mathbin"||ut==="\\mathrel"||ut==="\\mathopen"||ut==="\\mathclose"||ut==="\\mathpunct"||ut==="\\mathord"||ut==="\\mathinner"){me=vr(a,y.body);break}let En=y.isDigit()?y.asDigit():y.value,Li=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(Li=y.value,En=Li),a==="text")me+=En;else{if(y.type==="mbin"&&(me+='<break time="150ms"/>'),En){const Ni=yc[En]||(Li?yc[Li.trim()]:"");if(Ni)me+=" "+Ni;else{const Oi=Li?Tv(Li.trim()):"";me+=Oi||ue(En)}}else me+=vr("math",y.body);y.type==="mbin"&&(me+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const En=y.command;if(En==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Li=vr("math",y.superscript);Li=Li.trim();let Ni=vr("math",y.subscript);Ni=Ni.trim(),me+=' the summation from <break time="200ms"/>'+Ni+'<break time="200ms"/> to <break time="200ms"/>'+Li+'<break time="200ms"/> of <break time="150ms"/>',nt=!0}else if(y.hasEmptyBranch("subscript"))me+=" the summation of";else{let Li=vr("math",y.subscript);Li=Li.trim(),me+=' the summation from <break time="200ms"/>'+Li+'<break time="200ms"/> of <break time="150ms"/>',nt=!0}else if(En==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Li=vr("math",y.superscript);Li=Li.trim();let Ni=vr("math",y.subscript);Ni=Ni.trim(),me+=' the product from <break time="200ms"/>'+Ni+'<break time="200ms"/> to <break time="200ms"/>'+Li+'<break time="200ms"/> of <break time="150ms"/>',nt=!0}else if(y.hasEmptyBranch("subscript"))me+=" the product of ";else{let Li=vr("math",y.subscript);Li=Li.trim(),me+=' the product from <break time="200ms"/>'+Li+'<break time="200ms"/> of <break time="150ms"/>',nt=!0}else if(En==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Li=vr("math",y.superscript);Li=Li.trim();let Ni=vr("math",y.subscript);Ni=Ni.trim(),me+=' the integral from <break time="200ms"/>'+de(Ni)+'<break time="200ms"/> to <break time="200ms"/>'+de(Li)+' <break time="200ms"/> of ',nt=!0}else me+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const Li=(ae=yc[y.value])!=null?ae:y.command?yc[y.command]:void 0;me+=Li||" "+y.value}else y.command&&(y.command==="\\mathop"?me+=vr("math",y.body):y.command==="\\operatorname"?me+=Pv(y.body):me+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":ze=vr("math",y.body),me+=" crossed out "+ze+". End crossed out.";break;case"space":case"spacing":break}if(!nt&&!y.hasEmptyBranch("superscript")){let nn=vr(a,y.superscript);nn=nn.trim();const Nn=nn.replace(/<[^>]*>/g,"");if(Ed(y.superscript)){if(a==="math"){const Yt=Bv(y.superscript);Yt&&(me+='<mark name="'+Yt+'"/>')}Nn==="\u2032"?me+=" prime ":Nn==="2"?me+=" squared ":Nn==="3"?me+=" cubed ":Number.isNaN(Number.parseInt(Nn))?me+=" to the "+nn+"; ":me+=' to the <say-as interpret-as="ordinal">'+Nn+"</say-as> power; "}else Number.isNaN(Number.parseInt(Nn))?me+=" raised to the "+nn+"; ":me+=' raised to the <say-as interpret-as="ordinal">'+Nn+"</say-as> power; "}if(!nt&&!y.hasEmptyBranch("subscript")){let nn=vr("math",y.subscript);nn=nn.trim(),me+=Ed(y.subscript)?" sub "+nn:" subscript "+nn+". End subscript. "}}return me}function bc(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Dr(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const ie=(b=window.SRE)!=null?b:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&ie.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let ae="";try{ae=ie.toSpeech(ee)}catch(ue){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",ue)}return ae}return""}let E=vr("math",a);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let ee="";window.MathfieldElement.speechEngineRate&&(ee='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),E='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+ee+"<p><s>"+E+"</s></p>"+(ee?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&rt()==="macos"?E=E.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,""):E=E.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return E}var Ld={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Dd={"\\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 Iv(a){let y="";for(const b of a){const E=y[y.length-1];E!==void 0&&/\d/.test(E)&&/^\d/.test(b)&&(y+=" "),y+=b}return y}function ya(a){var y,b,E,ee,ie,ae,ue,de,me,ye,Te,ze,nt;if(!a)return"";if(Ie(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(ya).join("");if(a[0].mode==="text"){let Wn=0,En="";for(;((y=a[Wn])==null?void 0:y.mode)==="text";)En+=a[Wn].body?ya(a[Wn].body):a[Wn].value,Wn++;return`"${En}" ${ya(a.slice(Wn))}`}let Yt=0;const Sn=[];for(;a[Yt]&&a[Yt].mode==="math";){let Wn="";for(;a[Yt]&&a[Yt].type==="mord"&&/\d/.test(a[Yt].value);)Wn+=a[Yt++].value;Wn?Sn.push(Wn):Sn.push(ya(a[Yt++]))}return Sn.push(ya(a.slice(Yt))),Iv(Sn)}if(a.mode==="text")return`"${a.value}"`;let ut="";const{command:nn}=a;let Nn;if(nn==="\\placeholder")return`(${ya(a.body)})`;switch(a.type){case"accent":const Yt={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[nn];ut=`${Yt!=null?Yt:""} ${ya(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(Oi=>Oi.value).join("");case"group":case"root":ut=(b=Ld[nn])!=null?b:ya(a.body);break;case"genfrac":{const Oi=a;(Oi.leftDelim||Oi.rightDelim)&&(ut=Oi.leftDelim==="."||!Oi.leftDelim?"{:":Oi.leftDelim),Oi.hasBarLine?(ut+="(",ut+=ya(Oi.above),ut+=")/(",ut+=ya(Oi.below),ut+=")"):(ut+="("+ya(Oi.above)+"),",ut+="("+ya(Oi.below)+")"),(Oi.leftDelim||Oi.rightDelim)&&(ut+=Oi.rightDelim==="."||!Oi.rightDelim?"{:":Oi.rightDelim)}break;case"surd":ut+=a.hasEmptyBranch("above")?"sqrt("+ya(a.body)+")":"root("+ya(a.above)+")("+ya(a.body)+")";break;case"latex":ut=a.value;break;case"leftright":{const Oi=a,Cr=Oi.leftDelim;ut+=Cr==="."||!Cr?"{:":Cr,ut+=ya(Oi.body);const zr=Oi.matchingRightDelim();ut+=zr==="."||!zr?":}":zr}break;case"sizeddelim":case"delim":ut=a.value;break;case"overlap":break;case"overunder":break;case"mord":ut=(ee=(E=Ld[nn])!=null?E:nn)!=null?ee:typeof a.value=="string"?a.value:"",ut.startsWith("\\")&&(ut+=" "),Nn=nn?nn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,Nn?ut=String.fromCodePoint(Number.parseInt("0x"+Nn[1])):ut.length>0&&ut.startsWith("\\")&&(ut=typeof a.value=="string"?a.value.charAt(0):a.command),ut=Ov(ut,a.style);break;case"mbin":case"mrel":case"minner":ut=(ae=(ie=Ld[nn])!=null?ie:Dd[nn])!=null?ae:a.value;break;case"mopen":case"mclose":ut=a.value;break;case"mpunct":ut=(ue=Dd[nn])!=null?ue:nn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Dd[nn]?ut=Dd[nn]:ut=nn==="\\operatorname"?ya(a.body):(de=a.value)!=null?de:nn,ut+=" ");break;case"array":const Sn=a.array,Wn=a.environmentName,En=(me={bmatrix:["[","]"],"bmatrix*":["[","]"]}[Wn])!=null?me:["(",")"],Li=[];for(const Oi of Sn){const Cr=[];for(const zr of Oi)Cr.push(En[0]+ya(zr)+En[1]);Li.push(Cr.join(","))}const Ni=(ye={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[Wn])!=null?ye:["(",")"];ut=Ni[0]+Li.join(",")+Ni[1];break;case"box":break;case"spacing":ut=(Te=Ld[nn])!=null?Te:" ";break;case"enclose":ut="("+ya(a.body)+")";break;case"space":ut=" ";break;case"subsup":ut="";break;case"macro":ut=(nt=(ze=Ld[nn])!=null?ze:Dd[nn])!=null?nt:ya(a.body);break}if(!a.hasEmptyBranch("subscript")){ut+="_";const Yt=ya(a.subscript);ut+=Yt.length!==1?`(${Yt})`:Yt}if(!a.hasEmptyBranch("superscript")){ut+="^";const Yt=ya(a.superscript);ut+=Yt.length!==1?`(${Yt})`:Yt}return ut}function Ov(a,y){if(!y)return a;let b=a;return y.variant==="double-struck"&&(b=`bbb "${b}"`),y.variant==="script"&&(b=`cc "${b}"`),y.variant==="fraktur"&&(b=`fr "${b}"`),y.variant==="sans-serif"&&(b=`sf "${b}"`),y.variant==="monospace"&&(b=`tt "${b}"`),y.variantStyle==="bold"&&(b=`bb "${b}"`),y.color?`color({${y.color}})(${b})`:b}function Va(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new xr({from:Me(Ce({},Qu()),{renderPlaceholder:()=>new $n(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new gn({mode:"math",type:"root",body:Za(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(qu(fd(ae,ee)),Yu(ae,{classes:"ML__latex"}).toMarkup()):""}function E1(a){return t0(a,{context:Qu()})}function Rv(a,y={}){return Dr(Za(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=Za(a,{parseMode:"math",mathstyle:"displaystyle"});return bc(y)}var qh;function Fv(a){var y,b;if(!qh){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?qh=new E: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(b=qh==null?void 0:qh.box(a).latex)!=null?b:""}function L1(a,y="math"){return ya(new gn({type:"root",body:Za(a,{parseMode:y})}))}function D1(a){return cu(a,{format:"ascii-math"})[1]}function Vf(a){if(typeof a=="string"){const y=$v(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?cp(a):a}function xc(a){return a<0?0:a>255?255:Math.round(a)}function $v(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&typeof y.a=="undefined"&&(y.a=1),y}function jf(a){const[y,b,E]=[a.L,a.C,a.H],ee=E*Math.PI/180,ie={L:y,a:b*Math.cos(ee),b:b*Math.sin(ee)};return a.alpha!==void 0&&(ie.alpha=a.alpha),ie}function zv(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.sqrt(b*b+E*E),ae=Math.atan2(E,b)*180/Math.PI,ue={L:y,C:ee,H:ae};return a.alpha!==void 0&&(ue.alpha=a.alpha),ue}function Gf(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.pow(.9999999984505198*y+.39633779217376786*b+.2158037580607588*E,3),ie=Math.pow(1.00000000888176*y-.10556134232365635*b-.0638541747717059*E,3),ae=Math.pow(y*1.000000054672411-.0894841820949657*b-1.2914855378640917*E,3),ue=4.076741661347994*ee-3.307711590408193*ie+.230969928729428*ae,de=-1.2684380040921763*ee+2.6097574006633715*ie-.3413193963102197*ae,me=-.004196086541837188*ee-.7034186144594493*ie+1.7076147009309444*ae,ye=Te=>{const ze=Math.abs(Te);return ze<=.0031308?Te*12.92:(Math.sign(Te)||1)*(1.055*Math.pow(ze,1/2.4)-.055)};return[ye(ue),ye(de),ye(me)]}function Uf(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xf(a,y){let[b,E,ee]=a;return b=xc(b*255),E=xc(E*255),ee=xc(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function cp(a){let[y,b,E]=Gf(a);if(Uf([y,b,E]))return Xf([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=Gf(jf(ee)),!Uf([y,b,E]))return Xf([y,b,E],a.alpha);let ie=0,ae=a.L,ue=(ie+ae)/2;ee.C=ue;const de=.36/Math.pow(2,12);for(;ae-ie>de;)ue=(ie+ae)/2,ee.C=ue,[y,b,E]=Gf(jf(ee)),Uf([y,b,E])?ie=ue:ae=ue;return Xf([y,b,E],a.alpha)}function Kv(a){return cp(jf(a))}function dp(a,y){const b=Vf(a),E=Vf(y),ee=.56,ie=.57,ae=.62,ue=.65,de=.022,me=1.414,ye=.1,Te=5e-4,ze=1.14,nt=.027,ut=1.14,nn=.027;function Nn(Oi){return Oi>=de?Oi:Oi+qs(de-Oi,me)}function Yt(Oi){return(Oi<0?-1:1)*Math.pow(Math.abs(Oi),2.4)}const Sn=Nn(Yt(E.r/255)*.2126729+Yt(E.g/255)*.7151522+Yt(E.b/255)*.072175),Wn=Nn(Yt(b.r/255)*.2126729+Yt(b.g/255)*.7151522+Yt(b.b/255)*.072175);let En,Li,Ni;return Math.abs(Wn-Sn)<Te?Li=0:Wn>Sn?(En=qs(Wn,ee)-qs(Sn,ie),Li=En*ze):(En=qs(Wn,ue)-qs(Sn,ae),Li=En*ut),Math.abs(Li)<ye?Ni=0:Li>0?Ni=Li-nn:Ni=Li+nt,Ni*100}function hp(a,y,b){b!=null||(b="#fff"),y!=null||(y="#000");const E=dp(a,b),ee=dp(a,y);return Math.abs(E)>Math.abs(ee)?b:y}function Hv(a){const y=Vf(a);let b=((1<<24)+(xc(y.r)<<16)+(xc(y.g)<<8)+xc(y.b)).toString(16).slice(1);return y.alpha!==void 0&&y.alpha<1&&(b+=("00"+Math.round(y.alpha*255).toString(16)).slice(-2)),b[0]===b[1]&&b[2]===b[3]&&b[4]===b[5]&&b[6]===b[7]&&(b=b[0]+b[2]+b[4]+(y.alpha!==void 0&&y.alpha<1?b[6]:"")),"#"+b}function na(a){const y=fp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function fp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=fp(a);if(b.length!==1)return!1;const E=pf[y];return E?!!E.test(b[0].value):!1}function Zv(a,y){return na(a).length>0}function Vv(a){return[qf(a,"double-struck","mathbb","tooltip.blackboard"),qf(a,"fraktur","mathfrak","tooltip.fraktur"),qf(a,"calligraphic","mathcal","tooltip.caligraphic"),Yf(a,"up","mathrm","tooltip.roman-upright"),Yf(a,"bold","mathbf","tooltip.bold"),Yf(a,"italic","mathit","tooltip.italic")]}function jv(a){return[{label:()=>Va(`\\vec{${na(a)}}`),visible:()=>na(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overrightarrow{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overleftarrow{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\dot{${na(a)}}`),visible:()=>na(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\ddot{${na(a)}}`),visible:()=>na(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bar{${na(a)}}`),visible:()=>na(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overline{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overgroup{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overbrace{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underline{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\undergroup{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underbrace{${na(a)}}`),visible:()=>na(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Gv(a){return[{label:()=>Va(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Uv(a){const y=[];for(const b of Object.keys(Ve))y.push({class:(Hv(hp(Ve[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ve[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({backgroundColor:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({backgroundColor:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}function Xv(a){const y=[];for(const b of Object.keys(Xe))y.push({class:(hp(Xe[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Xe[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({color:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({color:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}var qv=class extends ep{constructor(a,y,b,E){super(a,y),this.row=b,this.col=E}set active(a){const y=this.parentMenu.children;if(a)for(const b of y)b.element.classList.toggle("active",b.row<=this.row&&b.col<=this.col);else for(const b of y)b.element.classList.remove("active")}};function Yv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,ie)=>new qv(ee,ie,b,E),label:"\u2610",tooltip:()=>lt("tooltip.row-by-col",b,E),data:{row:b,col:E},onMenuSelect:()=>{a.insert(`\\begin{pmatrix}${Array(b).fill(Array(E).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return y}function Jv(a){return[{label:()=>lt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Cu(a)},{label:()=>lt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Cu(a)},{label:()=>lt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>Cu(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>lt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Cu(a)},{type:"divider"},{label:()=>lt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Cu(a)},{label:()=>lt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Cu(a)},{type:"divider"},{label:()=>lt("menu.borders"),visible:()=>(Qv(a)||Cu(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Ad(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Ad(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Ad(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Ad(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Ad(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>lt("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Yv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>lt("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>lt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{uc(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>lt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{uc(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>lt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>lt("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Uv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&na(a).length>0,submenu:Gv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>lt("menu.evaluate"),id:"ce-evaluate",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const y=t1(a);if(!y){a.model.announce("plonk");return}a.model.selectionIsCollapsed?(a.model.position=a.model.lastOffset,a.insert(`=${y}`,{insertionMode:"insertAfter",selectionMode:"item"})):a.insert(y,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>lt("menu.simplify"),id:"ce-simplify",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var y,b;if(a.model.selectionIsCollapsed){const E=(y=a.expression)==null?void 0:y.simplify();if(a.model.position=a.model.lastOffset,!E){a.model.announce("plonk");return}a.insert(`=${E.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection)).simplify();if(!E){a.model.announce("plonk");return}a.insert(E.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var y;if(window.MathfieldElement.computeEngine===null)return"";const b=(y=a.expression)==null?void 0:y.unknowns[0];return b?lt("menu.solve-for",Va(b)):lt("menu.solve")},id:"ce-solve",visible:()=>{var y;return a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((y=a.expression)==null?void 0:y.unknowns.length)===1&&a.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var y;const b=a.expression,E=b==null?void 0:b.unknowns[0],ee=(y=b.solve(E))==null?void 0:y.map(ie=>{var ae;return(ae=ie.simplify().latex)!=null?ae:""});if(!ee){a.model.announce("plonk");return}a.insert(`${E}=${ee.length===1?ee[0]:"\\left\\lbrace"+(ee==null?void 0:ee.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>lt("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>lt("menu.copy"),id:"copy",submenu:[{label:()=>lt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>er.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>lt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>er.copyToClipboard(a,"ascii-math")},{label:()=>lt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>er.copyToClipboard(a,"math-ml")}]},{label:()=>lt("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>lt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function Cu(a){var y;return!!((y=a.model.parentEnvironment)!=null&&y.array)}function Qv(a){return a.model.at(a.model.position).type==="array"}function e1(a){var y;const b=(y=a.model.parentEnvironment)==null?void 0:y.array;return b?[b.length,b.reduce((E,ee)=>Math.max(E,ee.length),0)]:[0,0]}function Ad(a,y){Ch(a),a.flushInlineShortcutBuffer(),B0(a.model,y),fa(a)}function t1(a){var y,b;let E;if(a.model.selectionIsCollapsed?E=(y=window.MathfieldElement.computeEngine)==null?void 0:y.parse(a.getValue(),{canonical:!1}):E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection),{canonical:!1}),!E)return"";let ee=E.evaluate();return ee.isSame(E)&&(ee=E.N()),ee.latex}function qf(a,y,b,E){return{label:()=>Va(`\\${b}{${na(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Wv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variant:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variant:y},{operation:"toggle"}),a.adoptStyle="none"}}}function Yf(a,y,b,E){return{label:()=>Va(`\\${b}{${na(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Zv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variantStyle:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variantStyle:y},{operation:"toggle"}),a.adoptStyle="none"}}}function wc(a,y){return a+bc(y)}Oo({speak:(a,y,b)=>n1(a,y,b)},{target:"mathfield"});function n1(a,y,b){var E,ee;b=b!=null?b:{withHighlighting:!1};const{model:ie}=a;function ae(ye){let Te=null;switch(ye){case"all":Te=ie.root;break;case"selection":Te=ie.getAtoms(ie.selection);break;case"left":{Te=ie.getAtoms(ie.offsetOf(ie.at(ie.position).leftSibling),ie.position);break}case"right":{Te=ie.getAtoms(ie.position,ie.offsetOf(ie.at(ie.position).rightSibling));break}case"group":Te=ie.getAtoms(ie.getSiblingsRange(ie.position));break;case"parent":{const{parent:ze}=ie.at(ie.position);ze!=null&&ze.parent?Te=ze:Te=ie.root;break}default:Te=ie.root}return Te}function ue(ye){let Te="";switch(ye){case"all":console.log("Internal failure: speak all failed");break;case"selection":Te="no selection";break;case"left":Te="at start";break;case"right":Te="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Te="no parent";break;default:console.log('unknown speak_ param value: "'+ye+'"');break}return Te}const de=ae(y);if(de===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,ue(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const me=bc(de);return mt()&&b.withHighlighting?($l().readAloudMathfield=a,pu(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,me)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(me),!1}function i1(a){var y,b;if(!mt()){console.log("Speak:",a);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const E=new SpeechSynthesisUtterance(a);window.speechSynthesis.speak(E)}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{const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"mp3",VoiceId:(y=window.MathfieldElement.speechEngineVoice)!=null?y:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna")?"neural":"standard",Text:a,TextType:"ssml"};E.synthesizeSpeech(ee,(ie,ae)=>{if(ie)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${ie}`);else if(ae!=null&&ae.AudioStream){const ue=new Uint8Array(ae.AudioStream),de=new Blob([ue.buffer],{type:"audio/mpeg"}),me=URL.createObjectURL(de);new Audio(me).play().catch(Te=>console.log(Te))}else console.log("polly.synthesizeSpeech():",ae)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function pp(a){var y;let b;if(a.parent.type==="prompt")a.parentBranch==="body"&&(b="prompt");else if(a.parentBranch==="body")b=a.type&&(y={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[a.type])!=null?y:"parent";else if(a.parent.type==="genfrac"){if(a.parentBranch==="above")return"numerator";if(a.parentBranch==="below")return"denominator"}else a.parent.type==="surd"?a.parentBranch==="above"&&(b="index"):a.parentBranch==="superscript"?b="superscript":a.parentBranch==="subscript"&&(b="subscript");return b||console.log("unknown relationship"),b!=null?b:"parent"}function r1(a,y,b,E){let ee="";if(y==="plonk")window.MathfieldElement.playSound("plonk"),a.flushInlineShortcutBuffer();else if(y==="delete")ee=wc("deleted: ",E);else if(y==="focus"||y.includes("move"))ee=a1(a.model,b)+(a.model.selectionIsCollapsed?"":"selected: ")+o1(a.model);else if(y==="replacement")ee=wc("",a.model.at(a.model.position));else if(y==="line"){const ie=wc("",a.model.root);a.keyboardDelegate.setAriaLabel(ie)}else ee=E?wc(y+" ",E):y;if(ee){const ie=a.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";a.ariaLiveText.textContent=ee+ie}}function a1(a,y){if(Number.isNaN(y))return"";const b=a.at(y);if(!b||b.treeDepth<=a.at(a.position).treeDepth)return"";let E="",ee=b.parent;const ie=a.at(a.position).parent;for(;ee!==a.root&&ee!==ie;)E+=`out of ${pp(ee)};`,ee=ee.parent;return E}function o1(a){if(!a.selectionIsCollapsed)return wc("",a.getAtoms(a.selection));let y="";const b=a.at(a.position),E=pp(b);return b.isFirstSibling&&(y=(E?"start of "+E:"unknown")+": "),b.isLastSibling?b.isFirstSibling||(y+=E?"end of "+E:"unknown"):y+=wc("",b),y}var s1=class{constructor(a,y,b){this.mathfield=a,this.mode=y,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=b}dispose(){this.mathfield=void 0}getState(){const a={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(a.direction=this.selection.direction),{content:this.root.toJson(),selection:a,mode:this.mode}}setState(a,y){var b;const E=this.silenceNotifications;this.silenceNotifications=(b=y==null?void 0:y.silenceNotifications)!=null?b:!0;let ee={};if((y==null?void 0:y.type)==="undo"&&(ee={inputType:"historyUndo"}),(y==null?void 0:y.type)==="redo"&&(ee={inputType:"historyRedo"}),this.contentWillChange(ee)){const ie=this.silenceNotifications;this.silenceNotifications=!0,this.mode=a.mode,this.root=Ol(a.content),this.selection=a.selection,this.silenceNotifications=ie,this.contentDidChange(ee)}this.silenceNotifications=E}get atoms(){return this.root.children}get selection(){return this._selection}set selection(a){this.setSelection(a)}setSelection(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var b,E,ee;const ie=this.normalizeSelection(a,y);if(ie===void 0)throw new TypeError("Invalid selection");if(ie.ranges.length===1&&ie.ranges[0][0]===ie.ranges[0][1]){const ye=ie.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(ye))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(ye-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(ye-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(ye+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(ye+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=ye,this._position=ye,this._selection=ie;return}const ae=Ha(ie);ie.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const ue=this.at(ae[0]+1),de=this.at(ae[1]),me=gn.commonAncestor(ue,de);(me==null?void 0:me.type)==="array"&&ue.parent===me&&de.parent===me?this._selection={ranges:[ae],direction:ie.direction}:this._selection={ranges:[ae],direction:ie.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(a){var y;const b=this.at(a);(b==null?void 0:b.type)==="placeholder"?this.setSelection(a-1,a):((y=b==null?void 0:b.rightSibling)==null?void 0:y.type)==="placeholder"?this.setSelection(a,a+1):this.position=a,b instanceof Ya&&b.isSuggestion&&(b.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(a){this.setSelection(a,a)}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(a="forward"){return this._anchor===this._position?!1:(a==="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(a){return this.atoms[a]}offsetOf(a){return this.atoms.indexOf(a)}getSiblingsRange(a){const y=this.at(a),{parent:b}=y;if(!b)return[0,this.lastOffset];const E=y.parent.branch(y.parentBranch);return[this.offsetOf(E[0]),this.offsetOf(E[E.length-1])]}getBranchRange(a,y){const b=this.at(a).branch(y);return[this.offsetOf(b[0]),this.offsetOf(b[b.length-1])]}getAtoms(a,y,b){let E=b!=null?b:{};if(tc(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((me,ye)=>[...me,...this.getAtoms(ye,E)],[]);a=a.ranges[0]}let ee,ie;if(Is(a)){if(ee=a,!Is(y))return[];ie=y}else[ee,ie]=a,E=y!=null?y:{};if(!Number.isFinite(ee))return[];E.includeChildren===void 0&&(E.includeChildren=!1),ee<0&&(ee=this.lastOffset-ee+1),ie<0&&(ie=this.lastOffset-ie+1);const ae=Math.min(ee,ie)+1,ue=Math.max(ee,ie);if(!E.includeChildren&&ae===1&&ue===this.lastOffset)return[this.root];let de=[];for(let me=ae;me<=ue;me++){const ye=this.atoms[me];mp(this,ye,ae,ue)&&de.push(ye)}return E.includeChildren||(de=de.filter(me=>{let ye=!1,{parent:Te}=me;for(;Te&&!ye;)ye=mp(this,Te,ae,ue),Te=Te.parent;return!ye})),de}getAllAtoms(a=0){const y=[],b=this.lastOffset;for(let E=a;E<=b;E++)y.push(this.atoms[E]);for(let E=0;E<a;E++)y.push(this.atoms[E]);return y}findAtom(a,y=0,b="forward"){let E;const ee=this.lastOffset;if(b==="forward"){for(let ie=y;ie<=ee;ie++)if(E=this.atoms[ie],a(E))return E;for(let ie=0;ie<y;ie++)if(E=this.atoms[ie],a(E))return E;return}for(let ie=y;ie>=0;ie--)if(E=this.atoms[ie],a(E))return E;for(let ie=ee;ie>y;ie--)if(E=this.atoms[ie],a(E))return E}extractAtoms(a){let y=this.getAtoms(a);if(y.length===1&&!y[0].parent)if(y[0].type==="root")y=[...y[0].body],y.shift();else return y=this.root.cells.flat(),this.root=new gn({type:"root",body:[]}),y;for(const b of y)b.parent.removeChild(b);return y}deleteAtoms(a){this.extractAtoms(a),this.position=a[0]}atomToString(a,y){const b=y!=null?y:"latex";if(b.startsWith("latex"))return gn.serialize([a],{expandMacro:b==="latex-expanded",skipStyles:b==="latex-unstyled",skipPlaceholders:b==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(b==="math-ml")return Dr(a);if(b==="spoken")return bc(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=bc(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}if(b==="spoken-ssml"||b==="spoken-ssml-with-highlighting"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const ee=bc(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?ya(a):(console.error(`MathLive 0.98.5: Unexpected format "${b}`),"")}getValue(a,y,b){if(a===void 0)return this.atomToString(this.root,"latex");if(typeof a=="string"&&a!=="math-json")return this.atomToString(this.root,a);let E,ee;if(Is(a)&&Is(y)?(E=[this.normalizeRange([a,y])],ee=b):ec(a)?(E=[this.normalizeRange(a)],ee=y):tc(a)?(E=a.ranges,ee=y):(E=[this.normalizeRange([0,-1])],ee=a),ee!=null||(ee="latex"),ee==="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"]';const ie=this.getValue({ranges:E},"latex-unstyled");try{const ae=window.MathfieldElement.computeEngine.parse(ie);return JSON.stringify(ae.json)}catch(ae){return JSON.stringify(["Error",`'${ae.toString()}'`])}}if(ee.startsWith("latex")){const ie={expandMacro:ee==="latex-expanded",skipStyles:ee==="latex-unstyled",skipPlaceholders:ee==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return cr(E.map(ae=>gn.serialize(this.getAtoms(ae),ie)))}return E.map(ie=>this.getAtoms(ie).map(ae=>this.atomToString(ae,ee)).join("")).join("")}extendSelectionTo(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const b=this.normalizeRange([a,y]);let[E,ee]=b,{parent:ie}=this.at(ee);if(ie&&(ie.type==="genfrac"||ie.type==="subsup"))for(;ie!==this.root&&Jf(this,ie,[E,ee]);)ee=this.offsetOf(ie),ie=ie.parent;for(ie=this.at(E).parent;ie!==this.root&&Jf(this,ie,[E,ee]);)E=this.offsetOf(ie.leftSibling),ie=ie.parent;if(ie=this.at(ee).parent,(ie==null?void 0:ie.type)==="genfrac")for(;ie!==this.root&&Jf(this,ie,[E,ee]);)ee=this.offsetOf(ie),console.assert(ee>=0),ie=ie.parent;this._position=this.normalizeOffset(y),this._selection={ranges:[[E,ee]],direction:"none"}})}announce(a,y,b=[]){var E,ee;((ee=(E=this.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("announce",{detail:{command:a,previousPosition:y,atoms:b},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0)&&r1(this.mathfield,a,y,b)}deferNotifications(a,y){const b=this._selection,E=this._anchor,ee=this._position,ie=this.silenceNotifications;this.silenceNotifications=!0;const ae=this.root.changeCounter;y();const ue=this.root.changeCounter!==ae,de=E!==this._anchor||ee!==this._position||uu(this._selection,b)==="different";return this.silenceNotifications=ie,a.content&&ue&&this.contentDidChange({inputType:a.type}),a.selection&&de&&this.selectionDidChange(),ue||de}normalizeOffset(a){return a>0?a=Math.min(a,this.lastOffset):a<0&&(a=this.lastOffset+a+1),a}normalizeRange(a){let[y,b]=a;return y=this.normalizeOffset(y),b=this.normalizeOffset(b),y<b?[y,b]:[b,y]}normalizeSelection(a,y){var b;let E;if(Is(a)){const ee=this.normalizeOffset(a);if(Is(y)){const ie=this.normalizeOffset(y);E=ee<=ie?{ranges:[[ee,ie]],direction:"none"}:{ranges:[[ie,ee]],direction:"backward"}}else E={ranges:[[ee,ee]],direction:"none"}}else if(ec(a)){const ee=this.normalizeOffset(a[0]),ie=this.normalizeOffset(a[1]);E=ee<=ie?{ranges:[[ee,ie]],direction:"none"}:{ranges:[[ie,ee]],direction:"backward"}}else tc(a)&&(E={ranges:a.ranges.map(ee=>this.normalizeRange(ee)),direction:(b=a.direction)!=null?b:"none"});return console.assert(E!==void 0),E}get parentEnvironment(){let a=this.at(this.position).parent;if(a){for(;a.parent&&a.type!=="array";)a=a.parent;if(a.type==="array")return a}}get cell(){var a;let y=this.at(this.position);if(y){for(;y&&((a=y.parent)==null?void 0:a.type)!=="array";)y=y.parent;if(!(!(y!=null&&y.parent)||y.parent.type!=="array"))return y.parentBranch}}contentWillChange(a={}){if(this.silenceNotifications||!this.mathfield)return!0;const y=this.silenceNotifications;this.silenceNotifications=!0;const b=this.mathfield.onContentWillChange(a);return this.silenceNotifications=y,b}contentDidChange(a){var y;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",Me(Ce({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",bubbles:!0,composed:!0}))),this.silenceNotifications=b}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this.mathfield)),this.silenceNotifications))return;const a=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=a}};function mp(a,y,b,E){const ee=a.offsetOf(y);if(ee<b||ee>E)return!1;if(!y.hasChildren)return!0;const ie=a.offsetOf(y.firstChild);if(ie>=b&&ie<=E){const ae=a.offsetOf(y.lastChild);if(ae>=b&&ae<=E)return!0}return!1}function Jf(a,y,b){if(!(y!=null&&y.hasChildren))return!1;const[E,ee]=b,ie=a.offsetOf(y.firstChild),ae=a.offsetOf(y.lastChild);return ie>=E&&ie<=ee&&ae>=ie&&ae<=ee}function Td(a,y,b,E){var ee,ie,ae,ue,de,me;const ye=b.parent;if(ye&&b instanceof Lr){const Te=!E&&y==="forward"||E==="body"&&y==="backward";let ze=Te?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Te?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(ye.addChildrenAfter(b.removeBranch("body"),b),ye.removeChild(b),ze--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(ye.addChildrenAfter(b.removeBranch("body"),b),ye.removeChild(b),ze--),a.position=ze,!0}if(ye&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Te=b.leftSibling;b.hasChildren&&ye.addChildrenAfter(b.removeBranch("body"),b),ye.removeChild(b),a.position=a.offsetOf(Te)}else y==="forward"&&E==="body"?a.position=a.offsetOf(b):!E&&y==="backward"?b.hasChildren?a.position=a.offsetOf(b.lastChild):(a.position=Math.max(0,a.offsetOf(b)-1),ye.removeChild(b)):E==="above"&&(b.hasEmptyBranch("above")&&b.removeBranch("above"),y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b.body[0]));return!0}if(ye&&(b.type==="box"||b.type==="enclose")){const Te=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return ye.addChildrenAfter(b.removeBranch("body"),b),ye.removeChild(b),a.position=a.offsetOf(Te),!0}if(b.type==="genfrac"||b.type==="overunder"){if(!E)return b.type==="overunder"&&b.hasEmptyBranch("body")||b.type==="genfrac"&&b.hasEmptyBranch("below")&&b.hasEmptyBranch("above")?!1:(a.position=a.offsetOf(y==="forward"?b.firstChild:b.lastChild),!0);const Te=Bd.fractionNavigationOrder==="numerator-denominator"?"above":"below",ze=Te==="above"?"below":"above";if(ye&&(y==="forward"&&E===Te||y==="backward"&&E===ze)){const nt=b.removeBranch(Te),ut=b.removeBranch(ze);return ye.addChildrenAfter([...nt,...ut],b),ye.removeChild(b),a.position=a.offsetOf(nt.length>0?nt[nt.length-1]:ut[0]),!0}return y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b),!0}if(b.isExtensibleSymbol||b.type==="subsup"){if(!E&&y==="forward")return!1;if(!E){if(b.subscript||b.superscript){const Te=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(ie=b.subscript)==null?void 0:ie[0]:(me=(ue=b.subscript)==null?void 0:ue[0].lastSibling)!=null?me:(de=b.superscript)==null?void 0:de[0].lastSibling;return Te&&(a.position=a.offsetOf(Te)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Te=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Te,!0}if(E==="superscript")if(y==="backward"){const Te=a.offsetOf(b.firstChild)-1;console.assert(Te>=0),a.position=Te}else b.subscript?a.position=a.offsetOf(b.subscript[0]):a.position=a.offsetOf(b);else E==="subscript"&&(y==="backward"&&b.superscript?a.position=a.offsetOf(b.superscript[0].lastSibling):y==="backward"?a.position=a.offsetOf(b.firstChild)-1:a.position=a.offsetOf(b));if(E&&b.hasEmptyBranch(E)&&(b.removeBranch(E),b.type==="subsup"&&!b.subscript&&!b.superscript)){const Te=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Te}return!0}if((ye==null?void 0:ye.type)==="genfrac"&&!E&&b.type!=="first"){let Te=a.offsetOf(b.leftSibling);return ye.removeChild(b),ye.hasEmptyBranch("above")&&ye.hasEmptyBranch("below")?(Te=a.offsetOf(ye.leftSibling),ye.parent.removeChild(ye),a.announce("delete",void 0,[ye]),a.position=Te,!0):(a.announce("delete",void 0,[b]),a.position=Te,!0)}if(y==="backward"&&((ye==null?void 0:ye.command)==="\\ln"||(ye==null?void 0:ye.command)==="\\log")&&b.parentBranch!=="body"){const Te=a.offsetOf(ye.leftSibling);return ye.parent.removeChild(ye),a.announce("delete",void 0,[ye]),a.position=Te,!0}return!1}function l1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentBackward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let y=a.at(a.position);if(!(y&&Td(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Td(a,"backward",y.parent,y.parentBranch))return;y=null}if(!y){a.announce("plonk");return}a.position=a.offsetOf(y.leftSibling),y.parent.removeChild(y),a.announce("delete",void 0,[y])}}):Zs(a,Ha(a.selection),"deleteContentBackward")}function u1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentForward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var y,b;let E=a.at(a.position).rightSibling;if(E&&Td(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Td(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Td(a,"forward",E.parent,E.parentBranch))return;E=void 0}if(a.position===a.lastOffset||!E){a.announce("plonk");return}E.parent.removeChild(E);let ee=(y=a.at(a.position))==null?void 0:y.rightSibling;for(;(ee==null?void 0:ee.type)==="subsup";)ee.parent.removeChild(ee),ee=(b=a.at(a.position))==null?void 0:b.rightSibling;a.announce("delete",void 0,[E])}):Zs(a,Ha(a.selection),"deleteContentForward")}function Zs(a,y,b){const E=a.getAtoms(y);if(E.length>0&&E[0].parent){let ee=E[0].parent.firstChild;ee.type==="first"&&(ee=ee.rightSibling);const ie=E[E.length-1].parent.lastChild;let ae=E[0];ae.type==="first"&&(ae=ae.rightSibling);const ue=E[E.length-1];if(ae===ee&&ue===ie){const de=E[0].parent;de.parent&&de.type!=="prompt"&&(y=[a.offsetOf(de.leftSibling),a.offsetOf(de)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const de=E[0].parent,me=E[0].parentBranch==="below"?"above":"below",ye=a.offsetOf(de.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Te,ze;const nt=de.removeBranch(me);if(nt.length===1&&nt[0].type==="placeholder")(ze=de.parent)==null||ze.removeChild(de),a.position=Math.max(0,ye);else{const ut=de.parent.addChildrenAfter(nt,de);(Te=de.parent)==null||Te.removeChild(de),a.position=a.offsetOf(ut)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Oo({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&Zs(a,[0,-1],"deleteContent"),deleteForward:a=>u1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&Zs(a,[a.anchor,Ef(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&Zs(a,[a.anchor,Ef(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&Zs(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&Zs(a,[a.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var c1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${lt("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>`,d1=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${lt("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>`,h1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=Ce(Me(Ce({},Ih()),{macros:zn(),registers:Al()}),Ph(y)),this.eventController=new AbortController;const ie=this.eventController.signal;y.eventSink&&(this.host=y.eventSink),this.element=a,a.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 ae=(E=(b=y.value)!=null?b:this.element.textContent)!=null?E:"";ae=ae.trim();const ue=D0(this.options),de=new gn({type:"root",mode:ue,body:Za(ae,{context:this.context})});this.model=new s1(this,ue,de),this.undoManager=new Ng(this.model);const me=[];if(me.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>"),me.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),me.push("<span part=content class=ML__content>"),me.push(w0(this)),me.push("</span>"),window.mathVirtualKeyboard&&(me.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">`),me.push(c1),me.push("</div>")),me.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),me.push(d1),me.push("</div>"),me.push("</span>"),me.push("<span class=ML__sr-only>"),me.push("<span role=status aria-live=assertive aria-atomic=true></span>"),me.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(me.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=Je.subscribe(()=>Je.update(this.element)),Je.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Te=>Te.stopImmediatePropagation(),{capture:!1,signal:ie}),this.field.addEventListener("wheel",this,{passive:!1,signal:ie}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:ie}):this.field.addEventListener("mousedown",this,{signal:ie}),(ee=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||ee.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Hs(this)))},{signal:ie}),this._menu=new Sv(Jv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:ie});const ye=this.element.querySelector("[part=menu-toggle]");ye==null||ye.addEventListener("pointerdown",Te=>{if(Te.currentTarget!==ye||this._menu.state!=="closed")return;this.element.classList.add("tracking");const ze=ye.getBoundingClientRect();this._menu.modifiers=fu(Te),this._menu.show({target:ye,location:{x:ze.left,y:ze.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Te.preventDefault(),Te.stopPropagation()},{signal:ie}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(ye.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Hm(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:ie}),document.addEventListener("scroll",this,{signal:ie}),this.resizeObserver=new ResizeObserver(()=>fa(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:ie}),gd&&!Je.locale.startsWith(gd.locale)&&Fm(Je.locale),Ho!=="ready"&&document.fonts.ready.then(()=>Lh(this)),a.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(a){this._defaultStyle=a}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const a=this.model.at(this.model.position),y=this.adoptStyle==="right"?a.rightSibling:a;if(!y)return this.defaultStyle;if(y.type==="group"){const b=y.branch("body");return!b||b.length<2?{}:this.adoptStyle==="right"?b[1].computedStyle:b[b.length-1].computedStyle}return y.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),jh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Ff())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:Ns(this.field))!=null?b:void 0,ee=a==null?void 0:a.modifiers,ie=this.element.querySelector("[part=container]");return this._menu.show({target:ie,location:E,modifiers:ee})}get colorMap(){return a=>{var y,b,E;return(E=(b=(y=this.options).colorMap)==null?void 0:b.call(y,a))!=null?E:It(a)}}get backgroundColorMap(){return a=>{var y,b,E,ee,ie,ae;return(ae=(ie=(b=(y=this.options).backgroundColorMap)==null?void 0:b.call(y,a))!=null?ie:(ee=(E=this.options).colorMap)==null?void 0:ee.call(E,a))!=null?ae:at(a)}}get smartFence(){var a;return(a=this.options.smartFence)!=null?a:!1}get readOnly(){var a;return(a=this.options.readOnly)!=null?a:!1}get disabled(){var a,y;return(y=(a=this.host)==null?void 0:a.disabled)!=null?y:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const a=getComputedStyle(this.host);return a.getPropertyValue("user-select")||a.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(a=>a.type==="prompt"&&!a.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const a=this.model.at(this.model.anchor),y=this.model.at(this.model.position),b=gn.commonAncestor(a,y);return!!((b==null?void 0:b.type)==="prompt"||b!=null&&b.parentPrompt)}get letterShapeStyle(){var a;return(a=this.options.letterShapeStyle)!=null?a:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const a=this.model.getAtoms(this.model.selection);if(a.length===0)return{};const y=Ce({},a[0].style);for(const b of a)for(const[E,ee]of Object.entries(b.style))y[E]!==ee&&delete y[E];return y}queryStyle(a){const y=Pf(this,a);"verbatimColor"in y&&delete y.verbatimColor,"verbatimBackgroundColor"in y&&delete y.verbatimBackgroundColor;const b=Object.keys(y).length;if(b===0)return"all";if(b>1){for(const de of Object.keys(y)){const me=this.queryStyle({[de]:y[de]});if(me==="none")return"none";if(me==="some")return"some"}return"all"}const E=Object.keys(y)[0],ee=y[E];if(this.model.selectionIsCollapsed)return this.effectiveStyle[E]===ee?"all":"none";const ie=this.model.getAtoms(this.model.selection,{includeChildren:!0});let ae=ie.length;if(ae===0)return"none";let ue=0;for(const de of ie){if(de.type==="first"){ae-=1;continue}de.style[E]===ee&&(ue+=1)}return ue===0?"none":ue===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=Gm(this.options.keybindings,(a=vd())!=null?a:$m());return((y=vd())==null?void 0:y.score)>0&&(this._keybindings=b,E.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",E)),b}get menu(){return this._menu}setOptions(a){var y;this.options=Ce(Ce({},this.options),Ph(a)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let b=this.options.defaultMode;b==="inline-math"&&(b="math"),((y=this.model.root.firstChild)==null?void 0:y.mode)!==b&&(this.model.root.firstChild.mode=b),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const E=gn.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&er.insert(this.model,E,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in a||"macros"in a||"registers"in a||"colorMap"in a||"backgroundColorMap"in a||"letterShapeStyle"in a||"minFontScale"in a||"readOnly"in a||"placeholderSymbol"in a)&&fa(this)}getOptions(a){return gu(this.options,a)}getOption(a){return gu(this.options,a)}handleEvent(a){return zl(this,null,function*(){var y;if($o(this)){if(Cf(a)){if(!ld(a.origin,(y=this.options.originValidator)!=null?y:"none"))throw new DOMException(`Message from unknown origin (${a.origin}) cannot be handled`,"SecurityError");const{action:b}=a.data;if(b==="execute-command"){const E=a.data.command;if(dc(E)==="virtual-keyboard")return;this.executeCommand(E)}else b==="update-state"||(b==="focus"?this.focus({preventScroll:!0}):b==="blur"&&this.blur());return}switch(a.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Z0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(Z0(this,a),a.shiftKey===!1&&(yield rp(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield rp(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&jh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>$o(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>$o(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!$o(this))return;Je.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();const a=this.element;delete a.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,Ug(),Qm(),mv()}flushInlineShortcutBuffer(a){if(a!=null||(a={defer:!1}),!a.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(a){return dc(a)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(a),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Hs(this))),!1):og(this,a)}get errors(){return t0(this.model.getValue(),{context:this.context})}getValue(a,y,b){return this.model.getValue(a,y,b)}setValue(a,y){var b;y=y!=null?y:{mode:"math"},y.insertionMode===void 0&&(y.insertionMode="replaceAll"),(y.format===void 0||y.format==="auto")&&(y.format="latex"),(y.mode===void 0||y.mode==="auto")&&(y.mode=(b=af(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();er.insert(this.model,a,y)&&(fa(this),E||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const a=window.MathfieldElement.computeEngine;return a?a.box(a.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 a;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){const E=window.mathVirtualKeyboard.boundingRect,ee=this.host.getBoundingClientRect();ee.bottom>E.top&&((a=window.document.scrollingElement)==null||a.scrollBy(0,ee.bottom-E.top+8))}}this.dirty&&pu(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=Ns(this.field);else{const E=sd(this);if(E.length>0){let ee=-1/0,ie=-1/0;for(const ae of E)ae.right>ee&&(ee=ae.right),ae.top<ie&&(ie=ae.top);b={x:ee+y.left-this.field.scrollLeft,y:ie+y.top-this.field.scrollTop,height:0}}}if(this.host&&b){const E=this.host.getBoundingClientRect(),ee=b.y;let ie=this.host.scrollTop;ee<E.top?ie=ee-E.top+this.host.scrollTop:ee>E.bottom&&(ie=ee-E.bottom+this.host.scrollTop+b.height),this.host.scroll({top:ie,left:0})}if(b){const E=b.x-window.scrollX;let ee=this.field.scrollLeft;E<y.left?ee=E-y.left+this.field.scrollLeft-20:E>y.right&&(ee=E-y.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:ee})}}insert(a,y){return typeof a!="string"||a.length===0&&((y==null?void 0:y.insertionMode)==="insertBefore"||(y==null?void 0:y.insertionMode)==="insertAfter")||a.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),y=y!=null?y:{mode:"math"},y.focus&&this.focus(),y.feedback&&(window.MathfieldElement.keypressVibration&&ot()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?A0(this.model):a==="&"?T0(this.model):this.model.selectionIsCollapsed?er.insert(this.model,a,Ce({style:this.model.at(this.model.position).computedStyle},y)):er.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),fa(this),y.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(a,y="",b=""){var E;if(this.model.mode===a||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const ee=this.model.mode;if(this.model.mode=a,!((E=this.host)!=null&&E.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=ee;return}const ie=this.model.mode,{model:ae}=this;ae.deferNotifications({content:!!b||!!y,selection:!0,type:"insertText"},()=>{let ue=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const de=Za(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const me=ae.at(ae.position);ae.position=ae.offsetOf(me.parent.addChildrenAfter(de,me)),ue=!0}if(this.model.mode=a,a==="latex"){let de=ae.selectionIsCollapsed;uc(this,"accept");let me,ye=ae.at(ae.position);if(de)me="\\";else{const ze=Ha(ae.selection);me=this.model.getValue(ze,"latex");const nt=this.model.extractAtoms(ze);nt.length===1&&nt[0].type==="placeholder"&&(me=y,de=!0),ye=ae.at(ze[0])}const Te=new cd(me);ye.parent.addChildAfter(Te,ye),de?ae.position=ae.offsetOf(Te.lastChild):ae.setSelection(ae.offsetOf(Te.firstChild),ae.offsetOf(Te.lastChild))}else yd(ae).forEach(de=>{de.isError=!1});if(b){const de=Za(b,{context:this.context,parseMode:ie});ae.collapseSelection("forward");const me=ae.at(ae.position);ae.position=ae.offsetOf(me.parent.addChildrenAfter(de,me)),ue=!0}return fa(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),ue}),this.model.mode=a,window.mathVirtualKeyboard.update(Hs(this))}hasFocus(){return!this.blurred}focus(a){var y;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(y=a==null?void 0:a.preventScroll)!=null&&y||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(a,y={}){var b,E;const ee={operation:"set",silenceNotifications:!1};ec(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const ie=Pf(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=Ce(Ce({},this.defaultStyle),ie);return}const ue=Ce({},this.defaultStyle);for(const de of Object.keys(ie))ue[de]===ie[de]?(de==="color"&&delete ue.verbatimColor,de==="backgroundColor"&&delete ue.verbatimBackgroundColor,delete ue[de]):ue[de]=ie[de];this.defaultStyle=ue;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const ue of this.model.selection.ranges)Mf(this.model,ue,ie,{operation:ae});else Mf(this.model,ee.range,ie,{operation:ae})}),fa(this)}toggleContextMenu(){var a;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(a=this.getCaretPoint())!=null?a:void 0,onDismiss:()=>{var y;return(y=this.element)==null?void 0:y.focus()}}),!0):!1}getCaretPoint(){const a=Ns(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=kd(this,a,y,{bias:0});if(b<0)return!1;const E=this.model.position;return this.model.position=b,this.model.announce("move",E),fa(this),!0}getPrompt(a){const y=this.model.findAtom(b=>b.type==="prompt"&&b.placeholderId===a);return console.assert(y!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),y}getPromptValue(a,y){const b=this.getPrompt(a);if(!b)return"";const E=this.model.offsetOf(b.firstChild),ee=this.model.offsetOf(b.lastChild);return this.model.getValue(E,ee,y)}getPrompts(a){return this.model.getAllAtoms().filter(y=>y.type!=="prompt"?!1:a?!(a.id&&y.placeholderId!==a.id||a.locked&&y.locked!==a.locked||a.correctness==="undefined"&&y.correctness||a.correctness&&y.correctness!==a.correctness):!0).map(y=>y.placeholderId)}setPromptValue(a,y,b){if(y!==void 0){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}const ee=this.model.getBranchRange(this.model.offsetOf(E),"body");this.model.setSelection(ee),this.insert(y,Me(Ce({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),fa(this)}setPromptState(a,y,b){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}y==="undefined"?E.correctness=void 0:typeof y=="string"&&(E.correctness=y),typeof b=="boolean"&&(E.locked=b,E.captureSelection=b),fa(this)}getPromptState(a){const y=this.getPrompt(a);return y?[y.correctness,y.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[void 0,!0])}getPromptRange(a){const y=this.getPrompt(a);return y?this.model.getBranchRange(this.model.offsetOf(y),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(a){var y;this.undoManager.snapshot(a)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(y=this.host)==null||y.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 a;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var a;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var a;(a=this.undoManager)==null||a.reset()}onSelectionDidChange(){var a,y;const b=this.model;this.keyboardDelegate.setValue(b.getValue(this.model.selection,"latex-expanded"));{const E=b.at(b.position),ee=(a=E.mode)!=null?a:D0(this.options);this.model.mode!==ee&&(this.model.mode==="latex"?(uc(this,"accept",{mode:ee}),b.position=b.offsetOf(E)):this.switchMode(ee))}(y=this.host)==null||y.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),jh(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",Me(Ce({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?E:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),pu(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 a,y,b;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",cc(this),this.model.getValue()!==this.valueOnFocus&&((a=this.host)==null||a.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(y=this.host)==null||y.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(b=this.host)==null||b.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),fa(this),this.focusBlurInProgress=!1,Ff();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{$o(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Af(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(Ha(this.model.selection));const y=Ns(this.field);y&&requestAnimationFrame(()=>{pu(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),fa(this)}onCompositionEnd(a){Dg(this.model),Af(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),er.onCopy(this,a),Zs(this.model,Ha(this.model.selection),"deleteByCut"),this.snapshot("cut"),fa(this))}onCopy(a){er.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=er.onPaste(this.model.at(this.model.position).mode,this,a.clipboardData)),y||this.model.announce("plonk"),a.preventDefault(),a.stopPropagation(),y}onGeometryChange(){this._menu.hide(),Mh(this),jh(this)}onWheel(a){const y=5*a.deltaX;if(!Number.isFinite(y)||y===0)return;const b=this.field;y<0&&b.scrollLeft===0||y>0&&b.offsetWidth+b.scrollLeft>=b.scrollWidth||(b.scrollBy({top:0,left:y}),a.preventDefault(),a.stopPropagation())}getHTMLElement(a){let y=a;for(;!y.id&&y.hasChildren;)y=a.children[0];return this.field.querySelector(`[data-atom-id="${y.id}"]`)}get context(){var a,y;return{registers:(a=this.options.registers)!=null?a:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(y=this.options.placeholderSymbol)!=null?y:"\u25A2",colorMap:b=>this.colorMap(b),backgroundColorMap:b=>this.backgroundColorMap(b),getMacro:b=>Ln(b,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function gp(a){if(a&&(a.classList.remove("ML__highlight"),a.children))for(const y of a.children)gp(y)}function Qf(a,y){var b;a&&(!y||((b=a.dataset)==null?void 0:b.atomId)===y?(a.classList.add("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qf(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qf(E,y)})))}function f1(a,y){var b;if(!mt())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(y);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"json",VoiceId:(b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna",Engine:"standard",Text:y,TextType:"ssml",SpeechMarkTypes:["ssml"]};$l().readAloudElement=a,E.synthesizeSpeech(ee,(ie,ae)=>{if(ie){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${ie}`);return}if(!(ae!=null&&ae.AudioStream)){console.log("polly.synthesizeSpeech():",ae);return}const ue=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));$l().readAloudMarks=ue.split(`
`).map(de=>de?JSON.parse(de):{}),$l().readAloudTokens=[];for(const de of $l().readAloudMarks)de.value&&$l().readAloudTokens.push(de.value);$l().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(de,me)=>{if(de){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${de}`);return}if(!(me!=null&&me.AudioStream))return;const ye=new Uint8Array(me.AudioStream),Te=new Blob([ye.buffer],{type:"audio/mpeg"}),ze=URL.createObjectURL(Te),nt=$l();nt.readAloudAudio?nt.readAloudAudio.pause():(nt.readAloudAudio=new Audio,nt.readAloudAudio.addEventListener("ended",()=>{const ut=nt.readAloudMathfield;nt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ut?(pu(ut),nt.readAloudElement=null,nt.readAloudMathfield=null,nt.readAloudTokens=[],nt.readAloudMarks=[],nt.readAloudCurrentMark=""):gp(nt.readAloudElement)}),nt.readAloudAudio.addEventListener("timeupdate",()=>{let ut="";const nn=nt.readAloudAudio.currentTime*1e3+100;for(const Nn of nt.readAloudMarks)Nn.time<nn&&(ut=Nn.value);nt.readAloudCurrentMark!==ut&&(nt.readAloudCurrentToken=ut,ut&&ut===nt.readAloudFinalToken?nt.readAloudAudio.pause():(nt.readAloudCurrentMark=ut,Qf(nt.readAloudElement,nt.readAloudCurrentMark)))})),nt.readAloudAudio.src=ze,nt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),nt.readAloudAudio.play()})})}mt()||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 Mr=new WeakMap,p1=.5,Fl={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 = ..."},Ja=class _u extends HTMLElement{static get formAssociated(){return Sc()}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(y){y!==this._fontsDirectory&&(this._fontsDirectory=y,ng())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(y){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(y){this._soundsDirectory=y,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(y){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(y){var b,E,ee;this.audioBuffers={},y===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof y=="string"?this._keypressSound={spacebar:y,return:y,delete:y,default:y}:typeof y=="object"&&"default"in y&&(this._keypressSound={spacebar:(b=y.spacebar)!=null?b:y.default,return:(E=y.return)!=null?E:y.default,delete:(ee=y.delete)!=null?ee:y.default,default:y.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(y){this.audioBuffers={},this._plonkSound=y}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(y){this._speechEngine=y}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(y){this._speechEngineRate=y}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(y){this._speechEngineVoice=y}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(y){this._textToSpeechMarkup=y}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(y){this._textToSpeechRules=y}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(y){this._textToSpeechRulesOptions=y}static get locale(){return Je.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),Je.locale=y}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(y){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Je.strings}static set strings(y){Je.merge(y)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(y){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(y){this._decimalSeparator=y,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(y){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var y,b;if(this._computeEngine===void 0){const E=(y=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;if(!E)return null;this._computeEngine=new E,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(b=this._computeEngine)!=null?b:null}static set computeEngine(y){this._computeEngine=y}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(y){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(y){this._isFunction=y}static loadSound(y){return zl(this,null,function*(){delete this.audioBuffers[y];let b="";switch(y){case"keypress":b=this._keypressSound.default;break;case"return":b=this._keypressSound.return;break;case"spacebar":b=this._keypressSound.spacebar;break;case"delete":b=this._keypressSound.delete;break;case"plonk":b=this.plonkSound;break}if(typeof b!="string")return;b=b.trim();const E=this.soundsDirectory;if(!(E==null||E==="null"||b==="none"||b==="null"))try{const ie=yield(yield fetch(yield x0(`${E}/${b}`))).arrayBuffer(),ae=yield this.audioContext.decodeAudioData(ie);this.audioBuffers[y]=ae}catch(ee){}})}static playSound(y){return zl(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[y]||(yield this.loadSound(y)),!this.audioBuffers[y])return;const b=this.audioContext.createBufferSource();b.buffer=this.audioBuffers[y];const E=this.audioContext.createGain();E.gain.value=p1,b.connect(E).connect(this.audioContext.destination),b.start()})}constructor(y){if(super(),y){const b=[];for(const E of Object.keys(y))if(Fl[E])if(Fl[E].startsWith("mf."))if(Fl[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${Fl[E]}`);else{const ee=Fl[E].match(/([a-zA-Z]+) =/);b.push(`Option \`${E}\` has been renamed \`${ee[1]}\``)}else b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${Fl[E]}`);if(b.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(const E of b)console.warn(E);console.groupEnd()}}if(Sc()&&(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=[Il("core"),Il("mathfield"),Il("mathfield-element"),Il("ui"),Il("menu")],this.shadowRoot.appendChild(document.createElement("span"));const b=document.createElement("slot");b.style.display="none",this.shadowRoot.appendChild(b)}else this.shadowRoot.innerHTML="<style>"+hl("core")+hl("mathfield")+hl("mathfield-element")+hl("ui")+hl("menu")+'</style><span></span><slot style="display:none"></slot>';y&&this._setOptions(y),this.shadowRoot.addEventListener("slotchange",()=>{var b;const E=this.shadowRoot.querySelector("slot:not([name])");this.value=(b=E==null?void 0:E.assignedNodes().map(ee=>ee.nodeType===3?ee.textContent:"").join("").trim())!=null?b:""})}showMenu(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.showMenu(y))!=null?E:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",y=>{var b;y.target===this&&!((b=this._mathfield)!=null&&b.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:y.altKey,button:y.button,buttons:y.buttons,clientX:y.clientX,clientY:y.clientY,ctrlKey:y.ctrlKey,metaKey:y.metaKey,movementX:y.movementX,movementY:y.movementY,relatedTarget:y.relatedTarget,screenX:y.screenX,screenY:y.screenY,shiftKey:y.shiftKey}))},{once:!0})}getPromptValue(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.getPromptValue(y,b))!=null?ee:""}setPromptValue(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptValue(y,b,E)}getPromptRange(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptRange(y))!=null?E:null}getPrompts(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPrompts(y))!=null?E:[]}get form(){var y;return(y=this._internals)==null?void 0:y.form}get name(){var y;return(y=this.getAttribute("name"))!=null?y:""}get type(){return this.localName}get mode(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.mode)!=null?b:this.defaultMode==="text"?"text":"math"}set mode(y){var b;(b=this._mathfield)==null||b.switchMode(y)}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(y){var b,E;if(!this._mathfield)return;const ee=(E=(b=_u.computeEngine)==null?void 0:b.box(y).latex)!=null?E:null;ee!==null&&this._mathfield.setValue(ee),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 y,b;return(b=(y=this._mathfield)==null?void 0:y.errors)!=null?b:[]}_getOptions(y){return this._mathfield?gu(this._mathfield.options,y):Mr.has(this)?Ce({},gu(Ce(Ce({},Ih()),Ph(Mr.get(this).options)),y)):null}getOptions(y){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?gu(this._mathfield.options,y):Mr.has(this)?gu(Ce(Ce({},Ih()),Ph(Mr.get(this).options)),y):null}reflectAttributes(){const y=Ih(),b=this._getOptions();Object.keys(_u.optionsAttributes).forEach(E=>{const ee=gl(E);_u.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(_u.optionsAttributes[E]==="boolean"?b[ee]?this.setAttribute(E,""):this.removeAttribute(E):(typeof b[ee]=="string"||typeof b[ee]=="number")&&this.setAttribute(E,b[ee].toString()))})}getOption(y){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([y])[y]}_getOption(y){return this._getOptions([y])[y]}_setOptions(y){if(this._mathfield)this._mathfield.setOptions(y);else if(Mr.has(this)){const b=Ce(Ce({},Mr.get(this).options),y);Mr.set(this,Me(Ce({},Mr.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Mr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:y,menuItems:void 0});this.reflectAttributes()}setOptions(y){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(const b of Object.keys(y))Fl[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${Fl[b]}`);console.groupEnd(),this._setOptions(y)}executeCommand(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.executeCommand(y))!=null?E:!1}getValue(y,b,E){var ee,ie;if(this._mathfield)return this._mathfield.model.getValue(y,b,E);if(Mr.has(this)){let ae,ue,de;if(tc(y)?([ae,ue]=y.ranges[0],de=b):ec(y)?([ae,ue]=y,de=b):Is(y)&&Is(b)?(ae=y,ue=b,de=E):(ae=0,ue=-1,de=y),(de===void 0||de==="latex")&&ae===0&&ue===-1)return(ie=(ee=Mr.get(this).value)!=null?ee:this.textContent)!=null?ie:""}return""}setValue(y,b){if(this._mathfield&&y!==void 0){b!=null||(b={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(y,b);return}if(Mr.has(this)){const ee=Mr.get(this).options;Mr.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Pd(this);Mr.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:E,menuItems:void 0})}hasFocus(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.hasFocus())!=null?b:!1}focus(){var y;(y=this._mathfield)==null||y.focus()}blur(){var y;(y=this._mathfield)==null||y.blur()}select(){var y;(y=this._mathfield)==null||y.select()}insert(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.insert(y,b))!=null?ee:!1}applyStyle(y,b){var E;return(E=this._mathfield)==null?void 0:E.applyStyle(y,b)}queryStyle(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.queryStyle(y))!=null?E:"none"}get caretPoint(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.getCaretPoint())!=null?b:null}set caretPoint(y){var b;y&&((b=this._mathfield)==null||b.setCaretPoint(y.x,y.y))}setCaretPoint(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.setCaretPoint(y,b))!=null?ee:!1}offsetFromPoint(y,b,E){return this._mathfield?kd(this._mathfield,y,b,E):-1}hitboxFromOffset(y){if(!this._mathfield)return null;const b=this._mathfield.model.at(y);if(!b)return null;const E=Bl(this._mathfield,b);return E?new DOMRect(E.left,E.top,E.right-E.left,E.bottom-E.top):null}resetUndo(){var y;(y=this._mathfield)==null||y.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(y){var b,E,ee,ie;$s.state==="closed"&&((E=(b=this._mathfield)==null?void 0:b.menu)==null?void 0:E.state)==="closed"&&(y.type==="pointerdown"&&this.onPointerDown(),y.type==="focus"&&((ee=this._mathfield)==null||ee.focus()),y.type==="blur"&&((ie=this._mathfield)==null||ie.blur()))}connectedCallback(){var y,b,E,ee;const ie=window.getComputedStyle(this),ae=this.shadowRoot,ue=ie.userSelect!=="none";if(ue)ae.host.addEventListener("pointerdown",this,!0);else{const ye=ae.querySelector("span");ye.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Sc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),ue&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const de=ae.querySelector("slot:not([name])");if(de)try{this._style=de.assignedElements().filter(ye=>ye.tagName.toLowerCase()==="style").map(ye=>ye.textContent).join("")}catch(ye){console.error(ye)}if(this._style){const ye=document.createElement("style");ye.textContent=this._style,ae.appendChild(ye)}let me="";if(this.hasAttribute("value")?me=this.getAttribute("value"):me=(y=de==null?void 0:de.assignedNodes().map(ye=>ye.nodeType===3?ye.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),Me(Ce({},(E=(b=Mr.get(this))==null?void 0:b.options)!=null?E:Pd(this)),{eventSink:this,value:me})),!Mr.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const ye of Object.keys(_u.optionsAttributes))this.upgradeProperty(gl(ye))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Mr.has(this)){const ye=this._mathfield,Te=Mr.get(this),ze=Te.menuItems;ye.model.deferNotifications({content:!1,selection:!1},()=>{const nt=Te.value;nt!==void 0&&ye.setValue(nt),ye.model.selection=Te.selection,Mr.delete(this)}),ze&&(this.menuItems=ze)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Eh()}disconnectedCallback(){var y,b;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const E=gu(this._mathfield.options,Object.keys(_u.optionsAttributes).map(ee=>gl(ee)));Mr.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(b=(y=this._mathfield.menu)==null?void 0:y.menuItems)!=null?b:void 0,options:E}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(y){if(this.hasOwnProperty(y)){const b=this[y];delete this[y],(y==="readonly"||y==="read-only")&&(y="readOnly"),this[y]=b}}attributeChangedCallback(y,b,E){if(b===E)return;const ee=E!==null;switch(y){case"contenteditable":fa(this._mathfield);break;case"disabled":this.disabled=ee;break;case"read-only":case"readonly":this.readOnly=ee;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(y){const b=!!y;b?(this.setAttribute("readonly",""),Sc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Sc()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:b})}get disabled(){return this.hasAttribute("disabled")}set disabled(y){var b;const E=!!y;E?this.setAttribute("disabled",""):this.removeAttribute("disabled"),Sc()?this._internals.ariaDisabled=E?"true":"false":this.setAttribute("aria-disabled",E?"true":"false"),E&&((b=this._mathfield)!=null&&b.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(y){this.setValue(y)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(y){this._setOptions({defaultMode:y})}get macros(){return this._getOption("macros")}set macros(y){this._setOptions({macros:y})}get registers(){const y=this;return new Proxy({},{get:(b,E)=>{if(typeof E=="string")return y._getOption("registers")[E]},set(b,E,ee){return typeof E!="string"?!1:(y._setOptions({registers:Me(Ce({},y._getOption("registers")),{[E]:ee})}),!0)}})}set registers(y){this._setOptions({registers:y})}get colorMap(){return this._getOption("colorMap")}set colorMap(y){this._setOptions({colorMap:y})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(y){this._setOptions({backgroundColorMap:y})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(y){this._setOptions({letterShapeStyle:y})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(y){this._setOptions({minFontScale:y})}get smartMode(){return this._getOption("smartMode")}set smartMode(y){this._setOptions({smartMode:y})}get smartFence(){return this._getOption("smartFence")}set smartFence(y){this._setOptions({smartFence:y})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(y){this._setOptions({smartSuperscript:y})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(y){this._setOptions({scriptDepth:y})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(y){this._setOptions({removeExtraneousParentheses:y})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(y){this._setOptions({mathModeSpace:y})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(y){this._setOptions({placeholderSymbol:y})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(y){this._setOptions({popoverPolicy:y})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(y){this._setOptions({environmentPopoverPolicy:y})}get menuItems(){var y,b,E;return this._mathfield?(y=this._mathfield.menu._menuItems.map(ee=>ee.menuItem))!=null?y:[]:(E=(b=Mr.get(this))==null?void 0:b.menuItems)!=null?E:[]}set menuItems(y){var b;if(this._mathfield){const E=(b=this._mathfield.element)==null?void 0:b.querySelector("[part=menu-toggle]");E&&(E.style.display=y.length===0?"none":""),this._mathfield.menu.menuItems=y}Mr.has(this)?Mr.set(this,Me(Ce({},Mr.get(this)),{menuItems:y})):Mr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Pd(this),menuItems:y})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(y){this._setOptions({mathVirtualKeyboardPolicy:y})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(y){this._setOptions({inlineShortcuts:y})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(y){this._setOptions({inlineShortcutTimeout:y})}get keybindings(){return this._getOption("keybindings")}set keybindings(y){this._setOptions({keybindings:y})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(y){this._setOptions({onInlineShortcut:y})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(y){this._setOptions({onScrollIntoView:y})}get onExport(){return this._getOption("onExport")}set onExport(y){this._setOptions({onExport:y})}get readOnly(){return this._getOption("readOnly")}set readOnly(y){this._setOptions({readOnly:y})}get isSelectionEditable(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.isSelectionEditable)!=null?b:!1}setPromptState(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptState(y,b,E)}getPromptState(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptState(y))!=null?E:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(y){this._setOptions({virtualKeyboardTargetOrigin:y})}get selection(){return this._mathfield?this._mathfield.model.selection:Mr.has(this)?Mr.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(y){if(typeof y=="number"&&(y={ranges:[[y,y]]}),this._mathfield){this._mathfield.model.selection=y,fa(this._mathfield);return}if(Mr.has(this)){Mr.set(this,Me(Ce({},Mr.get(this)),{selection:y}));return}Mr.set(this,{value:void 0,selection:y,options:Pd(this),menuItems:void 0})}get selectionIsCollapsed(){const y=this.selection;return y.ranges.length===1&&y.ranges[0][0]===y.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Mr.has(this)?Mr.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,fa(this._mathfield)),Mr.has(this)){Mr.set(this,Me(Ce({},Mr.get(this)),{selection:{ranges:[[y,y]]}}));return}Mr.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Pd(this),menuItems:void 0})}getOffsetDepth(y){var b,E;return this._mathfield?((E=(b=this._mathfield.model.at(y))==null?void 0:b.treeDepth)!=null?E:2)-2:0}get lastOffset(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.lastOffset)!=null?b:-1}};Ja.version="0.98.5",Ja._fontsDirectory="./fonts",Ja._soundsDirectory="./sounds",Ja.keypressVibration=!0,Ja._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Ja._plonkSound="plonk.wav",Ja.audioBuffers={},Ja.createHTML=a=>a,Ja._speechEngineRate="100%",Ja._speechEngineVoice="Joanna",Ja._textToSpeechMarkup="",Ja._textToSpeechRules="mathlive",Ja._textToSpeechRulesOptions={},Ja.speakHook=i1,Ja.readAloudHook=f1,Ja._decimalSeparator=".",Ja.fractionNavigationOrder="numerator-denominator",Ja._isFunction=a=>{var y,b;const E=window.MathfieldElement.computeEngine;return(b=(y=E==null?void 0:E.parse(a).domain)==null?void 0:y.isFunction)!=null?b:!1};var Bd=Ja;function gl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Pd(a){const y={readOnly:!1},b=Bd.optionsAttributes;return Object.keys(b).forEach(E=>{if(a.hasAttribute(E)){const ee=a.getAttribute(E);E==="placeholder"?y.contentPlaceholder=ee!=null?ee:"":b[E]==="boolean"?y[gl(E)]=!0:b[E]==="on/off"?ee==="on"?y[gl(E)]=!0:ee==="off"?y[gl(E)]=!1:y[gl(E)]=void 0:b[E]==="number"?y[gl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[gl(E)]=ee}}),y}function Sc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Bd,yp,bp,xp,wp;if(mt()&&!((yp=window.customElements)!=null&&yp.get("math-field"))){(xp=window[bp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[bp]={});const a=window[Symbol.for("io.cortexjs.mathlive")];a.version="0.98.5",window.MathfieldElement=Bd,(wp=window.customElements)==null||wp.define("math-field",Bd)}function m1(a,y,b){let E=b,ee=0;const ie=a.length;for(;E<y.length;){const ae=y[E];if(ee<=0&&y.slice(E,E+ie)===a)return E;ae==="\\"?E++:ae==="{"?ee++:ae==="}"&&ee--,E++}return-1}function Yh(a,y,b,E,ee="latex"){const ie=[];for(const ae of a)if(ae.type==="text"){const ue=ae.data;let de=!0,me=0,ye;ye=ue.indexOf(y),ye!==-1&&(me=ye,me>0&&ie.push({type:"text",data:ue.slice(0,me)}),de=!1);let Te=!1;for(;!Te;){if(de){if(ye=ue.indexOf(y,me),ye===-1){Te=!0;break}me!==ye&&ie.push({type:"text",data:ue.slice(me,ye)}),me=ye}else{if(ye=m1(b,ue,me+y.length),ye===-1){Te=!0;break}let ze=ue.slice(me+y.length,ye);ee==="ascii-math"&&([,ze]=cu(ze,{format:"ascii-math"})),ie.push({type:"math",data:ze,rawData:ue.slice(me,ye+b.length),mathstyle:E}),me=ye+b.length}de=!de}me<ue.length&&ie.push({type:"text",data:ue.slice(me)})}else ie.push(ae);return ie}function Sp(a,y,b){let E=[{type:"text",data:a}];return y!=null&&y.inline&&y.inline.forEach(([ee,ie])=>{E=Yh(E,ee,ie,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,ie])=>{E=Yh(E,ee,ie,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,ie])=>{E=Yh(E,ee,ie,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,ie])=>{E=Yh(E,ee,ie,"displaystyle","ascii-math")}),E}function g1(a,y){const b=document.createElement("span");b.setAttribute("translate","no");try{const E="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+y.renderToMathML(a)+"</math>";b.innerHTML=window.MathfieldElement.createHTML(E)}catch(E){console.error(`MathLive 0.98.5: Could not convert "${a}"' to MathML with ${E}`),b.textContent=a}return b.className="ML__sr-only",b}function v1(a,y,b,E){try{const ee=y.renderToMarkup(a,{mathstyle:b,format:"html"}),ie=document.createElement("span");return ie.dataset.latex=a,ie.style.display=b==="displaystyle"?"flex":"inline-flex",ie.setAttribute("aria-hidden","true"),ie.setAttribute("translate","no"),ie.innerHTML=window.MathfieldElement.createHTML(ee),ie}catch(ee){if(console.error("Could not parse'"+a+"' with ",ee),E)return document.createTextNode(a)}return null}function Cc(a,y,b,E){var ee;const ie=v1(a,b,y||"textstyle",E),ae=(ee=b.renderAccessibleContent)!=null?ee:"";if(ie&&/\b(mathml|speakable-text)\b/i.test(ae)){const ue=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&ue.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const de=document.createElement("span");de.setAttribute("translate","no");const me=b.renderToSpeakableText(a);de.innerHTML=window.MathfieldElement.createHTML(me),de.className="ML__sr-only",ue.append(de)}return ue.append(ie),ue}return ie}function y1(a,y){var b,E,ee;let ie=null;if((b=y.TeX)!=null&&b.processEnvironments&&/^\s*\\begin/.test(a)){ie=document.createDocumentFragment();const ae=Cc(a,"",y,!0);ae&&ie.appendChild(ae)}else{if(!a.trim())return null;const ae=Sp(a,(E=y.TeX)==null?void 0:E.delimiters,(ee=y.asciiMath)==null?void 0:ee.delimiters);if(ae.length===1&&ae[0].type==="text")return null;ie=document.createDocumentFragment();for(const ue of ae)if(ue.type==="text")ie.appendChild(document.createTextNode(ue.data));else{const de=Cc(ue.data,ue.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);de&&ie.appendChild(de)}}return ie}function Cp(a,y){var b,E,ee,ie,ae,ue,de,me,ye,Te,ze,nt,ut,nn,Nn,Yt;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Sn=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(Sn)){a.textContent="";const En=Cc(Sn,"",y,!0);En&&a.append(En);return}const Wn=Sp(Sn,(ee=y.TeX)==null?void 0:ee.delimiters,(ie=y.asciiMath)==null?void 0:ie.delimiters);if(Wn.length===1&&Wn[0].type==="math"){a.textContent="";const En=Cc(Wn[0].data,Wn[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);En&&a.append(En);return}if(Wn.length===1&&Wn[0].type==="text")return}for(let Sn=a.childNodes.length-1;Sn>=0;Sn--){const Wn=a.childNodes[Sn];if(Wn.nodeType===3){const En=y1((ae=Wn.textContent)!=null?ae:"",y);En&&(Sn+=En.childNodes.length-1,Wn.replaceWith(En))}else if(Wn.nodeType===1){const En=Wn,Li=Wn.nodeName.toLowerCase();if(Li==="script"){const Ni=Wn;let Oi;if((ue=y.processScriptTypePattern)!=null&&ue.test(Ni.type))Oi=(de=Ni.textContent)!=null?de:"";else if((me=y.processMathJSONScriptTypePattern)!=null&&me.test(Ni.type))try{Oi=(Te=y.serializeToLatex)==null?void 0:Te.call(y,JSON.parse((ye=Ni.textContent)!=null?ye:""))}catch(Cr){console.error(Cr)}if(Oi){let Cr="textstyle";for(const ei of Ni.type.split(";")){const[Wo,Vs]=ei.toLowerCase().split("=");Wo.trim()==="mode"&&(Cr=Vs.trim()==="display"?"displaystyle":"textstyle")}const zr=Cc(Oi,Cr,y,!0);zr&&Ni.parentNode.replaceChild(zr,Ni)}}else if(((nt=(ze=y.processClassPattern)==null?void 0:ze.test(En.className))!=null?nt:!1)||!((nn=(ut=y.skipTags)==null?void 0:ut.includes(Li))!=null&&nn||(Yt=(Nn=y.ignoreClassPattern)==null?void 0:Nn.test(En.className))!=null&&Yt))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Oi=a.textContent;a.textContent="";const Cr=Cc(Oi!=null?Oi:"","displaystyle",y,!0);Cr&&a.append(Cr)}else Cp(En,y)}}}var b1={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 x1(a,y){var b,E,ee,ie;try{const ae=Ce(Ce({},b1),y);ae.ignoreClassPattern=new RegExp((b=ae.ignoreClass)!=null?b:""),ae.processClassPattern=new RegExp((E=ae.processClass)!=null?E:""),ae.processScriptTypePattern=new RegExp((ee=ae.processScriptType)!=null?ee:""),ae.processMathJSONScriptTypePattern=new RegExp((ie=ae.processMathJSONScriptType)!=null?ie:""),Eh(),Io("core"),Cp(a,ae)}catch(ae){ae instanceof Error?console.error("renderMathInElement(): "+ae.message):console.error("renderMathInElement(): Could not render math for element",a)}}function w1(a,y){const b=Rl.singleton;return b?(b.show(),wd(),b.currentLayer=y,b.render(),b.focus(),!0):!1}function S1(){const a=window.mathVirtualKeyboard;return a.visible?a.hide({animate:!0}):a.show({animate:!0}),!1}Oo({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function $l(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function A1(){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 T1(a){_1(document.body,a)}function C1(a){if(typeof a=="string"){const y=document.getElementById(a);if(y===null)throw new Error(`The element with ID "${a}" could not be found.`);return y}return typeof a=="string"?null:a}function _1(a,y){var b,E,ee,ie;const ae=C1(a);if(!ae)return;const ue=y!=null?y:{};(b=ue.renderToMarkup)!=null||(ue.renderToMarkup=Va),(E=ue.renderToMathML)!=null||(ue.renderToMathML=Rv),(ee=ue.renderToSpeakableText)!=null||(ue.renderToSpeakableText=Nv),(ie=ue.serializeToLatex)!=null||(ue.serializeToLatex=Fv),x1(ae,ue)}var B1={mathlive:"0.98.5"}},16722:function(mn,rn,he){"use strict";he.d(rn,{Z:function(){return Ce}});const we=Me=>typeof Me=="object"&&Me!=null&&Me.nodeType===1,ct=(Me,Ne)=>(!Ne||Me!=="hidden")&&Me!=="visible"&&Me!=="clip",Re=(Me,Ne)=>{if(Me.clientHeight<Me.scrollHeight||Me.clientWidth<Me.scrollWidth){const ht=getComputedStyle(Me,null);return ct(ht.overflowY,Ne)||ct(ht.overflowX,Ne)||(Ie=>{const He=(mt=>{if(!mt.ownerDocument||!mt.ownerDocument.defaultView)return null;try{return mt.ownerDocument.defaultView.frameElement}catch(Ye){return null}})(Ie);return!!He&&(He.clientHeight<Ie.scrollHeight||He.clientWidth<Ie.scrollWidth)})(Me)}return!1},st=(Me,Ne,ht,Ie,He,mt,Ye,ot)=>mt<Me&&Ye>Ne||mt>Me&&Ye<Ne?0:mt<=Me&&ot<=ht||Ye>=Ne&&ot>=ht?mt-Me-Ie:Ye>Ne&&ot<ht||mt<Me&&ot>ht?Ye-Ne+He:0,Se=Me=>{const Ne=Me.parentElement;return Ne==null?Me.getRootNode().host||null:Ne},Be=(Me,Ne)=>{var ht,Ie,He,mt;if(typeof document=="undefined")return[];const{scrollMode:Ye,block:ot,inline:rt,boundary:Et,skipOverflowHiddenElements:Zt}=Ne,Je=typeof Et=="function"?Et:Ot=>Ot!==Et;if(!we(Me))throw new TypeError("Invalid target");const lt=document.scrollingElement||document.documentElement,We=[];let Ee=Me;for(;we(Ee)&&Je(Ee);){if(Ee=Se(Ee),Ee===lt){We.push(Ee);break}Ee!=null&&Ee===document.body&&Re(Ee)&&!Re(document.documentElement)||Ee!=null&&Re(Ee,Zt)&&We.push(Ee)}const Ve=(Ie=(ht=window.visualViewport)==null?void 0:ht.width)!=null?Ie:innerWidth,Xe=(mt=(He=window.visualViewport)==null?void 0:He.height)!=null?mt:innerHeight,{scrollX:bt,scrollY:je}=window,{height:It,width:at,top:Ct,right:qe,bottom:Nt,left:Qt}=Me.getBoundingClientRect(),{top:Vt,right:Gt,bottom:Ft,left:Fe}=(Ot=>{const Ue=window.getComputedStyle(Ot);return{top:parseFloat(Ue.scrollMarginTop)||0,right:parseFloat(Ue.scrollMarginRight)||0,bottom:parseFloat(Ue.scrollMarginBottom)||0,left:parseFloat(Ue.scrollMarginLeft)||0}})(Me);let xe=ot==="start"||ot==="nearest"?Ct-Vt:ot==="end"?Nt+Ft:Ct+It/2-Vt+Ft,ft=rt==="center"?Qt+at/2-Fe+Gt:rt==="end"?qe+Gt:Qt-Fe;const qt=[];for(let Ot=0;Ot<We.length;Ot++){const Ue=We[Ot],{height:Ge,width:wt,top:dn,right:Rt,bottom:an,left:$t}=Ue.getBoundingClientRect();if(Ye==="if-needed"&&Ct>=0&&Qt>=0&&Nt<=Xe&&qe<=Ve&&(Ue===lt&&!Re(Ue)||Ct>=dn&&Nt<=an&&Qt>=$t&&qe<=Rt))return qt;const Bt=getComputedStyle(Ue),Tt=parseInt(Bt.borderLeftWidth,10),ge=parseInt(Bt.borderTopWidth,10),se=parseInt(Bt.borderRightWidth,10),oe=parseInt(Bt.borderBottomWidth,10);let fe=0,ve=0;const ce="offsetWidth"in Ue?Ue.offsetWidth-Ue.clientWidth-Tt-se:0,$e="offsetHeight"in Ue?Ue.offsetHeight-Ue.clientHeight-ge-oe:0,xt="offsetWidth"in Ue?Ue.offsetWidth===0?0:wt/Ue.offsetWidth:0,Ut="offsetHeight"in Ue?Ue.offsetHeight===0?0:Ge/Ue.offsetHeight:0;if(lt===Ue)fe=ot==="start"?xe:ot==="end"?xe-Xe:ot==="nearest"?st(je,je+Xe,Xe,ge,oe,je+xe,je+xe+It,It):xe-Xe/2,ve=rt==="start"?ft:rt==="center"?ft-Ve/2:rt==="end"?ft-Ve:st(bt,bt+Ve,Ve,Tt,se,bt+ft,bt+ft+at,at),fe=Math.max(0,fe+je),ve=Math.max(0,ve+bt);else{fe=ot==="start"?xe-dn-ge:ot==="end"?xe-an+oe+$e:ot==="nearest"?st(dn,an,Ge,ge,oe+$e,xe,xe+It,It):xe-(dn+Ge/2)+$e/2,ve=rt==="start"?ft-$t-Tt:rt==="center"?ft-($t+wt/2)+ce/2:rt==="end"?ft-Rt+se+ce:st($t,Rt,wt,Tt,se+ce,ft,ft+at,at);const{scrollLeft:Ht,scrollTop:Jt}=Ue;fe=Ut===0?0:Math.max(0,Math.min(Jt+fe/Ut,Ue.scrollHeight-Ge/Ut+$e)),ve=xt===0?0:Math.max(0,Math.min(Ht+ve/xt,Ue.scrollWidth-wt/xt+ce)),xe+=Jt-fe,ft+=Ht-ve}qt.push({el:Ue,top:fe,left:ve})}return qt},Oe=Me=>Me===!1?{block:"end",inline:"nearest"}:(Ne=>Ne===Object(Ne)&&Object.keys(Ne).length!==0)(Me)?Me:{block:"start",inline:"nearest"};function Ce(Me,Ne){if(!Me.isConnected||!(He=>{let mt=He;for(;mt&&mt.parentNode;){if(mt.parentNode===document)return!0;mt=mt.parentNode instanceof ShadowRoot?mt.parentNode.host:mt.parentNode}return!1})(Me))return;const ht=(He=>{const mt=window.getComputedStyle(He);return{top:parseFloat(mt.scrollMarginTop)||0,right:parseFloat(mt.scrollMarginRight)||0,bottom:parseFloat(mt.scrollMarginBottom)||0,left:parseFloat(mt.scrollMarginLeft)||0}})(Me);if((He=>typeof He=="object"&&typeof He.behavior=="function")(Ne))return Ne.behavior(Be(Me,Ne));const Ie=typeof Ne=="boolean"||Ne==null?void 0:Ne.behavior;for(const{el:He,top:mt,left:Ye}of Be(Me,Oe(Ne))){const ot=mt-ht.top+ht.bottom,rt=Ye-ht.left+ht.right;He.scroll({top:ot,left:rt,behavior:Ie})}}}}]);
}());