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__Forums__Detail__id.63020...

3385 lines
1.5 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 Ys=Math.pow;var zl=(Mn,rn,ue)=>new Promise((fe,Ze)=>{var Fe=De=>{try{be(ue.next(De))}catch(Pe){Ze(Pe)}},tt=De=>{try{be(ue.throw(De))}catch(Pe){Ze(Pe)}},be=De=>De.done?fe(De.value):Promise.resolve(De.value).then(Fe,tt);be((ue=ue.apply(Mn,rn)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[508],{40001:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},26227:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},84105:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},18785:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},87169:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},73331:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},15277:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},33853:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},62772:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},61485:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},38819:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},47472:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},87395:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(60499),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),De=function(Ne,dt){return Ze.createElement(be.Z,(0,fe.Z)({},Ne,{ref:dt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe},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",ue={},fe=null,Ze=!1,Fe=!1,tt=null,be=!1,De=null,Pe=null,we=0;we<arguments.length;we++){var _e=arguments[we];if(_e!==null)switch(typeof _e){case"number":rn=_e.toFixed(1);break;case"string":_e.match(new RegExp("^[0-9]\\.[0-9]+$"))?rn=_e:tt=_e;break;case"object":typeof _e.is3D!="undefined"?fe=_e:ue=_e;break;case"boolean":Ze=_e,Fe=!0;break}}fe===null&&(fe={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ue.material_id!==void 0&&!Fe&&(Ze=!0)),tt!==null&&ue.id===void 0&&(ue.id=tt);var Ne="",dt="",Ae=!1,He=null,rt=null,je=null,it=!1,at=null,xt=null,jt=null,Qe=null,mt=null;ue.height!==void 0&&(ue.height=Math.round(ue.height)),ue.width!==void 0&&(ue.width=Math.round(ue.width));var We=function(qe){return parseFloat(qe)>4?parseFloat(qe):5};Mn.setHTML5Codebase=function(qe,Ye){Pe=qe,gt(qe,Ye)},Mn.setJavaCodebase=Mn.setJavaCodebaseVersion=Mn.isCompiledInstalled=Mn.setPreCompiledScriptPath=Mn.setPreCompiledResourcePath=function(){},Mn.setHTML5CodebaseVersion=function(qe,Ye){var Lt=parseFloat(qe);if(Lt!==NaN&&Lt<5){console.log("The GeoGebra HTML5 codebase version "+Lt+" is deprecated. Using version latest instead.");return}De=qe,xe(qe,Ye)},Mn.getHTML5CodebaseVersion=function(){return rt},Mn.getParameters=function(){return ue},Mn.setFontsCSSURL=function(qe){Qe=qe},Mn.setGiacJSURL=function(qe){},Mn.setJNLPFile=function(qe){Ne=qe},Mn.setJNLPBaseDir=function(qe){},Mn.inject=function(){function qe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Ye="auto",Lt=ue.id,mn,Qt=!1,dn=0;dn<arguments.length;dn++){var Zt=arguments[dn];typeof Zt=="string"?(Zt=Zt.toLowerCase(),Zt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Ye=Zt:Lt=arguments[dn]):typeof Zt=="boolean"?Qt=Zt:Zt instanceof HTMLElement&&(mn=Zt)}Vt();function Vt(){if(!be){setTimeout(Vt,200);return}Ye=bt(Ye);var zt=mn||document.getElementById(Lt);if(!zt){console.log("possibly bug on ajax loading? ");return}if(Mn.removeExistingApplet(zt,!1),ue.width===void 0&&zt.clientWidth&&(ue.width=zt.clientWidth),ue.height===void 0&&zt.clientHeight&&(ue.height=zt.clientHeight),!(ue.width&&ue.height)&&Ye==="html5"&&(delete ue.width,delete ue.height),He=Ye,Ye==="screenshot")et(zt,ue);else{var ye=!1;ue.hasOwnProperty("playButton")&&ue.playButton||ue.hasOwnProperty("clickToLoad")&&ue.clickToLoad?ye=!0:ue.hasOwnProperty("playButtonAutoDecide")&&ue.playButtonAutoDecide&&(ye=(!Me()||qe())&&Ke()),ye?(He="screenshot",ft(zt,ue,Qt,Ye)):Tt(zt,ue,Qt)}}};function Me(){try{return window.self!==window.top}catch(qe){return!0}}function Ke(){return ue.hasOwnProperty("screenshotGenerator")&&ue.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Mn.getViews=function(){return fe},Mn.isJavaInstalled=function(){return!1};var Ve=function(qe){var Ye=function(dn){var Zt=JSON.parse(dn),Vt=function(se){return se.type=="G"||se.type=="E"},zt=Zt.elements?Zt.elements.filter(Vt)[0]:Zt;if(!zt||!zt.url){Lt();return}ue.fileName=zt.url,Mt(zt.settings||{}),fe.is3D=!0;var ye="https://www.geogebra.org/images/";Mn.setPreviewImage(at||zt.previewUrl,ye+"GeoGebra_loading.png",ye+"applet_play.png"),qe()},Lt=function(){ue.onError&&ue.onError(),en("Error: Fetching material (id "+ue.material_id+") failed.",ue)},mn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Qt="/materials/"+ue.material_id+"?scope=basic";Xe("https://"+mn+"/api/proxy.php?path="+encodeURIComponent(Qt),Ye,Lt)};function Mt(qe){var Ye=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Lt){qe[Lt]=!!qe[Lt]}),Ye.forEach(function(Lt){ue[Lt]===void 0&&qe[Lt]!==void 0&&(ue[Lt]=qe[Lt])}),ue.showToolBarHelp===void 0&&(ue.showToolBarHelp=ue.showToolBar)}function Xe(qe,Ye,Lt){var mn=new XMLHttpRequest;mn.open("GET",qe),mn.onload=function(){Ye(mn.responseText)},mn.onerror=Lt,mn.send()}Mn.isHTML5Installed=function(){return!0},Mn.getLoadedAppletType=function(){return He},Mn.setPreviewImage=function(qe,Ye,Lt){at=qe,xt=Ye,jt=Lt},Mn.removeExistingApplet=function(qe,Ye){var Lt;typeof qe=="string"&&(qe=document.getElementById(qe)),He=null;var mn=null;for(Lt=0;Lt<qe.childNodes.length;Lt++){var Qt=qe.childNodes[Lt],dn=Qt.className;dn==="applet_screenshot"?Ye?(Qt.style.display="block",He="screenshot"):Qt.style.display="none":dn!=="applet_scaler prerender"&&(qe.removeChild(Qt),mn=dn&&dn.indexOf("appletParameters")!=-1?Qt.id:null,Lt--)}var Zt=ue.id!==void 0?ue.id:mn,Vt=window[Zt];Vt&&typeof Vt.getBase64=="function"&&(Vt.remove(),window[Zt]=null)},Mn.refreshHitPoints=function(){if(We(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var qe=Mn.getAppletObject();return qe&&typeof qe.recalculateEnvironments=="function"?(qe.recalculateEnvironments(),!0):!1},Mn.startAnimation=function(){var qe=Mn.getAppletObject();return qe&&typeof qe.startAnimation=="function"?(qe.startAnimation(),!0):!1},Mn.stopAnimation=function(){var qe=Mn.getAppletObject();return qe&&typeof qe.stopAnimation=="function"?(qe.stopAnimation(),!0):!1},Mn.getAppletObject=function(){var qe=ue.id!==void 0?ue.id:"ggbApplet";return window[qe]},Mn.resize=function(){};var Nt=function(qe,Ye,Lt){var mn=document.createElement("param");mn.setAttribute("name",Ye),mn.setAttribute("value",Lt),qe.appendChild(mn)},ht=function(qe){return qe&&qe!=="false"},Tt=function(qe,Ye,Lt){We(rt)<=4.2&&(Lt=!0);var mn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==rt||ggbHTML5LoadedCodebaseIsWebSimple&&!it)&&(mn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Qt=document.createElement("div");Qt.classList.add("appletParameters","notranslate");var dn=Ye.width,Zt=Ye.height;if(Ye.disableAutoScale=Ye.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Ye.disableAutoScale,Ye.width!==void 0)if(We(rt)<=4.4)ht(Ye.showToolBar)&&(Ye.height-=7),ht(Ye.showAlgebraInput)&&(Ye.height-=37),Ye.width<605&&ht(Ye.showToolBar)&&(Ye.width=605,dn=605);else{var Vt=100;(ht(Ye.showToolBar)||ht(Ye.showMenuBar))&&(Ye.hasOwnProperty("customToolBar")&&(Ye.customToolbar=Ye.customToolBar),Vt=ht(Ye.showMenuBar)?245:155),dn<Vt&&(Ye.width=Vt,dn=Vt)}Qt.style.border="none",Qt.style.display="inline-block";for(var zt in Ye)Ye.hasOwnProperty(zt)&&zt!=="appletOnLoad"&&Qt.setAttribute("data-param-"+zt,Ye[zt]);Qe&&Qt.setAttribute("data-param-fontscssurl",Qe),Mn.resize=function(){GGBAppletUtils.responsiveResize(qe,Ye)},window.addEventListener("resize",function(an){Mn.resize()});var ye=typeof Ye.appletOnLoad=="function"?Ye.appletOnLoad:function(){};if(!Lt&&Ye.width!==void 0){Ye.hasOwnProperty("showSplash")||Qt.setAttribute("data-param-showSplash","false");var se=qe.querySelector(".applet_scaler.prerender"),oe=se!==null;if(oe)var de=se.querySelector(".ggb_preview");else{var de=Bt(dn,Zt,Ye.borderColor,!1);se=document.createElement("div"),se.className="applet_scaler",se.style.position="relative",se.style.display="block",se.style.width=dn+"px",se.style.height=Zt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(se,"66%"),We(rt)>=5?(Ye.appletOnLoad=function(an){var cn=qe.querySelector(".ggb_preview");cn&&cn.parentNode.removeChild(cn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(se),window.GGBT_wsf_view&&$(window).trigger("resize"),ye(an)},oe||se.appendChild(de)):Qt.appendChild(de),se.appendChild(Qt),oe||qe.appendChild(se),setTimeout(function(){Mn.resize()},1)}else{var pe=document.createElement("div");pe.className="applet_scaler",pe.style.position="relative",pe.style.display="block",pe.appendChild(Qt),qe.appendChild(pe),Ye.appletOnLoad=function(an){Mn.resize(),ye(an)}}function le(an,cn){cn&&typeof cn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(an,cn.appletOnLoad):renderGGBElement(an),en("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",cn)}function Be(an,cn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:an,params:cn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Sn){le(Sn.article,Sn.params)}),html5AppletsToProcess=null)},We(rt)<5&&(an.className+=" geogebraweb")):le(an,cn)}if(mn){scriptLoadStarted=!0;for(var lt=0;lt<Qt.childNodes.length;lt++){var Ot=Qt.childNodes[lt].tagName;Ot==="TABLE"&&(Qt.removeChild(Qt.childNodes[lt]),lt--)}if(ggbHTML5LoadedScript!==null){var It=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');It!=null&&It.parentNode.removeChild(It)}var Ht=document.createElement("script"),Yt=function(){Be(Qt,Ye)};Ht.src=dt+je,ggbHTML5LoadedCodebaseIsWebSimple=it,ggbHTML5LoadedCodebaseVersion=rt,ggbHTML5LoadedScript=Ht.src,en("GeoGebra HTML5 codebase loaded: '"+dt+"'.",Ye),!Pe&&(!De||De=="5.0")?(it?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Yt()):dt.requirejs?__webpack_require__.e(7206).then(function(){var an=[__webpack_require__(97206)];Yt.apply(null,an)}.bind(this)).catch(__webpack_require__.oe):(Ht.onload=Yt,qe.appendChild(Ht))}else Be(Qt,Ye);Ye.height=Zt,Ye.width=dn},et=function(qe,Ye,Lt){var mn=Bt(Ye.width,Ye.height,Ye.borderColor,Lt),Qt=document.createElement("div");Qt.style.position="relative",Qt.style.display="block",Qt.style.width=Ye.width+"px",Qt.style.height=Ye.height+"px",Qt.className="applet_screenshot applet_scaler"+(Lt?" applet_screenshot_play":""),Qt.appendChild(mn);var dn=GGBAppletUtils.getScale(Ye,qe,Lt);Lt?(qe.appendChild(Dt()),window.GGBT_wsf_view||(qe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Qt,"66%"),qe.appendChild(Qt),dn!==1&&!isNaN(dn)&&(GGBAppletUtils.scaleElement(Qt,dn),Qt.style.width=Ye.width+"px",Qt.style.height=Ye.height+"px",Qt.parentNode.style.width=Ye.width*dn+"px",Qt.parentNode.style.height=Ye.height*dn+"px"),Mn.resize=function(){Ut(qe,mn,Qt,Lt)},window.addEventListener("resize",function(Zt){Mn.resize()}),Mn.resize()};function Ut(qe,Ye,Lt,mn){if(qe.contains(Ye)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(qe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(qe)}var Qt=GGBAppletUtils.getScale(ue,qe,mn);Lt.parentNode!==null&&(!isNaN(Qt)&&Qt!==1?(GGBAppletUtils.scaleElement(Lt,Qt),Lt.parentNode.style.width=ue.width*Qt+"px",Lt.parentNode.style.height=ue.height*Qt+"px"):(GGBAppletUtils.scaleElement(Lt,1),Lt.parentNode.style.width=ue.width+"px",Lt.parentNode.style.height=ue.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(qe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Mn.onExitFullscreen=function(qe,Ye){Ye.appendChild(qe)};var ft=function(qe,Ye,Lt,mn){et(qe,Ye,!0);for(var Qt=function(){var Vt=[];for(Zt=0;Zt<qe.childNodes.length;Zt++)Vt.push(qe.childNodes[Zt]);if(window.GGBT_wsf_view){var zt=window.GGBT_wsf_view.renderFullScreen(qe,Ye.id),ye=document.getElementById("fullscreencontainer"),se=jQuery(qe).find(".fullscreencontent");se.length>0?(zt.remove(),se.attr("id","fullscreencontent").show(),jQuery(ye).append(se),window.dispatchEvent(new Event("resize"))):Tt(zt,Ye,!1),window.GGBT_wsf_view.launchFullScreen(ye)}else He=mn,Tt(qe,Ye,!1);if(!window.GGBT_wsf_view)for(Zt=0;Zt<Vt.length;Zt++)qe.removeChild(Vt[Zt])},dn=qe.getElementsByClassName("ggb_preview_play"),Zt=0;Zt<dn.length;Zt++)dn[Zt].addEventListener("click",Qt,!1),dn[Zt].addEventListener("ontouchstart",Qt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(qe),Ke()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Dt=function(){var qe=document.createElement("div");if(qe.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Ye='.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");}',Lt=document.createElement("style");Lt.styleSheet?Lt.styleSheet.cssText=Ye:Lt.appendChild(document.createTextNode(Ye)),document.getElementsByTagName("head")[0].appendChild(Lt)}return qe},Bt=function(qe,Ye,Lt,mn){var Qt=document.createElement("div");Qt.className="ggb_preview",Qt.style.position="absolute",Qt.style.zIndex="90",Qt.style.width=qe-2+"px",Qt.style.height=Ye-2+"px",Qt.style.top="0px",Qt.style.left="0px",Qt.style.overflow="hidden",Qt.style.backgroundColor="white";var dn="lightgrey";Lt!==void 0&&(Lt==="none"?dn="transparent":dn=Lt),Qt.style.border="1px solid "+dn;var Zt=document.createElement("img");if(Zt.style.position="relative",Zt.style.zIndex="1000",Zt.style.top="-1px",Zt.style.left="-1px",at!==null&&Zt.setAttribute("src",at),Zt.style.opacity=.7,xt!==null){var Vt,zt,ye;if(!mn){Vt=document.createElement("img"),Vt.style.position="absolute",Vt.style.zIndex="1001",Vt.style.opacity=1,Zt.style.opacity=.3,zt=360,zt>qe/4*3&&(zt=qe/4*3),ye=zt/5.8,Vt.setAttribute("src",xt),Vt.setAttribute("width",zt),Vt.setAttribute("height",ye);var se=(qe-zt)/2,oe=(Ye-ye)/2;Vt.style.left=se+"px",Vt.style.top=oe+"px",Qt.appendChild(Vt)}}return Qt.appendChild(Zt),Qt},bt=function(qe){return qe=qe.toLowerCase(),qe==="html5"||qe==="screenshot"?qe:"html5"},$e=["web","webSimple","web3d","tablet","tablet3d","phone"],xe=function(qe,Ye){if(rt=qe,Ye){gt(rt,!0);return}var Lt=!Ze;if(Lt){var mn=We(rt);!isNaN(mn)&&mn<4.4&&(Lt=!1)}var Qt,dn;window.location.protocol.substr(0,4)==="http"?Qt=window.location.protocol:Qt="http:";var Zt=rt.indexOf("//");Zt>0?dn=rt:Zt===0?dn=Qt+rt:dn="https://www.geogebra.org/apps/5.2.814.0/";for(var Vt in $e)if(rt.slice($e[Vt].length*-1)===$e[Vt]||rt.slice(($e[Vt].length+1)*-1)===$e[Vt]+"/"){gt(dn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Lt&&!fe.is3D&&!fe.AV&&!fe.SV&&!fe.CV&&!fe.EV2&&!fe.CP&&!fe.PC&&!fe.DA&&!fe.FI&&!fe.PV&&!ht(ue.showToolBar)&&!ht(ue.showMenuBar)&&!ht(ue.showAlgebraInput)&&!ht(ue.enableRightClick)&&(!ue.appName||ue.appName=="classic")?dn+="webSimple/":dn+="web3d/",gt(dn,!1)},gt=function(qe,Ye){if(qe.requirejs){dt=qe;return}qe.slice(-1)!=="/"&&(qe+="/"),dt=qe,Ye===null&&(Ye=qe.indexOf("http")===-1),Ae=Ye,je="web.nocache.js",it=!1;var Lt=dt.split("/");Lt.length>1&&(!Ye&&Lt[Lt.length-2]==="webSimple"?(je="webSimple.nocache.js",it=!0):$e.indexOf(Lt[Lt.length-2])>=0&&(je=Lt[Lt.length-2]+".nocache.js")),Lt=qe.split("/"),rt=Lt[Lt.length-3],rt.substr(0,4)==="test"?rt=rt.substr(4,1)+"."+rt.substr(5,1):(rt.substr(0,3)==="war"||rt.substr(0,4)==="beta")&&(rt="5.0");var mn=parseFloat(rt);mn!==NaN&&mn<5&&qe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+mn+" is deprecated. Using version latest instead."),xe("5.0",Ye))},en=function(qe,Ye){window.console&&window.console.log&&(!Ye||typeof Ye.showLogging=="undefined"||Ye.showLogging&&Ye.showLogging!=="false")&&console.log(qe)};ue.material_id!==void 0?Ve(Wt):Wt();function Wt(){var qe=rn;De!==null?qe=De:parseFloat(qe)<5&&(qe="5.0"),xe(qe,!1),Pe!==null&&gt(Pe,Ae),be=!0}return Mn},GGBAppletUtils=function(){"use strict";function Mn(){return window.GGBT_wsf_edit!==void 0}function rn(be,De){De!=1?(be.style.transformOrigin="0% 0% 0px",be.style.webkitTransformOrigin="0% 0% 0px",be.style.transform="scale("+De+","+De+")",be.style.webkitTransform="scale("+De+","+De+")",be.style.maxWidth="initial",be.querySelector(".ggb_preview")!==null&&(be.querySelector(".ggb_preview").style.maxWidth="initial"),be.querySelectorAll(".ggb_preview img")[0]!==void 0&&(be.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),be.querySelectorAll(".ggb_preview img")[1]!==void 0&&(be.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(be.style.transform="none",be.style.webkitTransform="none")}function ue(be,De,Pe,we,_e,Ne){var dt=null;if(Ne!=null&&Ne!="")for(var Ae=be.parentNode;Ae!=null;)if((" "+Ae.className+" ").indexOf(" "+Ne+" ")>-1){dt=Ae;break}else Ae=Ae.parentNode;var He=0,rt=0,je=0,it=0,at=0,xt=0,jt=0;if(dt)He=dt.offsetWidth,rt=Math.max(we?dt.offsetWidth:0,dt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(He=Math.min(window.innerWidth,document.documentElement.clientWidth),rt=Math.min(window.innerHeight,document.documentElement.clientHeight),je=He):(He=window.innerWidth,rt=window.innerHeight,je=window.innerWidth),be){var Qe=be.getBoundingClientRect();Qe.left>0&&Qe.left<=He&&(_e===void 0||!_e)&&(document.dir==="rtl"?(at=He-Qe.width-Qe.left,xt=je<=480?10:30):(xt=Qe.left,at=je<=480?10:30),it=xt+at)}if(be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var mt=be.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(it=40,jt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(it=0,jt=40)}}return be&&((Pe===void 0||!Pe)&&De>0&&De+it<He?He=De:He-=it,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Pe===void 0||!Pe)&&(rt-=jt)),{width:He,height:rt}}function fe(be,De,Pe,we,_e){if(be.isScreenshoGenerator)return 1;var Ne=we!==void 0&&we,dt=be.noScaleMargin!=null&&be.noScaleMargin,Ae=function(mt){return mt&&mt!=="false"},He=Ae(be.autoHeight),rt=ue(De,be.width,Pe,He,Ne&&window.GGBT_wsf_view||dt,_e),je=parseInt(rt.width),it=be.width,at=be.height;if(it===void 0){var xt=De.querySelector(".appletParameters");xt&&(it=xt.offsetWidth,at=xt.offsetHeight)}var jt=je/it,Qe=Ne?1:rt.height/at;return Pe!==void 0&&!Pe&&(jt=Math.min(1,jt),Qe=Math.min(1,Qe)),Math.min(jt,Qe)}function Ze(be,De,Pe){var we=1,_e,Ne=!1;if(be.hasOwnProperty("allowUpscale")&&(Ne=be.allowUpscale),be.hasOwnProperty("scale")&&(we=parseFloat(be.scale),(isNaN(we)||we===null||we===0)&&(we=1),we>1&&(Ne=!0)),De&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ne=!0),!(be.hasOwnProperty("disableAutoScale")&&be.disableAutoScale))_e=fe(be,De,Ne,Pe,be.scaleContainerClass);else return we;return Ne&&(!be.hasOwnProperty("scale")||we===1)?_e:Math.min(we,_e)}function Fe(be){var De=Math.min(window.innerWidth,document.documentElement.clientWidth),Pe=Math.min(window.innerHeight,document.documentElement.clientHeight),we=be.getBoundingClientRect(),_e=(De-we.width)/2,Ne=(Pe-we.height)/2;Ne<0&&(Ne=0),be.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(_e<40?be.style.left="40px":be.style.left=_e+"px",be.style.top=Ne+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ne<40?be.style.top="40px":be.style.top=Ne+"px",be.style.left=_e+"px")}function tt(be,De){var Pe=be.querySelector(".appletParameters");if(Pe){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(De.id!==Pe.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(be)}if(Pe.parentElement&&/fullscreen/.test(Pe.parentElement.className))return;var we=Ze(De,be);Mn()&&Pe.setAttribute("data-param-scale",we);for(var _e=null,Ne=0;Ne<be.childNodes.length;Ne++)if(be.childNodes[Ne].className!==void 0&&be.childNodes[Ne].className.match(/^applet_scaler/)){_e=be.childNodes[Ne];break}if(_e!==null&&_e.querySelector(".noscale")!==null)return;var dt=De.id!==void 0?De.id:"ggbApplet",Ae=window[dt];(Ae==null||!Ae.recalculateEnvironments)&&_e!==null&&!_e.className.match(/fullscreen/)&&(_e.parentNode.style.transform="",!isNaN(we)&&we!==1?(_e.parentNode.style.width=De.width*we+"px",_e.parentNode.style.height=De.height*we+"px",rn(_e,we)):(rn(_e,1),_e.parentNode.style.width=De.width+"px",_e.parentNode.style.height=De.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Fe(be),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Pe).parents(".content-added-content"))}}return{responsiveResize:tt,isFlexibleWorksheetEditor:Mn,positionCenter:Fe,getScale:Ze,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 ue=rn?rn():{},fe=Mn[webModule.__softPermutationId],Ze=O;Ze<fe.length;Ze++){var Fe=fe[Ze];ue[Fe[O]]=Fe[P]}return ue}};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(fe){function Ze(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Fe=Ze();if(Fe){fe();return}function tt(){if(!Fe){if(!Ze())return;Fe=!0,fe(),o.removeEventListener&&o.removeEventListener(Z,tt,!1),be&&clearInterval(be)}}o.addEventListener&&o.addEventListener(Z,tt,!1);var be=setInterval(function(){tt()},$)}function ue(fe){var Ze=u(),Fe=Ze.body,tt=Ze.createElement(_);tt.language=ab,tt.crossOrigin=W,tt.src=fe,webModule.__errFn&&(tt.onerror=function(){webModule.__errFn(L,new Error(bb+fe))}),Fe.appendChild(tt)}rn(function(){ue(Mn)})}webModule.__startLoadingFragment=function(Mn){return C(Mn)},webModule.__installRunAsyncCode=function(Mn){var rn=u(),ue=rn.body,fe=rn.createElement(_);fe.language=ab,fe.text=Mn,ue.appendChild(fe),ue.removeChild(fe)};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(be){var De=be.lastIndexOf(rb);De==-1&&(De=be.length);var Pe=be.indexOf(sb);Pe==-1&&(Pe=be.length);var we=be.lastIndexOf(tb,Math.min(Pe,De));return we>=O?be.substring(O,we+P):W}function rn(be){if(!be.match(/^\w+:\/\//)){var De=o.createElement(ub);De.src=be+vb,be=Mn(De.src)}return be}function ue(){var be=__gwt_getMetaProperty(wb);return be!=null?be:W}function fe(){for(var be=o.getElementsByTagName(_),De=O;De<be.length;++De)if(be[De].src.indexOf(xb)!=-1)return Mn(be[De].src);return W}function Ze(){var be=o.getElementsByTagName(yb);return be.length>O?be[be.length-P].href:W}function Fe(){var be=o.location;return be.href==be.protocol+zb+be.host+be.pathname+be.search+be.hash}var tt=ue();return tt==W&&(tt=fe()),tt==W&&(tt=Ze()),tt==W&&Fe()&&(tt=Mn(o.location.href)),tt=rn(tt),tt}function C(Mn){return Mn.match(/^\//)||Mn.match(/^[a-zA-Z]+:\/\//)?Mn:webModule.__moduleBase+Mn}function D(){var Mn=[],rn=O,ue=[],fe=[];function Ze(be){var De=fe[be](),Pe=ue[be];if(De in Pe)return De;var we=[];for(var _e in Pe)we[Pe[_e]]=_e;throw r&&r(be,we,De),null}if(__gwt_isKnownPropertyValue=function(be,De){return De in ue[be]},webModule.__getPropMap=function(){var be={};for(var De in ue)ue.hasOwnProperty(De)&&(be[De]=Ze(De));return be},webModule.__computePropValue=Ze,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Fe;try{Fe=Cb;var tt=Fe.indexOf(Db);tt!=-1&&(rn=parseInt(Fe.substring(tt+P),$),Fe=Fe.substring(O,tt))}catch(be){}return webModule.__softPermutationId=rn,C(Fe+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,ue){"use strict";ue.d(rn,{Ax:function(){return tt},Ds:function(){return be},KI:function(){return Pe},SI:function(){return Fe},f1:function(){return Ze}});var fe=ue(6521);function Ze(we){let _e=!0;if(we.length>0){for(let Ne=0;Ne<we.length;Ne++)if(we[Ne].compile_success==0||!we[Ne].compile_success){_e=!1;break}}else _e=!1;return _e}function Fe(we,_e=""){let Ne=[];for(let dt=0;dt<we.length;dt++){let Ae=we[dt],He=_e?`${_e}/${Ae.name}`:`${Ae.name}`;Ne.push({title:Ae.name,type:Ae.type,isLeaf:Ae.type!=="tree",key:He})}return Ne}function tt(we,_e,Ne){for(let dt=0;dt<we.length;dt++){let Ae=we[dt];if(Ae.key===_e){Ae.children=Ne;break}Ae.children&&tt(Ae.children,_e,Ne)}return we}function be(we,_e,Ne){let dt;return function(){let Ae=this,He=arguments,rt=function(){dt=null,Ne||we.apply(Ae,He)},je=Ne&&!dt;clearTimeout(dt),dt=setTimeout(rt,_e),je&&we.apply(Ae,He)}}const De=!0,Pe=fe.Z.API_SERVER},15868:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return dt}});var fe=ue(59301),Ze={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Fe=ue(92310),tt=ue.n(Fe),be=ue(71418),De=ue(2859),Pe=ue(79769),we=ue(25544),_e=(Ae,He,rt)=>new Promise((je,it)=>{var at=Qe=>{try{jt(rt.next(Qe))}catch(mt){it(mt)}},xt=Qe=>{try{jt(rt.throw(Qe))}catch(mt){it(mt)}},jt=Qe=>Qe.done?je(Qe.value):Promise.resolve(Qe.value).then(at,xt);jt((rt=rt.apply(Ae,He)).next())}),dt=({data:Ae,className:He,fullWidth:rt,style:je={},onClose:it,onOk:at,showFullTools:xt,noAssociationId:jt})=>{const Qe=(0,fe.useRef)(null),mt=(0,fe.useRef)(null),We=(0,fe.useRef)(null),Me=(0,fe.useRef)(null),[Ke,Ve]=(0,fe.useState)(!1),[Mt,Xe]=(0,fe.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,fe.useEffect)(()=>{We.current||(We.current=document.createElement("style"),document.head.appendChild(We.current)),Ae!=null&&Ae.visible?(document.body.setAttribute("data-custom","y-hidden"),We.current.innerHTML=" html { overflow-y: hidden; }",Ae!=null&&Ae.src&&Nt()):(document.body.removeAttribute("data-custom"),We.current&&(document.head.removeChild(We.current),We.current=null))},[Ae==null?void 0:Ae.visible]);const Nt=()=>_e(void 0,null,function*(){Ve(!0),Xe("\u6B63\u5728\u52A0\u8F7D\u4E2D");const ft=yield(0,we.ZJ)(Ae==null?void 0:Ae.src);Qe.current.src="",Qe.current.src=ft,Qe.current.onload=function(){Ut()},Ve(!1),Xe("")}),ht=()=>{document.body.removeAttribute("data-custom"),We.current.innerHTML=" ",it()},Tt=ft=>_e(void 0,null,function*(){Ve(!0),Xe("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Dt=yield(0,Pe.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ae.title,file:ft.dataUrl}});Dt!=null&&Dt.id&&!jt?(yield(0,Pe.ZP)(`/api/attachments/${Ae.id}/add_subitem.json`,{method:"post",body:{subitem_id:Dt==null?void 0:Dt.id,settings:JSON.stringify(ft.state)}})).status===0&&at():Dt!=null&&Dt.id&&at(Dt),document.body.removeAttribute("data-custom"),We.current.innerHTML=" ",Ve(!1),Xe("")}),et=()=>{const ft=document.querySelector('a[href="https://markerjs.com/"]');ft&&ft.parentNode&&(ft.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(Bt=>{const bt=document.querySelector(Bt.name);bt&&bt.setAttribute("title",Bt.title)})},Ut=()=>{mt.current=new De.hP(Qe.current),mt.current.targetRoot=Me.current,mt.current.addEventListener("render",Tt),mt.current.addEventListener("beforeclose",ht),xt&&(mt.current.availableMarkerTypes=mt.current.ALL_MARKER_TYPES,mt.current.uiStyleSettings.redoButtonVisible=!0,mt.current.uiStyleSettings.notesButtonVisible=!0,mt.current.uiStyleSettings.zoomButtonVisible=!0,mt.current.uiStyleSettings.zoomOutButtonVisible=!0,mt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=mt.current.uiStyleSettings,mt.current.show(),Ae!=null&&Ae.snapshotData&&mt.current.restoreState(Ae.snapshotData),setTimeout(()=>{window.scrollTo(0,0),et()},300)};return fe.createElement(fe.Fragment,null,(Ae==null?void 0:Ae.visible)&&fe.createElement(be.Z,{spinning:Ke,tip:Mt,style:{position:"absolute"}},fe.createElement("div",{ref:Me,className:tt()(Ze.imageDimensions,He,rt?Ze.fullWidth:""),style:je},fe.createElement("img",{className:Ze.img,ref:Qe}))))}},3315:function(Mn,rn,ue){"use strict";var fe=ue(59301),Ze=ue(95237),Fe=ue(43604),tt=ue(99313),be=ue(3113),De=ue(39655),Pe=ue(18760),we=ue(48136),_e=ue(59301);const Ne=(0,fe.forwardRef)(({callback:dt,showSaveButton:Ae,value:He=""},rt)=>{const je=(0,fe.useRef)(),it=[{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 "}]}]}],at=[{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}`}]}]}],xt=mt=>{je.current.setValue(je.current.getValue()+" "+mt.value+" ")},jt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:_e.createElement(Ze.Z,{className:Pe.Z.lists,gutter:[10,10]},it.map((mt,We)=>_e.createElement(Fe.Z,{flex:"110px",className:Pe.Z.item},_e.createElement("div",null,_e.createElement(De.Z,{value:`$$${mt.value}$$`}),mt.name),_e.createElement("div",{className:Pe.Z.children},mt.children.map((Me,Ke)=>_e.createElement("div",{key:Ke},_e.createElement("h1",null,Me.name),_e.createElement(Ze.Z,{gutter:[10,10]},Me.data.map((Ve,Mt)=>_e.createElement(Fe.Z,{key:Mt,onClick:()=>xt(Ve),className:Pe.Z.diamond},_e.createElement(De.Z,{value:"`$$"+Ve.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:_e.createElement(Ze.Z,{className:Pe.Z.lists,gutter:[10,10]},at.map((mt,We)=>_e.createElement(Fe.Z,{flex:"110px",className:Pe.Z.item},_e.createElement("div",null,_e.createElement(De.Z,{value:"`$$"+mt.value+"$$`"}),mt.name),_e.createElement("div",{className:Pe.Z.children},mt.children.map((Me,Ke)=>_e.createElement("div",{key:Ke},Me.name&&_e.createElement("h1",null,Me.name),_e.createElement(Ze.Z,{gutter:[10,10]},Me.data.map((Ve,Mt)=>_e.createElement(Fe.Z,{key:Mt,onClick:()=>xt(Ve),className:Pe.Z.diamond},_e.createElement(De.Z,{value:"`$$"+Ve.value+"$$`"}))))))))))}],Qe=()=>{var mt=document.createElement("div");mt.innerHTML=je.current.getValue();var We=mt.innerText;return dt&&dt(We),We};return(0,fe.useImperativeHandle)(rt,()=>({getData:Qe})),_e.createElement("div",{className:Pe.Z.mathWrap},_e.createElement(tt.default,{defaultActiveKey:"1",items:jt}),_e.createElement("math-field",{locale:"zh_cn",className:Pe.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:je,style:{width:800,marginTop:30,fontSize:18}},He||""),Ae&&_e.createElement("div",{className:Pe.Z.button},_e.createElement(be.ZP,{size:"large",onClick:Qe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});rn.Z=Ne},94615:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return tt}});var fe=ue(59301),Ze=ue(21798),Fe=ue(11611),tt=()=>{const[be,De]=(0,fe.useState)(""),[Pe,we]=(0,fe.useState)(0);let[_e,Ne]=(0,fe.useState)(),[dt,Ae]=(0,fe.useState)();const[He,rt]=(0,fe.useState)(!1),je=(0,fe.useRef)("");(0,fe.useEffect)(()=>Ze.Z.subscribe("preview-image",Mt=>{De(Mt),console.log(Me.current),document.body.style.overflow="hidden"}),[]),(0,fe.useEffect)(()=>(document.addEventListener("keydown",it),()=>{document.removeEventListener("keydown",it)}),[]),(0,fe.useEffect)(()=>{je.current=be},[be]);function it(Ve){Ve.keyCode==27&&je.current&&at()}function at(){document.body.style.overflow="auto",Ne(void 0),Ae(void 0),we(0),De("")}function xt(){we(Pe+90)}function jt(){_e=Me.current.width*1.1,dt=Me.current.height*1.1,Ae(dt),Ne(_e)}function Qe(){_e=Me.current.width/1.1,dt=Me.current.height/1.1,Ae(dt),Ne(_e)}const mt=(0,fe.useRef)(),We=(0,fe.useRef)(),Me=(0,fe.useRef)(),Ke=Ve=>{(Ve.nativeEvent.target===mt.current||Ve.nativeEvent.target===We.current)&&at()};return fe.createElement(fe.Fragment,null,be?fe.createElement("div",null,fe.createElement("div",{className:"preview-wrp-group",ref:We},fe.createElement(Fe.Z,{className:"image-preview",src:be,style:{display:"none"},preview:{visible:!0,src:be,movable:!1,onVisibleChange:Ve=>{De("")}},alt:"\u9884\u89C8\u5927\u56FE"}))):null)}},67831:function(Mn,rn,ue){"use strict";ue.d(rn,{h:function(){return mt}});var fe=ue(59301),Ze=ue(57809),Fe=ue(78241),tt=ue(3113),be=ue(89780),De=ue.n(be),Pe=ue(14618),we=ue(66552),_e=Object.defineProperty,Ne=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,je=(We,Me,Ke)=>Me in We?_e(We,Me,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):We[Me]=Ke,it=(We,Me)=>{for(var Ke in Me||(Me={}))He.call(Me,Ke)&&je(We,Ke,Me[Ke]);if(Ae)for(var Ke of Ae(Me))rt.call(Me,Ke)&&je(We,Ke,Me[Ke]);return We},at=(We,Me)=>Ne(We,dt(Me));const xt=Ze.default.Option,jt={labelCol:{span:4},wrapperCol:{span:20}},Qe={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:Me})=>{const[Ke,Ve]=(0,fe.useState)("python");function Mt(Nt){Ve(Qe[Nt][1])}function Xe(Nt){We(Nt)}return fe.createElement(Fe.default,at(it({},jt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Xe,style:{width:500}}),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},fe.createElement(Ze.default,{getPopupContainer:Nt=>Nt.parentNode,onChange:Mt},Object.keys(Qe).map(Nt=>fe.createElement(xt,{key:Nt,value:Nt},Qe[Nt][0])))),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},fe.createElement(mt,{mode:Ke})),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(tt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(tt.ZP,{type:"ghost",onClick:Me},"\u53D6\u6D88")))};function mt({value:We,onChange:Me,mode:Ke,options:Ve={}}){const Mt=(0,fe.useRef)(),[Xe,Nt]=(0,fe.useState)();return(0,fe.useEffect)(()=>{if(Xe){let ht=function(Tt){const et=Tt.getValue();Me&&Me(et)};return Xe.on("change",ht),()=>{Xe.off("change",ht)}}},[Xe,Me]),(0,fe.useEffect)(()=>{Xe&&Xe.setOption("mode",Ke)},[Xe,Ke]),(0,fe.useEffect)(()=>{Xe&&(We!==Xe.getValue()||We==="")&&setTimeout(()=>{Xe.setValue(We||"")},300)},[Xe,We]),(0,fe.useEffect)(()=>{if(Mt.current&&!Xe){const ht=De().fromTextArea(Mt.current,it({mode:Ke,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ve));Nt(ht)}},[Mt.current,Xe]),fe.createElement("div",{className:"my-codemirror-container"},fe.createElement("textarea",{ref:Mt}))}},40973:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return br}});var fe=ue(59301),Ze=ue(89780),Fe=ue.n(Ze),tt=ue(76374),be=ue(14618),De=ue(6313),Pe=ue(25717),we=ue(99498),_e=ue(25419),Ne=ue(67549),dt=ue(39655),Ae=({value:Kn="",className:ar,showTextOnly:vn,showLines:pn,style:Nn={}})=>{const st=(0,fe.useMemo)(()=>"",[Kn]);return fe.createElement(fe.Fragment,null,fe.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},He=ue(59301),rt=Object.defineProperty,je=Object.defineProperties,it=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Qe=(Kn,ar,vn)=>ar in Kn?rt(Kn,ar,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Kn[ar]=vn,mt=(Kn,ar)=>{for(var vn in ar||(ar={}))xt.call(ar,vn)&&Qe(Kn,vn,ar[vn]);if(at)for(var vn of at(ar))jt.call(ar,vn)&&Qe(Kn,vn,ar[vn]);return Kn},We=(Kn,ar)=>je(Kn,it(ar));let Me=[{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 Ke({onActionCallback:Kn,title:ar,icon:vn,actionName:pn,className:Nn="",children:st}){function Ee(){Kn(pn)}return He.createElement("a",{title:ar,className:Nn,onClick:Ee},He.createElement("i",{className:`${vn}`}),st)}var Ve=({watch:Kn,showNullButton:ar,showNullProgramButton:vn,onActionCallback:pn,fullScreen:Nn,insertTemp:st,hidetoolBar:Ee,extraUse:Te})=>{const ke=[...Me,{title:`${Kn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Kn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return He.createElement("ul",{className:"markdown-toolbar-container"},!Ee&&ke.map((Ie,Ge)=>He.createElement("li",{key:Ge},Ie.actionName?He.createElement(Ke,We(mt({},Ie),{onActionCallback:pn})):He.createElement("span",{className:"v-line"}))),ar?He.createElement("li",null,He.createElement(Ke,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pn},He.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,vn?He.createElement(He.Fragment,null,He.createElement("li",null,He.createElement(Ke,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:pn},He.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),He.createElement("li",null,He.createElement(Ke,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:pn},He.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,st&&He.createElement("li",null,He.createElement(Ke,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${st}`,onActionCallback:pn},He.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Te&&He.createElement("li",null,Te),He.createElement("li",{className:"btn-full-screen"},He.createElement(Ke,{icon:`${Nn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Nn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pn})))},Mt=ue(53531),Xe=ue(78241),Nt=ue(92832),ht=ue(3113),Tt=Object.defineProperty,et=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,bt=(Kn,ar,vn)=>ar in Kn?Tt(Kn,ar,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Kn[ar]=vn,$e=(Kn,ar)=>{for(var vn in ar||(ar={}))Dt.call(ar,vn)&&bt(Kn,vn,ar[vn]);if(ft)for(var vn of ft(ar))Bt.call(ar,vn)&&bt(Kn,vn,ar[vn]);return Kn},xe=(Kn,ar)=>et(Kn,Ut(ar));const gt={labelCol:{span:4},wrapperCol:{span:20}};var en=({callback:Kn,onCancel:ar})=>{function vn(pn){Kn(pn)}return fe.createElement(Xe.default,xe($e({},gt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:vn,style:{width:500}}),fe.createElement(Xe.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},fe.createElement(Nt.default,null)),fe.createElement(Xe.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},fe.createElement(Nt.default,null)),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(ht.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(ht.ZP,{type:"ghost",onClick:ar},"\u53D6\u6D88")))},Wt=ue(67831),qe=ue(58448),Ye=ue(43418),Lt=ue(95237),mn=ue(15868),Qt=ue(59301),dn=({callback:Kn,onCancel:ar})=>{const vn=document.createElement("canvas"),pn=vn.getContext("2d");vn.width=1e3,vn.height=800,pn.fillStyle="#ffffff",pn.fillRect(0,0,vn.width,vn.height);const Nn=vn.toDataURL("image/png");return Qt.createElement(Ye.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Qt.createElement(Lt.Z,{style:{height:"100vh"}},Qt.createElement(mn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Nn,visible:!0,title:String(Date.now())},onOk:st=>{Kn({src:st.url})},onClose:ar})))},Zt=ue(8591),Vt=ue(43428),zt=ue(43604),ye={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},se=ue(59301),de=(0,fe.forwardRef)(({onCancel:Kn,editImgId:ar,callback:vn},pn)=>{let Nn=(0,fe.useRef)(),st=(0,fe.useRef)(),Ee=(0,fe.useRef)(),Te=(0,fe.useRef)(!1);const ke=(0,fe.useRef)(!1);console.log("ref:",pn);const[Ie,Ge]=(0,fe.useState)(0),[ut,nt]=(0,fe.useState)("100vh");(0,fe.useEffect)(()=>{Ge(1);try{indexedDB.databases().then(kt=>{kt.forEach(Rt=>indexedDB.deleteDatabase(Rt.name))})}catch(kt){}},[]),(0,fe.useEffect)(()=>(window.addEventListener("message",ct),()=>{window.removeEventListener("message",ct)}),[]),(0,fe.useImperativeHandle)(pn,()=>({setHeight:nt}));const ze=kt=>{window.saveDrawData(Rt=>{if(Rt===null&&!kt){Zt.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Zt.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),vn({src:`/api/attachments/${Rt}`,id:Rt,disabledClose:!0})})},ct=kt=>{var Rt;((Rt=kt==null?void 0:kt.data)==null?void 0:Rt.type)==="closePop"&&ze(!0)};return se.createElement("div",{ref:ke,className:"body-overflow-initial"},se.createElement(Vt.Z,{width:"100vw",height:ut,footer:null,closable:!0,placement:"bottom",open:!!Ie,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ye.drawerWrap}`,onClose:()=>{window.saveDrawData(kt=>{vn({src:`/api/attachments/${kt}`,id:kt})})},title:se.createElement(Lt.Z,{align:"middle"},se.createElement(zt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),se.createElement(zt.Z,{onClick:()=>{nt(ut==="60px"?"100vh":"60px")}},se.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),se.createElement(zt.Z,{onClick:ze},se.createElement(ht.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},se.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${ar||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:st})))}),pe=ue(6521),le=ue(5112),Be=ue(5871);const lt=le.ZP.Group,Ot={margin:"0 8px"};var It=({callback:Kn,onCancel:ar})=>{function vn(pn){Kn(pn)}return fe.createElement(Xe.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:vn},fe.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},fe.createElement("span",{style:Ot},"\u5355\u5143\u683C\u6570\uFF1A"),fe.createElement("span",{style:Ot},"\u884C\u6570"),fe.createElement(Xe.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},fe.createElement(Be.Z,null)),fe.createElement("span",{style:Ot},"\u5217\u6570"),fe.createElement(Xe.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},fe.createElement(Be.Z,null))),fe.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},fe.createElement("span",{style:Ot},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),fe.createElement(Xe.default.Item,{name:"align"},fe.createElement(lt,null,fe.createElement(le.ZP,{value:"default"},fe.createElement("i",{className:"fa fa-align-justify"})),fe.createElement(le.ZP,{value:"left"},fe.createElement("i",{className:"fa fa-align-left"})),fe.createElement(le.ZP,{value:"center"},fe.createElement("i",{className:"fa fa-align-center"})),fe.createElement(le.ZP,{value:"right"},fe.createElement("i",{className:"fa fa-align-right"}))))),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(ht.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(ht.ZP,{type:"ghost",onClick:ar},"\u53D6\u6D88")))},Ht=ue(78673),Yt=ue(3352),an=ue.n(Yt),Sn=(0,fe.forwardRef)(({use3d:Kn,width:ar,height:vn,callback:pn,showSaveButton:Nn},st)=>{const Ee=(0,fe.useRef)(),Te=(0,fe.useRef)(),[ke,Ie]=(0,fe.useState)(!1),Ge=(0,fe.useRef)({id:Ee,appName:"graphing",width:ar||1e3,height:vn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,fe.useEffect)(()=>{Te.current=new(an())(Ge.current,!0),window.onload=function(){Te.current.inject("applet_container")}},[]);const ut=()=>{var nt=window.ggbApplet.getPNGBase64(1,!0,72);return pn&&pn(nt),nt};return(0,fe.useEffect)(()=>{Ge.current.appName=ke?"3D":"graphing",Te.current.inject("applet_container")},[ke]),(0,fe.useEffect)(()=>{Ie(Kn)},[Kn]),(0,fe.useImperativeHandle)(st,()=>({getImgData:ut})),fe.createElement(fe.Fragment,null,fe.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Ee}),fe.createElement(Lt.Z,{align:"middle"},fe.createElement(zt.Z,{flex:1},fe.createElement(Ht.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:ke,onChange:nt=>Ie(nt)})),fe.createElement(zt.Z,null,fe.createElement(ht.ZP,{size:"large",onClick:ut,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),wt=ue(3315),on=ue(1012);const Pn="link",ot="upload-image",St="add-flowchart",$t="draw-image",Dn="add-flowchart",Ln="code-block",In="add-table",qn="------------",dr={default:qn,left:`:${qn}`,center:`:${qn}:`,right:`${qn}:`};var ir=ue(57649),Er=(Kn,ar,vn)=>new Promise((pn,Nn)=>{var st=ke=>{try{Te(vn.next(ke))}catch(Ie){Nn(Ie)}},Ee=ke=>{try{Te(vn.throw(ke))}catch(Ie){Nn(Ie)}},Te=ke=>ke.done?pn(ke.value):Promise.resolve(ke.value).then(st,Ee);Te((vn=vn.apply(Kn,ar)).next())});function kr(){}let Qn=0;const Kr=1e4,jr="\u2581",Hr="@\u2581\u2581@",ni="@\u2581@",Br=`
**\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`,qr=["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 Cr(Kn){return/^\d+$/.test(Kn)?`${Kn}px`:Kn}const wn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",fn={[wn+"-B"]:"bold",[wn+"-I"]:"italic"},Rn={[Pn]:"\u6DFB\u52A0\u94FE\u63A5",[Ln]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[ot]:"\u6DFB\u52A0\u56FE\u7247",[$t]:"\u6DFB\u52A0\u753B\u56FE",[St]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[In]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var br=({defaultValue:Kn="",onChange:ar,width:vn="100%",height:pn=400,miniToolbar:Nn=!1,isFocus:st=!1,watch:Ee,insertTemp:Te,mode:ke="markdown",id:Ie="markdown-editor-id",showResizeBar:Ge=!1,noStorage:ut=!1,showNullButton:nt=!1,showNullProgramButton:ze=!1,hidetoolBar:ct=!1,fullScreen:kt=!1,onBlur:Rt,onCMBeforeChange:Jt,onFullScreen:pt,className:Ct="",disablePaste:bn=!1,disabled:ln=!1,disabledFill:En=!1,placeholder:qt="",values:On="",extraUse:tn,onAddBlank:An})=>{const[Ue,At]=(0,fe.useState)(null),[Pt,Xt]=(0,fe.useState)(Kn),[Ft,Gt]=(0,fe.useState)(Ee),[Kt,un]=(0,fe.useState)(kt),[xn,_n]=(0,fe.useState)(""),[Hn,Yn]=(0,fe.useState)(0),[yr,rr]=(0,fe.useState)(pn),[Wn,xr]=(0,fe.useState)(!1),gr=(0,fe.useRef)((0,on.Z)()),mr=(0,fe.useRef)(!1),Gn=(0,fe.useRef)(),[Jn,hr]=(0,fe.useState)(0),[tr,_r]=(0,fe.useState)(0),Wr=(0,fe.useRef)(),fr=(0,fe.useRef)(),kn=(0,fe.useRef)(),Cn=(0,fe.useRef)(),Xn=(0,fe.useRef)(),Fn=(0,fe.useRef)(),Sr=()=>Er(void 0,null,function*(){var Zn;const Un=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:gr.current}});(Zn=Un==null?void 0:Un.attachments)!=null&&Zn.length&&(console.log("cm:",Ue,Wr),Un.attachments.map(jn=>{jn.content_type.indexOf("image")>-1?Ue.replaceSelection(`![,](/api/attachments/${jn.id}?type=${jn.content_type})`):jn.content_type.indexOf("video")>-1?Ue.replaceSelection(`<video width="100%" controls src="${pe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):jn.content_type.indexOf("pdf")>-1?Ue.replaceSelection(`<a href="${pe.Z.API_SERVER}/api/attachments/${jn.id}?type=${jn.content_type}&disposition=inline" target="_blank">${jn.name}</a>`):Ue.replaceSelection(`[${jn.name}](${pe.Z.API_SERVER}/api/attachments/${jn.id}?type=${jn.content_type})`)}))});(0,fe.useEffect)(()=>{const Zn=window.scrollY||window.pageYOffset;Xt(On),Ue==null||Ue.setValue(On),window.scrollTo(0,Zn)},[On]),(0,fe.useEffect)(()=>{pt==null||pt(Kt)},[Kt]),(0,fe.useEffect)(()=>{if(Wr.current){let Zn=function(jn,ur){var Yr;if(bn){ur.preventDefault();return}const li=ur.clipboardData;if(li){const fi=li.types.toString(),di=li.items;if(fi==="Files"||li.types.indexOf("Files")>-1){if(ur.preventDefault(),ke=="stex")return;try{let ii=di[1];((Yr=di[0])==null?void 0:Yr.kind)==="file"&&(ii=di[0]);const Si=ii.getAsFile(),Fi=Si.name.split(".").pop();(0,qe.I)(Si,Ii=>{var la,ea,Pi;Ii.id?((la=Si==null?void 0:Si.type)==null?void 0:la.indexOf("image"))>-1?Un.replaceSelection(`<img width="100%" src="/api/attachments/${Ii.id}?type=${Ii.content_type})" alt="" />`):((ea=Si==null?void 0:Si.type)==null?void 0:ea.indexOf("video"))>-1?Un.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ii.id}"></video>`):((Pi=Si==null?void 0:Si.type)==null?void 0:Pi.indexOf("pdf"))>-1?Un.replaceSelection(`<a href="/api/attachments/${Ii.id}?type=${Si.type}&disposition=inline" target="_blank">${Si.name}</a>`):qr.includes(Fi)?Un.replaceSelection(`<a href="/api/attachments/${Ii.id}?type=office&disposition=inline" target="_blank">${Si.name}</a>`):Un.replaceSelection(`[${Si.name}](/api/attachments/${Ii.id}?type=${Ii.content_type})`):(Ii==null?void 0:Ii.status)===401&&(Zt.ZP.warning((Ii==null?void 0:Ii.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(ii){Zt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Un=Fe().fromTextArea(Wr.current,{mode:ke,lineNumbers:!Nn,lineWrapping:!0,value:Kn,autoCloseTags:!ze,autoCloseBrackets:!0});return Un.on("keyup",function(jn,ur){ur.keyCode===8&&(jn.getValue()==""?Un.setOption("placeholder",qt):Un.setOption("placeholder",null))}),Un.on("keydown",function(jn,ur){if(ur.keyCode===8){var Yr=lr(jn);Yr&&ur.preventDefault()}}),st&&Un.focus(),Un.on("paste",Zn),Un.on("dragleave",function(jn,ur){fr.current.classList.remove("mouse-hover-md")}),ln&&Un.on("beforeChange",function(jn,ur){(ur.origin==="paste"||ur.origin==="+input")&&ur.cancel()}),At(Un),()=>{Un.off("paste",Zn)}}},[]);const Ar=(0,fe.useCallback)(()=>{if(fr.current)try{}catch(Zn){console.log(Zn,"---- to set md editor body height")}},[yr,fr,Kt]);(0,fe.useEffect)(()=>{function Zn(){let Un=new tt.Z(jn=>{for(let ur of jn)(ur.target.offsetHeight>0||ur.target.offsetWidth>0)&&(Ar(),Ue.setSize("100%","100%"),Ue.refresh())});return Un.observe(Wr.current.parentElement),Un}if(Ue){const Un=Zn();return()=>{var jn,ur;(jn=Wr.current)!=null&&jn.parentElement&&Un.unobserve((ur=Wr.current)==null?void 0:ur.parentElement)}}},[Ue,Ar]),(0,fe.useEffect)(()=>{if(Ue){let Zn=[];for(const[Un,jn]of Object.entries(fn)){let ur={[Un]:()=>{Vr(jn)}};Zn.push(ur),Ue.addKeyMap(ur)}return Gn.current=setInterval(()=>{mr.current&&Sr()},4e3),()=>{clearInterval(Gn.current);for(let Un of Zn)Ue.removeKeyMap(Un)}}},[Ue]),(0,fe.useEffect)(()=>{kt!==Kt&&un(kt)},[kt]),(0,ir.Z)(()=>{if(!ut&&Hn>0){let Zn=new Date().getTime(),Un=window.sessionStorage.getItem(Ie);Zn>=Hn+Kr&&(!Un||Un!==Pt)&&(window.sessionStorage.setItem(Ie,Pt),xr(!0))}},Kr),(0,fe.useEffect)(()=>{Gt(Ee)},[Ue,Ee]),(0,fe.useEffect)(()=>{Ue&&st&&Ue.focus()},[Ue,st]),(0,fe.useEffect)(()=>{if(Ft&&Ue){let Zn=function(jn){let ur=jn.target;if(Cn.current){let Yr=ur.scrollTop/ur.scrollHeight;Cn.current.scrollTop=Cn.current.scrollHeight*Yr}};const Un=Ue.getScrollerElement();return Un.addEventListener("scroll",Zn),()=>{Un.removeEventListener("scroll",Zn)}}},[Ue,Ft]),(0,fe.useEffect)(()=>{if(Ue&&Jt){let Zn=function(Un,jn){Jt(Un,jn)};return Ue.on("beforeChange",Zn),()=>{Ue.off("beforeChange",Zn)}}},[Ue,Jt]),(0,fe.useEffect)(()=>{if(Ue&&Rt){let Zn=function(){Rt(Ue.getValue())};return Ue.on("blur",Zn),()=>{Ue.off("blur",Zn)}}},[Ue,Rt]);function lr(Zn,Un){var jn=Zn.getDoc(),ur=jn.getCursor(),Yr=jn.getLine(ur.line),li=Yr.charAt(ur.ch-1),fi=Yr.lastIndexOf("@\u2581@",ur.ch),di=Yr.lastIndexOf("@\u2581\u2581@",ur.ch),ii=fi>di?fi:di,Si=fi>di?3:4;if(Hr.indexOf(li)===-1)return null;if(console.log("change1:",Un,Zn,Yr,ur,ii,fi,di,li),ii>=0&&ur.ch-ii<5){var Fi=ii+Si;return jn.replaceRange("",{line:ur.line,ch:ii},{line:ur.line,ch:Fi}),{line:ur.line,ch:Fi}}return null}(0,fe.useEffect)(()=>{if(Ue){let Zn=function(Un,jn){const ur=Un.getValue();Xt(ur),Yn(new Date().getTime()),Un.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ar&&(ze?ar(ur,yi(ur)):ar(ur))};return Ue.on("change",Zn),()=>{Ue.off("change",Zn)}}},[Ue,ar]),(0,fe.useEffect)(()=>{if(Ue)if(Kn==null)Ue.setValue(""),Xt("");else{const Zn=window.scrollY||window.pageYOffset;Kn!==Ue.getValue()&&(Ue.setValue(Kn),Xt(Kn),Ue.setCursor(ln?1:Ue.lineCount(),0),window.scrollTo(0,Zn))}},[Ue,Kn]);const Vr=(0,fe.useCallback)(Zn=>{const Un=Ue.getCursor(),jn=Ue.getSelection();let ur=jn.split(`
`);switch(Zn){case"bold":return Ue.replaceSelection("**"+jn+"**"),jn===""&&Ue.setCursor(Un.line,Un.ch+2),Ue.focus();case"italic":return Ue.replaceSelection("*"+jn+"*"),jn===""&&Ue.setCursor(Un.line,Un.ch+1),Ue.focus();case"code":return Ue.replaceSelection("`"+jn+"`"),jn===""&&Ue.setCursor(Un.line,Un.ch+1),Ue.focus();case"inline-latex":return _n("inline-latex"),Ue.focus();case"latex":return Ue.replaceSelection("```latex\n"+jn+"\n```"),Ue.setCursor(Un.line+1,jn.length+1),Ue.focus();case"line-break":return Ue.replaceSelection(`<br/>
`),Ue.focus();case"list-ul":return jn===""?Ue.replaceSelection("- "+jn):Ue.replaceSelection(ur.map(Yr=>Yr===""?"":`- ${Yr}`).join(`
`)),Ue.focus();case"list-ol":return jn===""?Ue.replaceSelection("1. "+jn):Ue.replaceSelection(ur.map((Yr,li)=>Yr===""?"":`${li+1}. ${Yr}`).join(`
`)),Ue.focus();case"add-null-ch":An==null||An();return;case"add-signal":return jn===""&&Ue.setCursor(Un.line,Un.ch),Ue.replaceSelection(ni),Ue.focus();case"add-multiple":return jn===""&&Ue.setCursor(Un.line,Un.ch),Ue.replaceSelection(Hr),Ue.focus();case"inster-template-1":return jn===""&&Ue.setCursor(Un.line,Un.ch),Ue.replaceSelection(Br),Ue.focus();case"eraser":return Ue.setValue(""),Ue.focus();case"trigger-watch":return Gt(!Ft),Ue.focus();case"trigger-full-screen":return un(!Kt),Ue.focus();case Pn:_n(Pn);return;case Ln:_n(Ln);return;case ot:_n(ot);return;case $t:_n($t);return;case"maths-latex":_n("maths-latex");return;case St:Xn.current="",sessionStorage.removeItem("file_id"),_n(St);return;case In:_n(In);return;default:throw new Error}},[Ue,Ft,Kt]),Tr=(0,fe.useCallback)((Zn,Un)=>{var jn,ur,Yr,li,fi,di;_n("");const{src:ii,alt:Si,id:Fi}=Zn||{};switch(xn){case Pn:const{title:ki,link:Qr}=Zn;return Ue.replaceSelection(`[${ki}](${Qr})`),Ue.focus();case Ln:const{language:Vi,content:$i}=Zn;return Ue.replaceSelection(["```"+Vi,$i,"```"].join(`
`)),Ue.focus();case"maths-latex":for(var Ii=atob(Zn),la=new Uint8Array(Ii.length),ea=0;ea<Ii.length;ea++)la[ea]=Ii.charCodeAt(ea);var Pi=new Blob([la],{type:"image/png"});(0,qe.I)(Pi,ri=>{ri.id?Ue.replaceSelection(`![,](/api/attachments/${ri.id}?type=${ri.content_type})`):(ri==null?void 0:ri.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Ue.replaceSelection("`$$"+Zn+"$$`");break;case Dn:if(!Fi)return;Ue.focus(),Ue.getValue().indexOf(ii)===-1?Ue.replaceSelection(`<center><img id="${Fi}" width="80%" src="${ii}" class="draw-flowchart" alt="${Si||""}" /></center>`):document.getElementById(Fi).src=pe.Z.API_SERVER+ii+"?t="+Date.now();try{setTimeout(()=>{Rt(Ue.getValue())},100)}catch(ri){}break;case ot:case $t:const ci=Un,Pr=(Yr=(ur=(jn=ci==null?void 0:ci.name)==null?void 0:jn.split("."))==null?void 0:ur.pop)==null?void 0:Yr.call(ur);return((li=ci==null?void 0:ci.type)==null?void 0:li.indexOf("image"))>-1||!(ci!=null&&ci.type)?ci!=null&&ci.align||ci!=null&&ci.width?Ue.replaceSelection(`<p style="text-align:${ci.align||"initial"}"><img width="${ci.width?ci.width+"%":"initial"}" src="${ii}" alt="${Si||""}" /></p>`):Ue.replaceSelection(`<img width="100%" src="${ii}" alt="${Si||""}" />`):((fi=ci==null?void 0:ci.type)==null?void 0:fi.indexOf("video"))>-1?Ue.replaceSelection(`<video width="100%" controls src="${ii}"></video>`):((di=ci==null?void 0:ci.type)==null?void 0:di.indexOf("pdf"))>-1?Ue.replaceSelection(`<a href="${ii}?type=${ci.type}&disposition=inline" target="_blank">${ci.name}</a>`):qr.includes(Pr)?Ue.replaceSelection(`<a href="${ii}?type=office&disposition=inline" target="_blank">${ci.name}</a>`):Ue.replaceSelection(`[${ci.name}](${ii})`),Ue.focus();case In:const{row:Ur,col:zr,align:Or}=Zn;let ai=`
`;for(let ri=0;ri<Ur;ri++){let Ai=[],Ki=[];for(let Hi=0;Hi<zr;Hi++)ri===1&&Ki.push(dr[Or]),Ai.push(" ");ri===1&&(ai+=`| ${Ki.join(" | ")} |
`),ai+=`| ${Ai.join(zr===1?"":" | ")} |
`}return Ue.replaceSelection(ai+`
`),Ue.focus();default:throw new Error}},[Ue,xn]),si=(0,fe.useMemo)(()=>{switch(xn){case Pn:return fe.createElement(en,{callback:Tr,onCancel:or});case Ln:return fe.createElement(Wt.Z,{callback:Tr,onCancel:or});case ot:return fe.createElement(qe.Z,{callback:Tr,onCancel:or});case St:return fe.createElement(de,{editImgId:Xn.current,callback:Tr,onCancel:or});case In:return fe.createElement(It,{callback:Tr,onCancel:or});case"maths-latex":return fe.createElement(Sn,{showSaveButton:!0,callback:Tr});case"inline-latex":return fe.createElement(wt.Z,{showSaveButton:!0,callback:Tr});default:return null}},[xn]);function or(){_n("")}(0,fe.useEffect)(()=>{if(kn.current){let Zn=function(fi){Yr=!0,li=fi.pageY},Un=function(){Yr=!1},jn=function(fi){if(Yr){let di=fi.pageY-li;di<0&&(di=0),di>300&&(di=300);let ii=pn+di+"px";rr(ii)}},ur=kn.current,Yr=!1,li=0;return ur.addEventListener("mousedown",Zn),document.addEventListener("mousemove",jn),document.addEventListener("mouseup",Un),()=>{ur.removeEventListener("mousedown",Zn),document.removeEventListener("mousemove",jn),document.removeEventListener("mouseup",Un)}}},[Ue,kn]),(0,fe.useEffect)(()=>{rr(pn)},[pn]);const nr=Cr(vn),Ir=Cr(yr),Lr={width:nr,height:Ir},ti=(0,fe.useMemo)(()=>{if(Hn){let Zn=new Date(Hn),Un=Zn.getHours(),jn=Zn.getMinutes(),ur=Zn.getSeconds();return Un=Un<10?"0"+Un:Un,jn=jn<10?"0"+jn:jn,ur=ur<10?"0"+ur:ur,`${Un}:${jn}:${ur}`}return 0},[Hn]),yi=Zn=>{const Un=[];if(ze){let jn=-1;Zn=Zn.replace(/(@▁▁@|@▁@)/g,function(ur,Yr,li){Un.push({multiLine:ur!==ni})})}return Un};function bi(){window.sessionStorage.removeItem(Ie),xr(!1),Yn(0)}function Gr(){xr(!1),Yn(0),Ue.setValue(window.sessionStorage.getItem(Ie))}(0,fe.useEffect)(()=>{Rn[xn]&&xn!==$t&&xn!==St&&setTimeout(()=>{const Zn=document.getElementsByClassName("markdown-popup-form")[0],Un=window.innerWidth/2-Zn.offsetWidth/2,jn=window.innerHeight/2-Zn.offsetHeight/2;hr(Un),_r(jn)},0)},[xn]);const gi=Zn=>{Zn.preventDefault();const Un=Zn.clientX-Jn,jn=Zn.clientY-tr;document.body.onmousemove=ur=>{let Yr=ur.clientX-Un,li=ur.clientY-jn;const fi=document.getElementsByClassName("markdown-popup-form")[0],di=window.innerWidth-fi.offsetWidth,ii=window.innerHeight-fi.offsetHeight;Yr=Math.max(0,Math.min(Yr,di)),li=Math.max(0,Math.min(li,ii)),pi(ur.clientX,ur.clientY,Un,jn)&&(hr(Yr),_r(li))},document.body.onmouseup=function(){document.body.onmousemove=null}},pi=(Zn,Un,jn,ur)=>{const Yr=document.body.clientHeight,li=document.body.clientWidth;return Zn<20&&jn>Zn||Zn>li-20&&jn<Zn||Un<20&&ur>Un||Un>Yr-20&&ur<Un?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:"markdown-editor-wrapper",ref:fr},fe.createElement("div",{className:`markdown-editor-container ${Ct} ${Ft?"on-preview":""} ${Nn?"mini":""} ${Kt?"full-screen":""}`,style:Lr},fe.createElement(Ve,{insertTemp:Te,watch:Ft,fullScreen:Kt,showNullButton:nt,showNullProgramButton:ze,onActionCallback:Vr,hidetoolBar:ct,extraUse:tn}),fe.createElement("div",{className:"markdown-editor-body"},fe.createElement("div",{className:"codemirror-container"},fe.createElement("textarea",{ref:Wr,placeholder:qt})),Ft?fe.createElement("div",{ref:Cn,className:"preview-container"},ke==="stex"&&fe.createElement(Ae,{value:Pt}),ke!=="stex"&&fe.createElement(dt.Z,{edit:!0,disabledFill:En,showProgramFill:ze,value:Pt,openEditor:Zn=>{var Un;Xn.current=Zn,(Un=Fn.current)==null||Un.setHeight("100vh"),setTimeout(()=>{_n("add-flowchart")},150)}})):null))),Ge?fe.createElement("a",{ref:kn,className:"editor-resize"}):null,xn===$t&&fe.createElement(dn,{callback:Tr,onCancel:or}),xn===St&&fe.createElement(de,{ref:Fn,editImgId:Xn.current,callback:Tr,onCancel:or}),fe.createElement(Mt.Z,null,Rn[xn]&&xn!==$t&&xn!==St?fe.createElement(Ye.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Jn,top:tr},title:fe.createElement("div",{style:{cursor:"move"},onMouseDown:gi},Rn[xn]),open:!0,onCancel:or,footer:null,destroyOnClose:!0,width:xn===St?"1200px":null,height:xn===St?"80vh":null,className:"markdown-popup-form"},si):null))}},58448:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ke},I:function(){return Mt}});var fe=ue(78241),Ze=ue(8591),Fe=ue(92832),tt=ue(81327),be=ue(5871),De=ue(5112),Pe=ue(3113),we=ue(79090),_e=ue(59301),Ne=ue(7544),dt=ue(59301),Ae=Object.defineProperty,He=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,it=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,xt=(Xe,Nt,ht)=>Nt in Xe?Ae(Xe,Nt,{enumerable:!0,configurable:!0,writable:!0,value:ht}):Xe[Nt]=ht,jt=(Xe,Nt)=>{for(var ht in Nt||(Nt={}))it.call(Nt,ht)&&xt(Xe,ht,Nt[ht]);if(je)for(var ht of je(Nt))at.call(Nt,ht)&&xt(Xe,ht,Nt[ht]);return Xe},Qe=(Xe,Nt)=>He(Xe,rt(Nt));const{useForm:mt}=fe.default,We={width:280,marginRight:10},Me={labelCol:{span:5},wrapperCol:{span:19}};var Ke=({callback:Xe,onCancel:Nt})=>{const[ht]=mt();let Tt=(0,_e.useRef)();function et(Dt){Tt.current.width=ht.getFieldValue("width"),Tt.current.align=ht.getFieldValue("align"),Xe(Dt,Tt.current)}function Ut(Dt,Bt){if(Dt.status===-1){Ze.ZP.error(Dt.message);return}ht.setFieldsValue({src:`/api/attachments/${Dt.id}`,type:Bt.type})}function ft(Dt){let Bt=Dt.target.files[0];Tt.current=Bt,Mt(Bt,Ut)}return dt.createElement(fe.default,Qe(jt({form:ht},Me),{className:"upload-image-panel",onFinish:et,style:{width:470,overflow:"hidden"}}),dt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},dt.createElement("div",{className:"flex-container"},dt.createElement(fe.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},dt.createElement(Fe.default,{style:We})),dt.createElement(Ve,{onFileChange:ft}))),dt.createElement(fe.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},dt.createElement(Fe.default,{style:{width:264}})),dt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},dt.createElement(tt.Z,null,dt.createElement(fe.default.Item,{name:"width",style:{margin:0}},dt.createElement(be.Z,{style:{width:264}})),dt.createElement("span",{className:"ml8"},"%"))),dt.createElement(fe.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},dt.createElement(De.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"}]})),dt.createElement("aside",null,dt.createElement(fe.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},dt.createElement(Pe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),dt.createElement(Pe.ZP,{type:"default",onClick:Nt},"\u53D6\u6D88"))))};function Ve({onFileChange:Xe}){return dt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",dt.createElement("input",{type:"file",onChange:Xe}))}function Mt(Xe,Nt){if(!Xe)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Ne.bg)())throw Ze.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let ht=new FormData;ht.append("editormd-image-file",Xe),ht.append("file_param_name","editormd-image-file"),ht.append("byxhr","true");var Tt=new window.XMLHttpRequest;Tt.withCredentials=!0,Tt.addEventListener("load",function(et){Nt(JSON.parse(et.target.responseText),Xe)},!1),Tt.addEventListener("error",function(et){console.error(et)},!1),Tt.open("POST",`${we.KI}/api/attachments.json`),Tt.send(ht)}},53531:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Fe}});var fe=ue(59301),Ze=ue(4676);class Fe extends fe.Component{constructor(be){super(be);const De=window.document;this.node=De.createElement("div"),De.body.appendChild(this.node)}render(){const{children:be}=this.props;return(0,Ze.createPortal)(be,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},57649:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ze}});var fe=ue(59301);function Ze(Fe,tt){const be=(0,fe.useRef)();(0,fe.useEffect)(()=>{be.current=Fe}),(0,fe.useEffect)(()=>{function De(){be.current()}if(tt!==null){let Pe=setInterval(De,tt);return()=>clearInterval(Pe)}},[tt])}},89323:function(Mn,rn,ue){"use strict";ue.r(rn),ue.d(rn,{default:function(){return Cr}});var fe=ue(59301),Ze=ue(91482),Fe=ue(6521),tt=ue(95237),be=ue(43604),De=ue(3113),Pe={wrap:"wrap___oiJRJ",head:"head___zCLJu",recommendItem:"recommendItem___Z46_0",buttonWrap:"buttonWrap___Gol4S",privateMessage:"privateMessage___UCiuy",flex1:"flex1___FVk7y",mWidth147:"mWidth147___f_pcl"},we=ue(53822),_e=Object.defineProperty,Ne=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,je=(yn,wn,fn)=>wn in yn?_e(yn,wn,{enumerable:!0,configurable:!0,writable:!0,value:fn}):yn[wn]=fn,it=(yn,wn)=>{for(var fn in wn||(wn={}))He.call(wn,fn)&&je(yn,fn,wn[fn]);if(Ae)for(var fn of Ae(wn))rt.call(wn,fn)&&je(yn,fn,wn[fn]);return yn},at=(yn,wn)=>Ne(yn,dt(wn)),xt=(yn,wn)=>{var fn={};for(var Rn in yn)He.call(yn,Rn)&&wn.indexOf(Rn)<0&&(fn[Rn]=yn[Rn]);if(yn!=null&&Ae)for(var Rn of Ae(yn))wn.indexOf(Rn)<0&&rt.call(yn,Rn)&&(fn[Rn]=yn[Rn]);return fn},jt=(yn,wn,fn)=>new Promise((Rn,br)=>{var Kn=pn=>{try{vn(fn.next(pn))}catch(Nn){br(Nn)}},ar=pn=>{try{vn(fn.throw(pn))}catch(Nn){br(Nn)}},vn=pn=>pn.done?Rn(pn.value):Promise.resolve(pn.value).then(Kn,ar);vn((fn=fn.apply(yn,wn)).next())});const Qe=yn=>{var wn=yn,{user:fn,forumsDetail:Rn,globalSetting:br,loading:Kn,dispatch:ar}=wn,vn=xt(wn,["user","forumsDetail","globalSetting","loading","dispatch"]),pn,Nn,st,Ee;const{author_info:Te,memo:ke,recommend_shixuns:Ie}=Rn.forumsDetailData||{},Ge=()=>jt(void 0,null,function*(){(Te!=null&&Te.watched?yield(0,we.Sr)({user_id:Te.login}):yield(0,we.YP)({user_id:Te.login}))&&ar({type:"forumsDetail/setForumsDetailData",payload:at(it({},Rn.forumsDetailData),{author_info:at(it({},Te),{watched:!(Te!=null&&Te.watched)})})})});return fe.createElement("section",{className:Pe.wrap},fe.createElement("aside",{className:"ml20"},fe.createElement("div",{className:`bg-white pt40 pb40 pl20 pr20 ${Pe.head}`},fe.createElement("a",{href:`/users/${Te==null?void 0:Te.login}`,target:"_blank"},(Te==null?void 0:Te.image_url)&&fe.createElement("img",{src:`${Fe.Z.API_SERVER}/images/${Te==null?void 0:Te.image_url}`})),fe.createElement("div",{className:"tc font20"},Te==null?void 0:Te.username),fe.createElement("div",{className:"tc c-grey-999"},Te==null?void 0:Te.identity),((pn=fn.userInfo)==null?void 0:pn.user_id)!==(Te==null?void 0:Te.user_id)&&fe.createElement(tt.Z,{justify:"center",className:`mt30 ${Pe.buttonWrap}`},fe.createElement(be.Z,null,fe.createElement(De.ZP,{type:"primary",className:"mr10",onClick:Ge},Te!=null&&Te.watched?"\u53D6\u6D88\u5173\u6CE8":"\u5173\u6CE8")),fe.createElement(be.Z,null,fe.createElement(De.ZP,{className:Pe.privateMessage,href:`/messages/${(Nn=fn.userInfo)==null?void 0:Nn.login}/message_detail?target_ids=${Te==null?void 0:Te.user_id}`,target:"_blank"},"\u79C1\u4FE1")))),!!((st=ke==null?void 0:ke.tag)!=null&&st.length)&&fe.createElement("div",{className:"bg-white mt10 pt40 pb40 pl20 pr20"},fe.createElement("div",{className:"font16"},"\u8BDD\u9898\u6807\u7B7E"),fe.createElement("div",{className:`mt10 ${Pe.tag}`},(Ee=ke==null?void 0:ke.tag)==null?void 0:Ee.map((ut,nt)=>fe.createElement("span",{key:nt,className:"c-light-primary mr10"},ut)))),fe.createElement("div",{className:"pt10 pb10 pl10 pr10"},fe.createElement("div",{className:"font16 mb20"},"\u63A8\u8350\u5B9E\u8BAD"),fe.createElement("div",{className:Pe.recommend},Ie==null?void 0:Ie.map(ut=>fe.createElement("div",{className:Pe.recommendItem},fe.createElement("a",{href:`/shixuns/${ut.identifier}/challenges`,target:"_blank"},fe.createElement("img",{alt:ut.id,src:`${ut.image_url}`})),fe.createElement("div",{className:`${Pe.flex1} ml10`},fe.createElement("a",{href:`/shixuns/${ut.identifier}/challenges`,target:"_blank",title:ut.name,className:`${Pe.mWidth147} multi-llipsis1e c-grey-666 mb10`},ut.name),fe.createElement("div",{className:"c-grey-999"},ut.myshixuns_count," \u4EBA\u5B66\u4E60"))))))))};var mt=(0,Ze.connect)(({user:yn,forumsDetail:wn,loading:fn,globalSetting:Rn})=>({user:yn,forumsDetail:wn,globalSetting:Rn,loading:fn.models.forumsDetail}))(Qe),We=ue(66649),Me=ue.n(We),Ke=ue(39655),Ve=ue(8591),Mt=ue(43418),Xe=ue(92832),Nt=ue(20834),ht=ue(66104),Tt=ue(38854),et=ue(6848),Ut=ue(40973),ft=ue(26227),Dt={flex_box_center:"flex_box_center___nMc3G",flex_space_between:"flex_space_between___gTlaF",flex_box_vertical_center:"flex_box_vertical_center___GQv6O",flex_box_center_end:"flex_box_center_end___nrFEP",flex_box_column:"flex_box_column___Ls1oQ",reply:"reply___jb23w",replyList:"replyList___ryiUt",comment:"comment___QJ1eT",content:"content___X2UnY",commentItem:"commentItem___h_wnY"},Bt=Object.defineProperty,bt=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,Wt=(yn,wn,fn)=>wn in yn?Bt(yn,wn,{enumerable:!0,configurable:!0,writable:!0,value:fn}):yn[wn]=fn,qe=(yn,wn)=>{for(var fn in wn||(wn={}))gt.call(wn,fn)&&Wt(yn,fn,wn[fn]);if(xe)for(var fn of xe(wn))en.call(wn,fn)&&Wt(yn,fn,wn[fn]);return yn},Ye=(yn,wn)=>bt(yn,$e(wn)),Lt=(yn,wn,fn)=>new Promise((Rn,br)=>{var Kn=pn=>{try{vn(fn.next(pn))}catch(Nn){br(Nn)}},ar=pn=>{try{vn(fn.throw(pn))}catch(Nn){br(Nn)}},vn=pn=>pn.done?Rn(pn.value):Promise.resolve(pn.value).then(Kn,ar);vn((fn=fn.apply(yn,wn)).next())});Me().locale("ZH-cn");function mn({user:yn,vlist:wn=[],dispatch:fn,params:Rn,id:br,memo_replies:Kn,forumsDetail:ar}){return fe.createElement("aside",{className:Dt.comment},wn.map(function(vn,pn){var Nn,st;return fe.createElement(tt.Z,{key:pn,className:Dt.commentItem},fe.createElement(be.Z,{span:24},fe.createElement(tt.Z,null,fe.createElement(be.Z,{flex:"1"},fe.createElement("a",{href:`/users/${vn.user_login}`,target:"_blank",className:"c-light-black"},vn==null?void 0:vn.username),fe.createElement("span",{className:"c-light-black ml10"},vn.time)),(vn.can_delete||vn.user_id===((Nn=yn.userInfo)==null?void 0:Nn.user_id)||vn.user_login===((st=yn.userInfo)==null?void 0:st.login))&&fe.createElement(be.Z,{className:"forums-comment-delete",style:{display:"none"}},fe.createElement(et.Z,{title:"\u5220\u9664"},fe.createElement(ft.Z,{className:"current",onClick:()=>{Mt.default.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:fe.createElement("div",{className:"font16 tc"},"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),onOk:()=>Lt(this,null,function*(){const Ee=yield(0,we.sW)({id:vn.id}),Te=Kn.find(ke=>ke.id===br).children.filter(ke=>ke.id!==vn.id);Kn.find(ke=>ke.id===br).children=Te,fn({type:"forumsDetail/setForumsDetailData",payload:Ye(qe({},ar.forumsDetailData),{memo_replies:[...Kn]})})})})}}))))),fe.createElement(be.Z,null,fe.createElement(Ke.Z,{value:vn.content})))}))}var Qt=mn,dn=ue(25544),Zt=Object.defineProperty,Vt=Object.defineProperties,zt=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,de=(yn,wn,fn)=>wn in yn?Zt(yn,wn,{enumerable:!0,configurable:!0,writable:!0,value:fn}):yn[wn]=fn,pe=(yn,wn)=>{for(var fn in wn||(wn={}))se.call(wn,fn)&&de(yn,fn,wn[fn]);if(ye)for(var fn of ye(wn))oe.call(wn,fn)&&de(yn,fn,wn[fn]);return yn},le=(yn,wn)=>Vt(yn,zt(wn)),Be=(yn,wn)=>{var fn={};for(var Rn in yn)se.call(yn,Rn)&&wn.indexOf(Rn)<0&&(fn[Rn]=yn[Rn]);if(yn!=null&&ye)for(var Rn of ye(yn))wn.indexOf(Rn)<0&&oe.call(yn,Rn)&&(fn[Rn]=yn[Rn]);return fn},lt=(yn,wn,fn)=>new Promise((Rn,br)=>{var Kn=pn=>{try{vn(fn.next(pn))}catch(Nn){br(Nn)}},ar=pn=>{try{vn(fn.throw(pn))}catch(Nn){br(Nn)}},vn=pn=>pn.done?Rn(pn.value):Promise.resolve(pn.value).then(Kn,ar);vn((fn=fn.apply(yn,wn)).next())});Me().locale("ZH-cn");const Ot=(yn,wn)=>{var fn=yn,{user:Rn,forumsDetail:br,globalSetting:Kn,loading:ar,dispatch:vn,handleClick:pn}=fn,Nn=Be(fn,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]);const{memo:st,memo_replies:Ee}=br.forumsDetailData||{},Te=(0,Ze.useParams)(),[ke,Ie]=(0,fe.useState)(""),[Ge,ut]=(0,fe.useState)(""),[nt,ze]=(0,fe.useState)(-1),[ct,kt]=(0,fe.useState)(!1),[Rt,Jt]=(0,fe.useState)(1),[pt,Ct]=(0,fe.useState)(!1);(0,fe.useImperativeHandle)(wn,()=>({onMdFouch:En})),(0,fe.useEffect)(()=>{kt((st==null?void 0:st.replies_count)>10)},[st==null?void 0:st.replies_count]);const bn=()=>lt(void 0,null,function*(){var qt;const On=Rt+1;Jt(On);const tn=yield(0,we.z5)({id:Te.memoId,page:On});tn!=null&&tn.memo_replies&&(vn({type:"forumsDetail/setForumsDetailData",payload:le(pe({},br.forumsDetailData),{memo_replies:[...Ee,...tn.memo_replies]})}),kt(((qt=tn.memo_replies)==null?void 0:qt.length)===10))}),ln=qt=>{var On,tn,An,Ue;return le(pe({},qt),{image_url:(On=Rn.userInfo)==null?void 0:On.image_url,children:[],user_id:(tn=Rn.userInfo)==null?void 0:tn.user_id,user_login:(An=Rn.userInfo)==null?void 0:An.login,username:(Ue=Rn.userInfo)==null?void 0:Ue.username,time:`${(0,dn.li)((new Date().getTime()-new Date(qt.created_at).getTime())/1e3)}\u524D`})},En=()=>{Ct(!0)};return fe.createElement("section",{className:Dt.wrap},!!(Ee!=null&&Ee.length)&&fe.createElement("aside",{className:Dt.content},fe.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},fe.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",st.replies_count,"\uFF09")),fe.createElement("aside",{className:Dt.replyList},Ee==null?void 0:Ee.map(function(qt,On){var tn;return fe.createElement(tt.Z,{gutter:[12,12],key:On},fe.createElement(be.Z,{flex:"40px"},fe.createElement("a",{href:`/users/${qt.user_login}`,target:"_blank"},fe.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:`${Fe.Z.IMG_SERVER}/images/${qt==null?void 0:qt.image_url}`}))),fe.createElement(be.Z,{flex:"1"},fe.createElement(tt.Z,{align:"middle"},fe.createElement(be.Z,{span:24},fe.createElement("a",{href:`/users/${qt.user_login}`,target:"_blank"},fe.createElement("span",{className:"c-light-black"},qt==null?void 0:qt.username)),fe.createElement("span",{className:"c-light-black ml10"},qt.time)),fe.createElement(be.Z,{span:24},fe.createElement("div",{onClick:pn},fe.createElement(Ke.Z,{value:qt.content}))),!!((tn=qt==null?void 0:qt.children)!=null&&tn.length)&&fe.createElement(Qt,{user:Rn,id:qt==null?void 0:qt.id,vlist:qt==null?void 0:qt.children,dispatch:vn,params:Te,memo_replies:Ee,forumsDetail:br}),fe.createElement(be.Z,{span:24,className:"mt5 c-light-black"},nt===On?fe.createElement("aside",null,fe.createElement(Ut.Z,{onChange:An=>{ut(An)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),fe.createElement(tt.Z,null,fe.createElement(be.Z,{span:24,className:"tr"},fe.createElement(De.ZP,{type:"primary",size:"middle",onClick:()=>lt(this,null,function*(){if(Ge==="")Ve.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");else{const An=yield(0,we.ts)({parent_id:qt.id,content:Ge});ut(null),An&&(ze(-1),Ee.find(Ue=>Ue.id===An.parent_id).children.push(ln(An)),vn({type:"forumsDetail/setForumsDetailData",payload:le(pe({},br.forumsDetailData),{memo:le(pe({},st),{replies_count:st.replies_count+1}),memo_replies:[...Ee]})}))}})},"\u53D1\u9001")))):fe.createElement("div",{className:"tr"},fe.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:()=>ze(On)}),fe.createElement(et.Z,{title:qt.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},fe.createElement("span",{className:qt.user_praise?"c-orange":"c-gery-888"},fe.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:()=>lt(this,null,function*(){const An=yield(0,we.vL)({id:qt.id,container_type:"Memo",type:qt.user_praise?0:1});(An==null?void 0:An.praise_count)>=0&&(Ee.find(Ue=>Ue.id===qt.id).user_praise=!qt.user_praise,Ee.find(Ue=>Ue.id===qt.id).praise_count=An==null?void 0:An.praise_count,vn({type:"forumsDetail/setForumsDetailData",payload:le(pe({},br.forumsDetailData),{memo_replies:[...Ee]})}))})}),qt.praise_count>0?qt.praise_count:"")))))))}))),ct&&fe.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},fe.createElement(tt.Z,{justify:"space-between"},fe.createElement(be.Z,null),fe.createElement(be.Z,null,ct&&fe.createElement("a",{className:"c-black",onClick:bn},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),fe.createElement("aside",{className:Dt.reply},fe.createElement(Ut.Z,{onBlur:()=>Ct(!1),isFocus:pt,defaultValue:ke,id:"writeForumsReviewId",onChange:qt=>{Ie(qt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),fe.createElement(tt.Z,null,fe.createElement(be.Z,{flex:"1"}),fe.createElement(be.Z,null,fe.createElement(De.ZP,{type:"primary",size:"middle",onClick:()=>lt(void 0,null,function*(){if(ke==="")Ve.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");else{const qt=yield(0,we.ts)({parent_id:st.id,content:ke});Ie(null),qt&&vn({type:"forumsDetail/setForumsDetailData",payload:le(pe({},br.forumsDetailData),{memo:le(pe({},st),{replies_count:st.replies_count+1}),memo_replies:[ln(qt),...Ee]})})}})},"\u53D1\u9001")))))};var It=(0,Ze.connect)(({user:yn,forumsDetail:wn,loading:fn,globalSetting:Rn})=>({user:yn,forumsDetail:wn,globalSetting:Rn,loading:fn.models.forumsDetail}),null,null,{forwardRef:!0})((0,fe.forwardRef)(Ot)),Ht={wrap:"wrap___Soi3l",header:"header___vk3EC",title:"title___WJAyR",menu:"menu___yMPKF",top:"top___ZqzEM",line:"line___EQKlG",flexCenter:"flexCenter___Rcnhr",like:"like___uNtmq",canLike:"canLike___Lu04z",attachmentName:"attachmentName___nwdzp"},Yt=ue(87169),an=ue(94615),cn=ue(21798),Sn=Object.defineProperty,wt=Object.defineProperties,on=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,$t=(yn,wn,fn)=>wn in yn?Sn(yn,wn,{enumerable:!0,configurable:!0,writable:!0,value:fn}):yn[wn]=fn,Dn=(yn,wn)=>{for(var fn in wn||(wn={}))ot.call(wn,fn)&&$t(yn,fn,wn[fn]);if(Pn)for(var fn of Pn(wn))St.call(wn,fn)&&$t(yn,fn,wn[fn]);return yn},Ln=(yn,wn)=>wt(yn,on(wn)),In=(yn,wn)=>{var fn={};for(var Rn in yn)ot.call(yn,Rn)&&wn.indexOf(Rn)<0&&(fn[Rn]=yn[Rn]);if(yn!=null&&Pn)for(var Rn of Pn(yn))wn.indexOf(Rn)<0&&St.call(yn,Rn)&&(fn[Rn]=yn[Rn]);return fn},qn=(yn,wn,fn)=>new Promise((Rn,br)=>{var Kn=pn=>{try{vn(fn.next(pn))}catch(Nn){br(Nn)}},ar=pn=>{try{vn(fn.throw(pn))}catch(Nn){br(Nn)}},vn=pn=>pn.done?Rn(pn.value):Promise.resolve(pn.value).then(Kn,ar);vn((fn=fn.apply(yn,wn)).next())});const dr={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},ir=yn=>{var wn=yn,{user:fn,forumsDetail:Rn,globalSetting:br,loading:Kn,dispatch:ar}=wn,vn=In(wn,["user","forumsDetail","globalSetting","loading","dispatch"]),pn,Nn,st,Ee;const{author_info:Te,memo:ke,attachments_list:Ie}=Rn.forumsDetailData||{},Ge=(0,fe.useRef)(),ut=(0,fe.useRef)(),nt=()=>qn(void 0,null,function*(){const Ct={id:ke.id,sticky:ke.sticky?0:1},bn=yield(0,we.B0)(Ct);(bn==null?void 0:bn.status)===0&&ar({type:"forumsDetail/setForumsDetailData",payload:Ln(Dn({},Rn.forumsDetailData),{memo:Ln(Dn({},ke),{sticky:!(ke!=null&&ke.sticky)})})})}),ze=()=>qn(void 0,null,function*(){const Ct=yield(0,we.sW)({id:ke==null?void 0:ke.id});(Ct==null?void 0:Ct.status)===0&&(Ve.ZP.success("\u5220\u9664\u6210\u529F"),Ze.history.push("/forums")),(Ct==null?void 0:Ct.status)===-1&&Ze.history.push("/forums")}),ct=()=>qn(void 0,null,function*(){Mt.default.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:fe.createElement("div",{className:"font14 tc"},fe.createElement(Xe.default,{defaultValue:Ge.current,onChange:Ct=>Ge.current=Ct.target.value})),onOk:()=>qn(void 0,null,function*(){const Ct=yield(0,we.eh)({id:ke==null?void 0:ke.id,container_type:"Memo",score:Ge.current?Number(Ge.current):0,user_id:Te==null?void 0:Te.user_id});if(Ge.current=null,(Ct==null?void 0:Ct.code)>0){ar({type:"forumsDetail/setForumsDetailData",payload:Ln(Dn({},Rn.forumsDetailData),{memo:Ln(Dn({},ke),{reward:Ct==null?void 0:Ct.code})})}),Ve.ZP.success("\u5956\u52B1\u6210\u529F");return}Ve.ZP.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01")})})}),kt=()=>{ut.current.onMdFouch&&ut.current.onMdFouch()},Rt=()=>qn(void 0,null,function*(){const Ct=yield(0,we.vL)({id:ke.id,container_type:"Memo",type:1});(Ct==null?void 0:Ct.praise_count)>=0&&ar({type:"forumsDetail/setForumsDetailData",payload:Ln(Dn({},Rn.forumsDetailData),{memo:Ln(Dn({},ke),{user_praise:!(ke!=null&&ke.user_praise),memo_praise_count:Ct==null?void 0:Ct.praise_count})})})}),Jt=fe.createElement(Nt.default,{className:Ht.menu},((pn=fn.userInfo)==null?void 0:pn.admin)&&(ke==null?void 0:ke.sticky)&&fe.createElement(Nt.default.Item,null,fe.createElement("a",{onClick:()=>nt()},"\u53D6\u6D88\u7F6E\u9876")),((Nn=fn.userInfo)==null?void 0:Nn.admin)&&!(ke!=null&&ke.sticky)&&fe.createElement(Nt.default.Item,null,fe.createElement("a",{onClick:()=>nt()},"\u7F6E\xA0\xA0\u9876")),fe.createElement(Nt.default.Item,null,fe.createElement(Ze.Link,{to:`/forums/${ke==null?void 0:ke.id}/edit`},"\u7F16\xA0\xA0\u8F91")),fe.createElement(Nt.default.Item,null,fe.createElement("a",{onClick:()=>{Mt.default.confirm({title:"\u63D0\u793A",icon:fe.createElement(Yt.Z,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:()=>{ze()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),pt=Ct=>{let{nodeName:bn,src:ln}=Ct.target;bn==="IMG"&&(cn.Z.publish("preview-image",ln),console.log("src:",ln))};return(0,fe.useEffect)(()=>{},[]),fe.createElement("section",{className:Ht.wrap},fe.createElement(ht.Z,{separator:"/",className:"mb5"},fe.createElement(ht.Z.Item,null,fe.createElement(Ze.Link,{to:`/forums/categories/${ke==null?void 0:ke.forum_id}`},dr[ke==null?void 0:ke.forum_id])),fe.createElement(ht.Z.Item,null,"\u8BE6\u60C5")),fe.createElement("header",{className:`bg-white pt40 pb40 pl30 pr30 ${Ht.header}`},fe.createElement(tt.Z,{align:"middle"},fe.createElement(be.Z,{flex:1,className:"font24 mb5"},fe.createElement("span",{className:Ht.title},ke==null?void 0:ke.subject),(ke==null?void 0:ke.sticky)&&fe.createElement("span",{className:Ht.top},"\u7F6E\u9876")),fe.createElement(be.Z,null,(((st=fn.userInfo)==null?void 0:st.admin)||((Ee=fn.userInfo)==null?void 0:Ee.user_id)===(Te==null?void 0:Te.user_id))&&fe.createElement(Tt.Z,{dropdownRender:()=>Jt},fe.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),fe.createElement(tt.Z,{align:"middle",className:"font14"},fe.createElement(be.Z,{flex:1,className:"c-grey-999"},fe.createElement("span",null,Me()(ke==null?void 0:ke.time).fromNow()," \u66F4\u65B0")),fe.createElement(be.Z,{className:"c-grey-999"},fe.createElement("span",{className:`pr10 pl10 ${ke!=null&&ke.replies_count?Ht.line:""}`},fe.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),ke==null?void 0:ke.viewed_count),!!(ke!=null&&ke.replies_count)&&fe.createElement(et.Z,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},fe.createElement("span",{className:"current pl10",onClick:kt},fe.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),ke==null?void 0:ke.replies_count))))),fe.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},fe.createElement("div",{onClick:pt},fe.createElement(Ke.Z,{value:ke==null?void 0:ke.content})),fe.createElement("div",{className:"bg-white pl40 pr40 mt40"},fe.createElement("div",{className:`mt10 mb20 ${Ht.flexCenter}`},fe.createElement("div",{className:`${Ht.like} ${ke!=null&&ke.user_praise?"":Ht.canLike}`,onClick:Rt},fe.createElement("i",{className:"iconfont icon-dianzan font18"}),fe.createElement("br",null),fe.createElement("span",null,ke==null?void 0:ke.memo_praise_count)))),!!(Ie!=null&&Ie.length)&&fe.createElement("div",{className:"mt40"},Ie==null?void 0:Ie.map(Ct=>fe.createElement("div",{className:`c-grey-888 ${Ht.flexCenter}`},fe.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),fe.createElement("a",{href:Ct==null?void 0:Ct.url,title:Ct==null?void 0:Ct.title,className:`${Ht.attachmentName} mr10`},Ct==null?void 0:Ct.title),fe.createElement("span",{className:"font12 c-grey-666 mt3"},Ct==null?void 0:Ct.filesize))))),fe.createElement(It,{ref:ut,handleClick:pt}),fe.createElement(an.Z,null))};var Er=(0,Ze.connect)(({user:yn,forumsDetail:wn,loading:fn,globalSetting:Rn})=>({user:yn,forumsDetail:wn,globalSetting:Rn,loading:fn.effects}))(ir),kr={flex:"flex___fgmSn"},Qn=ue(71418),Kr=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable,ni=(yn,wn)=>{var fn={};for(var Rn in yn)jr.call(yn,Rn)&&wn.indexOf(Rn)<0&&(fn[Rn]=yn[Rn]);if(yn!=null&&Kr)for(var Rn of Kr(yn))wn.indexOf(Rn)<0&&Hr.call(yn,Rn)&&(fn[Rn]=yn[Rn]);return fn},Br=(yn,wn,fn)=>new Promise((Rn,br)=>{var Kn=pn=>{try{vn(fn.next(pn))}catch(Nn){br(Nn)}},ar=pn=>{try{vn(fn.throw(pn))}catch(Nn){br(Nn)}},vn=pn=>pn.done?Rn(pn.value):Promise.resolve(pn.value).then(Kn,ar);vn((fn=fn.apply(yn,wn)).next())});const qr=yn=>{var wn=yn,{forumsDetail:fn,globalSetting:Rn,loading:br,dispatch:Kn}=wn,ar=ni(wn,["forumsDetail","globalSetting","loading","dispatch"]);const vn=(0,Ze.useParams)(),[pn,Nn]=(0,fe.useState)(!1);(0,fe.useEffect)(()=>{st()},[vn.memoId]);const st=()=>Br(void 0,null,function*(){Nn(!0);let Ee=yield Kn({type:"forumsDetail/getForumsDetailData",payload:{id:vn.memoId}});Nn(!1)});return fe.createElement(Qn.Z,{spinning:pn},fe.createElement("section",{className:`edu-container mb20 mt30 ${kr.flex}`},fe.createElement(Er,null),fe.createElement(mt,null)))};var Cr=(0,Ze.connect)(({forumsDetail:yn,loading:wn,globalSetting:fn})=>({forumsDetail:yn,globalSetting:fn,loading:wn.models.forumsDetail}))(qr)},19080:function(Mn,rn,ue){"use strict";ue.d(rn,{F:function(){return be},Z:function(){return tt}});var fe=ue(92310),Ze=ue.n(fe);const Fe=null;function tt(De,Pe,we){return Ze()({[`${De}-status-success`]:Pe==="success",[`${De}-status-warning`]:Pe==="warning",[`${De}-status-error`]:Pe==="error",[`${De}-status-validating`]:Pe==="validating",[`${De}-has-feedback`]:we})}const be=(De,Pe)=>Pe||De},66104:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ut}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(11592),tt=ue(26112),be=ue(59301),De=ue(92343),Pe=ue(36355),we=ue(84105),_e=ue(91857);const Ne=ft=>{let{children:Dt}=ft;const{getPrefixCls:Bt}=be.useContext(Pe.E_),bt=Bt("breadcrumb");return be.createElement("li",{className:`${bt}-separator`,"aria-hidden":"true"},Dt===""?Dt:Dt||"/")};Ne.__ANT_BREADCRUMB_SEPARATOR=!0;var dt=Ne,Ae=function(ft,Dt){var Bt={};for(var bt in ft)Object.prototype.hasOwnProperty.call(ft,bt)&&Dt.indexOf(bt)<0&&(Bt[bt]=ft[bt]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,bt=Object.getOwnPropertySymbols(ft);$e<bt.length;$e++)Dt.indexOf(bt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ft,bt[$e])&&(Bt[bt[$e]]=ft[bt[$e]]);return Bt};function He(ft,Dt){if(ft.title===void 0||ft.title===null)return null;const Bt=Object.keys(Dt).join("|");return typeof ft.title=="object"?ft.title:String(ft.title).replace(new RegExp(`:(${Bt})`,"g"),(bt,$e)=>Dt[$e]||bt)}function rt(ft,Dt,Bt,bt){if(Bt==null)return null;const{className:$e,onClick:xe}=Dt,gt=Ae(Dt,["className","onClick"]),en=Object.assign(Object.assign({},(0,tt.Z)(gt,{data:!0,aria:!0})),{onClick:xe});return bt!==void 0?be.createElement("a",Object.assign({},en,{className:Ze()(`${ft}-link`,$e),href:bt}),Bt):be.createElement("span",Object.assign({},en,{className:Ze()(`${ft}-link`,$e)}),Bt)}function je(ft,Dt){return(bt,$e,xe,gt,en)=>{if(Dt)return Dt(bt,$e,xe,gt);const Wt=He(bt,$e);return rt(ft,bt,Wt,en)}}var it=function(ft,Dt){var Bt={};for(var bt in ft)Object.prototype.hasOwnProperty.call(ft,bt)&&Dt.indexOf(bt)<0&&(Bt[bt]=ft[bt]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,bt=Object.getOwnPropertySymbols(ft);$e<bt.length;$e++)Dt.indexOf(bt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ft,bt[$e])&&(Bt[bt[$e]]=ft[bt[$e]]);return Bt};const at=ft=>{const{prefixCls:Dt,separator:Bt="/",children:bt,menu:$e,overlay:xe,dropdownProps:gt,href:en}=ft,qe=(Ye=>{if($e||xe){const Lt=Object.assign({},gt);if($e){const mn=$e||{},{items:Qt}=mn,dn=it(mn,["items"]);Lt.menu=Object.assign(Object.assign({},dn),{items:Qt==null?void 0:Qt.map((Zt,Vt)=>{var{key:zt,title:ye,label:se,path:oe}=Zt,de=it(Zt,["key","title","label","path"]);let pe=se!=null?se:ye;return oe&&(pe=be.createElement("a",{href:`${en}${oe}`},pe)),Object.assign(Object.assign({},de),{key:zt!=null?zt:Vt,label:pe})})})}else xe&&(Lt.overlay=xe);return be.createElement(_e.Z,Object.assign({placement:"bottom"},Lt),be.createElement("span",{className:`${Dt}-overlay-link`},Ye,be.createElement(we.Z,null)))}return Ye})(bt);return qe!=null?be.createElement(be.Fragment,null,be.createElement("li",null,qe),Bt&&be.createElement(dt,null,Bt)):null},xt=ft=>{const{prefixCls:Dt,children:Bt,href:bt}=ft,$e=it(ft,["prefixCls","children","href"]),{getPrefixCls:xe}=be.useContext(Pe.E_),gt=xe("breadcrumb",Dt);return be.createElement(at,Object.assign({},$e,{prefixCls:gt}),rt(gt,$e,Bt,bt))};xt.__ANT_BREADCRUMB_ITEM=!0;var jt=xt,Qe=ue(17313),mt=ue(83116),We=ue(37613);const Me=ft=>{const{componentCls:Dt,iconCls:Bt}=ft;return{[Dt]:Object.assign(Object.assign({},(0,Qe.Wf)(ft)),{color:ft.itemColor,fontSize:ft.fontSize,[Bt]:{fontSize:ft.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:ft.linkColor,transition:`color ${ft.motionDurationMid}`,padding:`0 ${ft.paddingXXS}px`,borderRadius:ft.borderRadiusSM,height:ft.lineHeight*ft.fontSize,display:"inline-block",marginInline:-ft.marginXXS,"&:hover":{color:ft.linkHoverColor,backgroundColor:ft.colorBgTextHover}},(0,Qe.Qy)(ft)),"li:last-child":{color:ft.lastItemColor},[`${Dt}-separator`]:{marginInline:ft.separatorMargin,color:ft.separatorColor},[`${Dt}-link`]:{[`
> ${Bt} + span,
> ${Bt} + a
`]:{marginInlineStart:ft.marginXXS}},[`${Dt}-overlay-link`]:{borderRadius:ft.borderRadiusSM,height:ft.lineHeight*ft.fontSize,display:"inline-block",padding:`0 ${ft.paddingXXS}px`,marginInline:-ft.marginXXS,[`> ${Bt}`]:{marginInlineStart:ft.marginXXS,fontSize:ft.fontSizeIcon},"&:hover":{color:ft.linkHoverColor,backgroundColor:ft.colorBgTextHover,a:{color:ft.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${ft.componentCls}-rtl`]:{direction:"rtl"}})}};var Ke=(0,mt.Z)("Breadcrumb",ft=>{const Dt=(0,We.TS)(ft,{});return[Me(Dt)]},ft=>({itemColor:ft.colorTextDescription,lastItemColor:ft.colorText,iconFontSize:ft.fontSize,linkColor:ft.colorTextDescription,linkHoverColor:ft.colorText,separatorColor:ft.colorTextDescription,separatorMargin:ft.marginXS})),Ve=function(ft,Dt){var Bt={};for(var bt in ft)Object.prototype.hasOwnProperty.call(ft,bt)&&Dt.indexOf(bt)<0&&(Bt[bt]=ft[bt]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,bt=Object.getOwnPropertySymbols(ft);$e<bt.length;$e++)Dt.indexOf(bt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ft,bt[$e])&&(Bt[bt[$e]]=ft[bt[$e]]);return Bt};function Mt(ft){const{breadcrumbName:Dt,children:Bt}=ft,bt=Ve(ft,["breadcrumbName","children"]),$e=Object.assign({title:Dt},bt);return Bt&&($e.menu={items:Bt.map(xe=>{var{breadcrumbName:gt}=xe,en=Ve(xe,["breadcrumbName"]);return Object.assign(Object.assign({},en),{title:gt})})}),$e}function Xe(ft,Dt){return(0,be.useMemo)(()=>ft||(Dt?Dt.map(Mt):null),[ft,Dt])}var Nt=function(ft,Dt){var Bt={};for(var bt in ft)Object.prototype.hasOwnProperty.call(ft,bt)&&Dt.indexOf(bt)<0&&(Bt[bt]=ft[bt]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,bt=Object.getOwnPropertySymbols(ft);$e<bt.length;$e++)Dt.indexOf(bt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ft,bt[$e])&&(Bt[bt[$e]]=ft[bt[$e]]);return Bt};const ht=(ft,Dt)=>{if(Dt===void 0)return Dt;let Bt=(Dt||"").replace(/^\//,"");return Object.keys(ft).forEach(bt=>{Bt=Bt.replace(`:${bt}`,ft[bt])}),Bt},Tt=ft=>{const{prefixCls:Dt,separator:Bt="/",style:bt,className:$e,rootClassName:xe,routes:gt,items:en,children:Wt,itemRender:qe,params:Ye={}}=ft,Lt=Nt(ft,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:mn,direction:Qt,breadcrumb:dn}=be.useContext(Pe.E_);let Zt;const Vt=mn("breadcrumb",Dt),[zt,ye]=Ke(Vt),se=Xe(en,gt),oe=je(Vt,qe);if(se&&se.length>0){const le=[],Be=en||gt;Zt=se.map((lt,Ot)=>{const{path:It,key:Ht,type:Yt,menu:an,overlay:cn,onClick:Sn,className:wt,separator:on,dropdownProps:Pn}=lt,ot=ht(Ye,It);ot!==void 0&&le.push(ot);const St=Ht!=null?Ht:Ot;if(Yt==="separator")return be.createElement(dt,{key:St},on);const $t={},Dn=Ot===se.length-1;an?$t.menu=an:cn&&($t.overlay=cn);let{href:Ln}=lt;return le.length&&ot!==void 0&&(Ln=`#/${le.join("/")}`),be.createElement(at,Object.assign({key:St},$t,(0,tt.Z)(lt,{data:!0,aria:!0}),{className:wt,dropdownProps:Pn,href:Ln,separator:Dn?"":Bt,onClick:Sn,prefixCls:Vt}),oe(lt,Ye,Be,le,Ln))})}else if(Wt){const le=(0,Fe.Z)(Wt).length;Zt=(0,Fe.Z)(Wt).map((Be,lt)=>{if(!Be)return Be;const Ot=lt===le-1;return(0,De.Tm)(Be,{separator:Ot?"":Bt,key:lt})})}const de=Ze()(Vt,dn==null?void 0:dn.className,{[`${Vt}-rtl`]:Qt==="rtl"},$e,xe,ye),pe=Object.assign(Object.assign({},dn==null?void 0:dn.style),bt);return zt(be.createElement("nav",Object.assign({className:de,style:pe},Lt),be.createElement("ol",null,Zt)))};Tt.Item=jt,Tt.Separator=dt;var et=Tt,Ut=et},93891:function(Mn,rn,ue){"use strict";var fe=ue(59301),Ze=ue(36355),Fe=ue(64165);const tt=be=>{const{componentName:De}=be,{getPrefixCls:Pe}=(0,fe.useContext)(Ze.E_),we=Pe("empty");switch(De){case"Table":case"List":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE,className:`${we}-small`});default:return fe.createElement(Fe.Z,null)}};rn.Z=tt},43428:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Zt}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(85899),tt=ue(72190),be=ue(43403),De=ue(34280),Pe=ue(59301),we=Pe.createContext(null),_e=Pe.createContext({}),Ne=we,dt=ue(18642),Ae=ue(60499),He=ue(77900),rt=ue(10228),je=ue(26112),it=ue(70425),at=function(zt){var ye=zt.prefixCls,se=zt.className,oe=zt.style,de=zt.children,pe=zt.containerRef,le=zt.id,Be=zt.onMouseEnter,lt=zt.onMouseOver,Ot=zt.onMouseLeave,It=zt.onClick,Ht=zt.onKeyDown,Yt=zt.onKeyUp,an={onMouseEnter:Be,onMouseOver:lt,onMouseLeave:Ot,onClick:It,onKeyDown:Ht,onKeyUp:Yt},cn=Pe.useContext(_e),Sn=cn.panel,wt=(0,it.useComposeRef)(Sn,pe);return Pe.createElement(Pe.Fragment,null,Pe.createElement("div",(0,Ae.Z)({id:le,className:Ze()("".concat(ye,"-content"),se),style:(0,Fe.Z)({},oe),"aria-modal":"true",role:"dialog",ref:wt},an),de))},xt=at,jt=ue(48736);function Qe(Vt){return typeof Vt=="string"&&String(Number(Vt))===Vt?((0,jt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Vt)):Vt}function mt(Vt){warning(!("wrapperClassName"in Vt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Vt.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 Me(Vt,zt){var ye,se,oe,de,pe=Vt.prefixCls,le=Vt.open,Be=Vt.placement,lt=Vt.inline,Ot=Vt.push,It=Vt.forceRender,Ht=Vt.autoFocus,Yt=Vt.keyboard,an=Vt.rootClassName,cn=Vt.rootStyle,Sn=Vt.zIndex,wt=Vt.className,on=Vt.id,Pn=Vt.style,ot=Vt.motion,St=Vt.width,$t=Vt.height,Dn=Vt.children,Ln=Vt.contentWrapperStyle,In=Vt.mask,qn=Vt.maskClosable,dr=Vt.maskMotion,ir=Vt.maskClassName,Er=Vt.maskStyle,kr=Vt.afterOpenChange,Qn=Vt.onClose,Kr=Vt.onMouseEnter,jr=Vt.onMouseOver,Hr=Vt.onMouseLeave,ni=Vt.onClick,Br=Vt.onKeyDown,qr=Vt.onKeyUp,Cr=Pe.useRef(),yn=Pe.useRef(),wn=Pe.useRef();Pe.useImperativeHandle(zt,function(){return Cr.current});var fn=function(ze){var ct=ze.keyCode,kt=ze.shiftKey;switch(ct){case rt.Z.TAB:{if(ct===rt.Z.TAB){if(!kt&&document.activeElement===wn.current){var Rt;(Rt=yn.current)===null||Rt===void 0||Rt.focus({preventScroll:!0})}else if(kt&&document.activeElement===yn.current){var Jt;(Jt=wn.current)===null||Jt===void 0||Jt.focus({preventScroll:!0})}}break}case rt.Z.ESC:{Qn&&Yt&&(ze.stopPropagation(),Qn(ze));break}}};Pe.useEffect(function(){if(le&&Ht){var nt;(nt=Cr.current)===null||nt===void 0||nt.focus({preventScroll:!0})}},[le]);var Rn=Pe.useState(!1),br=(0,tt.Z)(Rn,2),Kn=br[0],ar=br[1],vn=Pe.useContext(Ne),pn;Ot===!1?pn={distance:0}:Ot===!0?pn={}:pn=Ot||{};var Nn=(ye=(se=(oe=pn)===null||oe===void 0?void 0:oe.distance)!==null&&se!==void 0?se:vn==null?void 0:vn.pushDistance)!==null&&ye!==void 0?ye:180,st=Pe.useMemo(function(){return{pushDistance:Nn,push:function(){ar(!0)},pull:function(){ar(!1)}}},[Nn]);Pe.useEffect(function(){if(le){var nt;vn==null||(nt=vn.push)===null||nt===void 0||nt.call(vn)}else{var ze;vn==null||(ze=vn.pull)===null||ze===void 0||ze.call(vn)}},[le]),Pe.useEffect(function(){return function(){var nt;vn==null||(nt=vn.pull)===null||nt===void 0||nt.call(vn)}},[]);var Ee=In&&Pe.createElement(He.default,(0,Ae.Z)({key:"mask"},dr,{visible:le}),function(nt,ze){var ct=nt.className,kt=nt.style;return Pe.createElement("div",{className:Ze()("".concat(pe,"-mask"),ct,ir),style:(0,Fe.Z)((0,Fe.Z)({},kt),Er),onClick:qn&&le?Qn:void 0,ref:ze})}),Te=typeof ot=="function"?ot(Be):ot,ke={};if(Kn&&Nn)switch(Be){case"top":ke.transform="translateY(".concat(Nn,"px)");break;case"bottom":ke.transform="translateY(".concat(-Nn,"px)");break;case"left":ke.transform="translateX(".concat(Nn,"px)");break;default:ke.transform="translateX(".concat(-Nn,"px)");break}Be==="left"||Be==="right"?ke.width=Qe(St):ke.height=Qe($t);var Ie={onMouseEnter:Kr,onMouseOver:jr,onMouseLeave:Hr,onClick:ni,onKeyDown:Br,onKeyUp:qr},Ge=Pe.createElement(He.default,(0,Ae.Z)({key:"panel"},Te,{visible:le,forceRender:It,onVisibleChanged:function(ze){kr==null||kr(ze)},removeOnLeave:!1,leavedClassName:"".concat(pe,"-content-wrapper-hidden")}),function(nt,ze){var ct=nt.className,kt=nt.style;return Pe.createElement("div",(0,Ae.Z)({className:Ze()("".concat(pe,"-content-wrapper"),ct),style:(0,Fe.Z)((0,Fe.Z)((0,Fe.Z)({},ke),kt),Ln)},(0,je.Z)(Vt,{data:!0})),Pe.createElement(xt,(0,Ae.Z)({id:on,containerRef:ze,prefixCls:pe,className:wt,style:Pn},Ie),Dn))}),ut=(0,Fe.Z)({},cn);return Sn&&(ut.zIndex=Sn),Pe.createElement(Ne.Provider,{value:st},Pe.createElement("div",{className:Ze()(pe,"".concat(pe,"-").concat(Be),an,(de={},(0,dt.Z)(de,"".concat(pe,"-open"),le),(0,dt.Z)(de,"".concat(pe,"-inline"),lt),de)),style:ut,tabIndex:-1,ref:Cr,onKeyDown:fn},Ee,Pe.createElement("div",{tabIndex:0,ref:yn,style:We,"aria-hidden":"true","data-sentinel":"start"}),Ge,Pe.createElement("div",{tabIndex:0,ref:wn,style:We,"aria-hidden":"true","data-sentinel":"end"})))}var Ke=Pe.forwardRef(Me),Ve=Ke,Mt=function(zt){var ye=zt.open,se=ye===void 0?!1:ye,oe=zt.prefixCls,de=oe===void 0?"rc-drawer":oe,pe=zt.placement,le=pe===void 0?"right":pe,Be=zt.autoFocus,lt=Be===void 0?!0:Be,Ot=zt.keyboard,It=Ot===void 0?!0:Ot,Ht=zt.width,Yt=Ht===void 0?378:Ht,an=zt.mask,cn=an===void 0?!0:an,Sn=zt.maskClosable,wt=Sn===void 0?!0:Sn,on=zt.getContainer,Pn=zt.forceRender,ot=zt.afterOpenChange,St=zt.destroyOnClose,$t=zt.onMouseEnter,Dn=zt.onMouseOver,Ln=zt.onMouseLeave,In=zt.onClick,qn=zt.onKeyDown,dr=zt.onKeyUp,ir=zt.panelRef,Er=Pe.useState(!1),kr=(0,tt.Z)(Er,2),Qn=kr[0],Kr=kr[1],jr=Pe.useState(!1),Hr=(0,tt.Z)(jr,2),ni=Hr[0],Br=Hr[1];(0,De.Z)(function(){Br(!0)},[]);var qr=ni?se:!1,Cr=Pe.useRef(),yn=Pe.useRef();(0,De.Z)(function(){qr&&(yn.current=document.activeElement)},[qr]);var wn=function(ar){var vn;if(Kr(ar),ot==null||ot(ar),!ar&&yn.current&&!((vn=Cr.current)!==null&&vn!==void 0&&vn.contains(yn.current))){var pn;(pn=yn.current)===null||pn===void 0||pn.focus({preventScroll:!0})}},fn=Pe.useMemo(function(){return{panel:ir}},[ir]);if(!Pn&&!Qn&&!qr&&St)return null;var Rn={onMouseEnter:$t,onMouseOver:Dn,onMouseLeave:Ln,onClick:In,onKeyDown:qn,onKeyUp:dr},br=(0,Fe.Z)((0,Fe.Z)({},zt),{},{open:qr,prefixCls:de,placement:le,autoFocus:lt,keyboard:It,width:Yt,mask:cn,maskClosable:wt,inline:on===!1,afterOpenChange:wn,ref:Cr},Rn);return Pe.createElement(_e.Provider,{value:fn},Pe.createElement(be.Z,{open:qr||Pn||Qn,autoDestroy:!1,getContainer:on,autoLock:cn&&(qr||Qn)},Pe.createElement(Ve,br)))},Xe=Mt,Nt=Xe,ht=ue(62892),Tt=ue(36355),et=ue(32441),Ut=ue(47729),Dt=Vt=>{const{prefixCls:zt,title:ye,footer:se,extra:oe,closeIcon:de,closable:pe,onClose:le,headerStyle:Be,drawerStyle:lt,bodyStyle:Ot,footerStyle:It,children:Ht}=Vt,Yt=Pe.useCallback(on=>Pe.createElement("button",{type:"button",onClick:le,"aria-label":"Close",className:`${zt}-close`},on),[le]),[an,cn]=(0,Ut.Z)(pe,de,Yt,void 0,!0),Sn=Pe.useMemo(()=>!ye&&!an?null:Pe.createElement("div",{style:Be,className:Ze()(`${zt}-header`,{[`${zt}-header-close-only`]:an&&!ye&&!oe})},Pe.createElement("div",{className:`${zt}-header-title`},cn,ye&&Pe.createElement("div",{className:`${zt}-title`},ye)),oe&&Pe.createElement("div",{className:`${zt}-extra`},oe)),[an,cn,oe,Be,zt,ye]),wt=Pe.useMemo(()=>{if(!se)return null;const on=`${zt}-footer`;return Pe.createElement("div",{className:on,style:It},se)},[se,It,zt]);return Pe.createElement("div",{className:`${zt}-wrapper-body`,style:lt},Sn,Pe.createElement("div",{className:`${zt}-body`,style:Ot},Ht),wt)},Bt=ue(33234),bt=ue(83116),$e=ue(37613),gt=Vt=>{const{componentCls:zt,motionDurationSlow:ye}=Vt,se={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ye}`}}};return{[zt]:{[`${zt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ye}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${zt}-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 en=Vt=>{const{componentCls:zt,zIndexPopup:ye,colorBgMask:se,colorBgElevated:oe,motionDurationSlow:de,motionDurationMid:pe,padding:le,paddingLG:Be,fontSizeLG:lt,lineHeightLG:Ot,lineWidth:It,lineType:Ht,colorSplit:Yt,marginSM:an,colorIcon:cn,colorIconHover:Sn,colorText:wt,fontWeightStrong:on,footerPaddingBlock:Pn,footerPaddingInline:ot}=Vt,St=`${zt}-content-wrapper`;return{[zt]:{position:"fixed",inset:0,zIndex:ye,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${zt}-left`]:{boxShadow:Vt.boxShadowDrawerLeft},[`&${zt}-right`]:{boxShadow:Vt.boxShadowDrawerRight},[`&${zt}-top`]:{boxShadow:Vt.boxShadowDrawerUp},[`&${zt}-bottom`]:{boxShadow:Vt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${zt}-mask`]:{position:"absolute",inset:0,zIndex:ye,background:se,pointerEvents:"auto"},[St]:{position:"absolute",zIndex:ye,maxWidth:"100vw",transition:`all ${de}`,"&-hidden":{display:"none"}},[`&-left > ${St}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Vt.boxShadowDrawerLeft},[`&-right > ${St}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Vt.boxShadowDrawerRight},[`&-top > ${St}`]:{top:0,insetInline:0,boxShadow:Vt.boxShadowDrawerUp},[`&-bottom > ${St}`]:{bottom:0,insetInline:0,boxShadow:Vt.boxShadowDrawerDown},[`${zt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:oe,pointerEvents:"auto"},[`${zt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${zt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${le}px ${Be}px`,fontSize:lt,lineHeight:Ot,borderBottom:`${It}px ${Ht} ${Yt}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${zt}-extra`]:{flex:"none"},[`${zt}-close`]:{display:"inline-block",marginInlineEnd:an,color:cn,fontWeight:on,fontSize:lt,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${pe}`,textRendering:"auto","&:focus, &:hover":{color:Sn,textDecoration:"none"}},[`${zt}-title`]:{flex:1,margin:0,color:wt,fontWeight:Vt.fontWeightStrong,fontSize:lt,lineHeight:Ot},[`${zt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Be,overflow:"auto"},[`${zt}-footer`]:{flexShrink:0,padding:`${Pn}px ${ot}px`,borderTop:`${It}px ${Ht} ${Yt}`},"&-rtl":{direction:"rtl"}}}};var Wt=(0,bt.Z)("Drawer",Vt=>{const zt=(0,$e.TS)(Vt,{});return[en(zt),gt(zt)]},Vt=>({zIndexPopup:Vt.zIndexPopupBase,footerPaddingBlock:Vt.paddingXS,footerPaddingInline:Vt.padding})),qe=ue(11575),Ye=function(Vt,zt){var ye={};for(var se in Vt)Object.prototype.hasOwnProperty.call(Vt,se)&&zt.indexOf(se)<0&&(ye[se]=Vt[se]);if(Vt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,se=Object.getOwnPropertySymbols(Vt);oe<se.length;oe++)zt.indexOf(se[oe])<0&&Object.prototype.propertyIsEnumerable.call(Vt,se[oe])&&(ye[se[oe]]=Vt[se[oe]]);return ye};const Lt=null,mn={distance:180},Qt=Vt=>{var zt;const{rootClassName:ye,width:se,height:oe,size:de="default",mask:pe=!0,push:le=mn,open:Be,afterOpenChange:lt,onClose:Ot,prefixCls:It,getContainer:Ht,style:Yt,className:an,visible:cn,afterVisibleChange:Sn}=Vt,wt=Ye(Vt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:on,getPrefixCls:Pn,direction:ot,drawer:St}=Pe.useContext(Tt.E_),$t=Pn("drawer",It),[Dn,Ln]=Wt($t),In=Ht===void 0&&on?()=>on(document.body):Ht,qn=Ze()({"no-mask":!pe,[`${$t}-rtl`]:ot==="rtl"},ye,Ln),dr=Pe.useMemo(()=>se!=null?se:de==="large"?736:378,[se,de]),ir=Pe.useMemo(()=>oe!=null?oe:de==="large"?736:378,[oe,de]),Er={motionName:(0,ht.m)($t,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},kr=Kr=>({motionName:(0,ht.m)($t,`panel-motion-${Kr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Qn=(0,qe.H)();return Dn(Pe.createElement(Bt.BR,null,Pe.createElement(et.Ux,{status:!0,override:!0},Pe.createElement(Nt,Object.assign({prefixCls:$t,onClose:Ot,maskMotion:Er,motion:kr},wt,{open:Be!=null?Be:cn,mask:pe,push:le,width:dr,height:ir,style:Object.assign(Object.assign({},St==null?void 0:St.style),Yt),className:Ze()(St==null?void 0:St.className,an),rootClassName:qn,getContainer:In,afterOpenChange:lt!=null?lt:Sn,panelRef:Qn}),Pe.createElement(Dt,Object.assign({prefixCls:$t},wt,{onClose:Ot}))))))},dn=Vt=>{const{prefixCls:zt,style:ye,className:se,placement:oe="right"}=Vt,de=Ye(Vt,["prefixCls","style","className","placement"]),{getPrefixCls:pe}=Pe.useContext(Tt.E_),le=pe("drawer",zt),[Be,lt]=Wt(le),Ot=Ze()(le,`${le}-pure`,`${le}-${oe}`,lt,se);return Be(Pe.createElement("div",{className:Ot,style:ye},Pe.createElement(Dt,Object.assign({prefixCls:le},de))))};Qt._InternalPanelDoNotUseOrYouWillBeFired=dn;var Zt=Qt},91857:function(Mn,rn,ue){"use strict";var fe=ue(59301),Ze=ue(38819),Fe=ue(92310),tt=ue.n(Fe),be=ue(31561),De=ue(70425),Pe=ue(18929),we=ue(2738),_e=ue(79676),Ne=ue(53487),dt=ue(92343),Ae=ue(36355),He=ue(20834),rt=ue(40875),je=ue(88088),it=ue(47211);const at=null,xt=We=>{const{menu:Me,arrow:Ke,prefixCls:Ve,children:Mt,trigger:Xe,disabled:Nt,dropdownRender:ht,getPopupContainer:Tt,overlayClassName:et,rootClassName:Ut,open:ft,onOpenChange:Dt,visible:Bt,onVisibleChange:bt,mouseEnterDelay:$e=.15,mouseLeaveDelay:xe=.1,autoAdjustOverflow:gt=!0,placement:en="",overlay:Wt,transitionName:qe}=We,{getPopupContainer:Ye,getPrefixCls:Lt,direction:mn}=fe.useContext(Ae.E_),Qt=fe.useMemo(()=>{const an=Lt();return qe!==void 0?qe:en.includes("top")?`${an}-slide-down`:`${an}-slide-up`},[Lt,en,qe]),dn=fe.useMemo(()=>en?en.includes("Center")?en.slice(0,en.indexOf("Center")):en:mn==="rtl"?"bottomRight":"bottomLeft",[en,mn]),Zt=Lt("dropdown",Ve),[Vt,zt]=(0,it.Z)(Zt),[,ye]=(0,je.Z)(),se=fe.Children.only(Mt),oe=(0,dt.Tm)(se,{className:tt()(`${Zt}-trigger`,{[`${Zt}-rtl`]:mn==="rtl"},se.props.className),disabled:Nt}),de=Nt?[]:Xe;let pe;de&&de.includes("contextMenu")&&(pe=!0);const[le,Be]=(0,Pe.Z)(!1,{value:ft!=null?ft:Bt}),lt=(0,De.useEvent)(an=>{Dt==null||Dt(an),bt==null||bt(an),Be(an)}),Ot=tt()(et,Ut,zt,{[`${Zt}-rtl`]:mn==="rtl"}),It=(0,_e.Z)({arrowPointAtCenter:typeof Ke=="object"&&Ke.pointAtCenter,autoAdjustOverflow:gt,offset:ye.marginXXS,arrowWidth:Ke?ye.sizePopupArrow:0,borderRadius:ye.borderRadius}),Ht=fe.useCallback(()=>{Be(!1)},[]),Yt=()=>{let an;return Me!=null&&Me.items?an=fe.createElement(He.default,Object.assign({},Me)):typeof Wt=="function"?an=Wt():an=Wt,ht&&(an=ht(an)),an=fe.Children.only(typeof an=="string"?fe.createElement("span",null,an):an),fe.createElement(rt.J,{prefixCls:`${Zt}-menu`,expandIcon:fe.createElement("span",{className:`${Zt}-menu-submenu-arrow`},fe.createElement(Ze.Z,{className:`${Zt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Ht,validator:cn=>{let{mode:Sn}=cn}},an)};return Vt(fe.createElement(be.Z,Object.assign({alignPoint:pe},(0,we.Z)(We,["rootClassName"]),{mouseEnterDelay:$e,mouseLeaveDelay:xe,visible:le,builtinPlacements:It,arrow:!!Ke,overlayClassName:Ot,prefixCls:Zt,getPopupContainer:Tt||Ye,transitionName:Qt,trigger:de,overlay:Yt,placement:dn,onVisibleChange:lt}),oe))};function jt(We){return Object.assign(Object.assign({},We),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const Qe=(0,Ne.Z)(xt,"dropdown",We=>We,jt),mt=We=>fe.createElement(Qe,Object.assign({},We),fe.createElement("span",null));xt._InternalPanelDoNotUseOrYouWillBeFired=mt,rn.Z=xt},38854:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return je}});var fe=ue(91857),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(59301),be=ue(18785),De=ue(3113),Pe=ue(36355),we=ue(81327),_e=ue(33234),Ne=ue(47211),dt=function(it,at){var xt={};for(var jt in it)Object.prototype.hasOwnProperty.call(it,jt)&&at.indexOf(jt)<0&&(xt[jt]=it[jt]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Qe=0,jt=Object.getOwnPropertySymbols(it);Qe<jt.length;Qe++)at.indexOf(jt[Qe])<0&&Object.prototype.propertyIsEnumerable.call(it,jt[Qe])&&(xt[jt[Qe]]=it[jt[Qe]]);return xt};const Ae=it=>{const{getPopupContainer:at,getPrefixCls:xt,direction:jt}=tt.useContext(Pe.E_),{prefixCls:Qe,type:mt="default",danger:We,disabled:Me,loading:Ke,onClick:Ve,htmlType:Mt,children:Xe,className:Nt,menu:ht,arrow:Tt,autoFocus:et,overlay:Ut,trigger:ft,align:Dt,open:Bt,onOpenChange:bt,placement:$e,getPopupContainer:xe,href:gt,icon:en=tt.createElement(be.Z,null),title:Wt,buttonsRender:qe=Yt=>Yt,mouseEnterDelay:Ye,mouseLeaveDelay:Lt,overlayClassName:mn,overlayStyle:Qt,destroyPopupOnHide:dn,dropdownRender:Zt}=it,Vt=dt(it,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),zt=xt("dropdown",Qe),ye=`${zt}-button`,[se,oe]=(0,Ne.Z)(zt),de={menu:ht,arrow:Tt,autoFocus:et,align:Dt,disabled:Me,trigger:Me?[]:ft,onOpenChange:bt,getPopupContainer:xe||at,mouseEnterDelay:Ye,mouseLeaveDelay:Lt,overlayClassName:mn,overlayStyle:Qt,destroyPopupOnHide:dn,dropdownRender:Zt},{compactSize:pe,compactItemClassnames:le}=(0,_e.ri)(zt,jt),Be=Fe()(ye,le,Nt,oe);"overlay"in it&&(de.overlay=Ut),"open"in it&&(de.open=Bt),"placement"in it?de.placement=$e:de.placement=jt==="rtl"?"bottomLeft":"bottomRight";const lt=tt.createElement(De.ZP,{type:mt,danger:We,disabled:Me,loading:Ke,onClick:Ve,htmlType:Mt,href:gt,title:Wt},Xe),Ot=tt.createElement(De.ZP,{type:mt,danger:We,icon:en}),[It,Ht]=qe([lt,Ot]);return se(tt.createElement(we.Z.Compact,Object.assign({className:Be,size:pe,block:!0},Vt),It,tt.createElement(fe.Z,Object.assign({},de),Ht)))};Ae.__ANT_BUTTON=!0;var He=Ae;const rt=fe.Z;rt.Button=He;var je=rt},47211:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return dt}});var fe=ue(17313),Ze=ue(13826),Fe=ue(92899),tt=ue(29878),be=ue(19447),De=ue(83116),Pe=ue(37613),_e=Ae=>{const{componentCls:He,menuCls:rt,colorError:je,colorTextLightSolid:it}=Ae,at=`${rt}-item`;return{[`${He}, ${He}-menu-submenu`]:{[`${rt} ${at}`]:{[`&${at}-danger:not(${at}-disabled)`]:{color:je,"&:hover":{color:it,backgroundColor:je}}}}}};const Ne=Ae=>{const{componentCls:He,menuCls:rt,zIndexPopup:je,dropdownArrowDistance:it,sizePopupArrow:at,antCls:xt,iconCls:jt,motionDurationMid:Qe,dropdownPaddingVertical:mt,fontSize:We,dropdownEdgeChildPadding:Me,colorTextDisabled:Ke,fontSizeIcon:Ve,controlPaddingHorizontal:Mt,colorBgElevated:Xe}=Ae;return[{[He]:Object.assign(Object.assign({},(0,fe.Wf)(Ae)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:je,display:"block","&::before":{position:"absolute",insetBlock:-it+at/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${xt}-btn`]:{[`& > ${jt}-down, & > ${xt}-btn-icon > ${jt}-down`]:{fontSize:Ve}},[`${He}-wrap`]:{position:"relative",[`${xt}-btn > ${jt}-down`]:{fontSize:Ve},[`${jt}-down::before`]:{transition:`transform ${Qe}`}},[`${He}-wrap-open`]:{[`${jt}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${xt}-slide-down-enter${xt}-slide-down-enter-active${He}-placement-bottomLeft,
&${xt}-slide-down-appear${xt}-slide-down-appear-active${He}-placement-bottomLeft,
&${xt}-slide-down-enter${xt}-slide-down-enter-active${He}-placement-bottom,
&${xt}-slide-down-appear${xt}-slide-down-appear-active${He}-placement-bottom,
&${xt}-slide-down-enter${xt}-slide-down-enter-active${He}-placement-bottomRight,
&${xt}-slide-down-appear${xt}-slide-down-appear-active${He}-placement-bottomRight`]:{animationName:Ze.fJ},[`&${xt}-slide-up-enter${xt}-slide-up-enter-active${He}-placement-topLeft,
&${xt}-slide-up-appear${xt}-slide-up-appear-active${He}-placement-topLeft,
&${xt}-slide-up-enter${xt}-slide-up-enter-active${He}-placement-top,
&${xt}-slide-up-appear${xt}-slide-up-appear-active${He}-placement-top,
&${xt}-slide-up-enter${xt}-slide-up-enter-active${He}-placement-topRight,
&${xt}-slide-up-appear${xt}-slide-up-appear-active${He}-placement-topRight`]:{animationName:Ze.Qt},[`&${xt}-slide-down-leave${xt}-slide-down-leave-active${He}-placement-bottomLeft,
&${xt}-slide-down-leave${xt}-slide-down-leave-active${He}-placement-bottom,
&${xt}-slide-down-leave${xt}-slide-down-leave-active${He}-placement-bottomRight`]:{animationName:Ze.Uw},[`&${xt}-slide-up-leave${xt}-slide-up-leave-active${He}-placement-topLeft,
&${xt}-slide-up-leave${xt}-slide-up-leave-active${He}-placement-top,
&${xt}-slide-up-leave${xt}-slide-up-leave-active${He}-placement-topRight`]:{animationName:Ze.ly}})},(0,be.ZP)(Ae,{colorBg:Xe,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${He} ${rt}`]:{position:"relative",margin:0},[`${rt}-submenu-popup`]:{position:"absolute",zIndex:je,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${He}, ${He}-menu-submenu`]:{[rt]:Object.assign(Object.assign({padding:Me,listStyleType:"none",backgroundColor:Xe,backgroundClip:"padding-box",borderRadius:Ae.borderRadiusLG,outline:"none",boxShadow:Ae.boxShadowSecondary},(0,fe.Qy)(Ae)),{[`${rt}-item-group-title`]:{padding:`${mt}px ${Mt}px`,color:Ae.colorTextDescription,transition:`all ${Qe}`},[`${rt}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${rt}-item-icon`]:{minWidth:We,marginInlineEnd:Ae.marginXS,fontSize:Ae.fontSizeSM},[`${rt}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${Qe}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${rt}-item, ${rt}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${mt}px ${Mt}px`,color:Ae.colorText,fontWeight:"normal",fontSize:We,lineHeight:Ae.lineHeight,cursor:"pointer",transition:`all ${Qe}`,borderRadius:Ae.borderRadiusSM,"&:hover, &-active":{backgroundColor:Ae.controlItemBgHover}},(0,fe.Qy)(Ae)),{"&-selected":{color:Ae.colorPrimary,backgroundColor:Ae.controlItemBgActive,"&:hover, &-active":{backgroundColor:Ae.controlItemBgActiveHover}},"&-disabled":{color:Ke,cursor:"not-allowed","&:hover":{color:Ke,backgroundColor:Xe,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Ae.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:Ae.colorSplit},[`${He}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:Ae.paddingXS,[`${He}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:Ae.colorTextDescription,fontSize:Ve,fontStyle:"normal"}}}),[`${rt}-item-group-list`]:{margin:`0 ${Ae.marginXS}px`,padding:0,listStyle:"none"},[`${rt}-submenu-title`]:{paddingInlineEnd:Mt+Ae.fontSizeSM},[`${rt}-submenu-vertical`]:{position:"relative"},[`${rt}-submenu${rt}-submenu-disabled ${He}-menu-submenu-title`]:{[`&, ${He}-menu-submenu-arrow-icon`]:{color:Ke,backgroundColor:Xe,cursor:"not-allowed"}},[`${rt}-submenu-selected ${He}-menu-submenu-title`]:{color:Ae.colorPrimary}})}},[(0,Ze.oN)(Ae,"slide-up"),(0,Ze.oN)(Ae,"slide-down"),(0,Fe.Fm)(Ae,"move-up"),(0,Fe.Fm)(Ae,"move-down"),(0,tt._y)(Ae,"zoom-big")]]};var dt=(0,De.Z)("Dropdown",(Ae,He)=>{let{rootPrefixCls:rt}=He;const{marginXXS:je,sizePopupArrow:it,controlHeight:at,fontSize:xt,lineHeight:jt,paddingXXS:Qe,componentCls:mt,borderRadiusLG:We}=Ae,Me=(at-xt*jt)/2,{dropdownArrowOffset:Ke}=(0,be.fS)({contentRadius:We}),Ve=(0,Pe.TS)(Ae,{menuCls:`${mt}-menu`,rootPrefixCls:rt,dropdownArrowDistance:it/2+je,dropdownArrowOffset:Ke,dropdownPaddingVertical:Me,dropdownEdgeChildPadding:Qe});return[Ne(Ve),_e(Ve)]},Ae=>({zIndexPopup:Ae.zIndexPopupBase+50}))},64165:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Qe}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(59301),tt=ue(36355),be=ue(9763),De=ue(64993),Pe=ue(88088),_e=()=>{const[,mt]=(0,Pe.Z)(),Me=new De.C(mt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Fe.createElement("svg",{style:Me,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{fill:"none",fillRule:"evenodd"},Fe.createElement("g",{transform:"translate(24 31.67)"},Fe.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Fe.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"}),Fe.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)"}),Fe.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"}),Fe.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"})),Fe.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"}),Fe.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Fe.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Fe.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},dt=()=>{const[,mt]=(0,Pe.Z)(),{colorFill:We,colorFillTertiary:Me,colorFillQuaternary:Ke,colorBgContainer:Ve}=mt,{borderColor:Mt,shadowColor:Xe,contentColor:Nt}=(0,Fe.useMemo)(()=>({borderColor:new De.C(We).onBackground(Ve).toHexShortString(),shadowColor:new De.C(Me).onBackground(Ve).toHexShortString(),contentColor:new De.C(Ke).onBackground(Ve).toHexShortString()}),[We,Me,Ke,Ve]);return Fe.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Fe.createElement("ellipse",{fill:Xe,cx:"32",cy:"33",rx:"32",ry:"7"}),Fe.createElement("g",{fillRule:"nonzero",stroke:Mt},Fe.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"}),Fe.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:Nt}))))},Ae=ue(83116),He=ue(37613);const rt=mt=>{const{componentCls:We,margin:Me,marginXS:Ke,marginXL:Ve,fontSize:Mt,lineHeight:Xe}=mt;return{[We]:{marginInline:Ke,fontSize:Mt,lineHeight:Xe,textAlign:"center",[`${We}-image`]:{height:mt.emptyImgHeight,marginBottom:Ke,opacity:mt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${We}-description`]:{color:mt.colorText},[`${We}-footer`]:{marginTop:Me},"&-normal":{marginBlock:Ve,color:mt.colorTextDisabled,[`${We}-description`]:{color:mt.colorTextDisabled},[`${We}-image`]:{height:mt.emptyImgHeightMD}},"&-small":{marginBlock:Ke,color:mt.colorTextDisabled,[`${We}-image`]:{height:mt.emptyImgHeightSM}}}}};var je=(0,Ae.Z)("Empty",mt=>{const{componentCls:We,controlHeightLG:Me}=mt,Ke=(0,He.TS)(mt,{emptyImgCls:`${We}-img`,emptyImgHeight:Me*2.5,emptyImgHeightMD:Me,emptyImgHeightSM:Me*.875});return[rt(Ke)]}),it=function(mt,We){var Me={};for(var Ke in mt)Object.prototype.hasOwnProperty.call(mt,Ke)&&We.indexOf(Ke)<0&&(Me[Ke]=mt[Ke]);if(mt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ve=0,Ke=Object.getOwnPropertySymbols(mt);Ve<Ke.length;Ve++)We.indexOf(Ke[Ve])<0&&Object.prototype.propertyIsEnumerable.call(mt,Ke[Ve])&&(Me[Ke[Ve]]=mt[Ke[Ve]]);return Me};const at=Fe.createElement(_e,null),xt=Fe.createElement(dt,null),jt=mt=>{var{className:We,rootClassName:Me,prefixCls:Ke,image:Ve=at,description:Mt,children:Xe,imageStyle:Nt,style:ht}=mt,Tt=it(mt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:et,direction:Ut,empty:ft}=Fe.useContext(tt.E_),Dt=et("empty",Ke),[Bt,bt]=je(Dt),[$e]=(0,be.Z)("Empty"),xe=typeof Mt!="undefined"?Mt:$e==null?void 0:$e.description,gt=typeof xe=="string"?xe:"empty";let en=null;return typeof Ve=="string"?en=Fe.createElement("img",{alt:gt,src:Ve}):en=Ve,Bt(Fe.createElement("div",Object.assign({className:Ze()(bt,Dt,ft==null?void 0:ft.className,{[`${Dt}-normal`]:Ve===xt,[`${Dt}-rtl`]:Ut==="rtl"},We,Me),style:Object.assign(Object.assign({},ft==null?void 0:ft.style),ht)},Tt),Fe.createElement("div",{className:`${Dt}-image`,style:Nt},en),xe&&Fe.createElement("div",{className:`${Dt}-description`},xe),Xe&&Fe.createElement("div",{className:`${Dt}-footer`},Xe)))};jt.PRESENTED_IMAGE_DEFAULT=at,jt.PRESENTED_IMAGE_SIMPLE=xt;var Qe=jt},78241:function(Mn,rn,ue){"use strict";ue.d(rn,{default:function(){return Nn}});var fe=ue(77654),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(77900),be=ue(59301),De=ue(62892),Pe=ue(32441);function we(st){const[Ee,Te]=be.useState(st);return be.useEffect(()=>{const ke=setTimeout(()=>{Te(st)},st.length?0:10);return()=>{clearTimeout(ke)}},[st]),Ee}var _e=ue(17313),Ne=ue(29878),dt=ue(8378),Ae=ue(37613),He=ue(83116),je=st=>{const{componentCls:Ee}=st,Te=`${Ee}-show-help`,ke=`${Ee}-show-help-item`;return{[Te]:{transition:`opacity ${st.motionDurationSlow} ${st.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[ke]:{overflow:"hidden",transition:`height ${st.motionDurationSlow} ${st.motionEaseInOut},
opacity ${st.motionDurationSlow} ${st.motionEaseInOut},
transform ${st.motionDurationSlow} ${st.motionEaseInOut} !important`,[`&${ke}-appear, &${ke}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${ke}-leave-active`]:{transform:"translateY(-5px)"}}}}};const it=st=>({legend:{display:"block",width:"100%",marginBottom:st.marginLG,padding:0,color:st.colorTextDescription,fontSize:st.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${st.lineWidth}px ${st.lineType} ${st.colorBorder}`},label:{fontSize:st.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 ${st.controlOutlineWidth}px ${st.controlOutline}`},output:{display:"block",paddingTop:15,color:st.colorText,fontSize:st.fontSize,lineHeight:st.lineHeight}}),at=(st,Ee)=>{const{formItemCls:Te}=st;return{[Te]:{[`${Te}-label > label`]:{height:Ee},[`${Te}-control-input`]:{minHeight:Ee}}}},xt=st=>{const{componentCls:Ee}=st;return{[st.componentCls]:Object.assign(Object.assign(Object.assign({},(0,_e.Wf)(st)),it(st)),{[`${Ee}-text`]:{display:"inline-block",paddingInlineEnd:st.paddingSM},"&-small":Object.assign({},at(st,st.controlHeightSM)),"&-large":Object.assign({},at(st,st.controlHeightLG))})}},jt=st=>{const{formItemCls:Ee,iconCls:Te,componentCls:ke,rootPrefixCls:Ie,labelRequiredMarkColor:Ge,labelColor:ut,labelFontSize:nt,labelHeight:ze,labelColonMarginInlineStart:ct,labelColonMarginInlineEnd:kt,itemMarginBottom:Rt}=st;return{[Ee]:Object.assign(Object.assign({},(0,_e.Wf)(st)),{marginBottom:Rt,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${Ie}-row`]:{display:"none"},"&-has-warning":{[`${Ee}-split`]:{color:st.colorError}},"&-has-error":{[`${Ee}-split`]:{color:st.colorWarning}},[`${Ee}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${st.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:ze,color:ut,fontSize:nt,[`> ${Te}`]:{fontSize:st.fontSize,verticalAlign:"top"},[`&${Ee}-required:not(${Ee}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:st.marginXXS,color:Ge,fontSize:st.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${ke}-hide-required-mark &`]:{display:"none"}},[`${Ee}-optional`]:{display:"inline-block",marginInlineStart:st.marginXXS,color:st.colorTextDescription,[`${ke}-hide-required-mark &`]:{display:"none"}},[`${Ee}-tooltip`]:{color:st.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:st.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:ct,marginInlineEnd:kt},[`&${Ee}-no-colon::after`]:{content:'"\\a0"'}}},[`${Ee}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Ie}-col-'"]):not([class*="' ${Ie}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:st.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[Ee]:{"&-explain, &-extra":{clear:"both",color:st.colorTextDescription,fontSize:st.fontSize,lineHeight:st.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:st.controlHeightSM,transition:`color ${st.motionDurationMid} ${st.motionEaseOut}`},"&-explain":{"&-error":{color:st.colorError},"&-warning":{color:st.colorWarning}}},[`&-with-help ${Ee}-explain`]:{height:"auto",opacity:1},[`${Ee}-feedback-icon`]:{fontSize:st.fontSize,textAlign:"center",visibility:"visible",animationName:Ne.kr,animationDuration:st.motionDurationMid,animationTimingFunction:st.motionEaseOutBack,pointerEvents:"none","&-success":{color:st.colorSuccess},"&-error":{color:st.colorError},"&-warning":{color:st.colorWarning},"&-validating":{color:st.colorPrimary}}})}},Qe=st=>{const{componentCls:Ee,formItemCls:Te}=st;return{[`${Ee}-horizontal`]:{[`${Te}-label`]:{flexGrow:0},[`${Te}-control`]:{flex:"1 1 0",minWidth:0},[`${Te}-label[class$='-24'], ${Te}-label[class*='-24 ']`]:{[`& + ${Te}-control`]:{minWidth:"unset"}}}}},mt=st=>{const{componentCls:Ee,formItemCls:Te}=st;return{[`${Ee}-inline`]:{display:"flex",flexWrap:"wrap",[Te]:{flex:"none",marginInlineEnd:st.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Te}-label,
> ${Te}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Te}-label`]:{flex:"none"},[`${Ee}-text`]:{display:"inline-block"},[`${Te}-has-feedback`]:{display:"inline-block"}}}}},We=st=>({padding:st.verticalLabelPadding,margin:st.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Me=st=>{const{componentCls:Ee,formItemCls:Te,rootPrefixCls:ke}=st;return{[`${Te} ${Te}-label`]:We(st),[Ee]:{[Te]:{flexWrap:"wrap",[`${Te}-label, ${Te}-control`]:{[`&:not([class*=" ${ke}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ke=st=>{const{componentCls:Ee,formItemCls:Te,rootPrefixCls:ke}=st;return{[`${Ee}-vertical`]:{[Te]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${Ee}-item-control`]:{width:"100%"}}},[`${Ee}-vertical ${Te}-label,
.${ke}-col-24${Te}-label,
.${ke}-col-xl-24${Te}-label`]:We(st),[`@media (max-width: ${st.screenXSMax}px)`]:[Me(st),{[Ee]:{[`.${ke}-col-xs-24${Te}-label`]:We(st)}}],[`@media (max-width: ${st.screenSMMax}px)`]:{[Ee]:{[`.${ke}-col-sm-24${Te}-label`]:We(st)}},[`@media (max-width: ${st.screenMDMax}px)`]:{[Ee]:{[`.${ke}-col-md-24${Te}-label`]:We(st)}},[`@media (max-width: ${st.screenLGMax}px)`]:{[Ee]:{[`.${ke}-col-lg-24${Te}-label`]:We(st)}}}},Ve=(st,Ee)=>(0,Ae.TS)(st,{formItemCls:`${st.componentCls}-item`,rootPrefixCls:Ee});var Mt=(0,He.Z)("Form",(st,Ee)=>{let{rootPrefixCls:Te}=Ee;const ke=Ve(st,Te);return[xt(ke),jt(ke),je(ke),Qe(ke),mt(ke),Ke(ke),(0,dt.Z)(ke),Ne.kr]},st=>({labelRequiredMarkColor:st.colorError,labelColor:st.colorTextHeading,labelFontSize:st.fontSize,labelHeight:st.controlHeight,labelColonMarginInlineStart:st.marginXXS/2,labelColonMarginInlineEnd:st.marginXS,itemMarginBottom:st.marginLG,verticalLabelPadding:`0 0 ${st.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Xe=[];function Nt(st,Ee,Te){let ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof st=="string"?st:`${Ee}-${ke}`,error:st,errorStatus:Te}}var Tt=st=>{let{help:Ee,helpStatus:Te,errors:ke=Xe,warnings:Ie=Xe,className:Ge,fieldId:ut,onVisibleChanged:nt}=st;const{prefixCls:ze}=be.useContext(Pe.Rk),ct=`${ze}-item-explain`,[,kt]=Mt(ze),Rt=(0,be.useMemo)(()=>(0,De.Z)(ze),[ze]),Jt=we(ke),pt=we(Ie),Ct=be.useMemo(()=>Ee!=null?[Nt(Ee,"help",Te)]:[].concat((0,fe.Z)(Jt.map((ln,En)=>Nt(ln,"error","error",En))),(0,fe.Z)(pt.map((ln,En)=>Nt(ln,"warning","warning",En)))),[Ee,Te,Jt,pt]),bn={};return ut&&(bn.id=`${ut}_help`),be.createElement(tt.default,{motionDeadline:Rt.motionDeadline,motionName:`${ze}-show-help`,visible:!!Ct.length,onVisibleChanged:nt},ln=>{const{className:En,style:qt}=ln;return be.createElement("div",Object.assign({},bn,{className:Fe()(ct,En,Ge,kt),style:qt,role:"alert"}),be.createElement(tt.CSSMotionList,Object.assign({keys:Ct},(0,De.Z)(ze),{motionName:`${ze}-show-help-item`,component:!1}),On=>{const{key:tn,error:An,errorStatus:Ue,className:At,style:Pt}=On;return be.createElement("div",{key:tn,className:Fe()(At,{[`${ct}-${Ue}`]:Ue}),style:Pt},An)}))})},et=ue(95013),Ut=ue(36355),ft=ue(1684),Dt=ue(52946),Bt=ue(19716),bt=ue(16722);const $e=["parentNode"],xe="form_item";function gt(st){return st===void 0||st===!1?[]:Array.isArray(st)?st:[st]}function en(st,Ee){if(!st.length)return;const Te=st.join("_");return Ee?`${Ee}_${Te}`:$e.includes(Te)?`${xe}_${Te}`:Te}function Wt(st,Ee,Te,ke,Ie,Ge){let ut=ke;return Ge!==void 0?ut=Ge:Te.validating?ut="validating":st.length?ut="error":Ee.length?ut="warning":(Te.touched||Ie&&Te.validated)&&(ut="success"),ut}function qe(st){return gt(st).join("_")}function Ye(st){const[Ee]=(0,et.useForm)(),Te=be.useRef({}),ke=be.useMemo(()=>st!=null?st:Object.assign(Object.assign({},Ee),{__INTERNAL__:{itemRef:Ie=>Ge=>{const ut=qe(Ie);Ge?Te.current[ut]=Ge:delete Te.current[ut]}},scrollToField:function(Ie){let Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const ut=gt(Ie),nt=en(ut,ke.__INTERNAL__.name),ze=nt?document.getElementById(nt):null;ze&&(0,bt.Z)(ze,Object.assign({scrollMode:"if-needed",block:"nearest"},Ge))},getFieldInstance:Ie=>{const Ge=qe(Ie);return Te.current[Ge]}}),[st,Ee]);return[ke]}var Lt=ue(28726),mn=function(st,Ee){var Te={};for(var ke in st)Object.prototype.hasOwnProperty.call(st,ke)&&Ee.indexOf(ke)<0&&(Te[ke]=st[ke]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ke=Object.getOwnPropertySymbols(st);Ie<ke.length;Ie++)Ee.indexOf(ke[Ie])<0&&Object.prototype.propertyIsEnumerable.call(st,ke[Ie])&&(Te[ke[Ie]]=st[ke[Ie]]);return Te};const Qt=(st,Ee)=>{const Te=be.useContext(ft.Z),{getPrefixCls:ke,direction:Ie,form:Ge}=be.useContext(Ut.E_),{prefixCls:ut,className:nt,rootClassName:ze,size:ct,disabled:kt=Te,form:Rt,colon:Jt,labelAlign:pt,labelWrap:Ct,labelCol:bn,wrapperCol:ln,hideRequiredMark:En,layout:qt="horizontal",scrollToFirstError:On,requiredMark:tn,onFinishFailed:An,name:Ue,style:At,feedbackIcons:Pt}=st,Xt=mn(st,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Ft=(0,Bt.Z)(ct),Gt=be.useContext(Lt.Z),Kt=(0,be.useMemo)(()=>tn!==void 0?tn:Ge&&Ge.requiredMark!==void 0?Ge.requiredMark:!En,[En,tn,Ge]),un=Jt!=null?Jt:Ge==null?void 0:Ge.colon,xn=ke("form",ut),[_n,Hn]=Mt(xn),Yn=Fe()(xn,`${xn}-${qt}`,{[`${xn}-hide-required-mark`]:Kt===!1,[`${xn}-rtl`]:Ie==="rtl",[`${xn}-${Ft}`]:Ft},Hn,Ge==null?void 0:Ge.className,nt,ze),[yr]=Ye(Rt),{__INTERNAL__:rr}=yr;rr.name=Ue;const Wn=(0,be.useMemo)(()=>({name:Ue,labelAlign:pt,labelCol:bn,labelWrap:Ct,wrapperCol:ln,vertical:qt==="vertical",colon:un,requiredMark:Kt,itemRef:rr.itemRef,form:yr,feedbackIcons:Pt}),[Ue,pt,bn,ln,qt,un,Kt,yr,Pt]);be.useImperativeHandle(Ee,()=>yr);const xr=(mr,Gn)=>{if(mr){let Jn={block:"nearest"};typeof mr=="object"&&(Jn=mr),yr.scrollToField(Gn,Jn)}},gr=mr=>{if(An==null||An(mr),mr.errorFields.length){const Gn=mr.errorFields[0].name;if(On!==void 0){xr(On,Gn);return}Ge&&Ge.scrollToFirstError!==void 0&&xr(Ge.scrollToFirstError,Gn)}};return _n(be.createElement(ft.n,{disabled:kt},be.createElement(Dt.q,{size:Ft},be.createElement(Pe.RV,Object.assign({},{validateMessages:Gt}),be.createElement(Pe.q3.Provider,{value:Wn},be.createElement(et.default,Object.assign({id:Ue},Xt,{name:Ue,onFinishFailed:gr,form:yr,style:Object.assign(Object.assign({},Ge==null?void 0:Ge.style),At),className:Yn})))))))};var Zt=be.forwardRef(Qt),Vt=ue(41799),zt=ue(8654),ye=ue(92343),se=ue(11592);function oe(st){if(typeof st=="function")return st;const Ee=(0,se.Z)(st);return Ee.length<=1?Ee[0]:Ee}const de=()=>{const{status:st,errors:Ee=[],warnings:Te=[]}=(0,be.useContext)(Pe.aM);return{status:st,errors:Ee,warnings:Te}};de.Context=Pe.aM;var pe=de,le=ue(16089);function Be(st){const[Ee,Te]=be.useState(st),ke=(0,be.useRef)(null),Ie=(0,be.useRef)([]),Ge=(0,be.useRef)(!1);be.useEffect(()=>(Ge.current=!1,()=>{Ge.current=!0,le.Z.cancel(ke.current),ke.current=null}),[]);function ut(nt){Ge.current||(ke.current===null&&(Ie.current=[],ke.current=(0,le.Z)(()=>{ke.current=null,Te(ze=>{let ct=ze;return Ie.current.forEach(kt=>{ct=kt(ct)}),ct})})),Ie.current.push(nt))}return[Ee,ut]}function lt(){const{itemRef:st}=be.useContext(Pe.q3),Ee=be.useRef({});function Te(ke,Ie){const Ge=Ie&&typeof Ie=="object"&&Ie.ref,ut=ke.join("_");return(Ee.current.name!==ut||Ee.current.originRef!==Ge)&&(Ee.current.name=ut,Ee.current.originRef=Ge,Ee.current.ref=(0,zt.sQ)(st(ke),Ge)),Ee.current.ref}return Te}var Ot=ue(29194),It=ue(34280),Ht=ue(2738),Yt=ue(27382),an=ue(37028);const cn=st=>{const{formItemCls:Ee}=st;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${Ee}-control`]:{display:"flex"}}}};var Sn=(0,He.b)(["Form","item-item"],(st,Ee)=>{let{rootPrefixCls:Te}=Ee;const ke=Ve(st,Te);return[cn(ke)]}),on=st=>{const{prefixCls:Ee,status:Te,wrapperCol:ke,children:Ie,errors:Ge,warnings:ut,_internalItemRender:nt,extra:ze,help:ct,fieldId:kt,marginBottom:Rt,onErrorVisibleChanged:Jt}=st,pt=`${Ee}-item`,Ct=be.useContext(Pe.q3),bn=ke||Ct.wrapperCol||{},ln=Fe()(`${pt}-control`,bn.className),En=be.useMemo(()=>Object.assign({},Ct),[Ct]);delete En.labelCol,delete En.wrapperCol;const qt=be.createElement("div",{className:`${pt}-control-input`},be.createElement("div",{className:`${pt}-control-input-content`},Ie)),On=be.useMemo(()=>({prefixCls:Ee,status:Te}),[Ee,Te]),tn=Rt!==null||Ge.length||ut.length?be.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},be.createElement(Pe.Rk.Provider,{value:On},be.createElement(Tt,{fieldId:kt,errors:Ge,warnings:ut,help:ct,helpStatus:Te,className:`${pt}-explain-connected`,onVisibleChanged:Jt})),!!Rt&&be.createElement("div",{style:{width:0,height:Rt}})):null,An={};kt&&(An.id=`${kt}_extra`);const Ue=ze?be.createElement("div",Object.assign({},An,{className:`${pt}-extra`}),ze):null,At=nt&&nt.mark==="pro_table_render"&&nt.render?nt.render(st,{input:qt,errorList:tn,extra:Ue}):be.createElement(be.Fragment,null,qt,tn,Ue);return be.createElement(Pe.q3.Provider,{value:En},be.createElement(an.Z,Object.assign({},bn,{className:ln}),At),be.createElement(Sn,{prefixCls:Ee}))},Pn=ue(61485),ot=ue(31724),St=ue(9763),$t=ue(6848),Dn=function(st,Ee){var Te={};for(var ke in st)Object.prototype.hasOwnProperty.call(st,ke)&&Ee.indexOf(ke)<0&&(Te[ke]=st[ke]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ke=Object.getOwnPropertySymbols(st);Ie<ke.length;Ie++)Ee.indexOf(ke[Ie])<0&&Object.prototype.propertyIsEnumerable.call(st,ke[Ie])&&(Te[ke[Ie]]=st[ke[Ie]]);return Te};function Ln(st){return st?typeof st=="object"&&!be.isValidElement(st)?st:{title:st}:null}var qn=st=>{let{prefixCls:Ee,label:Te,htmlFor:ke,labelCol:Ie,labelAlign:Ge,colon:ut,required:nt,requiredMark:ze,tooltip:ct}=st;var kt;const[Rt]=(0,St.Z)("Form"),{vertical:Jt,labelAlign:pt,labelCol:Ct,labelWrap:bn,colon:ln}=be.useContext(Pe.q3);if(!Te)return null;const En=Ie||Ct||{},qt=Ge||pt,On=`${Ee}-item-label`,tn=Fe()(On,qt==="left"&&`${On}-left`,En.className,{[`${On}-wrap`]:!!bn});let An=Te;const Ue=ut===!0||ln!==!1&&ut!==!1;Ue&&!Jt&&typeof Te=="string"&&Te.trim()!==""&&(An=Te.replace(/[:|]\s*$/,""));const Pt=Ln(ct);if(Pt){const{icon:Kt=be.createElement(Pn.Z,null)}=Pt,un=Dn(Pt,["icon"]),xn=be.createElement($t.Z,Object.assign({},un),be.cloneElement(Kt,{className:`${Ee}-item-tooltip`,title:""}));An=be.createElement(be.Fragment,null,An,xn)}const Xt=ze==="optional",Ft=typeof ze=="function";Ft?An=ze(An,{required:!!nt}):Xt&&!nt&&(An=be.createElement(be.Fragment,null,An,be.createElement("span",{className:`${Ee}-item-optional`,title:""},(Rt==null?void 0:Rt.optional)||((kt=ot.Z.Form)===null||kt===void 0?void 0:kt.optional))));const Gt=Fe()({[`${Ee}-item-required`]:nt,[`${Ee}-item-required-mark-optional`]:Xt||Ft,[`${Ee}-item-no-colon`]:!Ue});return be.createElement(an.Z,Object.assign({},En,{className:tn}),be.createElement("label",{htmlFor:ke,className:Gt,title:typeof Te=="string"?Te:""},An))},dr=ue(29679),ir=ue(19248),Er=ue(96512),kr=ue(58617);const Qn={success:dr.Z,warning:Er.Z,error:ir.Z,validating:kr.Z};function Kr(st){let{children:Ee,errors:Te,warnings:ke,hasFeedback:Ie,validateStatus:Ge,prefixCls:ut,meta:nt,noStyle:ze}=st;const ct=`${ut}-item`,{feedbackIcons:kt}=be.useContext(Pe.q3),Rt=Wt(Te,ke,nt,null,!!Ie,Ge),{isFormItemInput:Jt,status:pt}=be.useContext(Pe.aM),Ct=be.useMemo(()=>{var bn;let ln;if(Ie){const On=Ie!==!0&&Ie.icons||kt,tn=Rt&&((bn=On==null?void 0:On({status:Rt,errors:Te,warnings:ke}))===null||bn===void 0?void 0:bn[Rt]),An=Rt&&Qn[Rt];ln=tn!==!1&&An?be.createElement("span",{className:Fe()(`${ct}-feedback-icon`,`${ct}-feedback-icon-${Rt}`)},tn||be.createElement(An,null)):null}let En=!0,qt=Rt||"";return ze&&(En=Jt,qt=(Rt!=null?Rt:pt)||""),{status:qt,errors:Te,warnings:ke,hasFeedback:!!Ie,feedbackIcon:ln,isFormItemInput:En}},[Rt,Ie,ze,Jt,pt]);return be.createElement(Pe.aM.Provider,{value:Ct},Ee)}var jr=function(st,Ee){var Te={};for(var ke in st)Object.prototype.hasOwnProperty.call(st,ke)&&Ee.indexOf(ke)<0&&(Te[ke]=st[ke]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ke=Object.getOwnPropertySymbols(st);Ie<ke.length;Ie++)Ee.indexOf(ke[Ie])<0&&Object.prototype.propertyIsEnumerable.call(st,ke[Ie])&&(Te[ke[Ie]]=st[ke[Ie]]);return Te};function Hr(st){const{prefixCls:Ee,className:Te,rootClassName:ke,style:Ie,help:Ge,errors:ut,warnings:nt,validateStatus:ze,meta:ct,hasFeedback:kt,hidden:Rt,children:Jt,fieldId:pt,required:Ct,isRequired:bn,onSubItemMetaChange:ln}=st,En=jr(st,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),qt=`${Ee}-item`,{requiredMark:On}=be.useContext(Pe.q3),tn=be.useRef(null),An=we(ut),Ue=we(nt),At=Ge!=null,Pt=!!(At||ut.length||nt.length),Xt=!!tn.current&&(0,Ot.Z)(tn.current),[Ft,Gt]=be.useState(null);(0,It.Z)(()=>{if(Pt&&tn.current){const Hn=getComputedStyle(tn.current);Gt(parseInt(Hn.marginBottom,10))}},[Pt,Xt]);const Kt=Hn=>{Hn||Gt(null)},xn=function(){let Hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Yn=Hn?An:ct.errors,yr=Hn?Ue:ct.warnings;return Wt(Yn,yr,ct,"",!!kt,ze)}(),_n=Fe()(qt,Te,ke,{[`${qt}-with-help`]:At||An.length||Ue.length,[`${qt}-has-feedback`]:xn&&kt,[`${qt}-has-success`]:xn==="success",[`${qt}-has-warning`]:xn==="warning",[`${qt}-has-error`]:xn==="error",[`${qt}-is-validating`]:xn==="validating",[`${qt}-hidden`]:Rt});return be.createElement("div",{className:_n,style:Ie,ref:tn},be.createElement(Yt.Z,Object.assign({className:`${qt}-row`},(0,Ht.Z)(En,["_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"])),be.createElement(qn,Object.assign({htmlFor:pt},st,{requiredMark:On,required:Ct!=null?Ct:bn,prefixCls:Ee})),be.createElement(on,Object.assign({},st,ct,{errors:An,warnings:Ue,prefixCls:Ee,status:xn,help:Ge,marginBottom:Ft,onErrorVisibleChanged:Kt}),be.createElement(Pe.qI.Provider,{value:ln},be.createElement(Kr,{prefixCls:Ee,meta:ct,errors:ct.errors,warnings:ct.warnings,hasFeedback:kt,validateStatus:xn},Jt)))),!!Ft&&be.createElement("div",{className:`${qt}-margin-offset`,style:{marginBottom:-Ft}}))}const ni="__SPLIT__",Br=null,qr=be.memo(st=>{let{children:Ee}=st;return Ee},(st,Ee)=>st.value===Ee.value&&st.update===Ee.update&&st.childProps.length===Ee.childProps.length&&st.childProps.every((Te,ke)=>Te===Ee.childProps[ke]));function Cr(st){return st!=null}function yn(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function wn(st){const{name:Ee,noStyle:Te,className:ke,dependencies:Ie,prefixCls:Ge,shouldUpdate:ut,rules:nt,children:ze,required:ct,label:kt,messageVariables:Rt,trigger:Jt="onChange",validateTrigger:pt,hidden:Ct,help:bn}=st,{getPrefixCls:ln}=be.useContext(Ut.E_),{name:En}=be.useContext(Pe.q3),qt=oe(ze),On=typeof qt=="function",tn=be.useContext(Pe.qI),{validateTrigger:An}=be.useContext(et.FieldContext),Ue=pt!==void 0?pt:An,At=Cr(Ee),Pt=ln("form",Ge),[Xt,Ft]=Mt(Pt),Gt=be.useContext(et.ListContext),Kt=be.useRef(),[un,xn]=Be({}),[_n,Hn]=(0,Vt.Z)(()=>yn()),Yn=Gn=>{const Jn=Gt==null?void 0:Gt.getKey(Gn.name);if(Hn(Gn.destroy?yn():Gn,!0),Te&&bn!==!1&&tn){let hr=Gn.name;if(Gn.destroy)hr=Kt.current||hr;else if(Jn!==void 0){const[tr,_r]=Jn;hr=[tr].concat((0,fe.Z)(_r)),Kt.current=hr}tn(Gn,hr)}},yr=(Gn,Jn)=>{xn(hr=>{const tr=Object.assign({},hr),Wr=[].concat((0,fe.Z)(Gn.name.slice(0,-1)),(0,fe.Z)(Jn)).join(ni);return Gn.destroy?delete tr[Wr]:tr[Wr]=Gn,tr})},[rr,Wn]=be.useMemo(()=>{const Gn=(0,fe.Z)(_n.errors),Jn=(0,fe.Z)(_n.warnings);return Object.values(un).forEach(hr=>{Gn.push.apply(Gn,(0,fe.Z)(hr.errors||[])),Jn.push.apply(Jn,(0,fe.Z)(hr.warnings||[]))}),[Gn,Jn]},[un,_n.errors,_n.warnings]),xr=lt();function gr(Gn,Jn,hr){return Te&&!Ct?be.createElement(Kr,{prefixCls:Pt,hasFeedback:st.hasFeedback,validateStatus:st.validateStatus,meta:_n,errors:rr,warnings:Wn,noStyle:!0},Gn):be.createElement(Hr,Object.assign({key:"row"},st,{className:Fe()(ke,Ft),prefixCls:Pt,fieldId:Jn,isRequired:hr,errors:rr,warnings:Wn,meta:_n,onSubItemMetaChange:yr}),Gn)}if(!At&&!On&&!Ie)return Xt(gr(qt));let mr={};return typeof kt=="string"?mr.label=kt:Ee&&(mr.label=String(Ee)),Rt&&(mr=Object.assign(Object.assign({},mr),Rt)),Xt(be.createElement(et.Field,Object.assign({},st,{messageVariables:mr,trigger:Jt,validateTrigger:Ue,onMetaChange:Yn}),(Gn,Jn,hr)=>{const tr=gt(Ee).length&&Jn?Jn.name:[],_r=en(tr,En),Wr=ct!==void 0?ct:!!(nt&&nt.some(Cn=>{if(Cn&&typeof Cn=="object"&&Cn.required&&!Cn.warningOnly)return!0;if(typeof Cn=="function"){const Xn=Cn(hr);return Xn&&Xn.required&&!Xn.warningOnly}return!1})),fr=Object.assign({},Gn);let kn=null;if(Array.isArray(qt)&&At)kn=qt;else if(!(On&&(!(ut||Ie)||At))){if(!(Ie&&!On&&!At))if((0,ye.l$)(qt)){const Cn=Object.assign(Object.assign({},qt.props),fr);if(Cn.id||(Cn.id=_r),bn||rr.length>0||Wn.length>0||st.extra){const Sr=[];(bn||rr.length>0)&&Sr.push(`${_r}_help`),st.extra&&Sr.push(`${_r}_extra`),Cn["aria-describedby"]=Sr.join(" ")}rr.length>0&&(Cn["aria-invalid"]="true"),Wr&&(Cn["aria-required"]="true"),(0,zt.Yr)(qt)&&(Cn.ref=xr(tr,qt)),new Set([].concat((0,fe.Z)(gt(Jt)),(0,fe.Z)(gt(Ue)))).forEach(Sr=>{Cn[Sr]=function(){for(var Ar,lr,Vr,Tr,si,or=arguments.length,nr=new Array(or),Ir=0;Ir<or;Ir++)nr[Ir]=arguments[Ir];(Vr=fr[Sr])===null||Vr===void 0||(Ar=Vr).call.apply(Ar,[fr].concat(nr)),(si=(Tr=qt.props)[Sr])===null||si===void 0||(lr=si).call.apply(lr,[Tr].concat(nr))}});const Fn=[Cn["aria-required"],Cn["aria-invalid"],Cn["aria-describedby"]];kn=be.createElement(qr,{value:fr[st.valuePropName||"value"],update:qt,childProps:Fn},(0,ye.Tm)(qt,Cn))}else On&&(ut||Ie)&&!At?kn=qt(hr):kn=qt}return gr(kn,_r,Wr)}))}const fn=wn;fn.useStatus=pe;var Rn=fn,br=function(st,Ee){var Te={};for(var ke in st)Object.prototype.hasOwnProperty.call(st,ke)&&Ee.indexOf(ke)<0&&(Te[ke]=st[ke]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ke=Object.getOwnPropertySymbols(st);Ie<ke.length;Ie++)Ee.indexOf(ke[Ie])<0&&Object.prototype.propertyIsEnumerable.call(st,ke[Ie])&&(Te[ke[Ie]]=st[ke[Ie]]);return Te},ar=st=>{var{prefixCls:Ee,children:Te}=st,ke=br(st,["prefixCls","children"]);const{getPrefixCls:Ie}=be.useContext(Ut.E_),Ge=Ie("form",Ee),ut=be.useMemo(()=>({prefixCls:Ge,status:"error"}),[Ge]);return be.createElement(et.List,Object.assign({},ke),(nt,ze,ct)=>be.createElement(Pe.Rk.Provider,{value:ut},Te(nt.map(kt=>Object.assign(Object.assign({},kt),{fieldKey:kt.key})),ze,{errors:ct.errors,warnings:ct.warnings})))};function vn(){const{form:st}=(0,be.useContext)(Pe.q3);return st}const pn=Zt;pn.Item=Rn,pn.List=ar,pn.ErrorList=Tt,pn.useForm=Ye,pn.useFormInstance=vn,pn.useWatch=et.useWatch,pn.Provider=Pe.RV,pn.create=()=>{};var Nn=pn},11611:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return ut}});var fe=ue(59301),Ze=ue(15277),Fe=ue(92310),tt=ue.n(Fe),be=ue(60499),De=ue(85899),Pe=ue(18642),we=ue(72190),_e=ue(43749),Ne=ue(42244),dt=ue(55468),Ae=ue(18929),He=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"],rt=fe.createContext(null),je=0;function it(nt,ze){var ct=fe.useState(function(){return je+=1,String(je)}),kt=(0,we.Z)(ct,1),Rt=kt[0],Jt=fe.useContext(rt),pt={data:ze,canPreview:nt};return fe.useEffect(function(){if(Jt)return Jt.register(Rt,pt)},[]),fe.useEffect(function(){Jt&&Jt.register(Rt,pt)},[nt,ze]),Rt}function at(nt){return new Promise(function(ze){var ct=document.createElement("img");ct.onerror=function(){return ze(!1)},ct.onload=function(){return ze(!0)},ct.src=nt})}function xt(nt){var ze=nt.src,ct=nt.isCustomPlaceholder,kt=nt.fallback,Rt=(0,fe.useState)(ct?"loading":"normal"),Jt=(0,we.Z)(Rt,2),pt=Jt[0],Ct=Jt[1],bn=(0,fe.useRef)(!1),ln=pt==="error";(0,fe.useEffect)(function(){at(ze).then(function(tn){tn||Ct("error")})},[ze]),(0,fe.useEffect)(function(){ct&&!bn.current?Ct("loading"):ln&&Ct("normal")},[ze]);var En=function(){Ct("normal")},qt=function(An){bn.current=!1,pt==="loading"&&An!=null&&An.complete&&(An.naturalWidth||An.naturalHeight)&&(bn.current=!0,En())},On=ln&&kt?{src:kt}:{onLoad:En,src:ze};return[qt,On,pt]}var jt=ue(86923),Qe=ue(8224),mt=ue(10228),We=ue(48736);function Me(nt,ze,ct,kt){var Rt=ze+ct,Jt=(ct-kt)/2;if(ct>kt){if(ze>0)return(0,Pe.Z)({},nt,Jt);if(ze<0&&Rt<kt)return(0,Pe.Z)({},nt,-Jt)}else if(ze<0||Rt>kt)return(0,Pe.Z)({},nt,ze<0?Jt:-Jt);return{}}function Ke(nt,ze,ct,kt){var Rt=(0,dt.g1)(),Jt=Rt.width,pt=Rt.height,Ct=null;return nt<=Jt&&ze<=pt?Ct={x:0,y:0}:(nt>Jt||ze>pt)&&(Ct=(0,De.Z)((0,De.Z)({},Me("x",ct,nt,Jt)),Me("y",kt,ze,pt))),Ct}var Ve=ue(13697),Mt=ue(16089),Xe={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function Nt(nt,ze,ct,kt){var Rt=(0,fe.useRef)(null),Jt=(0,fe.useRef)([]),pt=(0,fe.useState)(Xe),Ct=(0,we.Z)(pt,2),bn=Ct[0],ln=Ct[1],En=function(An){ln(Xe),kt&&!(0,Ve.Z)(Xe,bn)&&kt({transform:Xe,action:An})},qt=function(An,Ue){Rt.current===null&&(Jt.current=[],Rt.current=(0,Mt.Z)(function(){ln(function(At){var Pt=At;return Jt.current.forEach(function(Xt){Pt=(0,De.Z)((0,De.Z)({},Pt),Xt)}),Rt.current=null,kt==null||kt({transform:Pt,action:Ue}),Pt})})),Jt.current.push((0,De.Z)((0,De.Z)({},bn),An))},On=function(An,Ue,At,Pt){var Xt=nt.current,Ft=Xt.width,Gt=Xt.height,Kt=Xt.offsetWidth,un=Xt.offsetHeight,xn=Xt.offsetLeft,_n=Xt.offsetTop,Hn=An,Yn=bn.scale*An;Yn>ct?(Hn=ct/bn.scale,Yn=ct):Yn<ze&&(Hn=ze/bn.scale,Yn=ze);var yr=At!=null?At:innerWidth/2,rr=Pt!=null?Pt:innerHeight/2,Wn=Hn-1,xr=Wn*Ft*.5,gr=Wn*Gt*.5,mr=Wn*(yr-bn.x-xn),Gn=Wn*(rr-bn.y-_n),Jn=bn.x-(mr-xr),hr=bn.y-(Gn-gr);if(An<1&&Yn===1){var tr=Kt*Yn,_r=un*Yn,Wr=(0,dt.g1)(),fr=Wr.width,kn=Wr.height;tr<=fr&&_r<=kn&&(Jn=0,hr=0)}qt({x:Jn,y:hr,scale:Yn},Ue)};return{transform:bn,resetTransform:En,updateTransform:qt,dispatchZoomChange:On}}var ht=ue(43403),Tt=ue(77900),et=function(ze){var ct=ze.visible,kt=ze.maskTransitionName,Rt=ze.getContainer,Jt=ze.prefixCls,pt=ze.rootClassName,Ct=ze.icons,bn=ze.countRender,ln=ze.showSwitch,En=ze.showProgress,qt=ze.current,On=ze.transform,tn=ze.count,An=ze.scale,Ue=ze.minScale,At=ze.maxScale,Pt=ze.closeIcon,Xt=ze.onSwitchLeft,Ft=ze.onSwitchRight,Gt=ze.onClose,Kt=ze.onZoomIn,un=ze.onZoomOut,xn=ze.onRotateRight,_n=ze.onRotateLeft,Hn=ze.onFlipX,Yn=ze.onFlipY,yr=ze.toolbarRender,rr=(0,fe.useContext)(rt),Wn=Ct.rotateLeft,xr=Ct.rotateRight,gr=Ct.zoomIn,mr=Ct.zoomOut,Gn=Ct.close,Jn=Ct.left,hr=Ct.right,tr=Ct.flipX,_r=Ct.flipY,Wr="".concat(Jt,"-operations-operation");fe.useEffect(function(){var Xn=function(Sr){Sr.keyCode===mt.Z.ESC&&Gt()};return ct&&window.addEventListener("keydown",Xn),function(){window.removeEventListener("keydown",Xn)}},[ct]);var fr=[{icon:_r,onClick:Yn,type:"flipY"},{icon:tr,onClick:Hn,type:"flipX"},{icon:Wn,onClick:_n,type:"rotateLeft"},{icon:xr,onClick:xn,type:"rotateRight"},{icon:mr,onClick:un,type:"zoomOut",disabled:An===Ue},{icon:gr,onClick:Kt,type:"zoomIn",disabled:An===At}],kn=fr.map(function(Xn){var Fn,Sr=Xn.icon,Ar=Xn.onClick,lr=Xn.type,Vr=Xn.disabled;return fe.createElement("div",{className:tt()(Wr,(Fn={},(0,Pe.Z)(Fn,"".concat(Jt,"-operations-operation-").concat(lr),!0),(0,Pe.Z)(Fn,"".concat(Jt,"-operations-operation-disabled"),!!Vr),Fn)),onClick:Ar,key:lr},Sr)}),Cn=fe.createElement("div",{className:"".concat(Jt,"-operations")},kn);return fe.createElement(Tt.default,{visible:ct,motionName:kt},function(Xn){var Fn=Xn.className,Sr=Xn.style;return fe.createElement(ht.Z,{open:!0,getContainer:Rt!=null?Rt:document.body},fe.createElement("div",{className:tt()("".concat(Jt,"-operations-wrapper"),Fn,pt),style:Sr},Pt===null?null:fe.createElement("button",{className:"".concat(Jt,"-close"),onClick:Gt},Pt||Gn),ln&&fe.createElement(fe.Fragment,null,fe.createElement("div",{className:tt()("".concat(Jt,"-switch-left"),(0,Pe.Z)({},"".concat(Jt,"-switch-left-disabled"),qt===0)),onClick:Xt},Jn),fe.createElement("div",{className:tt()("".concat(Jt,"-switch-right"),(0,Pe.Z)({},"".concat(Jt,"-switch-right-disabled"),qt===tn-1)),onClick:Ft},hr)),fe.createElement("div",{className:"".concat(Jt,"-footer")},En&&fe.createElement("div",{className:"".concat(Jt,"-progress")},bn?bn(qt+1,tn):"".concat(qt+1," / ").concat(tn)),yr?yr(Cn,(0,De.Z)({icons:{flipYIcon:kn[0],flipXIcon:kn[1],rotateLeftIcon:kn[2],rotateRightIcon:kn[3],zoomOutIcon:kn[4],zoomInIcon:kn[5]},actions:{onFlipY:Yn,onFlipX:Hn,onRotateLeft:_n,onRotateRight:xn,onZoomOut:un,onZoomIn:Kt},transform:On},rr?{current:qt,total:tn}:{})):Cn)))})},Ut=et,ft=1,Dt=1,Bt=["fallback","src","imgRef"],bt=["prefixCls","src","alt","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],$e=function(ze){var ct=ze.fallback,kt=ze.src,Rt=ze.imgRef,Jt=(0,Ne.Z)(ze,Bt),pt=xt({src:kt,fallback:ct}),Ct=(0,we.Z)(pt,2),bn=Ct[0],ln=Ct[1];return fe.createElement("img",(0,be.Z)({ref:function(qt){Rt.current=qt,bn(qt)}},Jt,ln))},xe=function(ze){var ct=ze.prefixCls,kt=ze.src,Rt=ze.alt,Jt=ze.fallback,pt=ze.movable,Ct=pt===void 0?!0:pt,bn=ze.onClose,ln=ze.visible,En=ze.icons,qt=En===void 0?{}:En,On=ze.rootClassName,tn=ze.closeIcon,An=ze.getContainer,Ue=ze.current,At=Ue===void 0?0:Ue,Pt=ze.count,Xt=Pt===void 0?1:Pt,Ft=ze.countRender,Gt=ze.scaleStep,Kt=Gt===void 0?.5:Gt,un=ze.minScale,xn=un===void 0?1:un,_n=ze.maxScale,Hn=_n===void 0?50:_n,Yn=ze.transitionName,yr=Yn===void 0?"zoom":Yn,rr=ze.maskTransitionName,Wn=rr===void 0?"fade":rr,xr=ze.imageRender,gr=ze.imgCommonProps,mr=ze.toolbarRender,Gn=ze.onTransform,Jn=ze.onChange,hr=(0,Ne.Z)(ze,bt),tr=(0,fe.useRef)(),_r=(0,fe.useRef)({deltaX:0,deltaY:0,transformX:0,transformY:0}),Wr=(0,fe.useState)(!1),fr=(0,we.Z)(Wr,2),kn=fr[0],Cn=fr[1],Xn=(0,fe.useContext)(rt),Fn=Xn&&Xt>1,Sr=Xn&&Xt>=1,Ar=Nt(tr,xn,Hn,Gn),lr=Ar.transform,Vr=Ar.resetTransform,Tr=Ar.updateTransform,si=Ar.dispatchZoomChange,or=(0,fe.useState)(!0),nr=(0,we.Z)(or,2),Ir=nr[0],Lr=nr[1],ti=lr.rotate,yi=lr.scale,bi=lr.x,Gr=lr.y,gi=tt()((0,Pe.Z)({},"".concat(ct,"-moving"),kn));(0,fe.useEffect)(function(){Ir||Lr(!0)},[Ir]);var pi=function(){Vr("close")},Zn=function(){si(ft+Kt,"zoomIn")},Un=function(){si(ft/(ft+Kt),"zoomOut")},jn=function(){Tr({rotate:ti+90},"rotateRight")},ur=function(){Tr({rotate:ti-90},"rotateLeft")},Yr=function(){Tr({flipX:!lr.flipX},"flipX")},li=function(){Tr({flipY:!lr.flipY},"flipY")},fi=function(Qr){Qr==null||Qr.preventDefault(),Qr==null||Qr.stopPropagation(),At>0&&(Lr(!1),Vr("prev"),Jn==null||Jn(At-1,At))},di=function(Qr){Qr==null||Qr.preventDefault(),Qr==null||Qr.stopPropagation(),At<Xt-1&&(Lr(!1),Vr("next"),Jn==null||Jn(At+1,At))},ii=function(){if(ln&&kn){Cn(!1);var Qr=_r.current,Vi=Qr.transformX,$i=Qr.transformY,ci=bi!==Vi&&Gr!==$i;if(!ci)return;var Pr=tr.current.offsetWidth*yi,Ur=tr.current.offsetHeight*yi,zr=tr.current.getBoundingClientRect(),Or=zr.left,ai=zr.top,ri=ti%180!==0,Ai=Ke(ri?Ur:Pr,ri?Pr:Ur,Or,ai);Ai&&Tr((0,De.Z)({},Ai),"dragRebound")}},Si=function(Qr){!Ct||Qr.button!==0||(Qr.preventDefault(),Qr.stopPropagation(),_r.current={deltaX:Qr.pageX-lr.x,deltaY:Qr.pageY-lr.y,transformX:lr.x,transformY:lr.y},Cn(!0))},Fi=function(Qr){ln&&kn&&Tr({x:Qr.pageX-_r.current.deltaX,y:Qr.pageY-_r.current.deltaY},"move")},Ii=function(Qr){if(!(!ln||Qr.deltaY==0)){var Vi=Math.abs(Qr.deltaY/100),$i=Math.min(Vi,Dt),ci=ft+$i*Kt;Qr.deltaY>0&&(ci=ft/ci),si(ci,"wheel",Qr.clientX,Qr.clientY)}},la=function(Qr){!ln||!Fn||(Qr.keyCode===mt.Z.LEFT?fi():Qr.keyCode===mt.Z.RIGHT&&di())},ea=function(Qr){ln&&(yi!==1?Tr({x:0,y:0,scale:1},"doubleClick"):si(ft+Kt,"doubleClick",Qr.clientX,Qr.clientY))};(0,fe.useEffect)(function(){var ki,Qr,Vi,$i;if(Ct){Vi=(0,Qe.Z)(window,"mouseup",ii,!1),$i=(0,Qe.Z)(window,"mousemove",Fi,!1);try{window.top!==window.self&&(ki=(0,Qe.Z)(window.top,"mouseup",ii,!1),Qr=(0,Qe.Z)(window.top,"mousemove",Fi,!1))}catch(ci){(0,We.Kp)(!1,"[rc-image] ".concat(ci))}}return function(){var ci,Pr,Ur,zr;(ci=Vi)===null||ci===void 0||ci.remove(),(Pr=$i)===null||Pr===void 0||Pr.remove(),(Ur=ki)===null||Ur===void 0||Ur.remove(),(zr=Qr)===null||zr===void 0||zr.remove()}},[ln,kn,bi,Gr,ti,Ct]),(0,fe.useEffect)(function(){var ki=(0,Qe.Z)(window,"keydown",la,!1);return function(){ki.remove()}},[ln,Fn,At]);var Pi=fe.createElement($e,(0,be.Z)({},gr,{width:ze.width,height:ze.height,imgRef:tr,className:"".concat(ct,"-img"),alt:Rt,style:{transform:"translate3d(".concat(lr.x,"px, ").concat(lr.y,"px, 0) scale3d(").concat(lr.flipX?"-":"").concat(yi,", ").concat(lr.flipY?"-":"").concat(yi,", 1) rotate(").concat(ti,"deg)"),transitionDuration:!Ir&&"0s"},fallback:Jt,src:kt,onWheel:Ii,onMouseDown:Si,onDoubleClick:ea}));return fe.createElement(fe.Fragment,null,fe.createElement(jt.Z,(0,be.Z)({transitionName:yr,maskTransitionName:Wn,closable:!1,keyboard:!0,prefixCls:ct,onClose:bn,visible:ln,wrapClassName:gi,rootClassName:On,getContainer:An},hr,{afterClose:pi}),fe.createElement("div",{className:"".concat(ct,"-img-wrapper")},xr?xr(Pi,(0,De.Z)({transform:lr},Xn?{current:At}:{})):Pi)),fe.createElement(Ut,{visible:ln,transform:lr,maskTransitionName:Wn,closeIcon:tn,getContainer:An,prefixCls:ct,rootClassName:On,icons:qt,countRender:Ft,showSwitch:Fn,showProgress:Sr,current:At,count:Xt,scale:yi,minScale:xn,maxScale:Hn,toolbarRender:mr,onSwitchLeft:fi,onSwitchRight:di,onZoomIn:Zn,onZoomOut:Un,onRotateRight:jn,onRotateLeft:ur,onFlipX:Yr,onFlipY:li,onClose:bn}))},gt=xe,en=ue(77654);function Wt(nt){var ze=fe.useState({}),ct=(0,we.Z)(ze,2),kt=ct[0],Rt=ct[1],Jt=fe.useCallback(function(Ct,bn){return Rt(function(ln){return(0,De.Z)((0,De.Z)({},ln),{},(0,Pe.Z)({},Ct,bn))}),function(){Rt(function(ln){var En=(0,De.Z)({},ln);return delete En[Ct],En})}},[]),pt=fe.useMemo(function(){return nt?nt.map(function(Ct){if(typeof Ct=="string")return{data:{src:Ct}};var bn={};return Object.keys(Ct).forEach(function(ln){["src"].concat((0,en.Z)(He)).includes(ln)&&(bn[ln]=Ct[ln])}),{data:bn}}):Object.keys(kt).reduce(function(Ct,bn){var ln=kt[bn],En=ln.canPreview,qt=ln.data;return En&&Ct.push({data:qt,id:bn}),Ct},[])},[nt,kt]);return[pt,Jt]}var qe=["visible","onVisibleChange","getContainer","current","movable","minScale","maxScale","countRender","closeIcon","onChange","onTransform","toolbarRender","imageRender"],Ye=["src"],Lt=function(ze){var ct,kt=ze.previewPrefixCls,Rt=kt===void 0?"rc-image-preview":kt,Jt=ze.children,pt=ze.icons,Ct=pt===void 0?{}:pt,bn=ze.items,ln=ze.preview,En=ze.fallback,qt=(0,_e.Z)(ln)==="object"?ln:{},On=qt.visible,tn=qt.onVisibleChange,An=qt.getContainer,Ue=qt.current,At=qt.movable,Pt=qt.minScale,Xt=qt.maxScale,Ft=qt.countRender,Gt=qt.closeIcon,Kt=qt.onChange,un=qt.onTransform,xn=qt.toolbarRender,_n=qt.imageRender,Hn=(0,Ne.Z)(qt,qe),Yn=Wt(bn),yr=(0,we.Z)(Yn,2),rr=yr[0],Wn=yr[1],xr=(0,Ae.Z)(0,{value:Ue}),gr=(0,we.Z)(xr,2),mr=gr[0],Gn=gr[1],Jn=(0,fe.useState)(!1),hr=(0,we.Z)(Jn,2),tr=hr[0],_r=hr[1],Wr=((ct=rr[mr])===null||ct===void 0?void 0:ct.data)||{},fr=Wr.src,kn=(0,Ne.Z)(Wr,Ye),Cn=(0,Ae.Z)(!!On,{value:On,onChange:function(ti,yi){tn==null||tn(ti,yi,mr)}}),Xn=(0,we.Z)(Cn,2),Fn=Xn[0],Sr=Xn[1],Ar=(0,fe.useState)(null),lr=(0,we.Z)(Ar,2),Vr=lr[0],Tr=lr[1],si=fe.useCallback(function(Lr,ti,yi){var bi=rr.findIndex(function(Gr){return Gr.id===Lr});Sr(!0),Tr({x:ti,y:yi}),Gn(bi<0?0:bi),_r(!0)},[rr]);fe.useEffect(function(){Fn?tr||Gn(0):_r(!1)},[Fn]);var or=function(ti,yi){Gn(ti),Kt==null||Kt(ti,yi)},nr=function(){Sr(!1),Tr(null)},Ir=fe.useMemo(function(){return{register:Wn,onPreview:si}},[Wn,si]);return fe.createElement(rt.Provider,{value:Ir},Jt,fe.createElement(gt,(0,be.Z)({"aria-hidden":!Fn,movable:At,visible:Fn,prefixCls:Rt,closeIcon:Gt,onClose:nr,mousePosition:Vr,imgCommonProps:kn,src:fr,fallback:En,icons:Ct,minScale:Pt,maxScale:Xt,getContainer:An,current:mr,count:rr.length,countRender:Ft,onTransform:un,toolbarRender:xn,imageRender:_n,onChange:or},Hn)))},mn=Lt,Qt=["src","alt","onPreviewClose","prefixCls","previewPrefixCls","placeholder","fallback","width","height","style","preview","className","onClick","onError","wrapperClassName","wrapperStyle","rootClassName"],dn=["src","visible","onVisibleChange","getContainer","mask","maskClassName","movable","icons","scaleStep","minScale","maxScale","imageRender","toolbarRender"],Zt=function(ze){var ct=ze.src,kt=ze.alt,Rt=ze.onPreviewClose,Jt=ze.prefixCls,pt=Jt===void 0?"rc-image":Jt,Ct=ze.previewPrefixCls,bn=Ct===void 0?"".concat(pt,"-preview"):Ct,ln=ze.placeholder,En=ze.fallback,qt=ze.width,On=ze.height,tn=ze.style,An=ze.preview,Ue=An===void 0?!0:An,At=ze.className,Pt=ze.onClick,Xt=ze.onError,Ft=ze.wrapperClassName,Gt=ze.wrapperStyle,Kt=ze.rootClassName,un=(0,Ne.Z)(ze,Qt),xn=ln&&ln!==!0,_n=(0,_e.Z)(Ue)==="object"?Ue:{},Hn=_n.src,Yn=_n.visible,yr=Yn===void 0?void 0:Yn,rr=_n.onVisibleChange,Wn=rr===void 0?Rt:rr,xr=_n.getContainer,gr=xr===void 0?void 0:xr,mr=_n.mask,Gn=_n.maskClassName,Jn=_n.movable,hr=_n.icons,tr=_n.scaleStep,_r=_n.minScale,Wr=_n.maxScale,fr=_n.imageRender,kn=_n.toolbarRender,Cn=(0,Ne.Z)(_n,dn),Xn=Hn!=null?Hn:ct,Fn=(0,Ae.Z)(!!yr,{value:yr,onChange:Wn}),Sr=(0,we.Z)(Fn,2),Ar=Sr[0],lr=Sr[1],Vr=xt({src:ct,isCustomPlaceholder:xn,fallback:En}),Tr=(0,we.Z)(Vr,3),si=Tr[0],or=Tr[1],nr=Tr[2],Ir=(0,fe.useState)(null),Lr=(0,we.Z)(Ir,2),ti=Lr[0],yi=Lr[1],bi=(0,fe.useContext)(rt),Gr=!!Ue,gi=function(){lr(!1),yi(null)},pi=tt()(pt,Ft,Kt,(0,Pe.Z)({},"".concat(pt,"-error"),nr==="error")),Zn=(0,fe.useMemo)(function(){var Yr={};return He.forEach(function(li){ze[li]!==void 0&&(Yr[li]=ze[li])}),Yr},He.map(function(Yr){return ze[Yr]})),Un=(0,fe.useMemo)(function(){return(0,De.Z)((0,De.Z)({},Zn),{},{src:Xn})},[Xn,Zn]),jn=it(Gr,Un),ur=function(li){var fi=(0,dt.os)(li.target),di=fi.left,ii=fi.top;bi?bi.onPreview(jn,di,ii):(yi({x:di,y:ii}),lr(!0)),Pt==null||Pt(li)};return fe.createElement(fe.Fragment,null,fe.createElement("div",(0,be.Z)({},un,{className:pi,onClick:Gr?ur:Pt,style:(0,De.Z)({width:qt,height:On},Gt)}),fe.createElement("img",(0,be.Z)({},Zn,{className:tt()("".concat(pt,"-img"),(0,Pe.Z)({},"".concat(pt,"-img-placeholder"),ln===!0),At),style:(0,De.Z)({height:On},tn),ref:si},or,{width:qt,height:On,onError:Xt})),nr==="loading"&&fe.createElement("div",{"aria-hidden":"true",className:"".concat(pt,"-placeholder")},ln),mr&&Gr&&fe.createElement("div",{className:tt()("".concat(pt,"-mask"),Gn),style:{display:(tn==null?void 0:tn.display)==="none"?"none":void 0}},mr)),!bi&&Gr&&fe.createElement(gt,(0,be.Z)({"aria-hidden":!Ar,visible:Ar,prefixCls:bn,onClose:gi,mousePosition:ti,src:Xn,alt:kt,fallback:En,getContainer:gr,icons:hr,movable:Jn,scaleStep:tr,minScale:_r,maxScale:Wr,rootClassName:Kt,imageRender:fr,imgCommonProps:Zn,toolbarRender:kn},Cn)))};Zt.PreviewGroup=mn,Zt.displayName="Image";var Vt=Zt,zt=Vt,ye=ue(62892),se=ue(36355),oe=ue(31724),de=ue(99267),pe=ue(33853),le=ue(38819),Be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"},lt=Be,Ot=ue(7657),It=function(ze,ct){return fe.createElement(Ot.Z,(0,be.Z)({},ze,{ref:ct,icon:lt}))},Ht=fe.forwardRef(It),Yt=Ht,an={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z"}},{tag:"path",attrs:{d:"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z"}}]},name:"rotate-right",theme:"outlined"},cn=an,Sn=function(ze,ct){return fe.createElement(Ot.Z,(0,be.Z)({},ze,{ref:ct,icon:cn}))},wt=fe.forwardRef(Sn),on=wt,Pn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},ot=Pn,St=function(ze,ct){return fe.createElement(Ot.Z,(0,be.Z)({},ze,{ref:ct,icon:ot}))},$t=fe.forwardRef(St),Dn=$t,Ln={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},In=Ln,qn=function(ze,ct){return fe.createElement(Ot.Z,(0,be.Z)({},ze,{ref:ct,icon:In}))},dr=fe.forwardRef(qn),ir=dr,Er={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},kr=Er,Qn=function(ze,ct){return fe.createElement(Ot.Z,(0,be.Z)({},ze,{ref:ct,icon:kr}))},Kr=fe.forwardRef(Qn),jr=Kr,Hr=ue(64993),ni=ue(73819),Br=ue(17313),qr=ue(29878),Cr=ue(1950),yn=ue(83116),wn=ue(37613);const fn=nt=>({position:nt||"absolute",inset:0}),Rn=nt=>{const{iconCls:ze,motionDurationSlow:ct,paddingXXS:kt,marginXXS:Rt,prefixCls:Jt,colorTextLightSolid:pt}=nt;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:pt,background:new Hr.C("#000").setAlpha(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${ct}`,[`.${Jt}-mask-info`]:Object.assign(Object.assign({},Br.vS),{padding:`0 ${kt}px`,[ze]:{marginInlineEnd:Rt,svg:{verticalAlign:"baseline"}}})}},br=nt=>{const{previewCls:ze,modalMaskBg:ct,paddingSM:kt,marginXL:Rt,margin:Jt,paddingLG:pt,previewOperationColorDisabled:Ct,previewOperationHoverColor:bn,motionDurationSlow:ln,iconCls:En,colorTextLightSolid:qt}=nt,On=new Hr.C(ct).setAlpha(.1),tn=On.clone().setAlpha(.2);return{[`${ze}-footer`]:{position:"fixed",bottom:Rt,left:{_skip_check_:!0,value:0},width:"100%",display:"flex",flexDirection:"column",alignItems:"center",color:nt.previewOperationColor},[`${ze}-progress`]:{marginBottom:Jt},[`${ze}-close`]:{position:"fixed",top:Rt,right:{_skip_check_:!0,value:Rt},display:"flex",color:qt,backgroundColor:On.toRgbString(),borderRadius:"50%",padding:kt,outline:0,border:0,cursor:"pointer",transition:`all ${ln}`,"&:hover":{backgroundColor:tn.toRgbString()},[`& > ${En}`]:{fontSize:nt.previewOperationSize}},[`${ze}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${pt}px`,backgroundColor:On.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:kt,padding:kt,cursor:"pointer",transition:`all ${ln}`,userSelect:"none",[`&:not(${ze}-operations-operation-disabled):hover > ${En}`]:{color:bn},"&-disabled":{color:Ct,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${En}`]:{fontSize:nt.previewOperationSize}}}}},Kn=nt=>{const{modalMaskBg:ze,iconCls:ct,previewOperationColorDisabled:kt,previewCls:Rt,zIndexPopup:Jt,motionDurationSlow:pt}=nt,Ct=new Hr.C(ze).setAlpha(.1),bn=Ct.clone().setAlpha(.2);return{[`${Rt}-switch-left, ${Rt}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:Jt+1,display:"flex",alignItems:"center",justifyContent:"center",width:nt.imagePreviewSwitchSize,height:nt.imagePreviewSwitchSize,marginTop:-nt.imagePreviewSwitchSize/2,color:nt.previewOperationColor,background:Ct.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${pt}`,userSelect:"none","&:hover":{background:bn.toRgbString()},"&-disabled":{"&, &:hover":{color:kt,background:"transparent",cursor:"not-allowed",[`> ${ct}`]:{cursor:"not-allowed"}}},[`> ${ct}`]:{fontSize:nt.previewOperationSize}},[`${Rt}-switch-left`]:{insetInlineStart:nt.marginSM},[`${Rt}-switch-right`]:{insetInlineEnd:nt.marginSM}}},ar=nt=>{const{motionEaseOut:ze,previewCls:ct,motionDurationSlow:kt,componentCls:Rt}=nt;return[{[`${Rt}-preview-root`]:{[ct]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${ct}-body`]:Object.assign(Object.assign({},fn()),{overflow:"hidden"}),[`${ct}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${kt} ${ze} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},fn()),{transition:`transform ${kt} ${ze} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${ct}-moving`]:{[`${ct}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${Rt}-preview-root`]:{[`${ct}-wrap`]:{zIndex:nt.zIndexPopup}}},{[`${Rt}-preview-operations-wrapper`]:{position:"fixed",zIndex:nt.zIndexPopup+1},"&":[br(nt),Kn(nt)]}]},vn=nt=>{const{componentCls:ze}=nt;return{[ze]:{position:"relative",display:"inline-block",[`${ze}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${ze}-img-placeholder`]:{backgroundColor:nt.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${ze}-mask`]:Object.assign({},Rn(nt)),[`${ze}-mask:hover`]:{opacity:1},[`${ze}-placeholder`]:Object.assign({},fn())}}},pn=nt=>{const{previewCls:ze}=nt;return{[`${ze}-root`]:(0,qr._y)(nt,"zoom"),"&":(0,Cr.J$)(nt,!0)}};var Nn=(0,yn.Z)("Image",nt=>{const ze=`${nt.componentCls}-preview`,ct=(0,wn.TS)(nt,{previewCls:ze,modalMaskBg:new Hr.C("#000").setAlpha(.45).toRgbString(),imagePreviewSwitchSize:nt.controlHeightLG});return[vn(ct),ar(ct),(0,ni.QA)((0,wn.TS)(ct,{componentCls:ze})),pn(ct)]},nt=>({zIndexPopup:nt.zIndexPopupBase+80,previewOperationColor:new Hr.C(nt.colorTextLightSolid).setAlpha(.65).toRgbString(),previewOperationHoverColor:new Hr.C(nt.colorTextLightSolid).setAlpha(.85).toRgbString(),previewOperationColorDisabled:new Hr.C(nt.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:nt.fontSizeIcon*1.5})),st=function(nt,ze){var ct={};for(var kt in nt)Object.prototype.hasOwnProperty.call(nt,kt)&&ze.indexOf(kt)<0&&(ct[kt]=nt[kt]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rt=0,kt=Object.getOwnPropertySymbols(nt);Rt<kt.length;Rt++)ze.indexOf(kt[Rt])<0&&Object.prototype.propertyIsEnumerable.call(nt,kt[Rt])&&(ct[kt[Rt]]=nt[kt[Rt]]);return ct};const Ee={rotateLeft:fe.createElement(Yt,null),rotateRight:fe.createElement(on,null),zoomIn:fe.createElement(ir,null),zoomOut:fe.createElement(jr,null),close:fe.createElement(de.Z,null),left:fe.createElement(pe.Z,null),right:fe.createElement(le.Z,null),flipX:fe.createElement(Dn,null),flipY:fe.createElement(Dn,{rotate:90})};var ke=nt=>{var{previewPrefixCls:ze,preview:ct}=nt,kt=st(nt,["previewPrefixCls","preview"]);const{getPrefixCls:Rt}=fe.useContext(se.E_),Jt=Rt("image",ze),pt=`${Jt}-preview`,Ct=Rt(),[bn,ln]=Nn(Jt),En=fe.useMemo(()=>{var qt;if(ct===!1)return ct;const On=typeof ct=="object"?ct:{},tn=tt()(ln,(qt=On.rootClassName)!==null&&qt!==void 0?qt:"");return Object.assign(Object.assign({},On),{transitionName:(0,ye.m)(Ct,"zoom",On.transitionName),maskTransitionName:(0,ye.m)(Ct,"fade",On.maskTransitionName),rootClassName:tn})},[ct]);return bn(fe.createElement(zt.PreviewGroup,Object.assign({preview:En,previewPrefixCls:pt,icons:Ee},kt)))},Ie=function(nt,ze){var ct={};for(var kt in nt)Object.prototype.hasOwnProperty.call(nt,kt)&&ze.indexOf(kt)<0&&(ct[kt]=nt[kt]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rt=0,kt=Object.getOwnPropertySymbols(nt);Rt<kt.length;Rt++)ze.indexOf(kt[Rt])<0&&Object.prototype.propertyIsEnumerable.call(nt,kt[Rt])&&(ct[kt[Rt]]=nt[kt[Rt]]);return ct};const Ge=nt=>{const{prefixCls:ze,preview:ct,className:kt,rootClassName:Rt,style:Jt}=nt,pt=Ie(nt,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:Ct,locale:bn=oe.Z,getPopupContainer:ln,image:En}=fe.useContext(se.E_),qt=Ct("image",ze),On=Ct(),tn=bn.Image||oe.Z.Image,[An,Ue]=Nn(qt),At=tt()(Rt,Ue),Pt=tt()(kt,Ue,En==null?void 0:En.className),Xt=fe.useMemo(()=>{if(ct===!1)return ct;const Gt=typeof ct=="object"?ct:{},{getContainer:Kt}=Gt,un=Ie(Gt,["getContainer"]);return Object.assign(Object.assign({mask:fe.createElement("div",{className:`${qt}-mask-info`},fe.createElement(Ze.Z,null),tn==null?void 0:tn.preview),icons:Ee},un),{getContainer:Kt||ln,transitionName:(0,ye.m)(On,"zoom",Gt.transitionName),maskTransitionName:(0,ye.m)(On,"fade",Gt.maskTransitionName)})},[ct,tn]),Ft=Object.assign(Object.assign({},En==null?void 0:En.style),Jt);return An(fe.createElement(zt,Object.assign({prefixCls:qt,preview:Xt,rootClassName:At,className:Pt,style:Ft},pt)))};Ge.PreviewGroup=ke;var ut=Ge},5871:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Pn}});var fe=ue(84105),Ze=ue(87395),Fe=ue(92310),tt=ue.n(Fe),be=ue(60499),De=ue(18642),Pe=ue(43749),we=ue(72190),_e=ue(42244),Ne=ue(38705),dt=ue(17212);function Ae(){return typeof BigInt=="function"}function He(ot){return!ot&&ot!==0&&!Number.isNaN(ot)||!String(ot).trim()}function rt(ot){var St=ot.trim(),$t=St.startsWith("-");$t&&(St=St.slice(1)),St=St.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),St.startsWith(".")&&(St="0".concat(St));var Dn=St||"0",Ln=Dn.split("."),In=Ln[0]||"0",qn=Ln[1]||"0";In==="0"&&qn==="0"&&($t=!1);var dr=$t?"-":"";return{negative:$t,negativeStr:dr,trimStr:Dn,integerStr:In,decimalStr:qn,fullStr:"".concat(dr).concat(Dn)}}function je(ot){var St=String(ot);return!Number.isNaN(Number(St))&&St.includes("e")}function it(ot){var St=String(ot);if(je(ot)){var $t=Number(St.slice(St.indexOf("e-")+2)),Dn=St.match(/\.(\d+)/);return Dn!=null&&Dn[1]&&($t+=Dn[1].length),$t}return St.includes(".")&&xt(St)?St.length-St.indexOf(".")-1:0}function at(ot){var St=String(ot);if(je(ot)){if(ot>Number.MAX_SAFE_INTEGER)return String(Ae()?BigInt(ot).toString():Number.MAX_SAFE_INTEGER);if(ot<Number.MIN_SAFE_INTEGER)return String(Ae()?BigInt(ot).toString():Number.MIN_SAFE_INTEGER);St=ot.toFixed(it(St))}return rt(St).fullStr}function xt(ot){return typeof ot=="number"?!Number.isNaN(ot):ot?/^\s*-?\d+(\.\d+)?\s*$/.test(ot)||/^\s*-?\d+\.\s*$/.test(ot)||/^\s*-?\.\d+\s*$/.test(ot):!1}var jt=function(){function ot(St){if((0,Ne.Z)(this,ot),(0,De.Z)(this,"origin",""),(0,De.Z)(this,"negative",void 0),(0,De.Z)(this,"integer",void 0),(0,De.Z)(this,"decimal",void 0),(0,De.Z)(this,"decimalLen",void 0),(0,De.Z)(this,"empty",void 0),(0,De.Z)(this,"nan",void 0),He(St)){this.empty=!0;return}if(this.origin=String(St),St==="-"||Number.isNaN(St)){this.nan=!0;return}var $t=St;if(je($t)&&($t=Number($t)),$t=typeof $t=="string"?$t:at($t),xt($t)){var Dn=rt($t);this.negative=Dn.negative;var Ln=Dn.trimStr.split(".");this.integer=BigInt(Ln[0]);var In=Ln[1]||"0";this.decimal=BigInt(In),this.decimalLen=In.length}else this.nan=!0}return(0,dt.Z)(ot,[{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($t){var Dn="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd($t,"0"));return BigInt(Dn)}},{key:"negate",value:function(){var $t=new ot(this.toString());return $t.negative=!$t.negative,$t}},{key:"cal",value:function($t,Dn,Ln){var In=Math.max(this.getDecimalStr().length,$t.getDecimalStr().length),qn=this.alignDecimal(In),dr=$t.alignDecimal(In),ir=Dn(qn,dr).toString(),Er=Ln(In),kr=rt(ir),Qn=kr.negativeStr,Kr=kr.trimStr,jr="".concat(Qn).concat(Kr.padStart(Er+1,"0"));return new ot("".concat(jr.slice(0,-Er),".").concat(jr.slice(-Er)))}},{key:"add",value:function($t){if(this.isInvalidate())return new ot($t);var Dn=new ot($t);return Dn.isInvalidate()?this:this.cal(Dn,function(Ln,In){return Ln+In},function(Ln){return Ln})}},{key:"multi",value:function($t){var Dn=new ot($t);return this.isInvalidate()||Dn.isInvalidate()?new ot(NaN):this.cal(Dn,function(Ln,In){return Ln*In},function(Ln){return Ln*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($t){return this.toString()===($t==null?void 0:$t.toString())}},{key:"lessEquals",value:function($t){return this.add($t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return $t?this.isInvalidate()?"":rt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),ot}(),Qe=function(){function ot(St){if((0,Ne.Z)(this,ot),(0,De.Z)(this,"origin",""),(0,De.Z)(this,"number",void 0),(0,De.Z)(this,"empty",void 0),He(St)){this.empty=!0;return}this.origin=String(St),this.number=Number(St)}return(0,dt.Z)(ot,[{key:"negate",value:function(){return new ot(-this.toNumber())}},{key:"add",value:function($t){if(this.isInvalidate())return new ot($t);var Dn=Number($t);if(Number.isNaN(Dn))return this;var Ln=this.number+Dn;if(Ln>Number.MAX_SAFE_INTEGER)return new ot(Number.MAX_SAFE_INTEGER);if(Ln<Number.MIN_SAFE_INTEGER)return new ot(Number.MIN_SAFE_INTEGER);var In=Math.max(it(this.number),it(Dn));return new ot(Ln.toFixed(In))}},{key:"multi",value:function($t){var Dn=Number($t);if(this.isInvalidate()||Number.isNaN(Dn))return new ot(NaN);var Ln=this.number*Dn;if(Ln>Number.MAX_SAFE_INTEGER)return new ot(Number.MAX_SAFE_INTEGER);if(Ln<Number.MIN_SAFE_INTEGER)return new ot(Number.MIN_SAFE_INTEGER);var In=Math.max(it(this.number),it(Dn));return new ot(Ln.toFixed(In))}},{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($t){return this.toNumber()===($t==null?void 0:$t.toNumber())}},{key:"lessEquals",value:function($t){return this.add($t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return $t?this.isInvalidate()?"":at(this.number):this.origin}}]),ot}();function mt(ot){return Ae()?new jt(ot):new Qe(ot)}function We(ot,St,$t){var Dn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ot==="")return"";var Ln=rt(ot),In=Ln.negativeStr,qn=Ln.integerStr,dr=Ln.decimalStr,ir="".concat(St).concat(dr),Er="".concat(In).concat(qn);if($t>=0){var kr=Number(dr[$t]);if(kr>=5&&!Dn){var Qn=mt(ot).add("".concat(In,"0.").concat("0".repeat($t)).concat(10-kr));return We(Qn.toString(),St,$t,Dn)}return $t===0?Er:"".concat(Er).concat(St).concat(dr.padEnd($t,"0").slice(0,$t))}return ir===".0"?Er:"".concat(Er).concat(ir)}var Me=mt,Ke=ue(93681),Ve=ue(34280),Mt=ue(8654),Xe=ue(59301),Nt=ue(48736);function ht(ot,St){var $t=(0,Xe.useRef)(null);function Dn(){try{var In=ot.selectionStart,qn=ot.selectionEnd,dr=ot.value,ir=dr.substring(0,In),Er=dr.substring(qn);$t.current={start:In,end:qn,value:dr,beforeTxt:ir,afterTxt:Er}}catch(kr){}}function Ln(){if(ot&&$t.current&&St)try{var In=ot.value,qn=$t.current,dr=qn.beforeTxt,ir=qn.afterTxt,Er=qn.start,kr=In.length;if(In.endsWith(ir))kr=In.length-$t.current.afterTxt.length;else if(In.startsWith(dr))kr=dr.length;else{var Qn=dr[Er-1],Kr=In.indexOf(Qn,Er-1);Kr!==-1&&(kr=Kr+1)}ot.setSelectionRange(kr,kr)}catch(jr){(0,Nt.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(jr.message))}}return[Dn,Ln]}var Tt=ue(49658),et=function(){var St=(0,Xe.useState)(!1),$t=(0,we.Z)(St,2),Dn=$t[0],Ln=$t[1];return(0,Ve.Z)(function(){Ln((0,Tt.Z)())},[]),Dn},Ut=et,ft=ue(16089),Dt=200,Bt=600;function bt(ot){var St=ot.prefixCls,$t=ot.upNode,Dn=ot.downNode,Ln=ot.upDisabled,In=ot.downDisabled,qn=ot.onStep,dr=Xe.useRef(),ir=Xe.useRef([]),Er=Xe.useRef();Er.current=qn;var kr=function(){clearTimeout(dr.current)},Qn=function(yn,wn){yn.preventDefault(),kr(),Er.current(wn);function fn(){Er.current(wn),dr.current=setTimeout(fn,Dt)}dr.current=setTimeout(fn,Bt)};Xe.useEffect(function(){return function(){kr(),ir.current.forEach(function(Cr){return ft.Z.cancel(Cr)})}},[]);var Kr=Ut();if(Kr)return null;var jr="".concat(St,"-handler"),Hr=tt()(jr,"".concat(jr,"-up"),(0,De.Z)({},"".concat(jr,"-up-disabled"),Ln)),ni=tt()(jr,"".concat(jr,"-down"),(0,De.Z)({},"".concat(jr,"-down-disabled"),In)),Br=function(){return ir.current.push((0,ft.Z)(kr))},qr={unselectable:"on",role:"button",onMouseUp:Br,onMouseLeave:Br};return Xe.createElement("div",{className:"".concat(jr,"-wrap")},Xe.createElement("span",(0,be.Z)({},qr,{onMouseDown:function(yn){Qn(yn,!0)},"aria-label":"Increase Value","aria-disabled":Ln,className:Hr}),$t||Xe.createElement("span",{unselectable:"on",className:"".concat(St,"-handler-up-inner")})),Xe.createElement("span",(0,be.Z)({},qr,{onMouseDown:function(yn){Qn(yn,!1)},"aria-label":"Decrease Value","aria-disabled":In,className:ni}),Dn||Xe.createElement("span",{unselectable:"on",className:"".concat(St,"-handler-down-inner")})))}function $e(ot){var St=typeof ot=="number"?at(ot):rt(ot).fullStr,$t=St.includes(".");return $t?rt(St.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:ot+"0"}var xe=ue(5643),gt=function(){var ot=(0,Xe.useRef)(0),St=function(){ft.Z.cancel(ot.current)};return(0,Xe.useEffect)(function(){return St},[]),function($t){St(),ot.current=(0,ft.Z)(function(){$t()})}},en=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Wt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],qe=function(St,$t){return St||$t.isEmpty()?$t.toString():$t.toNumber()},Ye=function(St){var $t=Me(St);return $t.isInvalidate()?null:$t},Lt=Xe.forwardRef(function(ot,St){var $t,Dn=ot.prefixCls,Ln=Dn===void 0?"rc-input-number":Dn,In=ot.className,qn=ot.style,dr=ot.min,ir=ot.max,Er=ot.step,kr=Er===void 0?1:Er,Qn=ot.defaultValue,Kr=ot.value,jr=ot.disabled,Hr=ot.readOnly,ni=ot.upHandler,Br=ot.downHandler,qr=ot.keyboard,Cr=ot.controls,yn=Cr===void 0?!0:Cr,wn=ot.classNames,fn=ot.stringMode,Rn=ot.parser,br=ot.formatter,Kn=ot.precision,ar=ot.decimalSeparator,vn=ot.onChange,pn=ot.onInput,Nn=ot.onPressEnter,st=ot.onStep,Ee=(0,_e.Z)(ot,en),Te="".concat(Ln,"-input"),ke=Xe.useRef(null),Ie=Xe.useState(!1),Ge=(0,we.Z)(Ie,2),ut=Ge[0],nt=Ge[1],ze=Xe.useRef(!1),ct=Xe.useRef(!1),kt=Xe.useRef(!1),Rt=Xe.useState(function(){return Me(Kr!=null?Kr:Qn)}),Jt=(0,we.Z)(Rt,2),pt=Jt[0],Ct=Jt[1];function bn(kn){Kr===void 0&&Ct(kn)}var ln=Xe.useCallback(function(kn,Cn){if(!Cn)return Kn>=0?Kn:Math.max(it(kn),it(kr))},[Kn,kr]),En=Xe.useCallback(function(kn){var Cn=String(kn);if(Rn)return Rn(Cn);var Xn=Cn;return ar&&(Xn=Xn.replace(ar,".")),Xn.replace(/[^\w.-]+/g,"")},[Rn,ar]),qt=Xe.useRef(""),On=Xe.useCallback(function(kn,Cn){if(br)return br(kn,{userTyping:Cn,input:String(qt.current)});var Xn=typeof kn=="number"?at(kn):kn;if(!Cn){var Fn=ln(Xn,Cn);if(xt(Xn)&&(ar||Fn>=0)){var Sr=ar||".";Xn=We(Xn,Sr,Fn)}}return Xn},[br,ln,ar]),tn=Xe.useState(function(){var kn=Qn!=null?Qn:Kr;return pt.isInvalidate()&&["string","number"].includes((0,Pe.Z)(kn))?Number.isNaN(kn)?"":kn:On(pt.toString(),!1)}),An=(0,we.Z)(tn,2),Ue=An[0],At=An[1];qt.current=Ue;function Pt(kn,Cn){At(On(kn.isInvalidate()?kn.toString(!1):kn.toString(!Cn),Cn))}var Xt=Xe.useMemo(function(){return Ye(ir)},[ir,Kn]),Ft=Xe.useMemo(function(){return Ye(dr)},[dr,Kn]),Gt=Xe.useMemo(function(){return!Xt||!pt||pt.isInvalidate()?!1:Xt.lessEquals(pt)},[Xt,pt]),Kt=Xe.useMemo(function(){return!Ft||!pt||pt.isInvalidate()?!1:pt.lessEquals(Ft)},[Ft,pt]),un=ht(ke.current,ut),xn=(0,we.Z)(un,2),_n=xn[0],Hn=xn[1],Yn=function(Cn){return Xt&&!Cn.lessEquals(Xt)?Xt:Ft&&!Ft.lessEquals(Cn)?Ft:null},yr=function(Cn){return!Yn(Cn)},rr=function(Cn,Xn){var Fn=Cn,Sr=yr(Fn)||Fn.isEmpty();if(!Fn.isEmpty()&&!Xn&&(Fn=Yn(Fn)||Fn,Sr=!0),!Hr&&!jr&&Sr){var Ar=Fn.toString(),lr=ln(Ar,Xn);return lr>=0&&(Fn=Me(We(Ar,".",lr)),yr(Fn)||(Fn=Me(We(Ar,".",lr,!0)))),Fn.equals(pt)||(bn(Fn),vn==null||vn(Fn.isEmpty()?null:qe(fn,Fn)),Kr===void 0&&Pt(Fn,Xn)),Fn}return pt},Wn=gt(),xr=function kn(Cn){if(_n(),qt.current=Cn,At(Cn),!ct.current){var Xn=En(Cn),Fn=Me(Xn);Fn.isNaN()||rr(Fn,!0)}pn==null||pn(Cn),Wn(function(){var Sr=Cn;Rn||(Sr=Cn.replace(/。/g,".")),Sr!==Cn&&kn(Sr)})},gr=function(){ct.current=!0},mr=function(){ct.current=!1,xr(ke.current.value)},Gn=function(Cn){xr(Cn.target.value)},Jn=function(Cn){var Xn;if(!(Cn&&Gt||!Cn&&Kt)){ze.current=!1;var Fn=Me(kt.current?$e(kr):kr);Cn||(Fn=Fn.negate());var Sr=(pt||Me(0)).add(Fn.toString()),Ar=rr(Sr,!1);st==null||st(qe(fn,Ar),{offset:kt.current?$e(kr):kr,type:Cn?"up":"down"}),(Xn=ke.current)===null||Xn===void 0||Xn.focus()}},hr=function(Cn){var Xn=Me(En(Ue)),Fn=Xn;Xn.isNaN()?Fn=rr(pt,Cn):Fn=rr(Xn,Cn),Kr!==void 0?Pt(pt,!1):Fn.isNaN()||Pt(Fn,!1)},tr=function(){ze.current=!0},_r=function(Cn){var Xn=Cn.key,Fn=Cn.shiftKey;ze.current=!0,kt.current=Fn,Xn==="Enter"&&(ct.current||(ze.current=!1),hr(!1),Nn==null||Nn(Cn)),qr!==!1&&!ct.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Xn)&&(Jn(Xn==="Up"||Xn==="ArrowUp"),Cn.preventDefault())},Wr=function(){ze.current=!1,kt.current=!1},fr=function(){hr(!1),nt(!1),ze.current=!1};return(0,Ve.o)(function(){pt.isInvalidate()||Pt(pt,!1)},[Kn]),(0,Ve.o)(function(){var kn=Me(Kr);Ct(kn);var Cn=Me(En(Ue));(!kn.equals(Cn)||!ze.current||br)&&Pt(kn,ze.current)},[Kr]),(0,Ve.o)(function(){br&&Hn()},[Ue]),Xe.createElement("div",{className:tt()(Ln,wn==null?void 0:wn.input,In,($t={},(0,De.Z)($t,"".concat(Ln,"-focused"),ut),(0,De.Z)($t,"".concat(Ln,"-disabled"),jr),(0,De.Z)($t,"".concat(Ln,"-readonly"),Hr),(0,De.Z)($t,"".concat(Ln,"-not-a-number"),pt.isNaN()),(0,De.Z)($t,"".concat(Ln,"-out-of-range"),!pt.isInvalidate()&&!yr(pt)),$t)),style:qn,onFocus:function(){nt(!0)},onBlur:fr,onKeyDown:_r,onKeyUp:Wr,onCompositionStart:gr,onCompositionEnd:mr,onBeforeInput:tr},yn&&Xe.createElement(bt,{prefixCls:Ln,upNode:ni,downNode:Br,upDisabled:Gt,downDisabled:Kt,onStep:Jn}),Xe.createElement("div",{className:"".concat(Te,"-wrap")},Xe.createElement("input",(0,be.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":dr,"aria-valuemax":ir,"aria-valuenow":pt.isInvalidate()?null:pt.toString(),step:kr},Ee,{ref:(0,Mt.sQ)(ke,St),className:Te,value:Ue,onChange:Gn,disabled:jr,readOnly:Hr}))))}),mn=Xe.forwardRef(function(ot,St){var $t=ot.disabled,Dn=ot.style,Ln=ot.prefixCls,In=ot.value,qn=ot.prefix,dr=ot.suffix,ir=ot.addonBefore,Er=ot.addonAfter,kr=ot.classes,Qn=ot.className,Kr=ot.classNames,jr=(0,_e.Z)(ot,Wt),Hr=Xe.useRef(null),ni=function(qr){Hr.current&&(0,xe.nH)(Hr.current,qr)};return Xe.createElement(Ke.BaseInput,{inputElement:Xe.createElement(Lt,(0,be.Z)({prefixCls:Ln,disabled:$t,classNames:Kr,ref:(0,Mt.sQ)(Hr,St)},jr)),className:Qn,triggerFocus:ni,prefixCls:Ln,value:In,disabled:$t,style:Dn,prefix:qn,suffix:dr,addonAfter:Er,addonBefore:ir,classes:kr,classNames:Kr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});mn.displayName="InputNumber";var Qt=mn,dn=Qt,Zt=ue(19080),Vt=ue(36355),zt=ue(92736),ye=ue(1684),se=ue(19716),oe=ue(32441),de=ue(33234),pe=ue(9937),le=ue(17313),Be=ue(74207),lt=ue(83116),Ot=ue(37613);const It=(ot,St)=>{let{componentCls:$t,borderRadiusSM:Dn,borderRadiusLG:Ln}=ot;const In=St==="lg"?Ln:Dn;return{[`&-${St}`]:{[`${$t}-handler-wrap`]:{borderStartEndRadius:In,borderEndEndRadius:In},[`${$t}-handler-up`]:{borderStartEndRadius:In},[`${$t}-handler-down`]:{borderEndEndRadius:In}}}},Ht=ot=>{const{componentCls:St,lineWidth:$t,lineType:Dn,colorBorder:Ln,borderRadius:In,fontSizeLG:qn,controlHeightLG:dr,controlHeightSM:ir,colorError:Er,paddingInlineSM:kr,colorTextDescription:Qn,motionDurationMid:Kr,handleHoverColor:jr,paddingInline:Hr,paddingBlock:ni,handleBg:Br,handleActiveBg:qr,colorTextDisabled:Cr,borderRadiusSM:yn,borderRadiusLG:wn,controlWidth:fn,handleVisible:Rn,handleBorderColor:br}=ot;return[{[St]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(ot)),(0,pe.ik)(ot)),(0,pe.bi)(ot,St)),{display:"inline-block",width:fn,margin:0,padding:0,border:`${$t}px ${Dn} ${Ln}`,borderRadius:In,"&-rtl":{direction:"rtl",[`${St}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:qn,borderRadius:wn,[`input${St}-input`]:{height:dr-2*$t}},"&-sm":{padding:0,borderRadius:yn,[`input${St}-input`]:{height:ir-2*$t,padding:`0 ${kr}px`}},"&:hover":Object.assign({},(0,pe.pU)(ot)),"&-focused":Object.assign({},(0,pe.M1)(ot)),"&-out-of-range":{[`${St}-input-wrap`]:{input:{color:Er}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,le.Wf)(ot)),(0,pe.s7)(ot)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${St}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${St}-group-addon`]:{borderRadius:wn,fontSize:ot.fontSizeLG}},"&-sm":{[`${St}-group-addon`]:{borderRadius:yn}},[`${St}-wrapper-disabled > ${St}-group-addon`]:Object.assign({},(0,pe.Xy)(ot))}}),[`&-disabled ${St}-input`]:{cursor:"not-allowed"},[St]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(ot)),{width:"100%",padding:`${ni}px ${Hr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:In,outline:0,transition:`all ${Kr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,pe.nz)(ot.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[St]:Object.assign(Object.assign(Object.assign({[`&:hover ${St}-handler-wrap, &-focused ${St}-handler-wrap`]:{opacity:1},[`${St}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:ot.handleWidth,height:"100%",background:Br,borderStartStartRadius:0,borderStartEndRadius:In,borderEndEndRadius:In,borderEndStartRadius:0,opacity:Rn===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Kr} linear ${Kr}`,[`${St}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${St}-handler-up-inner,
${St}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:ot.handleFontSize}}},[`${St}-handler`]:{height:"50%",overflow:"hidden",color:Qn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${$t}px ${Dn} ${br}`,transition:`all ${Kr} linear`,"&:active":{background:qr},"&:hover":{height:"60%",[`
${St}-handler-up-inner,
${St}-handler-down-inner
`]:{color:jr}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,le.Ro)()),{color:Qn,transition:`all ${Kr} linear`,userSelect:"none"})},[`${St}-handler-up`]:{borderStartEndRadius:In},[`${St}-handler-down`]:{borderBlockStart:`${$t}px ${Dn} ${br}`,borderEndEndRadius:In}},It(ot,"lg")),It(ot,"sm")),{"&-disabled, &-readonly":{[`${St}-handler-wrap`]:{display:"none"},[`${St}-input`]:{color:"inherit"}},[`
${St}-handler-up-disabled,
${St}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${St}-handler-up-disabled:hover &-handler-up-inner,
${St}-handler-down-disabled:hover &-handler-down-inner
`]:{color:Cr}})},{[`${St}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${St}-handler-down`]:{borderBlockStartWidth:0}}}]},Yt=ot=>{const{componentCls:St,paddingBlock:$t,paddingInline:Dn,inputAffixPadding:Ln,controlWidth:In,borderRadiusLG:qn,borderRadiusSM:dr}=ot;return{[`${St}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,pe.ik)(ot)),(0,pe.bi)(ot,`${St}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:In,padding:0,paddingInlineStart:Dn,"&-lg":{borderRadius:qn},"&-sm":{borderRadius:dr},[`&:not(${St}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,pe.pU)(ot)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${St}-disabled`]:{background:"transparent"},[`> div${St}`]:{width:"100%",border:"none",outline:"none",[`&${St}-focused`]:{boxShadow:"none !important"}},[`input${St}-input`]:{padding:`${$t}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${St}-handler-wrap`]:{zIndex:2},[St]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Ln},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Dn,marginInlineStart:Ln}}})}};var an=(0,lt.Z)("InputNumber",ot=>{const St=(0,Ot.TS)(ot,(0,pe.e5)(ot));return[Ht(St),Yt(St),(0,Be.c)(St)]},ot=>Object.assign(Object.assign({},(0,pe.TM)(ot)),{controlWidth:90,handleWidth:ot.controlHeightSM-ot.lineWidth*2,handleFontSize:ot.fontSize/2,handleVisible:"auto",handleActiveBg:ot.colorFillAlter,handleBg:ot.colorBgContainer,handleHoverColor:ot.colorPrimary,handleBorderColor:ot.colorBorder})),cn=function(ot,St){var $t={};for(var Dn in ot)Object.prototype.hasOwnProperty.call(ot,Dn)&&St.indexOf(Dn)<0&&($t[Dn]=ot[Dn]);if(ot!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ln=0,Dn=Object.getOwnPropertySymbols(ot);Ln<Dn.length;Ln++)St.indexOf(Dn[Ln])<0&&Object.prototype.propertyIsEnumerable.call(ot,Dn[Ln])&&($t[Dn[Ln]]=ot[Dn[Ln]]);return $t};const Sn=Xe.forwardRef((ot,St)=>{const{getPrefixCls:$t,direction:Dn}=Xe.useContext(Vt.E_),Ln=Xe.useRef(null);Xe.useImperativeHandle(St,()=>Ln.current);const{className:In,rootClassName:qn,size:dr,disabled:ir,prefixCls:Er,addonBefore:kr,addonAfter:Qn,prefix:Kr,bordered:jr=!0,readOnly:Hr,status:ni,controls:Br}=ot,qr=cn(ot,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),Cr=$t("input-number",Er),[yn,wn]=an(Cr),{compactSize:fn,compactItemClassnames:Rn}=(0,de.ri)(Cr,Dn);let br=Xe.createElement(Ze.Z,{className:`${Cr}-handler-up-inner`}),Kn=Xe.createElement(fe.Z,{className:`${Cr}-handler-down-inner`});const ar=typeof Br=="boolean"?Br:void 0;typeof Br=="object"&&(br=typeof Br.upIcon=="undefined"?br:Xe.createElement("span",{className:`${Cr}-handler-up-inner`},Br.upIcon),Kn=typeof Br.downIcon=="undefined"?Kn:Xe.createElement("span",{className:`${Cr}-handler-down-inner`},Br.downIcon));const{hasFeedback:vn,status:pn,isFormItemInput:Nn,feedbackIcon:st}=Xe.useContext(oe.aM),Ee=(0,Zt.F)(pn,ni),Te=(0,se.Z)(ze=>{var ct;return(ct=dr!=null?dr:fn)!==null&&ct!==void 0?ct:ze}),ke=Xe.useContext(ye.Z),Ie=ir!=null?ir:ke,Ge=tt()({[`${Cr}-lg`]:Te==="large",[`${Cr}-sm`]:Te==="small",[`${Cr}-rtl`]:Dn==="rtl",[`${Cr}-borderless`]:!jr,[`${Cr}-in-form-item`]:Nn},(0,Zt.Z)(Cr,Ee),Rn,wn),ut=`${Cr}-group`,nt=Xe.createElement(dn,Object.assign({ref:Ln,disabled:Ie,className:tt()(In,qn),upHandler:br,downHandler:Kn,prefixCls:Cr,readOnly:Hr,controls:ar,prefix:Kr,suffix:vn&&st,addonAfter:Qn&&Xe.createElement(de.BR,null,Xe.createElement(oe.Ux,{override:!0,status:!0},Qn)),addonBefore:kr&&Xe.createElement(de.BR,null,Xe.createElement(oe.Ux,{override:!0,status:!0},kr)),classNames:{input:Ge},classes:{affixWrapper:tt()((0,Zt.Z)(`${Cr}-affix-wrapper`,Ee,vn),{[`${Cr}-affix-wrapper-sm`]:Te==="small",[`${Cr}-affix-wrapper-lg`]:Te==="large",[`${Cr}-affix-wrapper-rtl`]:Dn==="rtl",[`${Cr}-affix-wrapper-borderless`]:!jr},wn),wrapper:tt()({[`${ut}-rtl`]:Dn==="rtl",[`${Cr}-wrapper-disabled`]:Ie},wn),group:tt()({[`${Cr}-group-wrapper-sm`]:Te==="small",[`${Cr}-group-wrapper-lg`]:Te==="large",[`${Cr}-group-wrapper-rtl`]:Dn==="rtl"},(0,Zt.Z)(`${Cr}-group-wrapper`,Ee,vn),wn)}},qr));return yn(nt)}),wt=Sn,on=ot=>Xe.createElement(zt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Xe.createElement(Sn,Object.assign({},ot)));wt._InternalPanelDoNotUseOrYouWillBeFired=on;var Pn=wt},9432:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return jt},n:function(){return at}});var fe=ue(19248),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(93681),be=ue(8654),De=ue(59301),Pe=ue(19080),we=ue(36355),_e=ue(1684),Ne=ue(19716),dt=ue(32441),Ae=ue(33234),He=ue(59412),rt=ue(9937);function je(Qe){return!!(Qe.prefix||Qe.suffix||Qe.allowClear)}var it=function(Qe,mt){var We={};for(var Me in Qe)Object.prototype.hasOwnProperty.call(Qe,Me)&&mt.indexOf(Me)<0&&(We[Me]=Qe[Me]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ke=0,Me=Object.getOwnPropertySymbols(Qe);Ke<Me.length;Ke++)mt.indexOf(Me[Ke])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Me[Ke])&&(We[Me[Ke]]=Qe[Me[Ke]]);return We};function at(Qe,mt){if(!Qe)return;Qe.focus(mt);const{cursor:We}=mt||{};if(We){const Me=Qe.value.length;switch(We){case"start":Qe.setSelectionRange(0,0);break;case"end":Qe.setSelectionRange(Me,Me);break;default:Qe.setSelectionRange(0,Me);break}}}var jt=(0,De.forwardRef)((Qe,mt)=>{var We;const{prefixCls:Me,bordered:Ke=!0,status:Ve,size:Mt,disabled:Xe,onBlur:Nt,onFocus:ht,suffix:Tt,allowClear:et,addonAfter:Ut,addonBefore:ft,className:Dt,style:Bt,styles:bt,rootClassName:$e,onChange:xe,classNames:gt}=Qe,en=it(Qe,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Wt,direction:qe,input:Ye}=De.useContext(we.E_),Lt=Wt("input",Me),mn=(0,De.useRef)(null),[Qt,dn]=(0,rt.ZP)(Lt),{compactSize:Zt,compactItemClassnames:Vt}=(0,Ae.ri)(Lt,qe),zt=(0,Ne.Z)(Sn=>{var wt;return(wt=Mt!=null?Mt:Zt)!==null&&wt!==void 0?wt:Sn}),ye=De.useContext(_e.Z),se=Xe!=null?Xe:ye,{status:oe,hasFeedback:de,feedbackIcon:pe}=(0,De.useContext)(dt.aM),le=(0,Pe.F)(oe,Ve),Be=je(Qe)||!!de,lt=(0,De.useRef)(Be);(0,De.useEffect)(()=>{var Sn;Be&&lt.current,lt.current=Be},[Be]);const Ot=(0,He.Z)(mn,!0),It=Sn=>{Ot(),Nt==null||Nt(Sn)},Ht=Sn=>{Ot(),ht==null||ht(Sn)},Yt=Sn=>{Ot(),xe==null||xe(Sn)},an=(de||Tt)&&De.createElement(De.Fragment,null,Tt,de&&pe);let cn;return typeof et=="object"&&(et!=null&&et.clearIcon)?cn=et:et&&(cn={clearIcon:De.createElement(fe.Z,null)}),Qt(De.createElement(tt.default,Object.assign({ref:(0,be.sQ)(mt,mn),prefixCls:Lt,autoComplete:Ye==null?void 0:Ye.autoComplete},en,{disabled:se,onBlur:It,onFocus:Ht,style:Object.assign(Object.assign({},Ye==null?void 0:Ye.style),Bt),styles:Object.assign(Object.assign({},Ye==null?void 0:Ye.styles),bt),suffix:an,allowClear:cn,className:Fe()(Dt,$e,Vt,Ye==null?void 0:Ye.className),onChange:Yt,addonAfter:Ut&&De.createElement(Ae.BR,null,De.createElement(dt.Ux,{override:!0,status:!0},Ut)),addonBefore:ft&&De.createElement(Ae.BR,null,De.createElement(dt.Ux,{override:!0,status:!0},ft)),classNames:Object.assign(Object.assign(Object.assign({},gt),Ye==null?void 0:Ye.classNames),{input:Fe()({[`${Lt}-sm`]:zt==="small",[`${Lt}-lg`]:zt==="large",[`${Lt}-rtl`]:qe==="rtl",[`${Lt}-borderless`]:!Ke},!Be&&(0,Pe.Z)(Lt,le),gt==null?void 0:gt.input,(We=Ye==null?void 0:Ye.classNames)===null||We===void 0?void 0:We.input,dn)}),classes:{affixWrapper:Fe()({[`${Lt}-affix-wrapper-sm`]:zt==="small",[`${Lt}-affix-wrapper-lg`]:zt==="large",[`${Lt}-affix-wrapper-rtl`]:qe==="rtl",[`${Lt}-affix-wrapper-borderless`]:!Ke},(0,Pe.Z)(`${Lt}-affix-wrapper`,le,de),dn),wrapper:Fe()({[`${Lt}-group-rtl`]:qe==="rtl"},dn),group:Fe()({[`${Lt}-group-wrapper-sm`]:zt==="small",[`${Lt}-group-wrapper-lg`]:zt==="large",[`${Lt}-group-wrapper-rtl`]:qe==="rtl",[`${Lt}-group-wrapper-disabled`]:se},(0,Pe.Z)(`${Lt}-group-wrapper`,le,de),dn)}})))})},1643:function(Mn,rn,ue){"use strict";var fe=ue(19248),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(9296),be=ue(59301),De=ue(19080),Pe=ue(36355),we=ue(1684),_e=ue(19716),Ne=ue(32441),dt=ue(9432),Ae=ue(9937),He=function(je,it){var at={};for(var xt in je)Object.prototype.hasOwnProperty.call(je,xt)&&it.indexOf(xt)<0&&(at[xt]=je[xt]);if(je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var jt=0,xt=Object.getOwnPropertySymbols(je);jt<xt.length;jt++)it.indexOf(xt[jt])<0&&Object.prototype.propertyIsEnumerable.call(je,xt[jt])&&(at[xt[jt]]=je[xt[jt]]);return at};const rt=(0,be.forwardRef)((je,it)=>{const{prefixCls:at,bordered:xt=!0,size:jt,disabled:Qe,status:mt,allowClear:We,showCount:Me,classNames:Ke,rootClassName:Ve,className:Mt}=je,Xe=He(je,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Nt,direction:ht}=be.useContext(Pe.E_),Tt=(0,_e.Z)(jt),et=be.useContext(we.Z),Ut=Qe!=null?Qe:et,{status:ft,hasFeedback:Dt,feedbackIcon:Bt}=be.useContext(Ne.aM),bt=(0,De.F)(ft,mt),$e=be.useRef(null);be.useImperativeHandle(it,()=>{var qe;return{resizableTextArea:(qe=$e.current)===null||qe===void 0?void 0:qe.resizableTextArea,focus:Ye=>{var Lt,mn;(0,dt.n)((mn=(Lt=$e.current)===null||Lt===void 0?void 0:Lt.resizableTextArea)===null||mn===void 0?void 0:mn.textArea,Ye)},blur:()=>{var Ye;return(Ye=$e.current)===null||Ye===void 0?void 0:Ye.blur()}}});const xe=Nt("input",at);let gt;typeof We=="object"&&(We!=null&&We.clearIcon)?gt=We:We&&(gt={clearIcon:be.createElement(fe.Z,null)});const[en,Wt]=(0,Ae.ZP)(xe);return en(be.createElement(tt.default,Object.assign({},Xe,{disabled:Ut,allowClear:gt,className:Fe()(Mt,Ve),classes:{affixWrapper:Fe()(`${xe}-textarea-affix-wrapper`,{[`${xe}-affix-wrapper-rtl`]:ht==="rtl",[`${xe}-affix-wrapper-borderless`]:!xt,[`${xe}-affix-wrapper-sm`]:Tt==="small",[`${xe}-affix-wrapper-lg`]:Tt==="large",[`${xe}-textarea-show-count`]:Me},(0,De.Z)(`${xe}-affix-wrapper`,bt),Wt)},classNames:Object.assign(Object.assign({},Ke),{textarea:Fe()({[`${xe}-borderless`]:!xt,[`${xe}-sm`]:Tt==="small",[`${xe}-lg`]:Tt==="large"},(0,De.Z)(xe,bt),Wt,Ke==null?void 0:Ke.textarea)}),prefixCls:xe,suffix:Dt&&be.createElement("span",{className:`${xe}-textarea-suffix`},Bt),showCount:Me,ref:$e})))});rn.Z=rt},59412:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ze}});var fe=ue(59301);function Ze(Fe,tt){const be=(0,fe.useRef)([]),De=()=>{be.current.push(setTimeout(()=>{var Pe,we,_e,Ne;!((Pe=Fe.current)===null||Pe===void 0)&&Pe.input&&((we=Fe.current)===null||we===void 0?void 0:we.input.getAttribute("type"))==="password"&&(!((_e=Fe.current)===null||_e===void 0)&&_e.input.hasAttribute("value"))&&((Ne=Fe.current)===null||Ne===void 0||Ne.input.removeAttribute("value"))}))};return(0,fe.useEffect)(()=>(tt&&De(),()=>be.current.forEach(Pe=>{Pe&&clearTimeout(Pe)})),[]),De}},92832:function(Mn,rn,ue){"use strict";ue.d(rn,{default:function(){return Tt}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(59301),tt=ue(36355),be=ue(32441),De=ue(9937),we=et=>{const{getPrefixCls:Ut,direction:ft}=(0,Fe.useContext)(tt.E_),{prefixCls:Dt,className:Bt}=et,bt=Ut("input-group",Dt),$e=Ut("input"),[xe,gt]=(0,De.ZP)($e),en=Ze()(bt,{[`${bt}-lg`]:et.size==="large",[`${bt}-sm`]:et.size==="small",[`${bt}-compact`]:et.compact,[`${bt}-rtl`]:ft==="rtl"},gt,Bt),Wt=(0,Fe.useContext)(be.aM),qe=(0,Fe.useMemo)(()=>Object.assign(Object.assign({},Wt),{isFormItemInput:!1}),[Wt]);return xe(Fe.createElement("span",{className:en,style:et.style,onMouseEnter:et.onMouseEnter,onMouseLeave:et.onMouseLeave,onFocus:et.onFocus,onBlur:et.onBlur},Fe.createElement(be.aM.Provider,{value:qe},et.children)))},_e=ue(9432),Ne=ue(73331),dt=ue(15277),Ae=ue(2738),He=ue(8654),rt=ue(59412),je=function(et,Ut){var ft={};for(var Dt in et)Object.prototype.hasOwnProperty.call(et,Dt)&&Ut.indexOf(Dt)<0&&(ft[Dt]=et[Dt]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Dt=Object.getOwnPropertySymbols(et);Bt<Dt.length;Bt++)Ut.indexOf(Dt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(et,Dt[Bt])&&(ft[Dt[Bt]]=et[Dt[Bt]]);return ft};const it=et=>et?Fe.createElement(dt.Z,null):Fe.createElement(Ne.Z,null),at={click:"onClick",hover:"onMouseOver"};var jt=Fe.forwardRef((et,Ut)=>{const{visibilityToggle:ft=!0}=et,Dt=typeof ft=="object"&&ft.visible!==void 0,[Bt,bt]=(0,Fe.useState)(()=>Dt?ft.visible:!1),$e=(0,Fe.useRef)(null);Fe.useEffect(()=>{Dt&&bt(ft.visible)},[Dt,ft]);const xe=(0,rt.Z)($e),gt=()=>{const{disabled:se}=et;se||(Bt&&xe(),bt(oe=>{var de;const pe=!oe;return typeof ft=="object"&&((de=ft.onVisibleChange)===null||de===void 0||de.call(ft,pe)),pe}))},en=se=>{const{action:oe="click",iconRender:de=it}=et,pe=at[oe]||"",le=de(Bt),Be={[pe]:gt,className:`${se}-icon`,key:"passwordIcon",onMouseDown:lt=>{lt.preventDefault()},onMouseUp:lt=>{lt.preventDefault()}};return Fe.cloneElement(Fe.isValidElement(le)?le:Fe.createElement("span",null,le),Be)},{className:Wt,prefixCls:qe,inputPrefixCls:Ye,size:Lt}=et,mn=je(et,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Qt}=Fe.useContext(tt.E_),dn=Qt("input",Ye),Zt=Qt("input-password",qe),Vt=ft&&en(Zt),zt=Ze()(Zt,Wt,{[`${Zt}-${Lt}`]:!!Lt}),ye=Object.assign(Object.assign({},(0,Ae.Z)(mn,["suffix","iconRender","visibilityToggle"])),{type:Bt?"text":"password",className:zt,prefixCls:dn,suffix:Vt});return Lt&&(ye.size=Lt),Fe.createElement(_e.Z,Object.assign({ref:(0,He.sQ)(Ut,$e)},ye))}),Qe=ue(47472),mt=ue(92343),We=ue(3113),Me=ue(19716),Ke=ue(33234),Ve=function(et,Ut){var ft={};for(var Dt in et)Object.prototype.hasOwnProperty.call(et,Dt)&&Ut.indexOf(Dt)<0&&(ft[Dt]=et[Dt]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Dt=Object.getOwnPropertySymbols(et);Bt<Dt.length;Bt++)Ut.indexOf(Dt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(et,Dt[Bt])&&(ft[Dt[Bt]]=et[Dt[Bt]]);return ft},Xe=Fe.forwardRef((et,Ut)=>{const{prefixCls:ft,inputPrefixCls:Dt,className:Bt,size:bt,suffix:$e,enterButton:xe=!1,addonAfter:gt,loading:en,disabled:Wt,onSearch:qe,onChange:Ye,onCompositionStart:Lt,onCompositionEnd:mn}=et,Qt=Ve(et,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:dn,direction:Zt}=Fe.useContext(tt.E_),Vt=Fe.useRef(!1),zt=dn("input-search",ft),ye=dn("input",Dt),{compactSize:se}=(0,Ke.ri)(zt,Zt),oe=(0,Me.Z)(on=>{var Pn;return(Pn=bt!=null?bt:se)!==null&&Pn!==void 0?Pn:on}),de=Fe.useRef(null),pe=on=>{on&&on.target&&on.type==="click"&&qe&&qe(on.target.value,on,{source:"clear"}),Ye&&Ye(on)},le=on=>{var Pn;document.activeElement===((Pn=de.current)===null||Pn===void 0?void 0:Pn.input)&&on.preventDefault()},Be=on=>{var Pn,ot;qe&&qe((ot=(Pn=de.current)===null||Pn===void 0?void 0:Pn.input)===null||ot===void 0?void 0:ot.value,on,{source:"input"})},lt=on=>{Vt.current||en||Be(on)},Ot=typeof xe=="boolean"?Fe.createElement(Qe.Z,null):null,It=`${zt}-button`;let Ht;const Yt=xe||{},an=Yt.type&&Yt.type.__ANT_BUTTON===!0;an||Yt.type==="button"?Ht=(0,mt.Tm)(Yt,Object.assign({onMouseDown:le,onClick:on=>{var Pn,ot;(ot=(Pn=Yt==null?void 0:Yt.props)===null||Pn===void 0?void 0:Pn.onClick)===null||ot===void 0||ot.call(Pn,on),Be(on)},key:"enterButton"},an?{className:It,size:oe}:{})):Ht=Fe.createElement(We.ZP,{className:It,type:xe?"primary":void 0,size:oe,disabled:Wt,key:"enterButton",onMouseDown:le,onClick:Be,loading:en,icon:Ot},xe),gt&&(Ht=[Ht,(0,mt.Tm)(gt,{key:"addonAfter"})]);const cn=Ze()(zt,{[`${zt}-rtl`]:Zt==="rtl",[`${zt}-${oe}`]:!!oe,[`${zt}-with-button`]:!!xe},Bt),Sn=on=>{Vt.current=!0,Lt==null||Lt(on)},wt=on=>{Vt.current=!1,mn==null||mn(on)};return Fe.createElement(_e.Z,Object.assign({ref:(0,He.sQ)(de,Ut),onPressEnter:lt},Qt,{size:oe,onCompositionStart:Sn,onCompositionEnd:wt,prefixCls:ye,addonAfter:Ht,suffix:$e,onChange:pe,className:cn,disabled:Wt}))}),Nt=ue(1643);const ht=_e.Z;ht.Group=we,ht.Search=Xe,ht.TextArea=Nt.Z,ht.Password=jt;var Tt=ht},9937:function(Mn,rn,ue){"use strict";ue.d(rn,{M1:function(){return Pe},TM:function(){return mt},Xy:function(){return we},bi:function(){return dt},e5:function(){return Qe},ik:function(){return Ae},nz:function(){return be},pU:function(){return De},s7:function(){return He},x0:function(){return Ne}});var fe=ue(17313),Ze=ue(74207),Fe=ue(37613),tt=ue(83116);const be=We=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:We,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),De=We=>({borderColor:We.hoverBorderColor}),Pe=We=>({borderColor:We.activeBorderColor,boxShadow:We.activeShadow,outline:0}),we=We=>({color:We.colorTextDisabled,backgroundColor:We.colorBgContainerDisabled,borderColor:We.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},De((0,Fe.TS)(We,{hoverBorderColor:We.colorBorder})))}),_e=We=>{const{paddingBlockLG:Me,fontSizeLG:Ke,lineHeightLG:Ve,borderRadiusLG:Mt,paddingInlineLG:Xe}=We;return{padding:`${Me}px ${Xe}px`,fontSize:Ke,lineHeight:Ve,borderRadius:Mt}},Ne=We=>({padding:`${We.paddingBlockSM}px ${We.paddingInlineSM}px`,borderRadius:We.borderRadiusSM}),dt=(We,Me)=>{const{componentCls:Ke,colorError:Ve,colorWarning:Mt,errorActiveShadow:Xe,warningActiveShadow:Nt,colorErrorBorderHover:ht,colorWarningBorderHover:Tt}=We;return{[`&-status-error:not(${Me}-disabled):not(${Me}-borderless)${Me}`]:{borderColor:Ve,"&:hover":{borderColor:ht},"&:focus, &-focused":Object.assign({},Pe((0,Fe.TS)(We,{activeBorderColor:Ve,activeShadow:Xe}))),[`${Ke}-prefix, ${Ke}-suffix`]:{color:Ve}},[`&-status-warning:not(${Me}-disabled):not(${Me}-borderless)${Me}`]:{borderColor:Mt,"&:hover":{borderColor:Tt},"&:focus, &-focused":Object.assign({},Pe((0,Fe.TS)(We,{activeBorderColor:Mt,activeShadow:Nt}))),[`${Ke}-prefix, ${Ke}-suffix`]:{color:Mt}}}},Ae=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}`},be(We.colorTextPlaceholder)),{"&:hover":Object.assign({},De(We)),"&:focus, &-focused":Object.assign({},Pe(We)),"&-disabled, &[disabled]":Object.assign({},we(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({},_e(We)),"&-sm":Object.assign({},Ne(We)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),He=We=>{const{componentCls:Me,antCls:Ke}=We;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:We.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${Me}, &-lg > ${Me}-group-addon`]:Object.assign({},_e(We)),[`&-sm ${Me}, &-sm > ${Me}-group-addon`]:Object.assign({},Ne(We)),[`&-lg ${Ke}-select-single ${Ke}-select-selector`]:{height:We.controlHeightLG},[`&-sm ${Ke}-select-single ${Ke}-select-selector`]:{height:We.controlHeightSM},[`> ${Me}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${Me}-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,[`${Ke}-select`]:{margin:`-${We.paddingBlock+1}px -${We.paddingInline}px`,[`&${Ke}-select-single:not(${Ke}-select-customize-input)`]:{[`${Ke}-select-selector`]:{backgroundColor:"inherit",border:`${We.lineWidth}px ${We.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ke}-select-selector`]:{color:We.colorPrimary}}},[`${Ke}-cascader-picker`]:{margin:`-9px -${We.paddingInline}px`,backgroundColor:"transparent",[`${Ke}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${Me}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${Me}-search-with-button &`]:{zIndex:0}}},[`> ${Me}:first-child, ${Me}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ke}-select ${Ke}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Me}-affix-wrapper`]:{[`&:not(:first-child) ${Me}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${Me}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Me}:last-child, ${Me}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ke}-select ${Ke}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${Me}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${Me}-search &`]:{borderStartStartRadius:We.borderRadius,borderEndStartRadius:We.borderRadius}},[`&:not(:first-child), ${Me}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${Me}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,fe.dF)()),{[`${Me}-group-addon, ${Me}-group-wrap, > ${Me}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:We.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${Me}-affix-wrapper,
& > ${Me}-number-affix-wrapper,
& > ${Ke}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-We.lineWidth,borderInlineEndWidth:We.lineWidth},[`${Me}`]:{float:"none"},[`& > ${Ke}-select > ${Ke}-select-selector,
& > ${Ke}-select-auto-complete ${Me},
& > ${Ke}-cascader-picker ${Me},
& > ${Me}-group-wrapper ${Me}`]:{borderInlineEndWidth:We.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ke}-select-focused`]:{zIndex:1},[`& > ${Ke}-select > ${Ke}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ke}-select:first-child > ${Ke}-select-selector,
& > ${Ke}-select-auto-complete:first-child ${Me},
& > ${Ke}-cascader-picker:first-child ${Me}`]:{borderStartStartRadius:We.borderRadius,borderEndStartRadius:We.borderRadius},[`& > *:last-child,
& > ${Ke}-select:last-child > ${Ke}-select-selector,
& > ${Ke}-cascader-picker:last-child ${Me},
& > ${Ke}-cascader-picker-focused:last-child ${Me}`]:{borderInlineEndWidth:We.lineWidth,borderStartEndRadius:We.borderRadius,borderEndEndRadius:We.borderRadius},[`& > ${Ke}-select-auto-complete ${Me}`]:{verticalAlign:"top"},[`${Me}-group-wrapper + ${Me}-group-wrapper`]:{marginInlineStart:-We.lineWidth,[`${Me}-affix-wrapper`]:{borderRadius:0}},[`${Me}-group-wrapper:not(:last-child)`]:{[`&${Me}-search > ${Me}-group`]:{[`& > ${Me}-group-addon > ${Me}-search-button`]:{borderRadius:0},[`& > ${Me}`]:{borderStartStartRadius:We.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:We.borderRadius}}}})}},rt=We=>{const{componentCls:Me,controlHeightSM:Ke,lineWidth:Ve}=We,Xe=(Ke-Ve*2-16)/2;return{[Me]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(We)),Ae(We)),dt(We,Me)),{'&[type="color"]':{height:We.controlHeight,[`&${Me}-lg`]:{height:We.controlHeightLG},[`&${Me}-sm`]:{height:Ke,paddingTop:Xe,paddingBottom:Xe}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},je=We=>{const{componentCls:Me}=We;return{[`${Me}-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`}}}},it=We=>{const{componentCls:Me,inputAffixPadding:Ke,colorTextDescription:Ve,motionDurationSlow:Mt,colorIcon:Xe,colorIconHover:Nt,iconCls:ht}=We;return{[`${Me}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ae(We)),{display:"inline-flex",[`&:not(${Me}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},De(We)),{zIndex:1,[`${Me}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${Me}[disabled]`]:{background:"transparent"}},[`> input${Me}`]:{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"'},[`${Me}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:We.paddingXS}},"&-show-count-suffix":{color:Ve},"&-show-count-has-suffix":{marginInlineEnd:We.paddingXXS},"&-prefix":{marginInlineEnd:Ke},"&-suffix":{marginInlineStart:Ke}}}),je(We)),{[`${ht}${Me}-password-icon`]:{color:Xe,cursor:"pointer",transition:`all ${Mt}`,"&:hover":{color:Nt}}}),dt(We,`${Me}-affix-wrapper`))}},at=We=>{const{componentCls:Me,colorError:Ke,colorWarning:Ve,borderRadiusLG:Mt,borderRadiusSM:Xe}=We;return{[`${Me}-group`]:Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(We)),He(We)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${Me}-group-addon`]:{borderRadius:Mt,fontSize:We.fontSizeLG}},"&-sm":{[`${Me}-group-addon`]:{borderRadius:Xe}},"&-status-error":{[`${Me}-group-addon`]:{color:Ke,borderColor:Ke}},"&-status-warning":{[`${Me}-group-addon`]:{color:Ve,borderColor:Ve}},"&-disabled":{[`${Me}-group-addon`]:Object.assign({},we(We))},[`&:not(${Me}-compact-first-item):not(${Me}-compact-last-item)${Me}-compact-item`]:{[`${Me}, ${Me}-group-addon`]:{borderRadius:0}},[`&:not(${Me}-compact-last-item)${Me}-compact-first-item`]:{[`${Me}, ${Me}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${Me}-compact-first-item)${Me}-compact-last-item`]:{[`${Me}, ${Me}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},xt=We=>{const{componentCls:Me,antCls:Ke}=We,Ve=`${Me}-search`;return{[Ve]:{[`${Me}`]:{"&:hover, &:focus":{borderColor:We.colorPrimaryHover,[`+ ${Me}-group-addon ${Ve}-button:not(${Ke}-btn-primary)`]:{borderInlineStartColor:We.colorPrimaryHover}}},[`${Me}-affix-wrapper`]:{borderRadius:0},[`${Me}-lg`]:{lineHeight:We.lineHeightLG-2e-4},[`> ${Me}-group`]:{[`> ${Me}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Ve}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:We.borderRadius,borderEndEndRadius:We.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Ve}-button:not(${Ke}-btn-primary)`]:{color:We.colorTextDescription,"&:hover":{color:We.colorPrimaryHover},"&:active":{color:We.colorPrimaryActive},[`&${Ke}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Ve}-button`]:{height:We.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Ve}-button`]:{height:We.controlHeightLG},[`&-small ${Ve}-button`]:{height:We.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${Me}-compact-item`]:{[`&:not(${Me}-compact-last-item)`]:{[`${Me}-group-addon`]:{[`${Me}-search-button`]:{marginInlineEnd:-We.lineWidth,borderRadius:0}}},[`&:not(${Me}-compact-first-item)`]:{[`${Me},${Me}-affix-wrapper`]:{borderRadius:0}},[`> ${Me}-group-addon ${Me}-search-button,
> ${Me},
${Me}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${Me}-affix-wrapper-focused`]:{zIndex:2}}}}},jt=We=>{const{componentCls:Me,paddingLG:Ke}=We,Ve=`${Me}-textarea`;return{[Ve]:{position:"relative","&-show-count":{[`> ${Me}`]:{height:"100%"},[`${Me}-data-count`]:{position:"absolute",bottom:-We.fontSize*We.lineHeight,insetInlineEnd:0,color:We.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${Me}`]:{paddingInlineEnd:Ke}},[`&-affix-wrapper${Ve}-has-feedback`]:{[`${Me}`]:{paddingInlineEnd:Ke}},[`&-affix-wrapper${Me}-affix-wrapper`]:{padding:0,[`> textarea${Me}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${Me}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${Me}-clear-icon`]:{position:"absolute",insetInlineEnd:We.paddingXS,insetBlockStart:We.paddingXS},[`${Ve}-suffix`]:{position:"absolute",top:0,insetInlineEnd:We.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Qe(We){return(0,Fe.TS)(We,{inputAffixPadding:We.paddingXXS})}const mt=We=>{const{controlHeight:Me,fontSize:Ke,lineHeight:Ve,lineWidth:Mt,controlHeightSM:Xe,controlHeightLG:Nt,fontSizeLG:ht,lineHeightLG:Tt,paddingSM:et,controlPaddingHorizontalSM:Ut,controlPaddingHorizontal:ft,colorFillAlter:Dt,colorPrimaryHover:Bt,controlOutlineWidth:bt,controlOutline:$e,colorErrorOutline:xe,colorWarningOutline:gt}=We;return{paddingBlock:Math.max(Math.round((Me-Ke*Ve)/2*10)/10-Mt,3),paddingBlockSM:Math.max(Math.round((Xe-Ke*Ve)/2*10)/10-Mt,0),paddingBlockLG:Math.ceil((Nt-ht*Tt)/2*10)/10-Mt,paddingInline:et-Mt,paddingInlineSM:Ut-Mt,paddingInlineLG:ft-Mt,addonBg:Dt,activeBorderColor:Bt,hoverBorderColor:Bt,activeShadow:`0 0 0 ${bt}px ${$e}`,errorActiveShadow:`0 0 0 ${bt}px ${xe}`,warningActiveShadow:`0 0 0 ${bt}px ${gt}`}};rn.ZP=(0,tt.Z)("Input",We=>{const Me=(0,Fe.TS)(We,Qe(We));return[rt(Me),jt(Me),it(Me),at(Me),xt(Me),(0,Ze.c)(Me)]},mt)},45818:function(Mn,rn,ue){"use strict";ue.d(rn,{D:function(){return Qe},Z:function(){return Me}});var fe=ue(60499),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},tt=Fe,be=ue(7657),De=function(Ve,Mt){return Ze.createElement(be.Z,(0,fe.Z)({},Ve,{ref:Mt,icon:tt}))},Pe=Ze.forwardRef(De),we=Pe,_e=ue(33853),Ne=ue(38819),dt=ue(92310),Ae=ue.n(dt),He=ue(2738),je=Ke=>!isNaN(parseFloat(Ke))&&isFinite(Ke),it=ue(36355),at=ue(84966),xt=function(Ke,Ve){var Mt={};for(var Xe in Ke)Object.prototype.hasOwnProperty.call(Ke,Xe)&&Ve.indexOf(Xe)<0&&(Mt[Xe]=Ke[Xe]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,Xe=Object.getOwnPropertySymbols(Ke);Nt<Xe.length;Nt++)Ve.indexOf(Xe[Nt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Xe[Nt])&&(Mt[Xe[Nt]]=Ke[Xe[Nt]]);return Mt};const jt={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Qe=Ze.createContext({}),mt=(()=>{let Ke=0;return function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Ke+=1,`${Ve}${Ke}`}})();var Me=Ze.forwardRef((Ke,Ve)=>{const{prefixCls:Mt,className:Xe,trigger:Nt,children:ht,defaultCollapsed:Tt=!1,theme:et="dark",style:Ut={},collapsible:ft=!1,reverseArrow:Dt=!1,width:Bt=200,collapsedWidth:bt=80,zeroWidthTriggerStyle:$e,breakpoint:xe,onCollapse:gt,onBreakpoint:en}=Ke,Wt=xt(Ke,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:qe}=(0,Ze.useContext)(at.Gs),[Ye,Lt]=(0,Ze.useState)("collapsed"in Ke?Ke.collapsed:Tt),[mn,Qt]=(0,Ze.useState)(!1);(0,Ze.useEffect)(()=>{"collapsed"in Ke&&Lt(Ke.collapsed)},[Ke.collapsed]);const dn=(oe,de)=>{"collapsed"in Ke||Lt(oe),gt==null||gt(oe,de)},Zt=(0,Ze.useRef)();Zt.current=oe=>{Qt(oe.matches),en==null||en(oe.matches),Ye!==oe.matches&&dn(oe.matches,"responsive")},(0,Ze.useEffect)(()=>{function oe(pe){return Zt.current(pe)}let de;if(typeof window!="undefined"){const{matchMedia:pe}=window;if(pe&&xe&&xe in jt){de=pe(`(max-width: ${jt[xe]})`);try{de.addEventListener("change",oe)}catch(le){de.addListener(oe)}oe(de)}}return()=>{try{de==null||de.removeEventListener("change",oe)}catch(pe){de==null||de.removeListener(oe)}}},[xe]),(0,Ze.useEffect)(()=>{const oe=mt("ant-sider-");return qe.addSider(oe),()=>qe.removeSider(oe)},[]);const Vt=()=>{dn(!Ye,"clickTrigger")},{getPrefixCls:zt}=(0,Ze.useContext)(it.E_),ye=()=>{const oe=zt("layout-sider",Mt),de=(0,He.Z)(Wt,["collapsed"]),pe=Ye?bt:Bt,le=je(pe)?`${pe}px`:String(pe),Be=parseFloat(String(bt||0))===0?Ze.createElement("span",{onClick:Vt,className:Ae()(`${oe}-zero-width-trigger`,`${oe}-zero-width-trigger-${Dt?"right":"left"}`),style:$e},Nt||Ze.createElement(we,null)):null,It={expanded:Dt?Ze.createElement(Ne.Z,null):Ze.createElement(_e.Z,null),collapsed:Dt?Ze.createElement(_e.Z,null):Ze.createElement(Ne.Z,null)}[Ye?"collapsed":"expanded"],Ht=Nt!==null?Be||Ze.createElement("div",{className:`${oe}-trigger`,onClick:Vt,style:{width:le}},Nt||It):null,Yt=Object.assign(Object.assign({},Ut),{flex:`0 0 ${le}`,maxWidth:le,minWidth:le,width:le}),an=Ae()(oe,`${oe}-${et}`,{[`${oe}-collapsed`]:!!Ye,[`${oe}-has-trigger`]:ft&&Nt!==null&&!Be,[`${oe}-below`]:!!mn,[`${oe}-zero-width`]:parseFloat(le)===0},Xe);return Ze.createElement("aside",Object.assign({className:an},de,{style:Yt,ref:Ve}),Ze.createElement("div",{className:`${oe}-children`},ht),ft||mn&&Be?Ht:null)},se=Ze.useMemo(()=>({siderCollapsed:Ye}),[Ye]);return Ze.createElement(Qe.Provider,{value:se},ye())})},84966:function(Mn,rn,ue){"use strict";ue.d(rn,{VY:function(){return Qe},$_:function(){return jt},h4:function(){return xt},Gs:function(){return He},ZP:function(){return mt}});var fe=ue(77654),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(2738),be=ue(59301),De=ue(36355),Pe=ue(83116),_e=We=>{const{componentCls:Me,bodyBg:Ke,lightSiderBg:Ve,lightTriggerBg:Mt,lightTriggerColor:Xe}=We;return{[`${Me}-sider-light`]:{background:Ve,[`${Me}-sider-trigger`]:{color:Xe,background:Mt},[`${Me}-sider-zero-width-trigger`]:{color:Xe,background:Mt,border:`1px solid ${Ke}`,borderInlineStart:0}}}};const Ne=We=>{const{antCls:Me,componentCls:Ke,colorText:Ve,triggerColor:Mt,footerBg:Xe,triggerBg:Nt,headerHeight:ht,headerPadding:Tt,headerColor:et,footerPadding:Ut,triggerHeight:ft,zeroTriggerHeight:Dt,zeroTriggerWidth:Bt,motionDurationMid:bt,motionDurationSlow:$e,fontSize:xe,borderRadius:gt,bodyBg:en,headerBg:Wt,siderBg:qe}=We;return{[Ke]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:en,"&, *":{boxSizing:"border-box"},[`&${Ke}-has-sider`]:{flexDirection:"row",[`> ${Ke}, > ${Ke}-content`]:{width:0}},[`${Ke}-header, &${Ke}-footer`]:{flex:"0 0 auto"},[`${Ke}-sider`]:{position:"relative",minWidth:0,background:qe,transition:`all ${bt}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${Me}-menu${Me}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:ft},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:ft,color:Mt,lineHeight:`${ft}px`,textAlign:"center",background:Nt,cursor:"pointer",transition:`all ${bt}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:ht,insetInlineEnd:-Bt,zIndex:1,width:Bt,height:Dt,color:Mt,fontSize:We.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:qe,borderStartStartRadius:0,borderStartEndRadius:gt,borderEndEndRadius:gt,borderEndStartRadius:0,cursor:"pointer",transition:`background ${$e} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${$e}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Bt,borderStartStartRadius:gt,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:gt}}}}},_e(We)),{"&-rtl":{direction:"rtl"}}),[`${Ke}-header`]:{height:ht,padding:Tt,color:et,lineHeight:`${ht}px`,background:Wt,[`${Me}-menu`]:{lineHeight:"inherit"}},[`${Ke}-footer`]:{padding:Ut,color:Ve,fontSize:xe,background:Xe},[`${Ke}-content`]:{flex:"auto",minHeight:0}}};var dt=(0,Pe.Z)("Layout",We=>[Ne(We)],We=>{const{colorBgLayout:Me,controlHeight:Ke,controlHeightLG:Ve,colorText:Mt,controlHeightSM:Xe,marginXXS:Nt,colorTextLightSolid:ht,colorBgContainer:Tt}=We,et=Ve*1.25;return{colorBgHeader:"#001529",colorBgBody:Me,colorBgTrigger:"#002140",bodyBg:Me,headerBg:"#001529",headerHeight:Ke*2,headerPadding:`0 ${et}px`,headerColor:Mt,footerPadding:`${Xe}px ${et}px`,footerBg:Me,siderBg:"#001529",triggerHeight:Ve+Nt*2,triggerBg:"#002140",triggerColor:ht,zeroTriggerWidth:Ve,zeroTriggerHeight:Ve,lightSiderBg:Tt,lightTriggerBg:Tt,lightTriggerColor:Mt}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),Ae=function(We,Me){var Ke={};for(var Ve in We)Object.prototype.hasOwnProperty.call(We,Ve)&&Me.indexOf(Ve)<0&&(Ke[Ve]=We[Ve]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,Ve=Object.getOwnPropertySymbols(We);Mt<Ve.length;Mt++)Me.indexOf(Ve[Mt])<0&&Object.prototype.propertyIsEnumerable.call(We,Ve[Mt])&&(Ke[Ve[Mt]]=We[Ve[Mt]]);return Ke};const He=be.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function rt(We){let{suffixCls:Me,tagName:Ke,displayName:Ve}=We;return Mt=>be.forwardRef((Nt,ht)=>be.createElement(Mt,Object.assign({ref:ht,suffixCls:Me,tagName:Ke},Nt)))}const je=be.forwardRef((We,Me)=>{const{prefixCls:Ke,suffixCls:Ve,className:Mt,tagName:Xe}=We,Nt=Ae(We,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:ht}=be.useContext(De.E_),Tt=ht("layout",Ke),[et,Ut]=dt(Tt),ft=Ve?`${Tt}-${Ve}`:Tt;return et(be.createElement(Xe,Object.assign({className:Fe()(Ke||ft,Mt,Ut),ref:Me},Nt)))}),it=be.forwardRef((We,Me)=>{const{direction:Ke}=be.useContext(De.E_),[Ve,Mt]=be.useState([]),{prefixCls:Xe,className:Nt,rootClassName:ht,children:Tt,hasSider:et,tagName:Ut,style:ft}=We,Dt=Ae(We,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Bt=(0,tt.Z)(Dt,["suffixCls"]),{getPrefixCls:bt,layout:$e}=be.useContext(De.E_),xe=bt("layout",Xe),[gt,en]=dt(xe),Wt=Fe()(xe,{[`${xe}-has-sider`]:typeof et=="boolean"?et:Ve.length>0,[`${xe}-rtl`]:Ke==="rtl"},$e==null?void 0:$e.className,Nt,ht,en),qe=be.useMemo(()=>({siderHook:{addSider:Ye=>{Mt(Lt=>[].concat((0,fe.Z)(Lt),[Ye]))},removeSider:Ye=>{Mt(Lt=>Lt.filter(mn=>mn!==Ye))}}}),[]);return gt(be.createElement(He.Provider,{value:qe},be.createElement(Ut,Object.assign({ref:Me,className:Wt,style:Object.assign(Object.assign({},$e==null?void 0:$e.style),ft)},Bt),Tt)))}),at=rt({tagName:"div",displayName:"Layout"})(it),xt=rt({suffixCls:"header",tagName:"header",displayName:"Header"})(je),jt=rt({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(je),Qe=rt({suffixCls:"content",tagName:"main",displayName:"Content"})(je);var mt=at},40875:function(Mn,rn,ue){"use strict";ue.d(rn,{J:function(){return De}});var fe=ue(59301),Ze=ue(33234),Fe=ue(70425),tt=function(Pe,we){var _e={};for(var Ne in Pe)Object.prototype.hasOwnProperty.call(Pe,Ne)&&we.indexOf(Ne)<0&&(_e[Ne]=Pe[Ne]);if(Pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var dt=0,Ne=Object.getOwnPropertySymbols(Pe);dt<Ne.length;dt++)we.indexOf(Ne[dt])<0&&Object.prototype.propertyIsEnumerable.call(Pe,Ne[dt])&&(_e[Ne[dt]]=Pe[Ne[dt]]);return _e};const be=fe.createContext(null),De=fe.forwardRef((Pe,we)=>{const{children:_e}=Pe,Ne=tt(Pe,["children"]),dt=fe.useContext(be),Ae=fe.useMemo(()=>Object.assign(Object.assign({},dt),Ne),[dt,Ne.prefixCls,Ne.mode,Ne.selectable]);return fe.createElement(be.Provider,{value:Ae},fe.createElement(Ze.BR,null,(0,Fe.supportNodeRef)(_e)?fe.cloneElement(_e,{ref:we}):_e))});rn.Z=be},20834:function(Mn,rn,ue){"use strict";ue.d(rn,{default:function(){return se}});var fe=ue(15285),Ze=ue(59301),Fe=ue(45818),tt=ue(92310),be=ue.n(tt),De=ue(36355),Pe=function(oe,de){var pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,le=Object.getOwnPropertySymbols(oe);Be<le.length;Be++)de.indexOf(le[Be])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Be])&&(pe[le[Be]]=oe[le[Be]]);return pe},_e=oe=>{const{prefixCls:de,className:pe,dashed:le}=oe,Be=Pe(oe,["prefixCls","className","dashed"]),{getPrefixCls:lt}=Ze.useContext(De.E_),Ot=lt("menu",de),It=be()({[`${Ot}-item-divider-dashed`]:!!le},pe);return Ze.createElement(fe.iz,Object.assign({className:It},Be))},Ne=ue(11592),dt=ue(2738),Ae=ue(6848),He=ue(92343),je=(0,Ze.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),at=oe=>{var de;const{className:pe,children:le,icon:Be,title:lt,danger:Ot}=oe,{prefixCls:It,firstLevel:Ht,direction:Yt,disableMenuItemTitleTooltip:an,inlineCollapsed:cn}=Ze.useContext(je),Sn=$t=>{const Dn=Ze.createElement("span",{className:`${It}-title-content`},le);return(!Be||(0,He.l$)(le)&&le.type==="span")&&le&&$t&&Ht&&typeof le=="string"?Ze.createElement("div",{className:`${It}-inline-collapsed-noicon`},le.charAt(0)):Dn},{siderCollapsed:wt}=Ze.useContext(Fe.D);let on=lt;typeof lt=="undefined"?on=Ht?le:"":lt===!1&&(on="");const Pn={title:on};!wt&&!cn&&(Pn.title=null,Pn.open=!1);const ot=(0,Ne.Z)(le).length;let St=Ze.createElement(fe.ck,Object.assign({},(0,dt.Z)(oe,["title","icon","danger"]),{className:be()({[`${It}-item-danger`]:Ot,[`${It}-item-only-child`]:(Be?ot+1:ot)===1},pe),title:typeof lt=="string"?lt:void 0}),(0,He.Tm)(Be,{className:be()((0,He.l$)(Be)?(de=Be.props)===null||de===void 0?void 0:de.className:"",`${It}-item-icon`)}),Sn(cn));return an||(St=Ze.createElement(Ae.Z,Object.assign({},Pn,{placement:Yt==="rtl"?"left":"right",overlayClassName:`${It}-inline-collapsed-tooltip`}),St)),St},jt=oe=>{var de;const{popupClassName:pe,icon:le,title:Be,theme:lt}=oe,Ot=Ze.useContext(je),{prefixCls:It,inlineCollapsed:Ht,theme:Yt}=Ot,an=(0,fe.Xl)();let cn;if(!le)cn=Ht&&!an.length&&Be&&typeof Be=="string"?Ze.createElement("div",{className:`${It}-inline-collapsed-noicon`},Be.charAt(0)):Ze.createElement("span",{className:`${It}-title-content`},Be);else{const wt=(0,He.l$)(Be)&&Be.type==="span";cn=Ze.createElement(Ze.Fragment,null,(0,He.Tm)(le,{className:be()((0,He.l$)(le)?(de=le.props)===null||de===void 0?void 0:de.className:"",`${It}-item-icon`)}),wt?Be:Ze.createElement("span",{className:`${It}-title-content`},Be))}const Sn=Ze.useMemo(()=>Object.assign(Object.assign({},Ot),{firstLevel:!1}),[Ot]);return Ze.createElement(je.Provider,{value:Sn},Ze.createElement(fe.Wd,Object.assign({},(0,dt.Z)(oe,["icon"]),{title:cn,popupClassName:be()(It,pe,`${It}-${lt||Yt}`)})))},Qe=ue(18785),mt=ue(70425),We=ue(62892),Me=ue(40875),Ke=function(oe,de){var pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,le=Object.getOwnPropertySymbols(oe);Be<le.length;Be++)de.indexOf(le[Be])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Be])&&(pe[le[Be]]=oe[le[Be]]);return pe};function Ve(oe){return(oe||[]).map((de,pe)=>{if(de&&typeof de=="object"){const le=de,{label:Be,children:lt,key:Ot,type:It}=le,Ht=Ke(le,["label","children","key","type"]),Yt=Ot!=null?Ot:`tmp-${pe}`;return lt||It==="group"?It==="group"?Ze.createElement(fe.BW,Object.assign({key:Yt},Ht,{title:Be}),Ve(lt)):Ze.createElement(jt,Object.assign({key:Yt},Ht,{title:Be}),Ve(lt)):It==="divider"?Ze.createElement(_e,Object.assign({key:Yt},Ht)):Ze.createElement(at,Object.assign({key:Yt},Ht),Be)}return null}).filter(de=>de)}function Mt(oe){return Ze.useMemo(()=>oe&&Ve(oe),[oe])}var Xe=ue(64993),Nt=ue(17313),ht=ue(8378),Tt=ue(13826),et=ue(29878),Ut=ue(83116),ft=ue(37613),Bt=oe=>{const{componentCls:de,motionDurationSlow:pe,horizontalLineHeight:le,colorSplit:Be,lineWidth:lt,lineType:Ot,itemPaddingInline:It}=oe;return{[`${de}-horizontal`]:{lineHeight:le,border:0,borderBottom:`${lt}px ${Ot} ${Be}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${de}-item, ${de}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:It},[`> ${de}-item:hover,
> ${de}-item-active,
> ${de}-submenu ${de}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${de}-item, ${de}-submenu-title`]:{transition:[`border-color ${pe}`,`background ${pe}`].join(",")},[`${de}-submenu-arrow`]:{display:"none"}}}},$e=oe=>{let{componentCls:de,menuArrowOffset:pe}=oe;return{[`${de}-rtl`]:{direction:"rtl"},[`${de}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${de}-rtl${de}-vertical,
${de}-submenu-rtl ${de}-vertical`]:{[`${de}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${pe})`},"&::after":{transform:`rotate(45deg) translateY(${pe})`}}}}};const xe=oe=>Object.assign({},(0,Nt.oN)(oe));var en=(oe,de)=>{const{componentCls:pe,itemColor:le,itemSelectedColor:Be,groupTitleColor:lt,itemBg:Ot,subMenuItemBg:It,itemSelectedBg:Ht,activeBarHeight:Yt,activeBarWidth:an,activeBarBorderWidth:cn,motionDurationSlow:Sn,motionEaseInOut:wt,motionEaseOut:on,itemPaddingInline:Pn,motionDurationMid:ot,itemHoverColor:St,lineType:$t,colorSplit:Dn,itemDisabledColor:Ln,dangerItemColor:In,dangerItemHoverColor:qn,dangerItemSelectedColor:dr,dangerItemActiveBg:ir,dangerItemSelectedBg:Er,itemHoverBg:kr,itemActiveBg:Qn,menuSubMenuBg:Kr,horizontalItemSelectedColor:jr,horizontalItemSelectedBg:Hr,horizontalItemBorderRadius:ni,horizontalItemHoverBg:Br,popupBg:qr}=oe;return{[`${pe}-${de}, ${pe}-${de} > ${pe}`]:{color:le,background:Ot,[`&${pe}-root:focus-visible`]:Object.assign({},xe(oe)),[`${pe}-item-group-title`]:{color:lt},[`${pe}-submenu-selected`]:{[`> ${pe}-submenu-title`]:{color:Be}},[`${pe}-item-disabled, ${pe}-submenu-disabled`]:{color:`${Ln} !important`},[`${pe}-item:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{[`&:hover, > ${pe}-submenu-title:hover`]:{color:St}},[`&:not(${pe}-horizontal)`]:{[`${pe}-item:not(${pe}-item-selected)`]:{"&:hover":{backgroundColor:kr},"&:active":{backgroundColor:Qn}},[`${pe}-submenu-title`]:{"&:hover":{backgroundColor:kr},"&:active":{backgroundColor:Qn}}},[`${pe}-item-danger`]:{color:In,[`&${pe}-item:hover`]:{[`&:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{color:qn}},[`&${pe}-item:active`]:{background:ir}},[`${pe}-item a`]:{"&, &:hover":{color:"inherit"}},[`${pe}-item-selected`]:{color:Be,[`&${pe}-item-danger`]:{color:dr},"a, a:hover":{color:"inherit"}},[`& ${pe}-item-selected`]:{backgroundColor:Ht,[`&${pe}-item-danger`]:{backgroundColor:Er}},[`${pe}-item, ${pe}-submenu-title`]:{[`&:not(${pe}-item-disabled):focus-visible`]:Object.assign({},xe(oe))},[`&${pe}-submenu > ${pe}`]:{backgroundColor:Kr},[`&${pe}-popup > ${pe}`]:{backgroundColor:qr},[`&${pe}-horizontal`]:Object.assign(Object.assign({},de==="dark"?{borderBottom:0}:{}),{[`> ${pe}-item, > ${pe}-submenu`]:{top:cn,marginTop:-cn,marginBottom:0,borderRadius:ni,"&::after":{position:"absolute",insetInline:Pn,bottom:0,borderBottom:`${Yt}px solid transparent`,transition:`border-color ${Sn} ${wt}`,content:'""'},"&:hover, &-active, &-open":{background:Br,"&::after":{borderBottomWidth:Yt,borderBottomColor:jr}},"&-selected":{color:jr,backgroundColor:Hr,"&:hover":{backgroundColor:Hr},"&::after":{borderBottomWidth:Yt,borderBottomColor:jr}}}}),[`&${pe}-root`]:{[`&${pe}-inline, &${pe}-vertical`]:{borderInlineEnd:`${cn}px ${$t} ${Dn}`}},[`&${pe}-inline`]:{[`${pe}-sub${pe}-inline`]:{background:It},[`${pe}-item, ${pe}-submenu-title`]:cn&&an?{width:`calc(100% + ${cn}px)`}:{},[`${pe}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${an}px solid ${Be}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${ot} ${on}`,`opacity ${ot} ${on}`].join(","),content:'""'},[`&${pe}-item-danger`]:{"&::after":{borderInlineEndColor:dr}}},[`${pe}-selected, ${pe}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${ot} ${wt}`,`opacity ${ot} ${wt}`].join(",")}}}}}};const Wt=oe=>{const{componentCls:de,itemHeight:pe,itemMarginInline:le,padding:Be,menuArrowSize:lt,marginXS:Ot,itemMarginBlock:It}=oe,Ht=Be+lt+Ot;return{[`${de}-item`]:{position:"relative",overflow:"hidden"},[`${de}-item, ${de}-submenu-title`]:{height:pe,lineHeight:`${pe}px`,paddingInline:Be,overflow:"hidden",textOverflow:"ellipsis",marginInline:le,marginBlock:It,width:`calc(100% - ${le*2}px)`},[`> ${de}-item,
> ${de}-submenu > ${de}-submenu-title`]:{height:pe,lineHeight:`${pe}px`},[`${de}-item-group-list ${de}-submenu-title,
${de}-submenu-title`]:{paddingInlineEnd:Ht}}};var Ye=oe=>{const{componentCls:de,iconCls:pe,itemHeight:le,colorTextLightSolid:Be,dropdownWidth:lt,controlHeightLG:Ot,motionDurationMid:It,motionEaseOut:Ht,paddingXL:Yt,itemMarginInline:an,fontSizeLG:cn,motionDurationSlow:Sn,paddingXS:wt,boxShadowSecondary:on,collapsedWidth:Pn,collapsedIconSize:ot}=oe,St={height:le,lineHeight:`${le}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[de]:{"&-inline, &-vertical":Object.assign({[`&${de}-root`]:{boxShadow:"none"}},Wt(oe))},[`${de}-submenu-popup`]:{[`${de}-vertical`]:Object.assign(Object.assign({},Wt(oe)),{boxShadow:on})}},{[`${de}-submenu-popup ${de}-vertical${de}-sub`]:{minWidth:lt,maxHeight:`calc(100vh - ${Ot*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${de}-inline`]:{width:"100%",[`&${de}-root`]:{[`${de}-item, ${de}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${Sn}`,`background ${Sn}`,`padding ${It} ${Ht}`].join(","),[`> ${de}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${de}-sub${de}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${de}-submenu > ${de}-submenu-title`]:St,[`& ${de}-item-group-title`]:{paddingInlineStart:Yt}},[`${de}-item`]:St}},{[`${de}-inline-collapsed`]:{width:Pn,[`&${de}-root`]:{[`${de}-item, ${de}-submenu ${de}-submenu-title`]:{[`> ${de}-inline-collapsed-noicon`]:{fontSize:cn,textAlign:"center"}}},[`> ${de}-item,
> ${de}-item-group > ${de}-item-group-list > ${de}-item,
> ${de}-item-group > ${de}-item-group-list > ${de}-submenu > ${de}-submenu-title,
> ${de}-submenu > ${de}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${cn/2}px - ${an}px)`,textOverflow:"clip",[`
${de}-submenu-arrow,
${de}-submenu-expand-icon
`]:{opacity:0},[`${de}-item-icon, ${pe}`]:{margin:0,fontSize:ot,lineHeight:`${le}px`,"+ span":{display:"inline-block",opacity:0}}},[`${de}-item-icon, ${pe}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${de}-item-icon, ${pe}`]:{display:"none"},"a, a:hover":{color:Be}},[`${de}-item-group-title`]:Object.assign(Object.assign({},Nt.vS),{paddingInline:wt})}}]};const Lt=oe=>{const{componentCls:de,motionDurationSlow:pe,motionDurationMid:le,motionEaseInOut:Be,motionEaseOut:lt,iconCls:Ot,iconSize:It,iconMarginInlineEnd:Ht}=oe;return{[`${de}-item, ${de}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${pe}`,`background ${pe}`,`padding ${pe} ${Be}`].join(","),[`${de}-item-icon, ${Ot}`]:{minWidth:It,fontSize:It,transition:[`font-size ${le} ${lt}`,`margin ${pe} ${Be}`,`color ${pe}`].join(","),"+ span":{marginInlineStart:Ht,opacity:1,transition:[`opacity ${pe} ${Be}`,`margin ${pe}`,`color ${pe}`].join(",")}},[`${de}-item-icon`]:Object.assign({},(0,Nt.Ro)()),[`&${de}-item-only-child`]:{[`> ${Ot}, > ${de}-item-icon`]:{marginInlineEnd:0}}},[`${de}-item-disabled, ${de}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${de}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},mn=oe=>{const{componentCls:de,motionDurationSlow:pe,motionEaseInOut:le,borderRadius:Be,menuArrowSize:lt,menuArrowOffset:Ot}=oe;return{[`${de}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:oe.margin,width:lt,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${pe} ${le}, opacity ${pe}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:lt*.6,height:lt*.15,backgroundColor:"currentcolor",borderRadius:Be,transition:[`background ${pe} ${le}`,`transform ${pe} ${le}`,`top ${pe} ${le}`,`color ${pe} ${le}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${Ot})`},"&::after":{transform:`rotate(-45deg) translateY(${Ot})`}}}}},Qt=oe=>{const{antCls:de,componentCls:pe,fontSize:le,motionDurationSlow:Be,motionDurationMid:lt,motionEaseInOut:Ot,paddingXS:It,padding:Ht,colorSplit:Yt,lineWidth:an,zIndexPopup:cn,borderRadiusLG:Sn,subMenuItemBorderRadius:wt,menuArrowSize:on,menuArrowOffset:Pn,lineType:ot,menuPanelMaskInset:St,groupTitleLineHeight:$t,groupTitleFontSize:Dn}=oe;return[{"":{[`${pe}`]:Object.assign(Object.assign({},(0,Nt.dF)()),{"&-hidden":{display:"none"}})},[`${pe}-submenu-hidden`]:{display:"none"}},{[pe]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Nt.Wf)(oe)),(0,Nt.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:le,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${Be} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${pe}-item`]:{flex:"none"}},[`${pe}-item, ${pe}-submenu, ${pe}-submenu-title`]:{borderRadius:oe.itemBorderRadius},[`${pe}-item-group-title`]:{padding:`${It}px ${Ht}px`,fontSize:Dn,lineHeight:$t,transition:`all ${Be}`},[`&-horizontal ${pe}-submenu`]:{transition:[`border-color ${Be} ${Ot}`,`background ${Be} ${Ot}`].join(",")},[`${pe}-submenu, ${pe}-submenu-inline`]:{transition:[`border-color ${Be} ${Ot}`,`background ${Be} ${Ot}`,`padding ${lt} ${Ot}`].join(",")},[`${pe}-submenu ${pe}-sub`]:{cursor:"initial",transition:[`background ${Be} ${Ot}`,`padding ${Be} ${Ot}`].join(",")},[`${pe}-title-content`]:{transition:`color ${Be}`},[`${pe}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${pe}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:Yt,borderStyle:ot,borderWidth:0,borderTopWidth:an,marginBlock:an,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Lt(oe)),{[`${pe}-item-group`]:{[`${pe}-item-group-list`]:{margin:0,padding:0,[`${pe}-item, ${pe}-submenu-title`]:{paddingInline:`${le*2}px ${Ht}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:cn,borderRadius:Sn,boxShadow:"none",transformOrigin:"0 0",[`&${pe}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${St}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:St},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:oe.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:oe.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:oe.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:oe.paddingXS},[`> ${pe}`]:Object.assign(Object.assign(Object.assign({borderRadius:Sn},Lt(oe)),mn(oe)),{[`${pe}-item, ${pe}-submenu > ${pe}-submenu-title`]:{borderRadius:wt},[`${pe}-submenu-title::after`]:{transition:`transform ${Be} ${Ot}`}})}}),mn(oe)),{[`&-inline-collapsed ${pe}-submenu-arrow,
&-inline ${pe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Pn})`},"&::after":{transform:`rotate(45deg) translateX(-${Pn})`}},[`${pe}-submenu-open${pe}-submenu-inline > ${pe}-submenu-title > ${pe}-submenu-arrow`]:{transform:`translateY(-${on*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Pn})`},"&::before":{transform:`rotate(45deg) translateX(${Pn})`}}})},{[`${de}-layout-header`]:{[pe]:{lineHeight:"inherit"}}}]};var dn=(oe,de)=>(0,Ut.Z)("Menu",le=>{if(de===!1)return[];const{colorBgElevated:Be,colorPrimary:lt,colorTextLightSolid:Ot,controlHeightLG:It,fontSize:Ht,darkItemColor:Yt,darkDangerItemColor:an,darkItemBg:cn,darkSubMenuItemBg:Sn,darkItemSelectedColor:wt,darkItemSelectedBg:on,darkDangerItemSelectedBg:Pn,darkItemHoverBg:ot,darkGroupTitleColor:St,darkItemHoverColor:$t,darkItemDisabledColor:Dn,darkDangerItemHoverColor:Ln,darkDangerItemSelectedColor:In,darkDangerItemActiveBg:qn}=le,dr=Ht/7*5,ir=(0,ft.TS)(le,{menuArrowSize:dr,menuHorizontalHeight:It*1.15,menuArrowOffset:`${dr*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:Be}),Er=(0,ft.TS)(ir,{itemColor:Yt,itemHoverColor:$t,groupTitleColor:St,itemSelectedColor:wt,itemBg:cn,popupBg:cn,subMenuItemBg:Sn,itemActiveBg:"transparent",itemSelectedBg:on,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:ot,itemDisabledColor:Dn,dangerItemColor:an,dangerItemHoverColor:Ln,dangerItemSelectedColor:In,dangerItemActiveBg:qn,dangerItemSelectedBg:Pn,menuSubMenuBg:Sn,horizontalItemSelectedColor:Ot,horizontalItemSelectedBg:lt});return[Qt(ir),Bt(ir),Ye(ir),en(ir,"light"),en(Er,"dark"),$e(ir),(0,ht.Z)(ir),(0,Tt.oN)(ir,"slide-up"),(0,Tt.oN)(ir,"slide-down"),(0,et._y)(ir,"zoom-big")]},le=>{const{colorPrimary:Be,colorError:lt,colorTextDisabled:Ot,colorErrorBg:It,colorText:Ht,colorTextDescription:Yt,colorBgContainer:an,colorFillAlter:cn,colorFillContent:Sn,lineWidth:wt,lineWidthBold:on,controlItemBgActive:Pn,colorBgTextHover:ot,controlHeightLG:St,lineHeight:$t,colorBgElevated:Dn,marginXXS:Ln,padding:In,fontSize:qn,controlHeightSM:dr,fontSizeLG:ir,colorTextLightSolid:Er,colorErrorHover:kr}=le,Qn=new Xe.C(Er).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:le.zIndexPopupBase+50,radiusItem:le.borderRadiusLG,itemBorderRadius:le.borderRadiusLG,radiusSubMenuItem:le.borderRadiusSM,subMenuItemBorderRadius:le.borderRadiusSM,colorItemText:Ht,itemColor:Ht,colorItemTextHover:Ht,itemHoverColor:Ht,colorItemTextHoverHorizontal:Be,horizontalItemHoverColor:Be,colorGroupTitle:Yt,groupTitleColor:Yt,colorItemTextSelected:Be,itemSelectedColor:Be,colorItemTextSelectedHorizontal:Be,horizontalItemSelectedColor:Be,colorItemBg:an,itemBg:an,colorItemBgHover:ot,itemHoverBg:ot,colorItemBgActive:Sn,itemActiveBg:Pn,colorSubItemBg:cn,subMenuItemBg:cn,colorItemBgSelected:Pn,itemSelectedBg:Pn,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:on,activeBarHeight:on,colorActiveBarBorderSize:wt,activeBarBorderWidth:wt,colorItemTextDisabled:Ot,itemDisabledColor:Ot,colorDangerItemText:lt,dangerItemColor:lt,colorDangerItemTextHover:lt,dangerItemHoverColor:lt,colorDangerItemTextSelected:lt,dangerItemSelectedColor:lt,colorDangerItemBgActive:It,dangerItemActiveBg:It,colorDangerItemBgSelected:It,dangerItemSelectedBg:It,itemMarginInline:le.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:St,groupTitleLineHeight:$t,collapsedWidth:St*2,popupBg:Dn,itemMarginBlock:Ln,itemPaddingInline:In,horizontalLineHeight:`${St*1.15}px`,iconSize:qn,iconMarginInlineEnd:dr-qn,collapsedIconSize:ir,groupTitleFontSize:qn,darkItemDisabledColor:new Xe.C(Er).setAlpha(.25).toRgbString(),darkItemColor:Qn,darkDangerItemColor:lt,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Er,darkItemSelectedBg:Be,darkDangerItemSelectedBg:lt,darkItemHoverBg:"transparent",darkGroupTitleColor:Qn,darkItemHoverColor:Er,darkDangerItemHoverColor:kr,darkDangerItemSelectedColor:Er,darkDangerItemActiveBg:lt}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(oe),Zt=function(oe,de){var pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,le=Object.getOwnPropertySymbols(oe);Be<le.length;Be++)de.indexOf(le[Be])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Be])&&(pe[le[Be]]=oe[le[Be]]);return pe},zt=(0,Ze.forwardRef)((oe,de)=>{var pe,le;const Be=Ze.useContext(Me.Z),lt=Be||{},{getPrefixCls:Ot,getPopupContainer:It,direction:Ht,menu:Yt}=Ze.useContext(De.E_),an=Ot(),{prefixCls:cn,className:Sn,style:wt,theme:on="light",expandIcon:Pn,_internalDisableMenuItemTitleTooltip:ot,inlineCollapsed:St,siderCollapsed:$t,items:Dn,children:Ln,rootClassName:In,mode:qn,selectable:dr,onClick:ir,overflowedIndicatorPopupClassName:Er}=oe,kr=Zt(oe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Qn=(0,dt.Z)(kr,["collapsedWidth"]),Kr=Mt(Dn)||Ln;(pe=lt.validator)===null||pe===void 0||pe.call(lt,{mode:qn});const jr=(0,mt.useEvent)(function(){var Kn;ir==null||ir.apply(void 0,arguments),(Kn=lt.onClick)===null||Kn===void 0||Kn.call(lt)}),Hr=lt.mode||qn,ni=dr!=null?dr:lt.selectable,Br=Ze.useMemo(()=>$t!==void 0?$t:St,[St,$t]),qr={horizontal:{motionName:`${an}-slide-up`},inline:(0,We.Z)(an),other:{motionName:`${an}-zoom-big`}},Cr=Ot("menu",cn||lt.prefixCls),[yn,wn]=dn(Cr,!Be),fn=be()(`${Cr}-${on}`,Yt==null?void 0:Yt.className,Sn);let Rn;if(typeof Pn=="function")Rn=Pn;else if(Pn===null||Pn===!1)Rn=null;else if(lt.expandIcon===null||lt.expandIcon===!1)Rn=null;else{const Kn=Pn!=null?Pn:lt.expandIcon;Rn=(0,He.Tm)(Kn,{className:be()(`${Cr}-submenu-expand-icon`,(0,He.l$)(Kn)?(le=Kn.props)===null||le===void 0?void 0:le.className:"")})}const br=Ze.useMemo(()=>({prefixCls:Cr,inlineCollapsed:Br||!1,direction:Ht,firstLevel:!0,theme:on,mode:Hr,disableMenuItemTitleTooltip:ot}),[Cr,Br,Ht,ot,on]);return yn(Ze.createElement(Me.Z.Provider,{value:null},Ze.createElement(je.Provider,{value:br},Ze.createElement(fe.ZP,Object.assign({getPopupContainer:It,overflowedIndicator:Ze.createElement(Qe.Z,null),overflowedIndicatorPopupClassName:be()(Cr,`${Cr}-${on}`,Er),mode:Hr,selectable:ni,onClick:jr},Qn,{inlineCollapsed:Br,style:Object.assign(Object.assign({},Yt==null?void 0:Yt.style),wt),className:fn,prefixCls:Cr,direction:Ht,defaultMotions:qr,expandIcon:Rn,ref:de,rootClassName:be()(In,wn)}),Kr))))});const ye=(0,Ze.forwardRef)((oe,de)=>{const pe=(0,Ze.useRef)(null),le=Ze.useContext(Fe.D);return(0,Ze.useImperativeHandle)(de,()=>({menu:pe.current,focus:Be=>{var lt;(lt=pe.current)===null||lt===void 0||lt.focus(Be)}})),Ze.createElement(zt,Object.assign({ref:pe},oe,le))});ye.Item=at,ye.SubMenu=jt,ye.Divider=_e,ye.ItemGroup=fe.BW;var se=ye},5112:function(Mn,rn,ue){"use strict";ue.d(rn,{ZP:function(){return $e}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(18929),tt=ue(26112),be=ue(59301),De=ue(36355),Pe=ue(19716);const we=be.createContext(null),_e=we.Provider;var Ne=we;const dt=be.createContext(null),Ae=dt.Provider;var He=ue(5630),rt=ue(8654),je=ue(1684),it=ue(32441),at=ue(17313),xt=ue(83116),jt=ue(37613);const Qe=xe=>{const{componentCls:gt,antCls:en}=xe,Wt=`${gt}-group`;return{[Wt]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{display:"inline-block",fontSize:0,[`&${Wt}-rtl`]:{direction:"rtl"},[`${en}-badge ${en}-badge-count`]:{zIndex:1},[`> ${en}-badge:not(:first-child) > ${en}-button-wrapper`]:{borderInlineStart:"none"}})}},mt=xe=>{const{componentCls:gt,wrapperMarginInlineEnd:en,colorPrimary:Wt,radioSize:qe,motionDurationSlow:Ye,motionDurationMid:Lt,motionEaseInOutCirc:mn,colorBgContainer:Qt,colorBorder:dn,lineWidth:Zt,dotSize:Vt,colorBgContainerDisabled:zt,colorTextDisabled:ye,paddingXS:se,dotColorDisabled:oe,lineType:de,radioDotDisabledSize:pe,wireframe:le,colorWhite:Be}=xe,lt=`${gt}-inner`;return{[`${gt}-wrapper`]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:en,cursor:"pointer",[`&${gt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:xe.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${gt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Zt}px ${de} ${Wt}`,borderRadius:"50%",visibility:"hidden",content:'""'},[gt]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${gt}-wrapper:hover &,
&:hover ${lt}`]:{borderColor:Wt},[`${gt}-input:focus-visible + ${lt}`]:Object.assign({},(0,at.oN)(xe)),[`${gt}:hover::after, ${gt}-wrapper:hover &::after`]:{visibility:"visible"},[`${gt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:qe,height:qe,marginBlockStart:qe/-2,marginInlineStart:qe/-2,backgroundColor:le?Wt:Be,borderBlockStart:0,borderInlineStart:0,borderRadius:qe,transform:"scale(0)",opacity:0,transition:`all ${Ye} ${mn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:qe,height:qe,backgroundColor:Qt,borderColor:dn,borderStyle:"solid",borderWidth:Zt,borderRadius:"50%",transition:`all ${Lt}`},[`${gt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${gt}-checked`]:{[lt]:{borderColor:Wt,backgroundColor:le?Qt:Wt,"&::after":{transform:`scale(${Vt/qe})`,opacity:1,transition:`all ${Ye} ${mn}`}}},[`${gt}-disabled`]:{cursor:"not-allowed",[lt]:{backgroundColor:zt,borderColor:dn,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${gt}-input`]:{cursor:"not-allowed"},[`${gt}-disabled + span`]:{color:ye,cursor:"not-allowed"},[`&${gt}-checked`]:{[lt]:{"&::after":{transform:`scale(${pe/qe})`}}}},[`span${gt} + *`]:{paddingInlineStart:se,paddingInlineEnd:se}})}},We=xe=>{const{buttonColor:gt,controlHeight:en,componentCls:Wt,lineWidth:qe,lineType:Ye,colorBorder:Lt,motionDurationSlow:mn,motionDurationMid:Qt,buttonPaddingInline:dn,fontSize:Zt,buttonBg:Vt,fontSizeLG:zt,controlHeightLG:ye,controlHeightSM:se,paddingXS:oe,borderRadius:de,borderRadiusSM:pe,borderRadiusLG:le,buttonCheckedBg:Be,buttonSolidCheckedColor:lt,colorTextDisabled:Ot,colorBgContainerDisabled:It,buttonCheckedBgDisabled:Ht,buttonCheckedColorDisabled:Yt,colorPrimary:an,colorPrimaryHover:cn,colorPrimaryActive:Sn,buttonSolidCheckedBg:wt,buttonSolidCheckedHoverBg:on,buttonSolidCheckedActiveBg:Pn}=xe;return{[`${Wt}-button-wrapper`]:{position:"relative",display:"inline-block",height:en,margin:0,paddingInline:dn,paddingBlock:0,color:gt,fontSize:Zt,lineHeight:`${en-qe*2}px`,background:Vt,border:`${qe}px ${Ye} ${Lt}`,borderBlockStartWidth:qe+.02,borderInlineStartWidth:0,borderInlineEndWidth:qe,cursor:"pointer",transition:[`color ${Qt}`,`background ${Qt}`,`box-shadow ${Qt}`].join(","),a:{color:gt},[`> ${Wt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-qe,insetInlineStart:-qe,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:qe,paddingInline:0,backgroundColor:Lt,transition:`background-color ${mn}`,content:'""'}},"&:first-child":{borderInlineStart:`${qe}px ${Ye} ${Lt}`,borderStartStartRadius:de,borderEndStartRadius:de},"&:last-child":{borderStartEndRadius:de,borderEndEndRadius:de},"&:first-child:last-child":{borderRadius:de},[`${Wt}-group-large &`]:{height:ye,fontSize:zt,lineHeight:`${ye-qe*2}px`,"&:first-child":{borderStartStartRadius:le,borderEndStartRadius:le},"&:last-child":{borderStartEndRadius:le,borderEndEndRadius:le}},[`${Wt}-group-small &`]:{height:se,paddingInline:oe-qe,paddingBlock:0,lineHeight:`${se-qe*2}px`,"&:first-child":{borderStartStartRadius:pe,borderEndStartRadius:pe},"&:last-child":{borderStartEndRadius:pe,borderEndEndRadius:pe}},"&:hover":{position:"relative",color:an},"&:has(:focus-visible)":Object.assign({},(0,at.oN)(xe)),[`${Wt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Wt}-button-wrapper-disabled)`]:{zIndex:1,color:an,background:Be,borderColor:an,"&::before":{backgroundColor:an},"&:first-child":{borderColor:an},"&:hover":{color:cn,borderColor:cn,"&::before":{backgroundColor:cn}},"&:active":{color:Sn,borderColor:Sn,"&::before":{backgroundColor:Sn}}},[`${Wt}-group-solid &-checked:not(${Wt}-button-wrapper-disabled)`]:{color:lt,background:wt,borderColor:wt,"&:hover":{color:lt,background:on,borderColor:on},"&:active":{color:lt,background:Pn,borderColor:Pn}},"&-disabled":{color:Ot,backgroundColor:It,borderColor:Lt,cursor:"not-allowed","&:first-child, &:hover":{color:Ot,backgroundColor:It,borderColor:Lt}},[`&-disabled${Wt}-button-wrapper-checked`]:{color:Yt,backgroundColor:Ht,borderColor:Lt,boxShadow:"none"}}}},Me=xe=>xe-4*2;var Ke=(0,xt.Z)("Radio",xe=>{const{controlOutline:gt,controlOutlineWidth:en,radioSize:Wt}=xe,qe=`0 0 0 ${en}px ${gt}`,Ye=qe,Lt=Me(Wt),mn=(0,jt.TS)(xe,{radioDotDisabledSize:Lt,radioFocusShadow:qe,radioButtonFocusShadow:Ye});return[Qe(mn),mt(mn),We(mn)]},xe=>{const{wireframe:gt,padding:en,marginXS:Wt,lineWidth:qe,fontSizeLG:Ye,colorText:Lt,colorBgContainer:mn,colorTextDisabled:Qt,controlItemBgActiveDisabled:dn,colorTextLightSolid:Zt,colorPrimary:Vt,colorPrimaryHover:zt,colorPrimaryActive:ye}=xe,se=4,oe=Ye,de=gt?Me(oe):oe-(se+qe)*2;return{radioSize:oe,dotSize:de,dotColorDisabled:Qt,buttonSolidCheckedColor:Zt,buttonSolidCheckedBg:Vt,buttonSolidCheckedHoverBg:zt,buttonSolidCheckedActiveBg:ye,buttonBg:mn,buttonCheckedBg:mn,buttonColor:Lt,buttonCheckedBgDisabled:dn,buttonCheckedColorDisabled:Qt,buttonPaddingInline:en-qe,wrapperMarginInlineEnd:Wt}}),Ve=ue(14088),Mt=ue(4572),Xe=function(xe,gt){var en={};for(var Wt in xe)Object.prototype.hasOwnProperty.call(xe,Wt)&&gt.indexOf(Wt)<0&&(en[Wt]=xe[Wt]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Wt=Object.getOwnPropertySymbols(xe);qe<Wt.length;qe++)gt.indexOf(Wt[qe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Wt[qe])&&(en[Wt[qe]]=xe[Wt[qe]]);return en};const Nt=(xe,gt)=>{var en,Wt;const qe=be.useContext(Ne),Ye=be.useContext(dt),{getPrefixCls:Lt,direction:mn,radio:Qt}=be.useContext(De.E_),dn=be.useRef(null),Zt=(0,rt.sQ)(gt,dn),{isFormItemInput:Vt}=be.useContext(it.aM),zt=Sn=>{var wt,on;(wt=xe.onChange)===null||wt===void 0||wt.call(xe,Sn),(on=qe==null?void 0:qe.onChange)===null||on===void 0||on.call(qe,Sn)},{prefixCls:ye,className:se,rootClassName:oe,children:de,style:pe}=xe,le=Xe(xe,["prefixCls","className","rootClassName","children","style"]),Be=Lt("radio",ye),lt=((qe==null?void 0:qe.optionType)||Ye)==="button",Ot=lt?`${Be}-button`:Be,[It,Ht]=Ke(Be),Yt=Object.assign({},le),an=be.useContext(je.Z);qe&&(Yt.name=qe.name,Yt.onChange=zt,Yt.checked=xe.value===qe.value,Yt.disabled=(en=Yt.disabled)!==null&&en!==void 0?en:qe.disabled),Yt.disabled=(Wt=Yt.disabled)!==null&&Wt!==void 0?Wt:an;const cn=Ze()(`${Ot}-wrapper`,{[`${Ot}-wrapper-checked`]:Yt.checked,[`${Ot}-wrapper-disabled`]:Yt.disabled,[`${Ot}-wrapper-rtl`]:mn==="rtl",[`${Ot}-wrapper-in-form-item`]:Vt},Qt==null?void 0:Qt.className,se,oe,Ht);return It(be.createElement(Ve.Z,{component:"Radio",disabled:Yt.disabled},be.createElement("label",{className:cn,style:Object.assign(Object.assign({},Qt==null?void 0:Qt.style),pe),onMouseEnter:xe.onMouseEnter,onMouseLeave:xe.onMouseLeave},be.createElement(He.Z,Object.assign({},Yt,{className:Ze()(Yt.className,!lt&&Mt.A),type:"radio",prefixCls:Ot,ref:Zt})),de!==void 0?be.createElement("span",null,de):null)))};var Tt=be.forwardRef(Nt);const et=be.forwardRef((xe,gt)=>{const{getPrefixCls:en,direction:Wt}=be.useContext(De.E_),[qe,Ye]=(0,Fe.Z)(xe.defaultValue,{value:xe.value}),Lt=wt=>{const on=qe,Pn=wt.target.value;"value"in xe||Ye(Pn);const{onChange:ot}=xe;ot&&Pn!==on&&ot(wt)},{prefixCls:mn,className:Qt,rootClassName:dn,options:Zt,buttonStyle:Vt="outline",disabled:zt,children:ye,size:se,style:oe,id:de,onMouseEnter:pe,onMouseLeave:le,onFocus:Be,onBlur:lt}=xe,Ot=en("radio",mn),It=`${Ot}-group`,[Ht,Yt]=Ke(Ot);let an=ye;Zt&&Zt.length>0&&(an=Zt.map(wt=>typeof wt=="string"||typeof wt=="number"?be.createElement(Tt,{key:wt.toString(),prefixCls:Ot,disabled:zt,value:wt,checked:qe===wt},wt):be.createElement(Tt,{key:`radio-group-value-options-${wt.value}`,prefixCls:Ot,disabled:wt.disabled||zt,value:wt.value,checked:qe===wt.value,title:wt.title,style:wt.style},wt.label)));const cn=(0,Pe.Z)(se),Sn=Ze()(It,`${It}-${Vt}`,{[`${It}-${cn}`]:cn,[`${It}-rtl`]:Wt==="rtl"},Qt,dn,Yt);return Ht(be.createElement("div",Object.assign({},(0,tt.Z)(xe,{aria:!0,data:!0}),{className:Sn,style:oe,onMouseEnter:pe,onMouseLeave:le,onFocus:Be,onBlur:lt,id:de,ref:gt}),be.createElement(_e,{value:{onChange:Lt,value:qe,disabled:xe.disabled,name:xe.name,optionType:xe.optionType}},an)))});var Ut=be.memo(et),ft=function(xe,gt){var en={};for(var Wt in xe)Object.prototype.hasOwnProperty.call(xe,Wt)&&gt.indexOf(Wt)<0&&(en[Wt]=xe[Wt]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Wt=Object.getOwnPropertySymbols(xe);qe<Wt.length;qe++)gt.indexOf(Wt[qe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Wt[qe])&&(en[Wt[qe]]=xe[Wt[qe]]);return en};const Dt=(xe,gt)=>{const{getPrefixCls:en}=be.useContext(De.E_),{prefixCls:Wt}=xe,qe=ft(xe,["prefixCls"]),Ye=en("radio",Wt);return be.createElement(Ae,{value:"button"},be.createElement(Tt,Object.assign({prefixCls:Ye},qe,{type:"radio",ref:gt})))};var Bt=be.forwardRef(Dt);const bt=Tt;bt.Button=Bt,bt.Group=Ut,bt.__ANT_RADIO=!0;var $e=bt},57809:function(Mn,rn,ue){"use strict";var fe=ue(92310),Ze=ue.n(fe),Fe=ue(77861),tt=ue(2738),be=ue(59301),De=ue(53487),Pe=ue(62892),we=ue(19080),_e=ue(36355),Ne=ue(1684),dt=ue(93891),Ae=ue(19716),He=ue(32441),rt=ue(33234),je=ue(14154),it=ue(58582),at=ue(84443),xt=ue(66339),jt=function(Ke,Ve){var Mt={};for(var Xe in Ke)Object.prototype.hasOwnProperty.call(Ke,Xe)&&Ve.indexOf(Xe)<0&&(Mt[Xe]=Ke[Xe]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,Xe=Object.getOwnPropertySymbols(Ke);Nt<Xe.length;Nt++)Ve.indexOf(Xe[Nt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Xe[Nt])&&(Mt[Xe[Nt]]=Ke[Xe[Nt]]);return Mt};const Qe="SECRET_COMBOBOX_MODE_DO_NOT_USE",mt=(Ke,Ve)=>{var Mt,{prefixCls:Xe,bordered:Nt=!0,className:ht,rootClassName:Tt,getPopupContainer:et,popupClassName:Ut,dropdownClassName:ft,listHeight:Dt=256,placement:Bt,listItemHeight:bt=24,size:$e,disabled:xe,notFoundContent:gt,status:en,builtinPlacements:Wt,dropdownMatchSelectWidth:qe,popupMatchSelectWidth:Ye,direction:Lt,style:mn,allowClear:Qt}=Ke,dn=jt(Ke,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Zt,getPrefixCls:Vt,renderEmpty:zt,direction:ye,virtual:se,popupMatchSelectWidth:oe,popupOverflow:de,select:pe}=be.useContext(_e.E_),le=Vt("select",Xe),Be=Vt(),lt=Lt!=null?Lt:ye,{compactSize:Ot,compactItemClassnames:It}=(0,rt.ri)(le,lt),[Ht,Yt]=(0,je.Z)(le),an=be.useMemo(()=>{const{mode:qr}=dn;if(qr!=="combobox")return qr===Qe?"combobox":qr},[dn.mode]),cn=an==="multiple"||an==="tags",Sn=(0,at.Z)(dn.suffixIcon,dn.showArrow),wt=(Mt=Ye!=null?Ye:qe)!==null&&Mt!==void 0?Mt:oe,{status:on,hasFeedback:Pn,isFormItemInput:ot,feedbackIcon:St}=be.useContext(He.aM),$t=(0,we.F)(on,en);let Dn;gt!==void 0?Dn=gt:an==="combobox"?Dn=null:Dn=(zt==null?void 0:zt("Select"))||be.createElement(dt.Z,{componentName:"Select"});const{suffixIcon:Ln,itemIcon:In,removeIcon:qn,clearIcon:dr}=(0,xt.Z)(Object.assign(Object.assign({},dn),{multiple:cn,hasFeedback:Pn,feedbackIcon:St,showSuffixIcon:Sn,prefixCls:le,showArrow:dn.showArrow,componentName:"Select"})),ir=Qt===!0?{clearIcon:dr}:Qt,Er=(0,tt.Z)(dn,["suffixIcon","itemIcon"]),kr=Ze()(Ut||ft,{[`${le}-dropdown-${lt}`]:lt==="rtl"},Tt,Yt),Qn=(0,Ae.Z)(qr=>{var Cr;return(Cr=$e!=null?$e:Ot)!==null&&Cr!==void 0?Cr:qr}),Kr=be.useContext(Ne.Z),jr=xe!=null?xe:Kr,Hr=Ze()({[`${le}-lg`]:Qn==="large",[`${le}-sm`]:Qn==="small",[`${le}-rtl`]:lt==="rtl",[`${le}-borderless`]:!Nt,[`${le}-in-form-item`]:ot},(0,we.Z)(le,$t,Pn),It,pe==null?void 0:pe.className,ht,Tt,Yt),ni=be.useMemo(()=>Bt!==void 0?Bt:lt==="rtl"?"bottomRight":"bottomLeft",[Bt,lt]),Br=(0,it.Z)(Wt,de);return Ht(be.createElement(Fe.ZP,Object.assign({ref:Ve,virtual:se,showSearch:pe==null?void 0:pe.showSearch},Er,{style:Object.assign(Object.assign({},pe==null?void 0:pe.style),mn),dropdownMatchSelectWidth:wt,builtinPlacements:Br,transitionName:(0,Pe.m)(Be,"slide-up",dn.transitionName),listHeight:Dt,listItemHeight:bt,mode:an,prefixCls:le,placement:ni,direction:lt,suffixIcon:Ln,menuItemSelectedIcon:In,removeIcon:qn,allowClear:ir,notFoundContent:Dn,className:Hr,getPopupContainer:et||Zt,dropdownClassName:kr,disabled:jr})))},We=be.forwardRef(mt),Me=(0,De.Z)(We);We.SECRET_COMBOBOX_MODE_DO_NOT_USE=Qe,We.Option=Fe.Wx,We.OptGroup=Fe.Xo,We._InternalPanelDoNotUseOrYouWillBeFired=Me,rn.default=We},14154:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return We}});var fe=ue(17313),Ze=ue(74207),Fe=ue(37613),tt=ue(83116),be=ue(13826),De=ue(92899);const Pe=Me=>{const{optionHeight:Ke,optionFontSize:Ve,optionLineHeight:Mt,optionPadding:Xe}=Me;return{position:"relative",display:"block",minHeight:Ke,padding:Xe,color:Me.colorText,fontWeight:"normal",fontSize:Ve,lineHeight:Mt,boxSizing:"border-box"}};var _e=Me=>{const{antCls:Ke,componentCls:Ve}=Me,Mt=`${Ve}-item`,Xe=`&${Ke}-slide-up-enter${Ke}-slide-up-enter-active`,Nt=`&${Ke}-slide-up-appear${Ke}-slide-up-appear-active`,ht=`&${Ke}-slide-up-leave${Ke}-slide-up-leave-active`,Tt=`${Ve}-dropdown-placement-`;return[{[`${Ve}-dropdown`]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{position:"absolute",top:-9999,zIndex:Me.zIndexPopup,boxSizing:"border-box",padding:Me.paddingXXS,overflow:"hidden",fontSize:Me.fontSize,fontVariant:"initial",backgroundColor:Me.colorBgElevated,borderRadius:Me.borderRadiusLG,outline:"none",boxShadow:Me.boxShadowSecondary,[`
${Xe}${Tt}bottomLeft,
${Nt}${Tt}bottomLeft
`]:{animationName:be.fJ},[`
${Xe}${Tt}topLeft,
${Nt}${Tt}topLeft,
${Xe}${Tt}topRight,
${Nt}${Tt}topRight
`]:{animationName:be.Qt},[`${ht}${Tt}bottomLeft`]:{animationName:be.Uw},[`
${ht}${Tt}topLeft,
${ht}${Tt}topRight
`]:{animationName:be.ly},"&-hidden":{display:"none"},[`${Mt}`]:Object.assign(Object.assign({},Pe(Me)),{cursor:"pointer",transition:`background ${Me.motionDurationSlow} ease`,borderRadius:Me.borderRadiusSM,"&-group":{color:Me.colorTextDescription,fontSize:Me.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},fe.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Mt}-option-disabled)`]:{backgroundColor:Me.optionActiveBg},[`&-selected:not(${Mt}-option-disabled)`]:{color:Me.optionSelectedColor,fontWeight:Me.optionSelectedFontWeight,backgroundColor:Me.optionSelectedBg,[`${Mt}-option-state`]:{color:Me.colorPrimary}},"&-disabled":{[`&${Mt}-option-selected`]:{backgroundColor:Me.colorBgContainerDisabled},color:Me.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:Me.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,be.oN)(Me,"slide-up"),(0,be.oN)(Me,"slide-down"),(0,De.Fm)(Me,"move-up"),(0,De.Fm)(Me,"move-down")]};const Ne=2,dt=Me=>{let{controlHeightSM:Ke,controlHeight:Ve,lineWidth:Mt}=Me;const Xe=(Ve-Ke)/2-Mt,Nt=Math.ceil(Xe/2);return[Xe,Nt]};function Ae(Me,Ke){const{componentCls:Ve,iconCls:Mt}=Me,Xe=`${Ve}-selection-overflow`,Nt=Me.multipleSelectItemHeight,[ht]=dt(Me),Tt=Ke?`${Ve}-${Ke}`:"";return{[`${Ve}-multiple${Tt}`]:{fontSize:Me.fontSize,[Xe]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Ve}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${ht-Ne}px ${Ne*2}px`,borderRadius:Me.borderRadius,[`${Ve}-show-search&`]:{cursor:"text"},[`${Ve}-disabled&`]:{background:Me.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Ne}px 0`,lineHeight:`${Nt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${Ve}-show-arrow ${Ve}-selector,
&${Ve}-allow-clear ${Ve}-selector
`]:{paddingInlineEnd:Me.fontSizeIcon+Me.controlPaddingHorizontal},[`${Ve}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Nt,marginTop:Ne,marginBottom:Ne,lineHeight:`${Nt-Me.lineWidth*2}px`,background:Me.multipleItemBg,border:`${Me.lineWidth}px ${Me.lineType} ${Me.multipleItemBorderColor}`,borderRadius:Me.borderRadiusSM,cursor:"default",transition:`font-size ${Me.motionDurationSlow}, line-height ${Me.motionDurationSlow}, height ${Me.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Ne*2,paddingInlineStart:Me.paddingXS,paddingInlineEnd:Me.paddingXS/2,[`${Ve}-disabled&`]:{color:Me.multipleItemColorDisabled,borderColor:Me.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:Me.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,fe.Ro)()),{display:"inline-flex",alignItems:"center",color:Me.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Mt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:Me.colorIconHover}})},[`${Xe}-item + ${Xe}-item`]:{[`${Ve}-selection-search`]:{marginInlineStart:0}},[`${Ve}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:Me.inputPaddingHorizontalBase-ht,"\n &-input,\n &-mirror\n ":{height:Nt,fontFamily:Me.fontFamily,lineHeight:`${Nt}px`,transition:`all ${Me.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Ve}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:Me.inputPaddingHorizontalBase,insetInlineEnd:Me.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${Me.motionDurationSlow}`}}}}var rt=Me=>{const{componentCls:Ke}=Me,Ve=(0,Fe.TS)(Me,{controlHeight:Me.controlHeightSM,multipleSelectItemHeight:Me.controlHeightXS,borderRadius:Me.borderRadiusSM,borderRadiusSM:Me.borderRadiusXS}),Mt=(0,Fe.TS)(Me,{fontSize:Me.fontSizeLG,controlHeight:Me.controlHeightLG,multipleSelectItemHeight:Me.multipleItemHeightLG,borderRadius:Me.borderRadiusLG,borderRadiusSM:Me.borderRadius}),[,Xe]=dt(Me);return[Ae(Me),Ae(Ve,"sm"),{[`${Ke}-multiple${Ke}-sm`]:{[`${Ke}-selection-placeholder`]:{insetInline:Me.controlPaddingHorizontalSM-Me.lineWidth},[`${Ke}-selection-search`]:{marginInlineStart:Xe}}},Ae(Mt,"lg")]};function je(Me,Ke){const{componentCls:Ve,inputPaddingHorizontalBase:Mt,borderRadius:Xe}=Me,Nt=Me.controlHeight-Me.lineWidth*2,ht=Math.ceil(Me.fontSize*1.25),Tt=Ke?`${Ve}-${Ke}`:"";return{[`${Ve}-single${Tt}`]:{fontSize:Me.fontSize,[`${Ve}-selector`]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{display:"flex",borderRadius:Xe,[`${Ve}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Mt,insetInlineEnd:Mt,bottom:0,"&-input":{width:"100%"}},[`
${Ve}-selection-item,
${Ve}-selection-placeholder
`]:{padding:0,lineHeight:`${Nt}px`,transition:`all ${Me.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Nt}px`}},[`${Ve}-selection-item`]:{position:"relative",userSelect:"none"},[`${Ve}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Ve}-selection-item:after`,`${Ve}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${Ve}-show-arrow ${Ve}-selection-item,
&${Ve}-show-arrow ${Ve}-selection-placeholder
`]:{paddingInlineEnd:ht},[`&${Ve}-open ${Ve}-selection-item`]:{color:Me.colorTextPlaceholder},[`&:not(${Ve}-customize-input)`]:{[`${Ve}-selector`]:{width:"100%",height:Me.controlHeight,padding:`0 ${Mt}px`,[`${Ve}-selection-search-input`]:{height:Nt},"&:after":{lineHeight:`${Nt}px`}}},[`&${Ve}-customize-input`]:{[`${Ve}-selector`]:{"&:after":{display:"none"},[`${Ve}-selection-search`]:{position:"static",width:"100%"},[`${Ve}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Mt}px`,"&:after":{display:"none"}}}}}}}function it(Me){const{componentCls:Ke}=Me,Ve=Me.controlPaddingHorizontalSM-Me.lineWidth;return[je(Me),je((0,Fe.TS)(Me,{controlHeight:Me.controlHeightSM,borderRadius:Me.borderRadiusSM}),"sm"),{[`${Ke}-single${Ke}-sm`]:{[`&:not(${Ke}-customize-input)`]:{[`${Ke}-selection-search`]:{insetInlineStart:Ve,insetInlineEnd:Ve},[`${Ke}-selector`]:{padding:`0 ${Ve}px`},[`&${Ke}-show-arrow ${Ke}-selection-search`]:{insetInlineEnd:Ve+Me.fontSize*1.5},[`
&${Ke}-show-arrow ${Ke}-selection-item,
&${Ke}-show-arrow ${Ke}-selection-placeholder
`]:{paddingInlineEnd:Me.fontSize*1.5}}}},je((0,Fe.TS)(Me,{controlHeight:Me.singleItemHeightLG,fontSize:Me.fontSizeLG,borderRadius:Me.borderRadiusLG}),"lg")]}const at=Me=>{const{componentCls:Ke,selectorBg:Ve}=Me;return{position:"relative",backgroundColor:Ve,border:`${Me.lineWidth}px ${Me.lineType} ${Me.colorBorder}`,transition:`all ${Me.motionDurationMid} ${Me.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ke}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ke}-disabled&`]:{color:Me.colorTextDisabled,background:Me.colorBgContainerDisabled,cursor:"not-allowed",[`${Ke}-multiple&`]:{background:Me.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},xt=function(Me,Ke){let Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Mt,borderHoverColor:Xe,outlineColor:Nt,antCls:ht}=Ke,Tt=Ve?{[`${Mt}-selector`]:{borderColor:Xe}}:{};return{[Me]:{[`&:not(${Mt}-disabled):not(${Mt}-customize-input):not(${ht}-pagination-size-changer)`]:Object.assign(Object.assign({},Tt),{[`${Mt}-focused& ${Mt}-selector`]:{borderColor:Xe,boxShadow:`0 0 0 ${Ke.controlOutlineWidth}px ${Nt}`,outline:0},[`&:hover ${Mt}-selector`]:{borderColor:Xe}})}}},jt=Me=>{const{componentCls:Ke}=Me;return{[`${Ke}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},Qe=Me=>{const{componentCls:Ke,inputPaddingHorizontalBase:Ve,iconCls:Mt}=Me;return{[Ke]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ke}-customize-input) ${Ke}-selector`]:Object.assign(Object.assign({},at(Me)),jt(Me)),[`${Ke}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},fe.vS),[`${Ke}-selection-placeholder`]:Object.assign(Object.assign({},fe.vS),{flex:1,color:Me.colorTextPlaceholder,pointerEvents:"none"}),[`${Ke}-arrow`]:Object.assign(Object.assign({},(0,fe.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ve,height:Me.fontSizeIcon,marginTop:-Me.fontSizeIcon/2,color:Me.colorTextQuaternary,fontSize:Me.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Mt]:{verticalAlign:"top",transition:`transform ${Me.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ke}-suffix)`]:{pointerEvents:"auto"}},[`${Ke}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ke}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ve,zIndex:1,display:"inline-block",width:Me.fontSizeIcon,height:Me.fontSizeIcon,marginTop:-Me.fontSizeIcon/2,color:Me.colorTextQuaternary,fontSize:Me.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:Me.clearBg,cursor:"pointer",opacity:0,transition:`color ${Me.motionDurationMid} ease, opacity ${Me.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:Me.colorTextTertiary}},"&:hover":{[`${Ke}-clear`]:{opacity:1}}}),[`${Ke}-has-feedback`]:{[`${Ke}-clear`]:{insetInlineEnd:Ve+Me.fontSize+Me.paddingXS}}}},mt=Me=>{const{componentCls:Ke}=Me;return[{[Ke]:{[`&-borderless ${Ke}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ke}-in-form-item`]:{width:"100%"}}},Qe(Me),it(Me),rt(Me),_e(Me),{[`${Ke}-rtl`]:{direction:"rtl"}},xt(Ke,(0,Fe.TS)(Me,{borderHoverColor:Me.colorPrimaryHover,outlineColor:Me.controlOutline})),xt(`${Ke}-status-error`,(0,Fe.TS)(Me,{borderHoverColor:Me.colorErrorHover,outlineColor:Me.colorErrorOutline}),!0),xt(`${Ke}-status-warning`,(0,Fe.TS)(Me,{borderHoverColor:Me.colorWarningHover,outlineColor:Me.colorWarningOutline}),!0),(0,Ze.c)(Me,{borderElCls:`${Ke}-selector`,focusElCls:`${Ke}-focused`})]};var We=(0,tt.Z)("Select",(Me,Ke)=>{let{rootPrefixCls:Ve}=Ke;const Mt=(0,Fe.TS)(Me,{rootPrefixCls:Ve,inputPaddingHorizontalBase:Me.paddingSM-1,multipleSelectItemHeight:Me.multipleItemHeight});return[mt(Mt)]},Me=>{const{fontSize:Ke,lineHeight:Ve,controlHeight:Mt,controlPaddingHorizontal:Xe,zIndexPopupBase:Nt,colorText:ht,fontWeightStrong:Tt,controlItemBgActive:et,controlItemBgHover:Ut,colorBgContainer:ft,colorFillSecondary:Dt,controlHeightLG:Bt,controlHeightSM:bt,colorBgContainerDisabled:$e,colorTextDisabled:xe}=Me;return{zIndexPopup:Nt+50,optionSelectedColor:ht,optionSelectedFontWeight:Tt,optionSelectedBg:et,optionActiveBg:Ut,optionPadding:`${(Mt-Ke*Ve)/2}px ${Xe}px`,optionFontSize:Ke,optionLineHeight:Ve,optionHeight:Mt,selectorBg:ft,clearBg:ft,singleItemHeightLG:Bt,multipleItemBg:Dt,multipleItemBorderColor:"transparent",multipleItemHeight:bt,multipleItemHeightLG:Mt,multipleSelectorBgDisabled:$e,multipleItemColorDisabled:xe,multipleItemBorderColorDisabled:"transparent"}})},58582:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ze}});const fe=Fe=>{const be={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Fe==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},be),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},be),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},be),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},be),{points:["br","tr"],offset:[0,-4]})}};function Ze(Fe,tt){return Fe||fe(tt)}},84443:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return fe}});function fe(Ze,Fe){return Fe!==void 0?Fe:Ze!==null}},66339:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});var fe=ue(40001),Ze=ue(19248),Fe=ue(99267),tt=ue(84105),be=ue(58617),De=ue(47472),Pe=ue(59301);function we(_e){let{suffixIcon:Ne,clearIcon:dt,menuItemSelectedIcon:Ae,removeIcon:He,loading:rt,multiple:je,hasFeedback:it,prefixCls:at,showSuffixIcon:xt,feedbackIcon:jt,showArrow:Qe,componentName:mt}=_e;const We=dt!=null?dt:Pe.createElement(Ze.Z,null),Me=Xe=>Ne===null&&!it&&!Qe?null:Pe.createElement(Pe.Fragment,null,xt!==!1&&Xe,it&&jt);let Ke=null;if(Ne!==void 0)Ke=Me(Ne);else if(rt)Ke=Me(Pe.createElement(be.Z,{spin:!0}));else{const Xe=`${at}-suffix`;Ke=Nt=>{let{open:ht,showSearch:Tt}=Nt;return Me(ht&&Tt?Pe.createElement(De.Z,{className:Xe}):Pe.createElement(tt.Z,{className:Xe}))}}let Ve=null;Ae!==void 0?Ve=Ae:je?Ve=Pe.createElement(fe.Z,null):Ve=null;let Mt=null;return He!==void 0?Mt=He:Mt=Pe.createElement(Fe.Z,null),{clearIcon:We,suffixIcon:Ke,itemIcon:Ve,removeIcon:Mt}}},8378:function(Mn,rn){"use strict";const ue=fe=>({[fe.componentCls]:{[`${fe.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}},[`${fe.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}}});rn.Z=ue},92899:function(Mn,rn,ue){"use strict";ue.d(rn,{Fm:function(){return Ae}});var fe=ue(36237),Ze=ue(95406);const Fe=new fe.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),tt=new fe.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),be=new fe.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),De=new fe.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Pe=new fe.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),we=new fe.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_e=new fe.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 fe.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),dt={"move-up":{inKeyframes:_e,outKeyframes:Ne},"move-down":{inKeyframes:Fe,outKeyframes:tt},"move-left":{inKeyframes:be,outKeyframes:De},"move-right":{inKeyframes:Pe,outKeyframes:we}},Ae=(He,rt)=>{const{antCls:je}=He,it=`${je}-${rt}`,{inKeyframes:at,outKeyframes:xt}=dt[rt];return[(0,Ze.R)(it,at,xt,He.motionDurationMid),{[`
${it}-enter,
${it}-appear
`]:{opacity:0,animationTimingFunction:He.motionEaseOutCirc},[`${it}-leave`]:{animationTimingFunction:He.motionEaseInOutCirc}}]}},13826:function(Mn,rn,ue){"use strict";ue.d(rn,{Qt:function(){return be},Uw:function(){return tt},fJ:function(){return Fe},ly:function(){return De},oN:function(){return Ae}});var fe=ue(36237),Ze=ue(95406);const Fe=new fe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),tt=new fe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),be=new fe.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),De=new fe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Pe=new fe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),we=new fe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),_e=new fe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Ne=new fe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),dt={"slide-up":{inKeyframes:Fe,outKeyframes:tt},"slide-down":{inKeyframes:be,outKeyframes:De},"slide-left":{inKeyframes:Pe,outKeyframes:we},"slide-right":{inKeyframes:_e,outKeyframes:Ne}},Ae=(He,rt)=>{const{antCls:je}=He,it=`${je}-${rt}`,{inKeyframes:at,outKeyframes:xt}=dt[rt];return[(0,Ze.R)(it,at,xt,He.motionDurationMid),{[`
${it}-enter,
${it}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:He.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${it}-leave`]:{animationTimingFunction:He.motionEaseInQuint}}]}},78673:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Tt}});var fe=ue(58617),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(60499),be=ue(18642),De=ue(72190),Pe=ue(42244),we=ue(59301),_e=ue(18929),Ne=ue(10228),dt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ae=we.forwardRef(function(et,Ut){var ft,Dt=et.prefixCls,Bt=Dt===void 0?"rc-switch":Dt,bt=et.className,$e=et.checked,xe=et.defaultChecked,gt=et.disabled,en=et.loadingIcon,Wt=et.checkedChildren,qe=et.unCheckedChildren,Ye=et.onClick,Lt=et.onChange,mn=et.onKeyDown,Qt=(0,Pe.Z)(et,dt),dn=(0,_e.Z)(!1,{value:$e,defaultValue:xe}),Zt=(0,De.Z)(dn,2),Vt=Zt[0],zt=Zt[1];function ye(pe,le){var Be=Vt;return gt||(Be=pe,zt(Be),Lt==null||Lt(Be,le)),Be}function se(pe){pe.which===Ne.Z.LEFT?ye(!1,pe):pe.which===Ne.Z.RIGHT&&ye(!0,pe),mn==null||mn(pe)}function oe(pe){var le=ye(!Vt,pe);Ye==null||Ye(le,pe)}var de=Fe()(Bt,bt,(ft={},(0,be.Z)(ft,"".concat(Bt,"-checked"),Vt),(0,be.Z)(ft,"".concat(Bt,"-disabled"),gt),ft));return we.createElement("button",(0,tt.Z)({},Qt,{type:"button",role:"switch","aria-checked":Vt,disabled:gt,className:de,ref:Ut,onKeyDown:se,onClick:oe}),en,we.createElement("span",{className:"".concat(Bt,"-inner")},we.createElement("span",{className:"".concat(Bt,"-inner-checked")},Wt),we.createElement("span",{className:"".concat(Bt,"-inner-unchecked")},qe)))});Ae.displayName="Switch";var He=Ae,rt=ue(14088),je=ue(36355),it=ue(1684),at=ue(19716),xt=ue(64993),jt=ue(17313),Qe=ue(83116),mt=ue(37613);const We=et=>{const{componentCls:Ut,trackHeightSM:ft,trackPadding:Dt,trackMinWidthSM:Bt,innerMinMarginSM:bt,innerMaxMarginSM:$e,handleSizeSM:xe}=et,gt=`${Ut}-inner`;return{[Ut]:{[`&${Ut}-small`]:{minWidth:Bt,height:ft,lineHeight:`${ft}px`,[`${Ut}-inner`]:{paddingInlineStart:$e,paddingInlineEnd:bt,[`${gt}-checked`]:{marginInlineStart:`calc(-100% + ${xe+Dt*2}px - ${$e*2}px)`,marginInlineEnd:`calc(100% - ${xe+Dt*2}px + ${$e*2}px)`},[`${gt}-unchecked`]:{marginTop:-ft,marginInlineStart:0,marginInlineEnd:0}},[`${Ut}-handle`]:{width:xe,height:xe},[`${Ut}-loading-icon`]:{top:(xe-et.switchLoadingIconSize)/2,fontSize:et.switchLoadingIconSize},[`&${Ut}-checked`]:{[`${Ut}-inner`]:{paddingInlineStart:bt,paddingInlineEnd:$e,[`${gt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${gt}-unchecked`]:{marginInlineStart:`calc(100% - ${xe+Dt*2}px + ${$e*2}px)`,marginInlineEnd:`calc(-100% + ${xe+Dt*2}px - ${$e*2}px)`}},[`${Ut}-handle`]:{insetInlineStart:`calc(100% - ${xe+Dt}px)`}},[`&:not(${Ut}-disabled):active`]:{[`&:not(${Ut}-checked) ${gt}`]:{[`${gt}-unchecked`]:{marginInlineStart:et.marginXXS/2,marginInlineEnd:-et.marginXXS/2}},[`&${Ut}-checked ${gt}`]:{[`${gt}-checked`]:{marginInlineStart:-et.marginXXS/2,marginInlineEnd:et.marginXXS/2}}}}}}},Me=et=>{const{componentCls:Ut,handleSize:ft}=et;return{[Ut]:{[`${Ut}-loading-icon${et.iconCls}`]:{position:"relative",top:(ft-et.fontSize)/2,color:et.switchLoadingIconColor,verticalAlign:"top"},[`&${Ut}-checked ${Ut}-loading-icon`]:{color:et.switchColor}}}},Ke=et=>{const{componentCls:Ut,motion:ft,trackPadding:Dt,handleBg:Bt,handleShadow:bt,handleSize:$e}=et,xe=`${Ut}-handle`;return{[Ut]:{[xe]:{position:"absolute",top:Dt,insetInlineStart:Dt,width:$e,height:$e,transition:`all ${et.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Bt,borderRadius:$e/2,boxShadow:bt,transition:`all ${et.switchDuration} ease-in-out`,content:'""'}},[`&${Ut}-checked ${xe}`]:{insetInlineStart:`calc(100% - ${$e+Dt}px)`},[`&:not(${Ut}-disabled):active`]:ft?{[`${xe}::before`]:{insetInlineEnd:et.switchHandleActiveInset,insetInlineStart:0},[`&${Ut}-checked ${xe}::before`]:{insetInlineEnd:0,insetInlineStart:et.switchHandleActiveInset}}:{}}}},Ve=et=>{const{componentCls:Ut,trackHeight:ft,trackPadding:Dt,innerMinMargin:Bt,innerMaxMargin:bt,handleSize:$e}=et,xe=`${Ut}-inner`;return{[Ut]:{[xe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:bt,paddingInlineEnd:Bt,transition:`padding-inline-start ${et.switchDuration} ease-in-out, padding-inline-end ${et.switchDuration} ease-in-out`,[`${xe}-checked, ${xe}-unchecked`]:{display:"block",color:et.colorTextLightSolid,fontSize:et.fontSizeSM,transition:`margin-inline-start ${et.switchDuration} ease-in-out, margin-inline-end ${et.switchDuration} ease-in-out`,pointerEvents:"none"},[`${xe}-checked`]:{marginInlineStart:`calc(-100% + ${$e+Dt*2}px - ${bt*2}px)`,marginInlineEnd:`calc(100% - ${$e+Dt*2}px + ${bt*2}px)`},[`${xe}-unchecked`]:{marginTop:-ft,marginInlineStart:0,marginInlineEnd:0}},[`&${Ut}-checked ${xe}`]:{paddingInlineStart:Bt,paddingInlineEnd:bt,[`${xe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xe}-unchecked`]:{marginInlineStart:`calc(100% - ${$e+Dt*2}px + ${bt*2}px)`,marginInlineEnd:`calc(-100% + ${$e+Dt*2}px - ${bt*2}px)`}},[`&:not(${Ut}-disabled):active`]:{[`&:not(${Ut}-checked) ${xe}`]:{[`${xe}-unchecked`]:{marginInlineStart:Dt*2,marginInlineEnd:-Dt*2}},[`&${Ut}-checked ${xe}`]:{[`${xe}-checked`]:{marginInlineStart:-Dt*2,marginInlineEnd:Dt*2}}}}}},Mt=et=>{const{componentCls:Ut,trackHeight:ft,trackMinWidth:Dt}=et;return{[Ut]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,jt.Wf)(et)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Dt,height:ft,lineHeight:`${ft}px`,verticalAlign:"middle",background:et.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${et.motionDurationMid}`,userSelect:"none",[`&:hover:not(${Ut}-disabled)`]:{background:et.colorTextTertiary}}),(0,jt.Qy)(et)),{[`&${Ut}-checked`]:{background:et.switchColor,[`&:hover:not(${Ut}-disabled)`]:{background:et.colorPrimaryHover}},[`&${Ut}-loading, &${Ut}-disabled`]:{cursor:"not-allowed",opacity:et.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${Ut}-rtl`]:{direction:"rtl"}})}};var Xe=(0,Qe.Z)("Switch",et=>{const Ut=(0,mt.TS)(et,{switchDuration:et.motionDurationMid,switchColor:et.colorPrimary,switchDisabledOpacity:et.opacityLoading,switchLoadingIconSize:et.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${et.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Mt(Ut),Ve(Ut),Ke(Ut),Me(Ut),We(Ut)]},et=>{const{fontSize:Ut,lineHeight:ft,controlHeight:Dt,colorWhite:Bt}=et,bt=Ut*ft,$e=Dt/2,xe=2,gt=bt-xe*2,en=$e-xe*2;return{trackHeight:bt,trackHeightSM:$e,trackMinWidth:gt*2+xe*4,trackMinWidthSM:en*2+xe*2,trackPadding:xe,handleBg:Bt,handleSize:gt,handleSizeSM:en,handleShadow:`0 2px 4px 0 ${new xt.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:gt/2,innerMaxMargin:gt+xe+xe*2,innerMinMarginSM:en/2,innerMaxMarginSM:en+xe+xe*2}}),Nt=function(et,Ut){var ft={};for(var Dt in et)Object.prototype.hasOwnProperty.call(et,Dt)&&Ut.indexOf(Dt)<0&&(ft[Dt]=et[Dt]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Dt=Object.getOwnPropertySymbols(et);Bt<Dt.length;Bt++)Ut.indexOf(Dt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(et,Dt[Bt])&&(ft[Dt[Bt]]=et[Dt[Bt]]);return ft};const ht=we.forwardRef((et,Ut)=>{const{prefixCls:ft,size:Dt,disabled:Bt,loading:bt,className:$e,rootClassName:xe,style:gt}=et,en=Nt(et,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Wt,direction:qe,switch:Ye}=we.useContext(je.E_),Lt=we.useContext(it.Z),mn=(Bt!=null?Bt:Lt)||bt,Qt=Wt("switch",ft),dn=we.createElement("div",{className:`${Qt}-handle`},bt&&we.createElement(fe.Z,{className:`${Qt}-loading-icon`})),[Zt,Vt]=Xe(Qt),zt=(0,at.Z)(Dt),ye=Fe()(Ye==null?void 0:Ye.className,{[`${Qt}-small`]:zt==="small",[`${Qt}-loading`]:bt,[`${Qt}-rtl`]:qe==="rtl"},$e,xe,Vt),se=Object.assign(Object.assign({},Ye==null?void 0:Ye.style),gt);return Zt(we.createElement(rt.Z,{component:"Switch"},we.createElement(He,Object.assign({},en,{prefixCls:Qt,className:ye,style:se,disabled:mn,ref:Ut,loadingIcon:dn}))))});ht.__ANT_SWITCH=!0;var Tt=ht},99313:function(Mn,rn,ue){"use strict";ue.d(rn,{default:function(){return st}});var fe=ue(99267),Ze=ue(18785),Fe=ue(62772),tt=ue(92310),be=ue.n(tt),De=ue(60499),Pe=ue(18642),we=ue(85899),_e=ue(72190),Ne=ue(43749),dt=ue(42244),Ae=ue(59301),He=ue(49658),rt=ue(18929),je=ue(77900),it=(0,Ae.createContext)(null),at=Ae.forwardRef(function(Ee,Te){var ke=Ee.prefixCls,Ie=Ee.className,Ge=Ee.style,ut=Ee.id,nt=Ee.active,ze=Ee.tabKey,ct=Ee.children;return Ae.createElement("div",{id:ut&&"".concat(ut,"-panel-").concat(ze),role:"tabpanel",tabIndex:nt?0:-1,"aria-labelledby":ut&&"".concat(ut,"-tab-").concat(ze),"aria-hidden":!nt,style:Ge,className:be()(ke,nt&&"".concat(ke,"-active"),Ie),ref:Te},ct)}),xt=at,jt=["key","forceRender","style","className"];function Qe(Ee){var Te=Ee.id,ke=Ee.activeKey,Ie=Ee.animated,Ge=Ee.tabPosition,ut=Ee.destroyInactiveTabPane,nt=Ae.useContext(it),ze=nt.prefixCls,ct=nt.tabs,kt=Ie.tabPane,Rt="".concat(ze,"-tabpane");return Ae.createElement("div",{className:be()("".concat(ze,"-content-holder"))},Ae.createElement("div",{className:be()("".concat(ze,"-content"),"".concat(ze,"-content-").concat(Ge),(0,Pe.Z)({},"".concat(ze,"-content-animated"),kt))},ct.map(function(Jt){var pt=Jt.key,Ct=Jt.forceRender,bn=Jt.style,ln=Jt.className,En=(0,dt.Z)(Jt,jt),qt=pt===ke;return Ae.createElement(je.default,(0,De.Z)({key:pt,visible:qt,forceRender:Ct,removeOnLeave:!!ut,leavedClassName:"".concat(Rt,"-hidden")},Ie.tabPaneMotion),function(On,tn){var An=On.style,Ue=On.className;return Ae.createElement(xt,(0,De.Z)({},En,{prefixCls:Rt,id:Te,tabKey:pt,animated:kt,active:qt,style:(0,we.Z)((0,we.Z)({},bn),An),className:be()(ln,Ue),ref:tn}))})})))}var mt=ue(77654),We=ue(29301),Me=ue(6089),Ke=ue(8654),Ve={width:0,height:0,left:0,top:0};function Mt(Ee,Te,ke){return(0,Ae.useMemo)(function(){for(var Ie,Ge=new Map,ut=Te.get((Ie=Ee[0])===null||Ie===void 0?void 0:Ie.key)||Ve,nt=ut.left+ut.width,ze=0;ze<Ee.length;ze+=1){var ct=Ee[ze].key,kt=Te.get(ct);if(!kt){var Rt;kt=Te.get((Rt=Ee[ze-1])===null||Rt===void 0?void 0:Rt.key)||Ve}var Jt=Ge.get(ct)||(0,we.Z)({},kt);Jt.right=nt-Jt.left-Jt.width,Ge.set(ct,Jt)}return Ge},[Ee.map(function(Ie){return Ie.key}).join("_"),Te,ke])}function Xe(Ee,Te){var ke=Ae.useRef(Ee),Ie=Ae.useState({}),Ge=(0,_e.Z)(Ie,2),ut=Ge[1];function nt(ze){var ct=typeof ze=="function"?ze(ke.current):ze;ct!==ke.current&&Te(ct,ke.current),ke.current=ct,ut({})}return[ke.current,nt]}var Nt=.1,ht=.01,Tt=20,et=Math.pow(.995,Tt);function Ut(Ee,Te){var ke=(0,Ae.useState)(),Ie=(0,_e.Z)(ke,2),Ge=Ie[0],ut=Ie[1],nt=(0,Ae.useState)(0),ze=(0,_e.Z)(nt,2),ct=ze[0],kt=ze[1],Rt=(0,Ae.useState)(0),Jt=(0,_e.Z)(Rt,2),pt=Jt[0],Ct=Jt[1],bn=(0,Ae.useState)(),ln=(0,_e.Z)(bn,2),En=ln[0],qt=ln[1],On=(0,Ae.useRef)();function tn(Ft){var Gt=Ft.touches[0],Kt=Gt.screenX,un=Gt.screenY;ut({x:Kt,y:un}),window.clearInterval(On.current)}function An(Ft){if(Ge){Ft.preventDefault();var Gt=Ft.touches[0],Kt=Gt.screenX,un=Gt.screenY;ut({x:Kt,y:un});var xn=Kt-Ge.x,_n=un-Ge.y;Te(xn,_n);var Hn=Date.now();kt(Hn),Ct(Hn-ct),qt({x:xn,y:_n})}}function Ue(){if(Ge&&(ut(null),qt(null),En)){var Ft=En.x/pt,Gt=En.y/pt,Kt=Math.abs(Ft),un=Math.abs(Gt);if(Math.max(Kt,un)<Nt)return;var xn=Ft,_n=Gt;On.current=window.setInterval(function(){if(Math.abs(xn)<ht&&Math.abs(_n)<ht){window.clearInterval(On.current);return}xn*=et,_n*=et,Te(xn*Tt,_n*Tt)},Tt)}}var At=(0,Ae.useRef)();function Pt(Ft){var Gt=Ft.deltaX,Kt=Ft.deltaY,un=0,xn=Math.abs(Gt),_n=Math.abs(Kt);xn===_n?un=At.current==="x"?Gt:Kt:xn>_n?(un=Gt,At.current="x"):(un=Kt,At.current="y"),Te(-un,-un)&&Ft.preventDefault()}var Xt=(0,Ae.useRef)(null);Xt.current={onTouchStart:tn,onTouchMove:An,onTouchEnd:Ue,onWheel:Pt},Ae.useEffect(function(){function Ft(xn){Xt.current.onTouchStart(xn)}function Gt(xn){Xt.current.onTouchMove(xn)}function Kt(xn){Xt.current.onTouchEnd(xn)}function un(xn){Xt.current.onWheel(xn)}return document.addEventListener("touchmove",Gt,{passive:!1}),document.addEventListener("touchend",Kt,{passive:!1}),Ee.current.addEventListener("touchstart",Ft,{passive:!1}),Ee.current.addEventListener("wheel",un),function(){document.removeEventListener("touchmove",Gt),document.removeEventListener("touchend",Kt)}},[])}var ft=ue(34280);function Dt(Ee){var Te=(0,Ae.useState)(0),ke=(0,_e.Z)(Te,2),Ie=ke[0],Ge=ke[1],ut=(0,Ae.useRef)(0),nt=(0,Ae.useRef)();return nt.current=Ee,(0,ft.o)(function(){var ze;(ze=nt.current)===null||ze===void 0||ze.call(nt)},[Ie]),function(){ut.current===Ie&&(ut.current+=1,Ge(ut.current))}}function Bt(Ee){var Te=(0,Ae.useRef)([]),ke=(0,Ae.useState)({}),Ie=(0,_e.Z)(ke,2),Ge=Ie[1],ut=(0,Ae.useRef)(typeof Ee=="function"?Ee():Ee),nt=Dt(function(){var ct=ut.current;Te.current.forEach(function(kt){ct=kt(ct)}),Te.current=[],ut.current=ct,Ge({})});function ze(ct){Te.current.push(ct),nt()}return[ut.current,ze]}var bt={width:0,height:0,left:0,top:0,right:0};function $e(Ee,Te,ke,Ie,Ge,ut,nt){var ze=nt.tabs,ct=nt.tabPosition,kt=nt.rtl,Rt,Jt,pt;return["top","bottom"].includes(ct)?(Rt="width",Jt=kt?"right":"left",pt=Math.abs(ke)):(Rt="height",Jt="top",pt=-ke),(0,Ae.useMemo)(function(){if(!ze.length)return[0,0];for(var Ct=ze.length,bn=Ct,ln=0;ln<Ct;ln+=1){var En=Ee.get(ze[ln].key)||bt;if(En[Jt]+En[Rt]>pt+Te){bn=ln-1;break}}for(var qt=0,On=Ct-1;On>=0;On-=1){var tn=Ee.get(ze[On].key)||bt;if(tn[Jt]<pt){qt=On+1;break}}return qt>=bn?[0,0]:[qt,bn]},[Ee,Te,Ie,Ge,ut,pt,ct,ze.map(function(Ct){return Ct.key}).join("_"),kt])}function xe(Ee){var Te;return Ee instanceof Map?(Te={},Ee.forEach(function(ke,Ie){Te[Ie]=ke})):Te=Ee,JSON.stringify(Te)}var gt="TABS_DQ";function en(Ee){return String(Ee).replace(/"/g,gt)}function Wt(Ee,Te,ke,Ie){return!(!ke||Ie||Ee===!1||Ee===void 0&&(Te===!1||Te===null))}function qe(Ee,Te){var ke=Ee.prefixCls,Ie=Ee.editable,Ge=Ee.locale,ut=Ee.style;return!Ie||Ie.showAdd===!1?null:Ae.createElement("button",{ref:Te,type:"button",className:"".concat(ke,"-nav-add"),style:ut,"aria-label":(Ge==null?void 0:Ge.addAriaLabel)||"Add tab",onClick:function(ze){Ie.onEdit("add",{event:ze})}},Ie.addIcon||"+")}var Ye=Ae.forwardRef(qe),Lt=Ae.forwardRef(function(Ee,Te){var ke=Ee.position,Ie=Ee.prefixCls,Ge=Ee.extra;if(!Ge)return null;var ut,nt={};return(0,Ne.Z)(Ge)==="object"&&!Ae.isValidElement(Ge)?nt=Ge:nt.right=Ge,ke==="right"&&(ut=nt.right),ke==="left"&&(ut=nt.left),ut?Ae.createElement("div",{className:"".concat(Ie,"-extra-content"),ref:Te},ut):null}),mn=Lt,Qt=ue(31561),dn=ue(15285),Zt=ue(10228);function Vt(Ee,Te){var ke=Ee.prefixCls,Ie=Ee.id,Ge=Ee.tabs,ut=Ee.locale,nt=Ee.mobile,ze=Ee.moreIcon,ct=ze===void 0?"More":ze,kt=Ee.moreTransitionName,Rt=Ee.style,Jt=Ee.className,pt=Ee.editable,Ct=Ee.tabBarGutter,bn=Ee.rtl,ln=Ee.removeAriaLabel,En=Ee.onTabClick,qt=Ee.getPopupContainer,On=Ee.popupClassName,tn=(0,Ae.useState)(!1),An=(0,_e.Z)(tn,2),Ue=An[0],At=An[1],Pt=(0,Ae.useState)(null),Xt=(0,_e.Z)(Pt,2),Ft=Xt[0],Gt=Xt[1],Kt="".concat(Ie,"-more-popup"),un="".concat(ke,"-dropdown"),xn=Ft!==null?"".concat(Kt,"-").concat(Ft):null,_n=ut==null?void 0:ut.dropdownAriaLabel;function Hn(mr,Gn){mr.preventDefault(),mr.stopPropagation(),pt.onEdit("remove",{key:Gn,event:mr})}var Yn=Ae.createElement(dn.ZP,{onClick:function(Gn){var Jn=Gn.key,hr=Gn.domEvent;En(Jn,hr),At(!1)},prefixCls:"".concat(un,"-menu"),id:Kt,tabIndex:-1,role:"listbox","aria-activedescendant":xn,selectedKeys:[Ft],"aria-label":_n!==void 0?_n:"expanded dropdown"},Ge.map(function(mr){var Gn=mr.closable,Jn=mr.disabled,hr=mr.closeIcon,tr=mr.key,_r=mr.label,Wr=Wt(Gn,hr,pt,Jn);return Ae.createElement(dn.sN,{key:tr,id:"".concat(Kt,"-").concat(tr),role:"option","aria-controls":Ie&&"".concat(Ie,"-panel-").concat(tr),disabled:Jn},Ae.createElement("span",null,_r),Wr&&Ae.createElement("button",{type:"button","aria-label":ln||"remove",tabIndex:0,className:"".concat(un,"-menu-item-remove"),onClick:function(kn){kn.stopPropagation(),Hn(kn,tr)}},hr||pt.removeIcon||"\xD7"))}));function yr(mr){for(var Gn=Ge.filter(function(Wr){return!Wr.disabled}),Jn=Gn.findIndex(function(Wr){return Wr.key===Ft})||0,hr=Gn.length,tr=0;tr<hr;tr+=1){Jn=(Jn+mr+hr)%hr;var _r=Gn[Jn];if(!_r.disabled){Gt(_r.key);return}}}function rr(mr){var Gn=mr.which;if(!Ue){[Zt.Z.DOWN,Zt.Z.SPACE,Zt.Z.ENTER].includes(Gn)&&(At(!0),mr.preventDefault());return}switch(Gn){case Zt.Z.UP:yr(-1),mr.preventDefault();break;case Zt.Z.DOWN:yr(1),mr.preventDefault();break;case Zt.Z.ESC:At(!1);break;case Zt.Z.SPACE:case Zt.Z.ENTER:Ft!==null&&En(Ft,mr);break}}(0,Ae.useEffect)(function(){var mr=document.getElementById(xn);mr&&mr.scrollIntoView&&mr.scrollIntoView(!1)},[Ft]),(0,Ae.useEffect)(function(){Ue||Gt(null)},[Ue]);var Wn=(0,Pe.Z)({},bn?"marginRight":"marginLeft",Ct);Ge.length||(Wn.visibility="hidden",Wn.order=1);var xr=be()((0,Pe.Z)({},"".concat(un,"-rtl"),bn)),gr=nt?null:Ae.createElement(Qt.Z,{prefixCls:un,overlay:Yn,trigger:["hover"],visible:Ge.length?Ue:!1,transitionName:kt,onVisibleChange:At,overlayClassName:be()(xr,On),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:qt},Ae.createElement("button",{type:"button",className:"".concat(ke,"-nav-more"),style:Wn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Kt,id:"".concat(Ie,"-more"),"aria-expanded":Ue,onKeyDown:rr},ct));return Ae.createElement("div",{className:be()("".concat(ke,"-nav-operations"),Jt),style:Rt,ref:Te},gr,Ae.createElement(Ye,{prefixCls:ke,locale:ut,editable:pt}))}var zt=Ae.memo(Ae.forwardRef(Vt),function(Ee,Te){return Te.tabMoving});function ye(Ee){var Te,ke=Ee.prefixCls,Ie=Ee.id,Ge=Ee.active,ut=Ee.tab,nt=ut.key,ze=ut.label,ct=ut.disabled,kt=ut.closeIcon,Rt=Ee.closable,Jt=Ee.renderWrapper,pt=Ee.removeAriaLabel,Ct=Ee.editable,bn=Ee.onClick,ln=Ee.onFocus,En=Ee.style,qt="".concat(ke,"-tab"),On=Wt(Rt,kt,Ct,ct);function tn(At){ct||bn(At)}function An(At){At.preventDefault(),At.stopPropagation(),Ct.onEdit("remove",{key:nt,event:At})}var Ue=Ae.createElement("div",{key:nt,"data-node-key":en(nt),className:be()(qt,(Te={},(0,Pe.Z)(Te,"".concat(qt,"-with-remove"),On),(0,Pe.Z)(Te,"".concat(qt,"-active"),Ge),(0,Pe.Z)(Te,"".concat(qt,"-disabled"),ct),Te)),style:En,onClick:tn},Ae.createElement("div",{role:"tab","aria-selected":Ge,id:Ie&&"".concat(Ie,"-tab-").concat(nt),className:"".concat(qt,"-btn"),"aria-controls":Ie&&"".concat(Ie,"-panel-").concat(nt),"aria-disabled":ct,tabIndex:ct?null:0,onClick:function(Pt){Pt.stopPropagation(),tn(Pt)},onKeyDown:function(Pt){[Zt.Z.SPACE,Zt.Z.ENTER].includes(Pt.which)&&(Pt.preventDefault(),tn(Pt))},onFocus:ln},ze),On&&Ae.createElement("button",{type:"button","aria-label":pt||"remove",tabIndex:0,className:"".concat(qt,"-remove"),onClick:function(Pt){Pt.stopPropagation(),An(Pt)}},kt||Ct.removeIcon||"\xD7"));return Jt?Jt(Ue):Ue}var se=ye,oe=ue(16089),de=function(Te){var ke=Te.activeTabOffset,Ie=Te.horizontal,Ge=Te.rtl,ut=Te.indicatorSize,nt=(0,Ae.useState)(),ze=(0,_e.Z)(nt,2),ct=ze[0],kt=ze[1],Rt=(0,Ae.useRef)(),Jt=function(bn){return typeof ut=="function"?ut(bn):typeof ut=="number"?ut:bn};function pt(){oe.Z.cancel(Rt.current)}return(0,Ae.useEffect)(function(){var Ct={};return ke&&(Ie?(Ge?(Ct.right=ke.right+ke.width/2,Ct.transform="translateX(50%)"):(Ct.left=ke.left+ke.width/2,Ct.transform="translateX(-50%)"),Ct.width=Jt(ke.width)):(Ct.top=ke.top+ke.height/2,Ct.transform="translateY(-50%)",Ct.height=Jt(ke.height))),pt(),Rt.current=(0,oe.Z)(function(){kt(Ct)}),pt},[ke,Ie,Ge,ut]),{style:ct}},pe=de,le=function(Te){var ke=Te.current||{},Ie=ke.offsetWidth,Ge=Ie===void 0?0:Ie,ut=ke.offsetHeight,nt=ut===void 0?0:ut;return[Ge,nt]},Be=function(Te,ke){return Te[ke?0:1]};function lt(Ee,Te){var ke,Ie=Ae.useContext(it),Ge=Ie.prefixCls,ut=Ie.tabs,nt=Ee.className,ze=Ee.style,ct=Ee.id,kt=Ee.animated,Rt=Ee.activeKey,Jt=Ee.rtl,pt=Ee.extra,Ct=Ee.editable,bn=Ee.locale,ln=Ee.tabPosition,En=Ee.tabBarGutter,qt=Ee.children,On=Ee.onTabClick,tn=Ee.onTabScroll,An=Ee.indicatorSize,Ue=(0,Ae.useRef)(),At=(0,Ae.useRef)(),Pt=(0,Ae.useRef)(),Xt=(0,Ae.useRef)(),Ft=(0,Ae.useRef)(),Gt=(0,Ae.useRef)(),Kt=(0,Ae.useRef)(),un=ln==="top"||ln==="bottom",xn=Xe(0,function(vi,mi){un&&tn&&tn({direction:vi>mi?"left":"right"})}),_n=(0,_e.Z)(xn,2),Hn=_n[0],Yn=_n[1],yr=Xe(0,function(vi,mi){!un&&tn&&tn({direction:vi>mi?"top":"bottom"})}),rr=(0,_e.Z)(yr,2),Wn=rr[0],xr=rr[1],gr=(0,Ae.useState)([0,0]),mr=(0,_e.Z)(gr,2),Gn=mr[0],Jn=mr[1],hr=(0,Ae.useState)([0,0]),tr=(0,_e.Z)(hr,2),_r=tr[0],Wr=tr[1],fr=(0,Ae.useState)([0,0]),kn=(0,_e.Z)(fr,2),Cn=kn[0],Xn=kn[1],Fn=(0,Ae.useState)([0,0]),Sr=(0,_e.Z)(Fn,2),Ar=Sr[0],lr=Sr[1],Vr=Bt(new Map),Tr=(0,_e.Z)(Vr,2),si=Tr[0],or=Tr[1],nr=Mt(ut,si,_r[0]),Ir=Be(Gn,un),Lr=Be(_r,un),ti=Be(Cn,un),yi=Be(Ar,un),bi=Ir<Lr+ti,Gr=bi?Ir-yi:Ir-ti,gi="".concat(Ge,"-nav-operations-hidden"),pi=0,Zn=0;un&&Jt?(pi=0,Zn=Math.max(0,Lr-Gr)):(pi=Math.min(0,Gr-Lr),Zn=0);function Un(vi){return vi<pi?pi:vi>Zn?Zn:vi}var jn=(0,Ae.useRef)(),ur=(0,Ae.useState)(),Yr=(0,_e.Z)(ur,2),li=Yr[0],fi=Yr[1];function di(){fi(Date.now())}function ii(){window.clearTimeout(jn.current)}Ut(Xt,function(vi,mi){function Gi(ca,oa){ca(function(ta){var ts=Un(ta+oa);return ts})}return bi?(un?Gi(Yn,vi):Gi(xr,mi),ii(),di(),!0):!1}),(0,Ae.useEffect)(function(){return ii(),li&&(jn.current=window.setTimeout(function(){fi(0)},100)),ii},[li]);var Si=$e(nr,Gr,un?Hn:Wn,Lr,ti,yi,(0,we.Z)((0,we.Z)({},Ee),{},{tabs:ut})),Fi=(0,_e.Z)(Si,2),Ii=Fi[0],la=Fi[1],ea=(0,Me.Z)(function(){var vi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rt,mi=nr.get(vi)||{width:0,height:0,left:0,right:0,top:0};if(un){var Gi=Hn;Jt?mi.right<Hn?Gi=mi.right:mi.right+mi.width>Hn+Gr&&(Gi=mi.right+mi.width-Gr):mi.left<-Hn?Gi=-mi.left:mi.left+mi.width>-Hn+Gr&&(Gi=-(mi.left+mi.width-Gr)),xr(0),Yn(Un(Gi))}else{var ca=Wn;mi.top<-Wn?ca=-mi.top:mi.top+mi.height>-Wn+Gr&&(ca=-(mi.top+mi.height-Gr)),Yn(0),xr(Un(ca))}}),Pi={};ln==="top"||ln==="bottom"?Pi[Jt?"marginRight":"marginLeft"]=En:Pi.marginTop=En;var ki=ut.map(function(vi,mi){var Gi=vi.key;return Ae.createElement(se,{id:ct,prefixCls:Ge,key:Gi,tab:vi,style:mi===0?void 0:Pi,closable:vi.closable,editable:Ct,active:Gi===Rt,renderWrapper:qt,removeAriaLabel:bn==null?void 0:bn.removeAriaLabel,onClick:function(oa){On(Gi,oa)},onFocus:function(){ea(Gi),di(),Xt.current&&(Jt||(Xt.current.scrollLeft=0),Xt.current.scrollTop=0)}})}),Qr=function(){return or(function(){var mi=new Map;return ut.forEach(function(Gi){var ca,oa=Gi.key,ta=(ca=Ft.current)===null||ca===void 0?void 0:ca.querySelector('[data-node-key="'.concat(en(oa),'"]'));ta&&mi.set(oa,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),mi})};(0,Ae.useEffect)(function(){Qr()},[ut.map(function(vi){return vi.key}).join("_")]);var Vi=Dt(function(){var vi=le(Ue),mi=le(At),Gi=le(Pt);Jn([vi[0]-mi[0]-Gi[0],vi[1]-mi[1]-Gi[1]]);var ca=le(Kt);Xn(ca);var oa=le(Gt);lr(oa);var ta=le(Ft);Wr([ta[0]-ca[0],ta[1]-ca[1]]),Qr()}),$i=ut.slice(0,Ii),ci=ut.slice(la+1),Pr=[].concat((0,mt.Z)($i),(0,mt.Z)(ci)),Ur=nr.get(Rt),zr=pe({activeTabOffset:Ur,horizontal:un,rtl:Jt,indicatorSize:An}),Or=zr.style;(0,Ae.useEffect)(function(){ea()},[Rt,pi,Zn,xe(Ur),xe(nr),un]),(0,Ae.useEffect)(function(){Vi()},[Jt]);var ai=!!Pr.length,ri="".concat(Ge,"-nav-wrap"),Ai,Ki,Hi,na;return un?Jt?(Ki=Hn>0,Ai=Hn!==Zn):(Ai=Hn<0,Ki=Hn!==pi):(Hi=Wn<0,na=Wn!==pi),Ae.createElement(We.Z,{onResize:Vi},Ae.createElement("div",{ref:(0,Ke.x1)(Te,Ue),role:"tablist",className:be()("".concat(Ge,"-nav"),nt),style:ze,onKeyDown:function(){di()}},Ae.createElement(mn,{ref:At,position:"left",extra:pt,prefixCls:Ge}),Ae.createElement(We.Z,{onResize:Vi},Ae.createElement("div",{className:be()(ri,(ke={},(0,Pe.Z)(ke,"".concat(ri,"-ping-left"),Ai),(0,Pe.Z)(ke,"".concat(ri,"-ping-right"),Ki),(0,Pe.Z)(ke,"".concat(ri,"-ping-top"),Hi),(0,Pe.Z)(ke,"".concat(ri,"-ping-bottom"),na),ke)),ref:Xt},Ae.createElement(We.Z,{onResize:Vi},Ae.createElement("div",{ref:Ft,className:"".concat(Ge,"-nav-list"),style:{transform:"translate(".concat(Hn,"px, ").concat(Wn,"px)"),transition:li?"none":void 0}},ki,Ae.createElement(Ye,{ref:Kt,prefixCls:Ge,locale:bn,editable:Ct,style:(0,we.Z)((0,we.Z)({},ki.length===0?void 0:Pi),{},{visibility:ai?"hidden":null})}),Ae.createElement("div",{className:be()("".concat(Ge,"-ink-bar"),(0,Pe.Z)({},"".concat(Ge,"-ink-bar-animated"),kt.inkBar)),style:Or}))))),Ae.createElement(zt,(0,De.Z)({},Ee,{removeAriaLabel:bn==null?void 0:bn.removeAriaLabel,ref:Gt,prefixCls:Ge,tabs:Pr,className:!ai&&gi,tabMoving:!!li})),Ae.createElement(mn,{ref:Pt,position:"right",extra:pt,prefixCls:Ge})))}var Ot=Ae.forwardRef(lt),It=["renderTabBar"],Ht=["label","key"];function Yt(Ee){var Te=Ee.renderTabBar,ke=(0,dt.Z)(Ee,It),Ie=Ae.useContext(it),Ge=Ie.tabs;if(Te){var ut=(0,we.Z)((0,we.Z)({},ke),{},{panes:Ge.map(function(nt){var ze=nt.label,ct=nt.key,kt=(0,dt.Z)(nt,Ht);return Ae.createElement(xt,(0,De.Z)({tab:ze,key:ct,tabKey:ct},kt))})});return Te(ut,Ot)}return Ae.createElement(Ot,ke)}var an=ue(48736);function cn(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Te;return Ee===!1?Te={inkBar:!1,tabPane:!1}:Ee===!0?Te={inkBar:!0,tabPane:!1}:Te=(0,we.Z)({inkBar:!0},(0,Ne.Z)(Ee)==="object"?Ee:{}),Te.tabPaneMotion&&Te.tabPane===void 0&&(Te.tabPane=!0),!Te.tabPaneMotion&&Te.tabPane&&(Te.tabPane=!1),Te}var Sn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],wt=0;function on(Ee,Te){var ke,Ie=Ee.id,Ge=Ee.prefixCls,ut=Ge===void 0?"rc-tabs":Ge,nt=Ee.className,ze=Ee.items,ct=Ee.direction,kt=Ee.activeKey,Rt=Ee.defaultActiveKey,Jt=Ee.editable,pt=Ee.animated,Ct=Ee.tabPosition,bn=Ct===void 0?"top":Ct,ln=Ee.tabBarGutter,En=Ee.tabBarStyle,qt=Ee.tabBarExtraContent,On=Ee.locale,tn=Ee.moreIcon,An=Ee.moreTransitionName,Ue=Ee.destroyInactiveTabPane,At=Ee.renderTabBar,Pt=Ee.onChange,Xt=Ee.onTabClick,Ft=Ee.onTabScroll,Gt=Ee.getPopupContainer,Kt=Ee.popupClassName,un=Ee.indicatorSize,xn=(0,dt.Z)(Ee,Sn),_n=Ae.useMemo(function(){return(ze||[]).filter(function(lr){return lr&&(0,Ne.Z)(lr)==="object"&&"key"in lr})},[ze]),Hn=ct==="rtl",Yn=cn(pt),yr=(0,Ae.useState)(!1),rr=(0,_e.Z)(yr,2),Wn=rr[0],xr=rr[1];(0,Ae.useEffect)(function(){xr((0,He.Z)())},[]);var gr=(0,rt.Z)(function(){var lr;return(lr=_n[0])===null||lr===void 0?void 0:lr.key},{value:kt,defaultValue:Rt}),mr=(0,_e.Z)(gr,2),Gn=mr[0],Jn=mr[1],hr=(0,Ae.useState)(function(){return _n.findIndex(function(lr){return lr.key===Gn})}),tr=(0,_e.Z)(hr,2),_r=tr[0],Wr=tr[1];(0,Ae.useEffect)(function(){var lr=_n.findIndex(function(Tr){return Tr.key===Gn});if(lr===-1){var Vr;lr=Math.max(0,Math.min(_r,_n.length-1)),Jn((Vr=_n[lr])===null||Vr===void 0?void 0:Vr.key)}Wr(lr)},[_n.map(function(lr){return lr.key}).join("_"),Gn,_r]);var fr=(0,rt.Z)(null,{value:Ie}),kn=(0,_e.Z)(fr,2),Cn=kn[0],Xn=kn[1];(0,Ae.useEffect)(function(){Ie||(Xn("rc-tabs-".concat(wt)),wt+=1)},[]);function Fn(lr,Vr){Xt==null||Xt(lr,Vr);var Tr=lr!==Gn;Jn(lr),Tr&&(Pt==null||Pt(lr))}var Sr={id:Cn,activeKey:Gn,animated:Yn,tabPosition:bn,rtl:Hn,mobile:Wn},Ar=(0,we.Z)((0,we.Z)({},Sr),{},{editable:Jt,locale:On,moreIcon:tn,moreTransitionName:An,tabBarGutter:ln,onTabClick:Fn,onTabScroll:Ft,extra:qt,style:En,panes:null,getPopupContainer:Gt,popupClassName:Kt,indicatorSize:un});return Ae.createElement(it.Provider,{value:{tabs:_n,prefixCls:ut}},Ae.createElement("div",(0,De.Z)({ref:Te,id:Ie,className:be()(ut,"".concat(ut,"-").concat(bn),(ke={},(0,Pe.Z)(ke,"".concat(ut,"-mobile"),Wn),(0,Pe.Z)(ke,"".concat(ut,"-editable"),Jt),(0,Pe.Z)(ke,"".concat(ut,"-rtl"),Hn),ke),nt)},xn),Ae.createElement(Yt,(0,De.Z)({},Ar,{renderTabBar:At})),Ae.createElement(Qe,(0,De.Z)({destroyInactiveTabPane:Ue},Sr,{animated:Yn}))))}var Pn=Ae.forwardRef(on),ot=Pn,St=ot,$t=ue(36355),Dn=ue(19716),In=()=>null,qn=ue(62892);const dr={motionAppear:!1,motionEnter:!0,motionLeave:!0};function ir(Ee){let Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},ke;return Te===!1?ke={inkBar:!1,tabPane:!1}:Te===!0?ke={inkBar:!0,tabPane:!0}:ke=Object.assign({inkBar:!0},typeof Te=="object"?Te:{}),ke.tabPane&&(ke.tabPaneMotion=Object.assign(Object.assign({},dr),{motionName:(0,qn.m)(Ee,"switch")})),ke}var Er=ue(11592),kr=function(Ee,Te){var ke={};for(var Ie in Ee)Object.prototype.hasOwnProperty.call(Ee,Ie)&&Te.indexOf(Ie)<0&&(ke[Ie]=Ee[Ie]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Ie=Object.getOwnPropertySymbols(Ee);Ge<Ie.length;Ge++)Te.indexOf(Ie[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ee,Ie[Ge])&&(ke[Ie[Ge]]=Ee[Ie[Ge]]);return ke};function Qn(Ee){return Ee.filter(Te=>Te)}function Kr(Ee,Te){if(Ee)return Ee;const ke=(0,Er.Z)(Te).map(Ie=>{if(Ae.isValidElement(Ie)){const{key:Ge,props:ut}=Ie,nt=ut||{},{tab:ze}=nt,ct=kr(nt,["tab"]);return Object.assign(Object.assign({key:String(Ge)},ct),{label:ze})}return null});return Qn(ke)}var jr=ue(17313),Hr=ue(83116),ni=ue(37613),Br=ue(13826),Cr=Ee=>{const{componentCls:Te,motionDurationSlow:ke}=Ee;return[{[Te]:{[`${Te}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${ke}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${ke}`}}}}},[(0,Br.oN)(Ee,"slide-up"),(0,Br.oN)(Ee,"slide-down")]]};const yn=Ee=>{const{componentCls:Te,tabsCardPadding:ke,cardBg:Ie,cardGutter:Ge,colorBorderSecondary:ut,itemSelectedColor:nt}=Ee;return{[`${Te}-card`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{margin:0,padding:ke,background:Ie,border:`${Ee.lineWidth}px ${Ee.lineType} ${ut}`,transition:`all ${Ee.motionDurationSlow} ${Ee.motionEaseInOut}`},[`${Te}-tab-active`]:{color:nt,background:Ee.colorBgContainer},[`${Te}-ink-bar`]:{visibility:"hidden"}},[`&${Te}-top, &${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Ge}px`}}}},[`&${Te}-top`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:`${Ee.borderRadiusLG}px ${Ee.borderRadiusLG}px 0 0`},[`${Te}-tab-active`]:{borderBottomColor:Ee.colorBgContainer}}},[`&${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:`0 0 ${Ee.borderRadiusLG}px ${Ee.borderRadiusLG}px`},[`${Te}-tab-active`]:{borderTopColor:Ee.colorBgContainer}}},[`&${Te}-left, &${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginTop:`${Ge}px`}}},[`&${Te}-left`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Ee.borderRadiusLG}px 0 0 ${Ee.borderRadiusLG}px`}},[`${Te}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Ee.colorBgContainer}}}},[`&${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Ee.borderRadiusLG}px ${Ee.borderRadiusLG}px 0`}},[`${Te}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Ee.colorBgContainer}}}}}}},wn=Ee=>{const{componentCls:Te,itemHoverColor:ke,dropdownEdgeChildVerticalPadding:Ie}=Ee;return{[`${Te}-dropdown`]:Object.assign(Object.assign({},(0,jr.Wf)(Ee)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Ee.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Te}-dropdown-menu`]:{maxHeight:Ee.tabsDropdownHeight,margin:0,padding:`${Ie}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Ee.colorBgContainer,backgroundClip:"padding-box",borderRadius:Ee.borderRadiusLG,outline:"none",boxShadow:Ee.boxShadowSecondary,"&-item":Object.assign(Object.assign({},jr.vS),{display:"flex",alignItems:"center",minWidth:Ee.tabsDropdownWidth,margin:0,padding:`${Ee.paddingXXS}px ${Ee.paddingSM}px`,color:Ee.colorText,fontWeight:"normal",fontSize:Ee.fontSize,lineHeight:Ee.lineHeight,cursor:"pointer",transition:`all ${Ee.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Ee.marginSM},color:Ee.colorTextDescription,fontSize:Ee.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:ke}},"&:hover":{background:Ee.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Ee.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},fn=Ee=>{const{componentCls:Te,margin:ke,colorBorderSecondary:Ie,horizontalMargin:Ge,verticalItemPadding:ut,verticalItemMargin:nt}=Ee;return{[`${Te}-top, ${Te}-bottom`]:{flexDirection:"column",[`> ${Te}-nav, > div > ${Te}-nav`]:{margin:Ge,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Ee.lineWidth}px ${Ee.lineType} ${Ie}`,content:"''"},[`${Te}-ink-bar`]:{height:Ee.lineWidthBold,"&-animated":{transition:`width ${Ee.motionDurationSlow}, left ${Ee.motionDurationSlow},
right ${Ee.motionDurationSlow}`}},[`${Te}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Ee.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Ee.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Ee.boxShadowTabsOverflowRight},[`&${Te}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Te}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Te}-top`]:{[`> ${Te}-nav,
> div > ${Te}-nav`]:{"&::before":{bottom:0},[`${Te}-ink-bar`]:{bottom:0}}},[`${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{order:1,marginTop:`${ke}px`,marginBottom:0,"&::before":{top:0},[`${Te}-ink-bar`]:{top:0}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{order:0}},[`${Te}-left, ${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{flexDirection:"column",minWidth:Ee.controlHeight*1.25,[`${Te}-tab`]:{padding:ut,textAlign:"center"},[`${Te}-tab + ${Te}-tab`]:{margin:nt},[`${Te}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Ee.controlHeight},"&::before":{top:0,boxShadow:Ee.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Ee.boxShadowTabsOverflowBottom},[`&${Te}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Te}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Te}-ink-bar`]:{width:Ee.lineWidthBold,"&-animated":{transition:`height ${Ee.motionDurationSlow}, top ${Ee.motionDurationSlow}`}},[`${Te}-nav-list, ${Te}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Te}-left`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Ee.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.colorBorder}`},[`> ${Te}-content > ${Te}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Ee.paddingLG}}}},[`${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{order:1,[`${Te}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Ee.lineWidth},borderRight:{_skip_check_:!0,value:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.colorBorder}`},[`> ${Te}-content > ${Te}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Ee.paddingLG}}}}}},Rn=Ee=>{const{componentCls:Te,cardPaddingSM:ke,cardPaddingLG:Ie,horizontalItemPaddingSM:Ge,horizontalItemPaddingLG:ut}=Ee;return{[Te]:{"&-small":{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:Ge,fontSize:Ee.titleFontSizeSM}}},"&-large":{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:ut,fontSize:Ee.titleFontSizeLG}}}},[`${Te}-card`]:{[`&${Te}-small`]:{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:ke}},[`&${Te}-bottom`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:`0 0 ${Ee.borderRadius}px ${Ee.borderRadius}px`}},[`&${Te}-top`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:`${Ee.borderRadius}px ${Ee.borderRadius}px 0 0`}},[`&${Te}-right`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Ee.borderRadius}px ${Ee.borderRadius}px 0`}}},[`&${Te}-left`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Ee.borderRadius}px 0 0 ${Ee.borderRadius}px`}}}},[`&${Te}-large`]:{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:Ie}}}}}},br=Ee=>{const{componentCls:Te,itemActiveColor:ke,itemHoverColor:Ie,iconCls:Ge,tabsHorizontalItemMargin:ut,horizontalItemPadding:nt,itemSelectedColor:ze,itemColor:ct}=Ee,kt=`${Te}-tab`;return{[kt]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:nt,fontSize:Ee.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:ct,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:ke}},(0,jr.Qy)(Ee)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Ee.marginXXS},marginLeft:{_skip_check_:!0,value:Ee.marginXS},color:Ee.colorTextDescription,fontSize:Ee.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Ee.motionDurationSlow}`,"&:hover":{color:Ee.colorTextHeading}},"&:hover":{color:Ie},[`&${kt}-active ${kt}-btn`]:{color:ze,textShadow:Ee.tabsActiveTextShadow},[`&${kt}-disabled`]:{color:Ee.colorTextDisabled,cursor:"not-allowed"},[`&${kt}-disabled ${kt}-btn, &${kt}-disabled ${Te}-remove`]:{"&:focus, &:active":{color:Ee.colorTextDisabled}},[`& ${kt}-remove ${Ge}`]:{margin:0},[Ge]:{marginRight:{_skip_check_:!0,value:Ee.marginSM}}},[`${kt} + ${kt}`]:{margin:{_skip_check_:!0,value:ut}}}},Kn=Ee=>{const{componentCls:Te,tabsHorizontalItemMarginRTL:ke,iconCls:Ie,cardGutter:Ge}=Ee;return{[`${Te}-rtl`]:{direction:"rtl",[`${Te}-nav`]:{[`${Te}-tab`]:{margin:{_skip_check_:!0,value:ke},[`${Te}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Ie]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Ee.marginSM}px`}},[`${Te}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Ee.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Ee.marginXXS}px`},[Ie]:{margin:0}}}},[`&${Te}-left`]:{[`> ${Te}-nav`]:{order:1},[`> ${Te}-content-holder`]:{order:0}},[`&${Te}-right`]:{[`> ${Te}-nav`]:{order:0},[`> ${Te}-content-holder`]:{order:1}},[`&${Te}-card${Te}-top, &${Te}-card${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginRight:{_skip_check_:!0,value:Ge},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Te}-dropdown-rtl`]:{direction:"rtl"},[`${Te}-menu-item`]:{[`${Te}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ar=Ee=>{const{componentCls:Te,tabsCardPadding:ke,cardHeight:Ie,cardGutter:Ge,itemHoverColor:ut,itemActiveColor:nt,colorBorderSecondary:ze}=Ee;return{[Te]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,jr.Wf)(Ee)),{display:"flex",[`> ${Te}-nav, > div > ${Te}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Te}-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 ${Ee.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Te}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Ee.motionDurationSlow}`},[`${Te}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Te}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Te}-nav-more`]:{position:"relative",padding:ke,background:"transparent",border:0,color:Ee.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Ee.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Te}-nav-add`]:Object.assign({minWidth:Ie,marginLeft:{_skip_check_:!0,value:Ge},padding:`0 ${Ee.paddingXS}px`,background:"transparent",border:`${Ee.lineWidth}px ${Ee.lineType} ${ze}`,borderRadius:`${Ee.borderRadiusLG}px ${Ee.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Ee.colorText,transition:`all ${Ee.motionDurationSlow} ${Ee.motionEaseInOut}`,"&:hover":{color:ut},"&:active, &:focus:not(:focus-visible)":{color:nt}},(0,jr.Qy)(Ee))},[`${Te}-extra-content`]:{flex:"none"},[`${Te}-ink-bar`]:{position:"absolute",background:Ee.inkBarColor,pointerEvents:"none"}}),br(Ee)),{[`${Te}-content`]:{position:"relative",width:"100%"},[`${Te}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Te}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Te}-centered`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-nav-wrap`]:{[`&:not([class*='${Te}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var vn=(0,Hr.Z)("Tabs",Ee=>{const Te=(0,ni.TS)(Ee,{tabsCardPadding:Ee.cardPadding||`${(Ee.cardHeight-Math.round(Ee.fontSize*Ee.lineHeight))/2-Ee.lineWidth}px ${Ee.padding}px`,dropdownEdgeChildVerticalPadding:Ee.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Ee.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Ee.horizontalItemGutter}px`});return[Rn(Te),Kn(Te),fn(Te),wn(Te),yn(Te),ar(Te),Cr(Te)]},Ee=>{const Te=Ee.controlHeightLG;return{zIndexPopup:Ee.zIndexPopupBase+50,cardBg:Ee.colorFillAlter,cardHeight:Te,cardPadding:"",cardPaddingSM:`${Ee.paddingXXS*1.5}px ${Ee.padding}px`,cardPaddingLG:`${Ee.paddingXS}px ${Ee.padding}px ${Ee.paddingXXS*1.5}px`,titleFontSize:Ee.fontSize,titleFontSizeLG:Ee.fontSizeLG,titleFontSizeSM:Ee.fontSize,inkBarColor:Ee.colorPrimary,horizontalMargin:`0 0 ${Ee.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Ee.paddingSM}px 0`,horizontalItemPaddingSM:`${Ee.paddingXS}px 0`,horizontalItemPaddingLG:`${Ee.padding}px 0`,verticalItemPadding:`${Ee.paddingXS}px ${Ee.paddingLG}px`,verticalItemMargin:`${Ee.margin}px 0 0 0`,itemColor:Ee.colorText,itemSelectedColor:Ee.colorPrimary,itemHoverColor:Ee.colorPrimaryHover,itemActiveColor:Ee.colorPrimaryActive,cardGutter:Ee.marginXXS/2}}),pn=function(Ee,Te){var ke={};for(var Ie in Ee)Object.prototype.hasOwnProperty.call(Ee,Ie)&&Te.indexOf(Ie)<0&&(ke[Ie]=Ee[Ie]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Ie=Object.getOwnPropertySymbols(Ee);Ge<Ie.length;Ge++)Te.indexOf(Ie[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ee,Ie[Ge])&&(ke[Ie[Ge]]=Ee[Ie[Ge]]);return ke};const Nn=Ee=>{const{type:Te,className:ke,rootClassName:Ie,size:Ge,onEdit:ut,hideAdd:nt,centered:ze,addIcon:ct,popupClassName:kt,children:Rt,items:Jt,animated:pt,style:Ct,indicatorSize:bn}=Ee,ln=pn(Ee,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:En,moreIcon:qt=Ae.createElement(Ze.Z,null)}=ln,{direction:On,tabs:tn,getPrefixCls:An,getPopupContainer:Ue}=Ae.useContext($t.E_),At=An("tabs",En),[Pt,Xt]=vn(At);let Ft;Te==="editable-card"&&(Ft={onEdit:(Hn,Yn)=>{let{key:yr,event:rr}=Yn;ut==null||ut(Hn==="add"?rr:yr,Hn)},removeIcon:Ae.createElement(fe.Z,null),addIcon:ct||Ae.createElement(Fe.Z,null),showAdd:nt!==!0});const Gt=An(),Kt=Kr(Jt,Rt),un=ir(At,pt),xn=(0,Dn.Z)(Ge),_n=Object.assign(Object.assign({},tn==null?void 0:tn.style),Ct);return Pt(Ae.createElement(St,Object.assign({direction:On,getPopupContainer:Ue,moreTransitionName:`${Gt}-slide-up`},ln,{items:Kt,className:be()({[`${At}-${xn}`]:xn,[`${At}-card`]:["card","editable-card"].includes(Te),[`${At}-editable-card`]:Te==="editable-card",[`${At}-centered`]:ze},tn==null?void 0:tn.className,ke,Ie,Xt),popupClassName:be()(kt,Xt),style:_n,editable:Ft,moreIcon:qt,prefixCls:At,animated:un,indicatorSize:bn!=null?bn:tn==null?void 0:tn.indicatorSize})))};Nn.TabPane=In;var st=Nn},99498:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){fe.defineOption("placeholder","",function(we,_e,Ne){var dt=Ne&&Ne!=fe.Init;if(_e&&!dt)we.on("blur",be),we.on("change",De),we.on("swapDoc",De),fe.on(we.getInputField(),"compositionupdate",we.state.placeholderCompose=function(){tt(we)}),De(we);else if(!_e&&dt){we.off("blur",be),we.off("change",De),we.off("swapDoc",De),fe.off(we.getInputField(),"compositionupdate",we.state.placeholderCompose),Ze(we);var Ae=we.getWrapperElement();Ae.className=Ae.className.replace(" CodeMirror-empty","")}_e&&!we.hasFocus()&&be(we)});function Ze(we){we.state.placeholder&&(we.state.placeholder.parentNode.removeChild(we.state.placeholder),we.state.placeholder=null)}function Fe(we){Ze(we);var _e=we.state.placeholder=document.createElement("pre");_e.style.cssText="height: 0; overflow: visible",_e.style.direction=we.getOption("direction"),_e.className="CodeMirror-placeholder CodeMirror-line-like";var Ne=we.getOption("placeholder");typeof Ne=="string"&&(Ne=document.createTextNode(Ne)),_e.appendChild(Ne),we.display.lineSpace.insertBefore(_e,we.display.lineSpace.firstChild)}function tt(we){setTimeout(function(){var _e=!1,Ne=we.getInputField();Ne.nodeName=="TEXTAREA"?_e=!Ne.value:we.lineCount()==1&&(_e=!/[^\u200b]/.test(Ne.querySelector(".CodeMirror-line").textContent)),_e?Fe(we):Ze(we)},20)}function be(we){Pe(we)&&Fe(we)}function De(we){var _e=we.getWrapperElement(),Ne=Pe(we);_e.className=_e.className.replace(" CodeMirror-empty","")+(Ne?" CodeMirror-empty":""),Ne?Fe(we):Ze(we)}function Pe(we){return we.lineCount()===1&&we.getLine(0)===""}})},25717:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){var Ze={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Fe=fe.Pos;fe.defineOption("autoCloseBrackets",!1,function(je,it,at){at&&at!=fe.Init&&(je.removeKeyMap(be),je.state.closeBrackets=null),it&&(De(tt(it,"pairs")),je.state.closeBrackets=it,je.addKeyMap(be))});function tt(je,it){return it=="pairs"&&typeof je=="string"?je:typeof je=="object"&&je[it]!=null?je[it]:Ze[it]}var be={Backspace:_e,Enter:Ne};function De(je){for(var it=0;it<je.length;it++){var at=je.charAt(it),xt="'"+at+"'";be[xt]||(be[xt]=Pe(at))}}De(Ze.pairs+"`");function Pe(je){return function(it){return Ae(it,je)}}function we(je){var it=je.state.closeBrackets;if(!it||it.override)return it;var at=je.getModeAt(je.getCursor());return at.closeBrackets||it}function _e(je){var it=we(je);if(!it||je.getOption("disableInput"))return fe.Pass;for(var at=tt(it,"pairs"),xt=je.listSelections(),jt=0;jt<xt.length;jt++){if(!xt[jt].empty())return fe.Pass;var Qe=He(je,xt[jt].head);if(!Qe||at.indexOf(Qe)%2!=0)return fe.Pass}for(var jt=xt.length-1;jt>=0;jt--){var mt=xt[jt].head;je.replaceRange("",Fe(mt.line,mt.ch-1),Fe(mt.line,mt.ch+1),"+delete")}}function Ne(je){var it=we(je),at=it&&tt(it,"explode");if(!at||je.getOption("disableInput"))return fe.Pass;for(var xt=je.listSelections(),jt=0;jt<xt.length;jt++){if(!xt[jt].empty())return fe.Pass;var Qe=He(je,xt[jt].head);if(!Qe||at.indexOf(Qe)%2!=0)return fe.Pass}je.operation(function(){var mt=je.lineSeparator()||`
`;je.replaceSelection(mt+mt,null),je.execCommand("goCharLeft"),xt=je.listSelections();for(var We=0;We<xt.length;We++){var Me=xt[We].head.line;je.indentLine(Me,null,!0),je.indentLine(Me+1,null,!0)}})}function dt(je){var it=fe.cmpPos(je.anchor,je.head)>0;return{anchor:new Fe(je.anchor.line,je.anchor.ch+(it?-1:1)),head:new Fe(je.head.line,je.head.ch+(it?1:-1))}}function Ae(je,it){var at=we(je);if(!at||je.getOption("disableInput"))return fe.Pass;var xt=tt(at,"pairs"),jt=xt.indexOf(it);if(jt==-1)return fe.Pass;for(var Qe=tt(at,"closeBefore"),mt=tt(at,"triples"),We=xt.charAt(jt+1)==it,Me=je.listSelections(),Ke=jt%2==0,Ve,Mt=0;Mt<Me.length;Mt++){var Xe=Me[Mt],Nt=Xe.head,ht,Tt=je.getRange(Nt,Fe(Nt.line,Nt.ch+1));if(Ke&&!Xe.empty())ht="surround";else if((We||!Ke)&&Tt==it)We&&rt(je,Nt)?ht="both":mt.indexOf(it)>=0&&je.getRange(Nt,Fe(Nt.line,Nt.ch+3))==it+it+it?ht="skipThree":ht="skip";else if(We&&Nt.ch>1&&mt.indexOf(it)>=0&&je.getRange(Fe(Nt.line,Nt.ch-2),Nt)==it+it){if(Nt.ch>2&&/\bstring/.test(je.getTokenTypeAt(Fe(Nt.line,Nt.ch-2))))return fe.Pass;ht="addFour"}else if(We){var et=Nt.ch==0?" ":je.getRange(Fe(Nt.line,Nt.ch-1),Nt);if(!fe.isWordChar(Tt)&&et!=it&&!fe.isWordChar(et))ht="both";else return fe.Pass}else if(Ke&&(Tt.length===0||/\s/.test(Tt)||Qe.indexOf(Tt)>-1))ht="both";else return fe.Pass;if(!Ve)Ve=ht;else if(Ve!=ht)return fe.Pass}var Ut=jt%2?xt.charAt(jt-1):it,ft=jt%2?it:xt.charAt(jt+1);je.operation(function(){if(Ve=="skip")je.execCommand("goCharRight");else if(Ve=="skipThree")for(var Dt=0;Dt<3;Dt++)je.execCommand("goCharRight");else if(Ve=="surround"){for(var Bt=je.getSelections(),Dt=0;Dt<Bt.length;Dt++)Bt[Dt]=Ut+Bt[Dt]+ft;je.replaceSelections(Bt,"around"),Bt=je.listSelections().slice();for(var Dt=0;Dt<Bt.length;Dt++)Bt[Dt]=dt(Bt[Dt]);je.setSelections(Bt)}else Ve=="both"?(je.replaceSelection(Ut+ft,null),je.triggerElectric(Ut+ft),je.execCommand("goCharLeft")):Ve=="addFour"&&(je.replaceSelection(Ut+Ut+Ut+Ut,"before"),je.execCommand("goCharRight"))})}function He(je,it){var at=je.getRange(Fe(it.line,it.ch-1),Fe(it.line,it.ch+1));return at.length==2?at:null}function rt(je,it){var at=je.getTokenAt(Fe(it.line,it.ch+1));return/\bstring/.test(at.type)&&at.start==it.ch&&(it.ch==0||!/\bstring/.test(je.getTokenTypeAt(it)))}})},6313:function(Mn,rn,ue){(function(fe){fe(ue(89780),ue(32855))})(function(fe){fe.defineOption("autoCloseTags",!1,function(_e,Ne,dt){if(dt!=fe.Init&&dt&&_e.removeKeyMap("autoCloseTags"),!!Ne){var Ae={name:"autoCloseTags"};(typeof Ne!="object"||Ne.whenClosing!==!1)&&(Ae["'/'"]=function(He){return De(He)}),(typeof Ne!="object"||Ne.whenOpening!==!1)&&(Ae["'>'"]=function(He){return tt(He)}),_e.addKeyMap(Ae)}});var Ze=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Fe=["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 tt(_e){if(_e.getOption("disableInput"))return fe.Pass;for(var Ne=_e.listSelections(),dt=[],Ae=_e.getOption("autoCloseTags"),He=0;He<Ne.length;He++){if(!Ne[He].empty())return fe.Pass;var rt=Ne[He].head,je=_e.getTokenAt(rt),it=fe.innerMode(_e.getMode(),je.state),at=it.state,xt=it.mode.xmlCurrentTag&&it.mode.xmlCurrentTag(at),jt=xt&&xt.name;if(!jt)return fe.Pass;var Qe=it.mode.configuration=="html",mt=typeof Ae=="object"&&Ae.dontCloseTags||Qe&&Ze,We=typeof Ae=="object"&&Ae.indentTags||Qe&&Fe;je.end>rt.ch&&(jt=jt.slice(0,jt.length-je.end+rt.ch));var Me=jt.toLowerCase();if(!jt||je.type=="string"&&(je.end!=rt.ch||!/[\"\']/.test(je.string.charAt(je.string.length-1))||je.string.length==1)||je.type=="tag"&&xt.close||je.string.indexOf("/")==rt.ch-je.start-1||mt&&Pe(mt,Me)>-1||we(_e,it.mode.xmlCurrentContext&&it.mode.xmlCurrentContext(at)||[],jt,rt,!0))return fe.Pass;var Ke=typeof Ae=="object"&&Ae.emptyTags;if(Ke&&Pe(Ke,jt)>-1){dt[He]={text:"/>",newPos:fe.Pos(rt.line,rt.ch+2)};continue}var Ve=We&&Pe(We,Me)>-1;dt[He]={indent:Ve,text:">"+(Ve?`
`:"")+"</"+jt+">",newPos:Ve?fe.Pos(rt.line+1,0):fe.Pos(rt.line,rt.ch+1)}}for(var Mt=typeof Ae=="object"&&Ae.dontIndentOnAutoClose,He=Ne.length-1;He>=0;He--){var Xe=dt[He];_e.replaceRange(Xe.text,Ne[He].head,Ne[He].anchor,"+insert");var Nt=_e.listSelections().slice(0);Nt[He]={head:Xe.newPos,anchor:Xe.newPos},_e.setSelections(Nt),!Mt&&Xe.indent&&(_e.indentLine(Xe.newPos.line,null,!0),_e.indentLine(Xe.newPos.line+1,null,!0))}}function be(_e,Ne){for(var dt=_e.listSelections(),Ae=[],He=Ne?"/":"</",rt=_e.getOption("autoCloseTags"),je=typeof rt=="object"&&rt.dontIndentOnSlash,it=0;it<dt.length;it++){if(!dt[it].empty())return fe.Pass;var at=dt[it].head,xt=_e.getTokenAt(at),jt=fe.innerMode(_e.getMode(),xt.state),Qe=jt.state;if(Ne&&(xt.type=="string"||xt.string.charAt(0)!="<"||xt.start!=at.ch-1))return fe.Pass;var mt,We=jt.mode.name!="xml"&&_e.getMode().name=="htmlmixed";if(We&&jt.mode.name=="javascript")mt=He+"script";else if(We&&jt.mode.name=="css")mt=He+"style";else{var Me=jt.mode.xmlCurrentContext&&jt.mode.xmlCurrentContext(Qe);if(!Me||Me.length&&we(_e,Me,Me[Me.length-1],at))return fe.Pass;mt=He+Me[Me.length-1]}_e.getLine(at.line).charAt(xt.end)!=">"&&(mt+=">"),Ae[it]=mt}if(_e.replaceSelections(Ae),dt=_e.listSelections(),!je)for(var it=0;it<dt.length;it++)(it==dt.length-1||dt[it].head.line<dt[it+1].head.line)&&_e.indentLine(dt[it].head.line)}function De(_e){return _e.getOption("disableInput")?fe.Pass:be(_e,!0)}fe.commands.closeTag=function(_e){return be(_e)};function Pe(_e,Ne){if(_e.indexOf)return _e.indexOf(Ne);for(var dt=0,Ae=_e.length;dt<Ae;++dt)if(_e[dt]==Ne)return dt;return-1}function we(_e,Ne,dt,Ae,He){if(!fe.scanForClosingTag)return!1;var rt=Math.min(_e.lastLine()+1,Ae.line+500),je=fe.scanForClosingTag(_e,Ae,null,rt);if(!je||je.tag!=dt)return!1;for(var it=He?1:0,at=Ne.length-1;at>=0&&Ne[at]==dt;at--)++it;Ae=je.to;for(var at=1;at<it;at++){var xt=fe.scanForClosingTag(_e,Ae,null,rt);if(!xt||xt.tag!=dt)return!1;Ae=xt.to}return!0}})},32855:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";var Ze=fe.Pos;function Fe(at,xt){return at.line-xt.line||at.ch-xt.ch}var tt="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",be=tt+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",De=new RegExp("<(/?)(["+tt+"]["+be+"]*)","g");function Pe(at,xt,jt,Qe){this.line=xt,this.ch=jt,this.cm=at,this.text=at.getLine(xt),this.min=Qe?Math.max(Qe.from,at.firstLine()):at.firstLine(),this.max=Qe?Math.min(Qe.to-1,at.lastLine()):at.lastLine()}function we(at,xt){var jt=at.cm.getTokenTypeAt(Ze(at.line,xt));return jt&&/\btag\b/.test(jt)}function _e(at){if(!(at.line>=at.max))return at.ch=0,at.text=at.cm.getLine(++at.line),!0}function Ne(at){if(!(at.line<=at.min))return at.text=at.cm.getLine(--at.line),at.ch=at.text.length,!0}function dt(at){for(;;){var xt=at.text.indexOf(">",at.ch);if(xt==-1){if(_e(at))continue;return}if(!we(at,xt+1)){at.ch=xt+1;continue}var jt=at.text.lastIndexOf("/",xt),Qe=jt>-1&&!/\S/.test(at.text.slice(jt+1,xt));return at.ch=xt+1,Qe?"selfClose":"regular"}}function Ae(at){for(;;){var xt=at.ch?at.text.lastIndexOf("<",at.ch-1):-1;if(xt==-1){if(Ne(at))continue;return}if(!we(at,xt+1)){at.ch=xt;continue}De.lastIndex=xt,at.ch=xt;var jt=De.exec(at.text);if(jt&&jt.index==xt)return jt}}function He(at){for(;;){De.lastIndex=at.ch;var xt=De.exec(at.text);if(!xt){if(_e(at))continue;return}if(!we(at,xt.index+1)){at.ch=xt.index+1;continue}return at.ch=xt.index+xt[0].length,xt}}function rt(at){for(;;){var xt=at.ch?at.text.lastIndexOf(">",at.ch-1):-1;if(xt==-1){if(Ne(at))continue;return}if(!we(at,xt+1)){at.ch=xt;continue}var jt=at.text.lastIndexOf("/",xt),Qe=jt>-1&&!/\S/.test(at.text.slice(jt+1,xt));return at.ch=xt+1,Qe?"selfClose":"regular"}}function je(at,xt){for(var jt=[];;){var Qe=He(at),mt,We=at.line,Me=at.ch-(Qe?Qe[0].length:0);if(!Qe||!(mt=dt(at)))return;if(mt!="selfClose")if(Qe[1]){for(var Ke=jt.length-1;Ke>=0;--Ke)if(jt[Ke]==Qe[2]){jt.length=Ke;break}if(Ke<0&&(!xt||xt==Qe[2]))return{tag:Qe[2],from:Ze(We,Me),to:Ze(at.line,at.ch)}}else jt.push(Qe[2])}}function it(at,xt){for(var jt=[];;){var Qe=rt(at);if(!Qe)return;if(Qe=="selfClose"){Ae(at);continue}var mt=at.line,We=at.ch,Me=Ae(at);if(!Me)return;if(Me[1])jt.push(Me[2]);else{for(var Ke=jt.length-1;Ke>=0;--Ke)if(jt[Ke]==Me[2]){jt.length=Ke;break}if(Ke<0&&(!xt||xt==Me[2]))return{tag:Me[2],from:Ze(at.line,at.ch),to:Ze(mt,We)}}}}fe.registerHelper("fold","xml",function(at,xt){for(var jt=new Pe(at,xt.line,0);;){var Qe=He(jt);if(!Qe||jt.line!=xt.line)return;var mt=dt(jt);if(!mt)return;if(!Qe[1]&&mt!="selfClose"){var We=Ze(jt.line,jt.ch),Me=je(jt,Qe[2]);return Me&&Fe(Me.from,We)>0?{from:We,to:Me.from}:null}}}),fe.findMatchingTag=function(at,xt,jt){var Qe=new Pe(at,xt.line,xt.ch,jt);if(!(Qe.text.indexOf(">")==-1&&Qe.text.indexOf("<")==-1)){var mt=dt(Qe),We=mt&&Ze(Qe.line,Qe.ch),Me=mt&&Ae(Qe);if(!(!mt||!Me||Fe(Qe,xt)>0)){var Ke={from:Ze(Qe.line,Qe.ch),to:We,tag:Me[2]};return mt=="selfClose"?{open:Ke,close:null,at:"open"}:Me[1]?{open:it(Qe,Me[2]),close:Ke,at:"close"}:(Qe=new Pe(at,We.line,We.ch,jt),{open:Ke,close:je(Qe,Me[2]),at:"open"})}}},fe.findEnclosingTag=function(at,xt,jt,Qe){for(var mt=new Pe(at,xt.line,xt.ch,jt);;){var We=it(mt,Qe);if(!We)break;var Me=new Pe(at,xt.line,xt.ch,jt),Ke=je(Me,We.tag);if(Ke)return{open:We,close:Ke}}},fe.scanForClosingTag=function(at,xt,jt,Qe){var mt=new Pe(at,xt.line,xt.ch,Qe?{from:0,to:Qe}:null);return je(mt,jt)}})},89780:function(Mn){(function(rn,ue){Mn.exports=ue()})(this,function(){"use strict";var rn=navigator.userAgent,ue=navigator.platform,fe=/gecko\/\d/i.test(rn),Ze=/MSIE \d/.test(rn),Fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn),tt=/Edge\/(\d+)/.exec(rn),be=Ze||Fe||tt,De=be&&(Ze?document.documentMode||6:+(tt||Fe)[1]),Pe=!tt&&/WebKit\//.test(rn),we=Pe&&/Qt\/\d+\.\d+/.test(rn),_e=!tt&&/Chrome\//.test(rn),Ne=/Opera\//.test(rn),dt=/Apple Computer/.test(navigator.vendor),Ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(rn),He=/PhantomJS/.test(rn),rt=!tt&&/AppleWebKit/.test(rn)&&/Mobile\/\w+/.test(rn),je=/Android/.test(rn),it=rt||je||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(rn),at=rt||/Mac/.test(ue),xt=/\bCrOS\b/.test(rn),jt=/win/i.test(ue),Qe=Ne&&rn.match(/Version\/(\d*\.\d*)/);Qe&&(Qe=Number(Qe[1])),Qe&&Qe>=15&&(Ne=!1,Pe=!0);var mt=at&&(we||Ne&&(Qe==null||Qe<12.11)),We=fe||be&&De>=9;function Me(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ke=function(x,z){var ne=x.className,te=Me(z).exec(ne);if(te){var ie=ne.slice(te.index+te[0].length);x.className=ne.slice(0,te.index)+(ie?te[1]+ie:"")}};function Ve(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function Mt(x,z){return Ve(x).appendChild(z)}function Xe(x,z,ne,te){var ie=document.createElement(x);if(ne&&(ie.className=ne),te&&(ie.style.cssText=te),typeof z=="string")ie.appendChild(document.createTextNode(z));else if(z)for(var ce=0;ce<z.length;++ce)ie.appendChild(z[ce]);return ie}function Nt(x,z,ne,te){var ie=Xe(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var ht;document.createRange?ht=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:ht=function(x,z,ne){var te=document.body.createTextRange();try{te.moveToElementText(x.parentNode)}catch(ie){return te}return te.collapse(!0),te.moveEnd("character",ne),te.moveStart("character",z),te};function Tt(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 et(){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 Ut(x,z){var ne=x.className;Me(z).test(ne)||(x.className+=(ne?" ":"")+z)}function ft(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!Me(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var Dt=function(x){x.select()};rt?Dt=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:be&&(Dt=function(x){try{x.select()}catch(z){}});function Bt(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function bt(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 $e(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var ce=te||0,ge=ie||0;;){var Ce=x.indexOf(" ",ce);if(Ce<0||Ce>=z)return ge+(z-ce);ge+=Ce-ce,ge+=ne-ge%ne,ce=Ce+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=Bt(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 gt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var en=50,Wt={toString:function(){return"CodeMirror.Pass"}},qe={scroll:!1},Ye={origin:"*mouse"},Lt={origin:"+move"};function mn(x,z,ne){for(var te=0,ie=0;;){var ce=x.indexOf(" ",te);ce==-1&&(ce=x.length);var ge=ce-te;if(ce==x.length||ie+ge>=z)return te+Math.min(ge,z-ie);if(ie+=ce-te,ie+=ne-ie%ne,te=ce+1,ie>=z)return te}}var Qt=[""];function dn(x){for(;Qt.length<=x;)Qt.push(Zt(Qt)+" ");return Qt[x]}function Zt(x){return x[x.length-1]}function Vt(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function zt(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function ye(){}function se(x,z){var ne;return Object.create?ne=Object.create(x):(ye.prototype=x,ne=new ye),z&&bt(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function de(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function pe(x,z){return z?z.source.indexOf("\\w")>-1&&de(x)?!0:z.test(x):de(x)}function le(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var Be=/[\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 lt(x){return x.charCodeAt(0)>=768&&Be.test(x)}function Ot(x,z,ne){for(;(ne<0?z>0:z<x.length)&&lt(x.charAt(z));)z+=ne;return z}function It(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,ce=te<0?Math.ceil(ie):Math.floor(ie);if(ce==z)return x(ce)?z:ne;x(ce)?ne=ce:z=ce+te}}function Ht(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,ce=0;ce<x.length;++ce){var ge=x[ce];(ge.from<ne&&ge.to>z||z==ne&&ge.to==z)&&(te(Math.max(ge.from,z),Math.min(ge.to,ne),ge.level==1?"rtl":"ltr",ce),ie=!0)}ie||te(z,ne,"ltr")}var Yt=null;function an(x,z,ne){var te;Yt=null;for(var ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.from<z&&ce.to>z)return ie;ce.to==z&&(ce.from!=ce.to&&ne=="before"?te=ie:Yt=ie),ce.from==z&&(ce.from!=ce.to&&ne!="before"?te=ie:Yt=ie)}return te!=null?te:Yt}var cn=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Oe){return Oe<=247?x.charAt(Oe):1424<=Oe&&Oe<=1524?"R":1536<=Oe&&Oe<=1785?z.charAt(Oe-1536):1774<=Oe&&Oe<=2220?"r":8192<=Oe&&Oe<=8203?"w":Oe==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,ce=/[LRr]/,ge=/[Lb1n]/,Ce=/[1n]/;function Le(Oe,vt,Et){this.level=Oe,this.from=vt,this.to=Et}return function(Oe,vt){var Et=vt=="ltr"?"L":"R";if(Oe.length==0||vt=="ltr"&&!te.test(Oe))return!1;for(var sn=Oe.length,nn=[],Bn=0;Bn<sn;++Bn)nn.push(ne(Oe.charCodeAt(Bn)));for(var Vn=0,vr=Et;Vn<sn;++Vn){var Dr=nn[Vn];Dr=="m"?nn[Vn]=vr:vr=Dr}for(var Rr=0,Mr=Et;Rr<sn;++Rr){var $r=nn[Rr];$r=="1"&&Mr=="r"?nn[Rr]="n":ce.test($r)&&(Mr=$r,$r=="r"&&(nn[Rr]="R"))}for(var Jr=1,ei=nn[0];Jr<sn-1;++Jr){var wi=nn[Jr];wi=="+"&&ei=="1"&&nn[Jr+1]=="1"?nn[Jr]="1":wi==","&&ei==nn[Jr+1]&&(ei=="1"||ei=="n")&&(nn[Jr]=ei),ei=wi}for(var Ji=0;Ji<sn;++Ji){var Na=nn[Ji];if(Na==",")nn[Ji]="N";else if(Na=="%"){var da=void 0;for(da=Ji+1;da<sn&&nn[da]=="%";++da);for(var co=Ji&&nn[Ji-1]=="!"||da<sn&&nn[da]=="1"?"1":"N",uo=Ji;uo<da;++uo)nn[uo]=co;Ji=da-1}}for(var _a=0,ho=Et;_a<sn;++_a){var ui=nn[_a];ho=="L"&&ui=="1"?nn[_a]="L":ce.test(ui)&&(ho=ui)}for(var ma=0;ma<sn;++ma)if(ie.test(nn[ma])){var ha=void 0;for(ha=ma+1;ha<sn&&ie.test(nn[ha]);++ha);for(var ga=(ma?nn[ma-1]:Et)=="L",ba=(ha<sn?nn[ha]:Et)=="L",fl=ga==ba?ga?"L":"R":Et,vo=ma;vo<ha;++vo)nn[vo]=fl;ma=ha-1}for(var Za=[],Oi,Pa=0;Pa<sn;)if(ge.test(nn[Pa])){var au=Pa;for(++Pa;Pa<sn&&ge.test(nn[Pa]);++Pa);Za.push(new Le(0,au,Pa))}else{var bs=Pa,Ns=Za.length,Yo=vt=="rtl"?1:0;for(++Pa;Pa<sn&&nn[Pa]!="L";++Pa);for(var Ea=bs;Ea<Pa;)if(Ce.test(nn[Ea])){bs<Ea&&(Za.splice(Ns,0,new Le(1,bs,Ea)),Ns+=Yo);var pl=Ea;for(++Ea;Ea<Pa&&Ce.test(nn[Ea]);++Ea);Za.splice(Ns,0,new Le(2,pl,Ea)),Ns+=Yo,bs=Ea}else++Ea;bs<Pa&&Za.splice(Ns,0,new Le(1,bs,Pa))}return vt=="ltr"&&(Za[0].level==1&&(Oi=Oe.match(/^\s+/))&&(Za[0].from=Oi[0].length,Za.unshift(new Le(0,0,Oi[0].length))),Zt(Za).level==1&&(Oi=Oe.match(/\s+$/))&&(Zt(Za).to-=Oi[0].length,Za.push(new Le(0,sn-Oi[0].length,sn)))),vt=="rtl"?Za.reverse():Za}}();function Sn(x,z){var ne=x.order;return ne==null&&(ne=x.order=cn(x.text,z)),ne}var wt=[],on=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]||wt).concat(ne)}};function Pn(x,z){return x._handlers&&x._handlers[z]||wt}function ot(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,ie=te&&te[z];if(ie){var ce=gt(ie,ne);ce>-1&&(te[z]=ie.slice(0,ce).concat(ie.slice(ce+1)))}}}function St(x,z){var ne=Pn(x,z);if(ne.length)for(var te=Array.prototype.slice.call(arguments,2),ie=0;ie<ne.length;++ie)ne[ie].apply(null,te)}function $t(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),St(x,ne||z.type,x,z),ir(z)||z.codemirrorIgnore}function Dn(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)gt(ne,z[te])==-1&&ne.push(z[te])}function Ln(x,z){return Pn(x,z).length>0}function In(x){x.prototype.on=function(z,ne){on(this,z,ne)},x.prototype.off=function(z,ne){ot(this,z,ne)}}function qn(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function dr(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function ir(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Er(x){qn(x),dr(x)}function kr(x){return x.target||x.srcElement}function Qn(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),at&&x.ctrlKey&&z==1&&(z=3),z}var Kr=function(){if(be&&De<9)return!1;var x=Xe("div");return"draggable"in x||"dragDrop"in x}(),jr;function Hr(x){if(jr==null){var z=Xe("span","\u200B");Mt(x,Xe("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(jr=z.offsetWidth<=1&&z.offsetHeight>2&&!(be&&De<8))}var ne=jr?Xe("span","\u200B"):Xe("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var ni;function Br(x){if(ni!=null)return ni;var z=Mt(x,document.createTextNode("A\u062EA")),ne=ht(z,0,1).getBoundingClientRect(),te=ht(z,1,2).getBoundingClientRect();return Ve(x),!ne||ne.left==ne.right?!1:ni=te.right-ne.right<3}var qr=`
b`.split(/\n/).length!=3?function(x){for(var z=0,ne=[],te=x.length;z<=te;){var ie=x.indexOf(`
`,z);ie==-1&&(ie=x.length);var ce=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),ge=ce.indexOf("\r");ge!=-1?(ne.push(ce.slice(0,ge)),z+=ge+1):(ne.push(ce),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},Cr=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},yn=function(){var x=Xe("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),wn=null;function fn(x){if(wn!=null)return wn;var z=Mt(x,Xe("span","x")),ne=z.getBoundingClientRect(),te=ht(z,0,1).getBoundingClientRect();return wn=Math.abs(ne.left-te.left)>1}var Rn={},br={};function Kn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),Rn[x]=z}function ar(x,z){br[x]=z}function vn(x){if(typeof x=="string"&&br.hasOwnProperty(x))x=br[x];else if(x&&typeof x.name=="string"&&br.hasOwnProperty(x.name)){var z=br[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 vn("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return vn("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function pn(x,z){z=vn(z);var ne=Rn[z.name];if(!ne)return pn(x,"text/plain");var te=ne(x,z);if(Nn.hasOwnProperty(z.name)){var ie=Nn[z.name];for(var ce in ie)ie.hasOwnProperty(ce)&&(te.hasOwnProperty(ce)&&(te["_"+ce]=te[ce]),te[ce]=ie[ce])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var ge in z.modeProps)te[ge]=z.modeProps[ge];return te}var Nn={};function st(x,z){var ne=Nn.hasOwnProperty(x)?Nn[x]:Nn[x]={};bt(z,ne)}function Ee(x,z){if(z===!0)return z;if(x.copyState)return x.copyState(z);var ne={};for(var te in z){var ie=z[te];ie instanceof Array&&(ie=ie.concat([])),ne[te]=ie}return ne}function Te(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 ke(x,z,ne){return x.startState?x.startState(z,ne):!0}var Ie=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};Ie.prototype.eol=function(){return this.pos>=this.string.length},Ie.prototype.sol=function(){return this.pos==this.lineStart},Ie.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ie.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ie.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},Ie.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Ie.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Ie.prototype.skipToEnd=function(){this.pos=this.string.length},Ie.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Ie.prototype.backUp=function(x){this.pos-=x},Ie.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=$e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?$e(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.indentation=function(){return $e(this.string,null,this.tabSize)-(this.lineStart?$e(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(ge){return ne?ge.toLowerCase():ge},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var ce=this.string.slice(this.pos).match(x);return ce&&ce.index>0?null:(ce&&z!==!1&&(this.pos+=ce[0].length),ce)}},Ie.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ie.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Ie.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Ie.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Ge(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 ie=ne.children[te],ce=ie.chunkSize();if(z<ce){ne=ie;break}z-=ce}return ne.lines[z]}function ut(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(ce){var ge=ce.text;ie==ne.line&&(ge=ge.slice(0,ne.ch)),ie==z.line&&(ge=ge.slice(z.ch)),te.push(ge),++ie}),te}function nt(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function ze(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function ct(x){if(x.parent==null)return null;for(var z=x.parent,ne=gt(z.lines,x),te=z.parent;te;z=te,te=te.parent)for(var ie=0;te.children[ie]!=z;++ie)ne+=te.children[ie].chunkSize();return ne+z.first}function kt(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],ce=ie.height;if(z<ce){x=ie;continue e}z-=ce,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var ge=0;ge<x.lines.length;++ge){var Ce=x.lines[ge],Le=Ce.height;if(z<Le)break;z-=Le}return ne+ge}function Rt(x,z){return z>=x.first&&z<x.first+x.size}function Jt(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function pt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof pt))return new pt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function Ct(x,z){return x.line-z.line||x.ch-z.ch}function bn(x,z){return x.sticky==z.sticky&&Ct(x,z)==0}function ln(x){return pt(x.line,x.ch)}function En(x,z){return Ct(x,z)<0?z:x}function qt(x,z){return Ct(x,z)<0?x:z}function On(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function tn(x,z){if(z.line<x.first)return pt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?pt(ne,Ge(x,ne).text.length):An(z,Ge(x,z.line).text.length)}function An(x,z){var ne=x.ch;return ne==null||ne>z?pt(x.line,z):ne<0?pt(x.line,0):x}function Ue(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=tn(x,z[te]);return ne}var At=function(x,z){this.state=x,this.lookAhead=z},Pt=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Pt.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Pt.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}},Pt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pt.fromSaved=function(x,z,ne){return z instanceof At?new Pt(x,Ee(x.mode,z.state),ne,z.lookAhead):new Pt(x,Ee(x.mode,z),ne)},Pt.prototype.save=function(x){var z=x!==!1?Ee(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new At(z,this.maxLookAhead):z};function Xt(x,z,ne,te){var ie=[x.state.modeGen],ce={};yr(x,z.text,x.doc.mode,ne,function(Oe,vt){return ie.push(Oe,vt)},ce,te);for(var ge=ne.state,Ce=function(Oe){ne.baseTokens=ie;var vt=x.state.overlays[Oe],Et=1,sn=0;ne.state=!0,yr(x,z.text,vt.mode,ne,function(nn,Bn){for(var Vn=Et;sn<nn;){var vr=ie[Et];vr>nn&&ie.splice(Et,1,nn,ie[Et+1],vr),Et+=2,sn=Math.min(nn,vr)}if(Bn)if(vt.opaque)ie.splice(Vn,Et-Vn,nn,"overlay "+Bn),Et=Vn+2;else for(;Vn<Et;Vn+=2){var Dr=ie[Vn+1];ie[Vn+1]=(Dr?Dr+" ":"")+"overlay "+Bn}},ce),ne.state=ge,ne.baseTokens=null,ne.baseTokenPos=1},Le=0;Le<x.state.overlays.length;++Le)Ce(Le);return{styles:ie,classes:ce.bgClass||ce.textClass?ce:null}}function Ft(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Gt(x,ct(z)),ie=z.text.length>x.options.maxHighlightLength&&Ee(x.doc.mode,te.state),ce=Xt(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=ce.styles,ce.classes?z.styleClasses=ce.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 Gt(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Pt(te,!0,z);var ce=rr(x,z,ne),ge=ce>te.first&&Ge(te,ce-1).stateAfter,Ce=ge?Pt.fromSaved(te,ge,ce):new Pt(te,ke(te.mode),ce);return te.iter(ce,z,function(Le){Kt(x,Le.text,Ce);var Oe=Ce.line;Le.stateAfter=Oe==z-1||Oe%5==0||Oe>=ie.viewFrom&&Oe<ie.viewTo?Ce.save():null,Ce.nextLine()}),ne&&(te.modeFrontier=Ce.line),Ce}function Kt(x,z,ne,te){var ie=x.doc.mode,ce=new Ie(z,x.options.tabSize,ne);for(ce.start=ce.pos=te||0,z==""&&un(ie,ne.state);!ce.eol();)xn(ie,ce,ne.state),ce.start=ce.pos}function un(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Te(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function xn(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Te(x,ne).mode);var ce=x.token(z,ne);if(z.pos>z.start)return ce}throw new Error("Mode "+x.name+" failed to advance stream.")}var _n=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function Hn(x,z,ne,te){var ie=x.doc,ce=ie.mode,ge;z=tn(ie,z);var Ce=Ge(ie,z.line),Le=Gt(x,z.line,ne),Oe=new Ie(Ce.text,x.options.tabSize,Le),vt;for(te&&(vt=[]);(te||Oe.pos<z.ch)&&!Oe.eol();)Oe.start=Oe.pos,ge=xn(ce,Oe,Le.state),te&&vt.push(new _n(Oe,ge,Ee(ie.mode,Le.state)));return te?vt:new _n(Oe,ge,Le.state)}function Yn(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 yr(x,z,ne,te,ie,ce,ge){var Ce=ne.flattenSpans;Ce==null&&(Ce=x.options.flattenSpans);var Le=0,Oe=null,vt=new Ie(z,x.options.tabSize,te),Et,sn=x.options.addModeClass&&[null];for(z==""&&Yn(un(ne,te.state),ce);!vt.eol();){if(vt.pos>x.options.maxHighlightLength?(Ce=!1,ge&&Kt(x,z,te,vt.pos),vt.pos=z.length,Et=null):Et=Yn(xn(ne,vt,te.state,sn),ce),sn){var nn=sn[0].name;nn&&(Et="m-"+(Et?nn+" "+Et:nn))}if(!Ce||Oe!=Et){for(;Le<vt.start;)Le=Math.min(vt.start,Le+5e3),ie(Le,Oe);Oe=Et}vt.start=vt.pos}for(;Le<vt.pos;){var Bn=Math.min(vt.pos,Le+5e3);ie(Bn,Oe),Le=Bn}}function rr(x,z,ne){for(var te,ie,ce=x.doc,ge=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Ce=z;Ce>ge;--Ce){if(Ce<=ce.first)return ce.first;var Le=Ge(ce,Ce-1),Oe=Le.stateAfter;if(Oe&&(!ne||Ce+(Oe instanceof At?Oe.lookAhead:0)<=ce.modeFrontier))return Ce;var vt=$e(Le.text,null,x.options.tabSize);(ie==null||te>vt)&&(ie=Ce-1,te=vt)}return ie}function Wn(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 ie=Ge(x,te).stateAfter;if(ie&&(!(ie instanceof At)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var xr=!1,gr=!1;function mr(){xr=!0}function Gn(){gr=!0}function Jn(x,z,ne){this.marker=x,this.from=z,this.to=ne}function hr(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function tr(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function _r(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Wr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ge=ce.marker,Ce=ce.from==null||(ge.inclusiveLeft?ce.from<=z:ce.from<z);if(Ce||ce.from==z&&ge.type=="bookmark"&&(!ne||!ce.marker.insertLeft)){var Le=ce.to==null||(ge.inclusiveRight?ce.to>=z:ce.to>z);(te||(te=[])).push(new Jn(ge,ce.from,Le?null:ce.to))}}return te}function fr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ge=ce.marker,Ce=ce.to==null||(ge.inclusiveRight?ce.to>=z:ce.to>z);if(Ce||ce.from==z&&ge.type=="bookmark"&&(!ne||ce.marker.insertLeft)){var Le=ce.from==null||(ge.inclusiveLeft?ce.from<=z:ce.from<z);(te||(te=[])).push(new Jn(ge,Le?null:ce.from-z,ce.to==null?null:ce.to-z))}}return te}function kn(x,z){if(z.full)return null;var ne=Rt(x,z.from.line)&&Ge(x,z.from.line).markedSpans,te=Rt(x,z.to.line)&&Ge(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,ce=z.to.ch,ge=Ct(z.from,z.to)==0,Ce=Wr(ne,ie,ge),Le=fr(te,ce,ge),Oe=z.text.length==1,vt=Zt(z.text).length+(Oe?ie:0);if(Ce)for(var Et=0;Et<Ce.length;++Et){var sn=Ce[Et];if(sn.to==null){var nn=hr(Le,sn.marker);nn?Oe&&(sn.to=nn.to==null?null:nn.to+vt):sn.to=ie}}if(Le)for(var Bn=0;Bn<Le.length;++Bn){var Vn=Le[Bn];if(Vn.to!=null&&(Vn.to+=vt),Vn.from==null){var vr=hr(Ce,Vn.marker);vr||(Vn.from=vt,Oe&&(Ce||(Ce=[])).push(Vn))}else Vn.from+=vt,Oe&&(Ce||(Ce=[])).push(Vn)}Ce&&(Ce=Cn(Ce)),Le&&Le!=Ce&&(Le=Cn(Le));var Dr=[Ce];if(!Oe){var Rr=z.text.length-2,Mr;if(Rr>0&&Ce)for(var $r=0;$r<Ce.length;++$r)Ce[$r].to==null&&(Mr||(Mr=[])).push(new Jn(Ce[$r].marker,null,null));for(var Jr=0;Jr<Rr;++Jr)Dr.push(Mr);Dr.push(Le)}return Dr}function Cn(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 Xn(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(nn){if(nn.markedSpans)for(var Bn=0;Bn<nn.markedSpans.length;++Bn){var Vn=nn.markedSpans[Bn].marker;Vn.readOnly&&(!te||gt(te,Vn)==-1)&&(te||(te=[])).push(Vn)}}),!te)return null;for(var ie=[{from:z,to:ne}],ce=0;ce<te.length;++ce)for(var ge=te[ce],Ce=ge.find(0),Le=0;Le<ie.length;++Le){var Oe=ie[Le];if(!(Ct(Oe.to,Ce.from)<0||Ct(Oe.from,Ce.to)>0)){var vt=[Le,1],Et=Ct(Oe.from,Ce.from),sn=Ct(Oe.to,Ce.to);(Et<0||!ge.inclusiveLeft&&!Et)&&vt.push({from:Oe.from,to:Ce.from}),(sn>0||!ge.inclusiveRight&&!sn)&&vt.push({from:Ce.to,to:Oe.to}),ie.splice.apply(ie,vt),Le+=vt.length-3}}return ie}function Fn(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Sr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function Ar(x){return x.inclusiveLeft?-1:0}function lr(x){return x.inclusiveRight?1:0}function Vr(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),ce=Ct(te.from,ie.from)||Ar(x)-Ar(z);if(ce)return-ce;var ge=Ct(te.to,ie.to)||lr(x)-lr(z);return ge||z.id-x.id}function Tr(x,z){var ne=gr&&x.markedSpans,te;if(ne)for(var ie=void 0,ce=0;ce<ne.length;++ce)ie=ne[ce],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||Vr(te,ie.marker)<0)&&(te=ie.marker);return te}function si(x){return Tr(x,!0)}function or(x){return Tr(x,!1)}function nr(x,z){var ne=gr&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var ce=ne[ie];ce.marker.collapsed&&(ce.from==null||ce.from<z)&&(ce.to==null||ce.to>z)&&(!te||Vr(te,ce.marker)<0)&&(te=ce.marker)}return te}function Ir(x,z,ne,te,ie){var ce=Ge(x,z),ge=gr&&ce.markedSpans;if(ge)for(var Ce=0;Ce<ge.length;++Ce){var Le=ge[Ce];if(Le.marker.collapsed){var Oe=Le.marker.find(0),vt=Ct(Oe.from,ne)||Ar(Le.marker)-Ar(ie),Et=Ct(Oe.to,te)||lr(Le.marker)-lr(ie);if(!(vt>=0&&Et<=0||vt<=0&&Et>=0)&&(vt<=0&&(Le.marker.inclusiveRight&&ie.inclusiveLeft?Ct(Oe.to,ne)>=0:Ct(Oe.to,ne)>0)||vt>=0&&(Le.marker.inclusiveRight&&ie.inclusiveLeft?Ct(Oe.from,te)<=0:Ct(Oe.from,te)<0)))return!0}}}function Lr(x){for(var z;z=si(x);)x=z.find(-1,!0).line;return x}function ti(x){for(var z;z=or(x);)x=z.find(1,!0).line;return x}function yi(x){for(var z,ne;z=or(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function bi(x,z){var ne=Ge(x,z),te=Lr(ne);return ne==te?z:ct(te)}function Gr(x,z){if(z>x.lastLine())return z;var ne=Ge(x,z),te;if(!gi(x,ne))return z;for(;te=or(ne);)ne=te.find(1,!0).line;return ct(ne)+1}function gi(x,z){var ne=gr&&z.markedSpans;if(ne){for(var te=void 0,ie=0;ie<ne.length;++ie)if(te=ne[ie],!!te.marker.collapsed){if(te.from==null)return!0;if(!te.marker.widgetNode&&te.from==0&&te.marker.inclusiveLeft&&pi(x,z,te))return!0}}}function pi(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return pi(x,te.line,hr(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,ce=0;ce<z.markedSpans.length;++ce)if(ie=z.markedSpans[ce],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&pi(x,z,ie))return!0}function Zn(x){x=Lr(x);for(var z=0,ne=x.parent,te=0;te<ne.lines.length;++te){var ie=ne.lines[te];if(ie==x)break;z+=ie.height}for(var ce=ne.parent;ce;ne=ce,ce=ne.parent)for(var ge=0;ge<ce.children.length;++ge){var Ce=ce.children[ge];if(Ce==ne)break;z+=Ce.height}return z}function Un(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=si(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=or(te);){var ce=ne.find(0,!0);z-=te.text.length-ce.from.ch,te=ce.to.line,z+=te.text.length-ce.to.ch}return z}function jn(x){var z=x.display,ne=x.doc;z.maxLine=Ge(ne,ne.first),z.maxLineLength=Un(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=Un(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var ur=function(x,z,ne){this.text=x,Sr(this,z),this.height=ne?ne(this):1};ur.prototype.lineNo=function(){return ct(this)},In(ur);function Yr(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),Fn(x),Sr(x,ne);var ie=te?te(x):1;ie!=x.height&&ze(x,ie)}function li(x){x.parent=null,Fn(x)}var fi={},di={};function ii(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?di:fi;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function Si(x,z){var ne=Nt("span",null,null,Pe?"padding-right: .1px":null),te={pre:Nt("pre",[ne],"CodeMirror-line"),content:ne,col:0,pos:0,cm:x,trailingSpace:!1,splitSpaces:x.getOption("lineWrapping")};z.measure={};for(var ie=0;ie<=(z.rest?z.rest.length:0);ie++){var ce=ie?z.rest[ie-1]:z.line,ge=void 0;te.pos=0,te.addToken=Ii,Br(x.display.measure)&&(ge=Sn(ce,x.doc.direction))&&(te.addToken=ea(te.addToken,ge)),te.map=[];var Ce=z!=x.display.externalMeasured&&ct(ce);ki(ce,te,Ft(x,ce,Ce)),ce.styleClasses&&(ce.styleClasses.bgClass&&(te.bgClass=ft(ce.styleClasses.bgClass,te.bgClass||"")),ce.styleClasses.textClass&&(te.textClass=ft(ce.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Hr(x.display.measure))),ie==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(Pe){var Le=te.content.lastChild;(/\bcm-tab\b/.test(Le.className)||Le.querySelector&&Le.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return St(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=ft(te.pre.className,te.textClass||"")),te}function Fi(x){var z=Xe("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Ii(x,z,ne,te,ie,ce,ge){if(z){var Ce=x.splitSpaces?la(z,x.trailingSpace):z,Le=x.cm.state.specialChars,Oe=!1,vt;if(!Le.test(z))x.col+=z.length,vt=document.createTextNode(Ce),x.map.push(x.pos,x.pos+z.length,vt),be&&De<9&&(Oe=!0),x.pos+=z.length;else{vt=document.createDocumentFragment();for(var Et=0;;){Le.lastIndex=Et;var sn=Le.exec(z),nn=sn?sn.index-Et:z.length-Et;if(nn){var Bn=document.createTextNode(Ce.slice(Et,Et+nn));be&&De<9?vt.appendChild(Xe("span",[Bn])):vt.appendChild(Bn),x.map.push(x.pos,x.pos+nn,Bn),x.col+=nn,x.pos+=nn}if(!sn)break;Et+=nn+1;var Vn=void 0;if(sn[0]==" "){var vr=x.cm.options.tabSize,Dr=vr-x.col%vr;Vn=vt.appendChild(Xe("span",dn(Dr),"cm-tab")),Vn.setAttribute("role","presentation"),Vn.setAttribute("cm-text"," "),x.col+=Dr}else sn[0]=="\r"||sn[0]==`
`?(Vn=vt.appendChild(Xe("span",sn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Vn.setAttribute("cm-text",sn[0]),x.col+=1):(Vn=x.cm.options.specialCharPlaceholder(sn[0]),Vn.setAttribute("cm-text",sn[0]),be&&De<9?vt.appendChild(Xe("span",[Vn])):vt.appendChild(Vn),x.col+=1);x.map.push(x.pos,x.pos+1,Vn),x.pos++}}if(x.trailingSpace=Ce.charCodeAt(z.length-1)==32,ne||te||ie||Oe||ce||ge){var Rr=ne||"";te&&(Rr+=te),ie&&(Rr+=ie);var Mr=Xe("span",[vt],Rr,ce);if(ge)for(var $r in ge)ge.hasOwnProperty($r)&&$r!="style"&&$r!="class"&&Mr.setAttribute($r,ge[$r]);return x.content.appendChild(Mr)}x.content.appendChild(vt)}}function la(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var ce=x.charAt(ie);ce==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(ce="\xA0"),te+=ce,ne=ce==" "}return te}function ea(x,z){return function(ne,te,ie,ce,ge,Ce,Le){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Oe=ne.pos,vt=Oe+te.length;;){for(var Et=void 0,sn=0;sn<z.length&&(Et=z[sn],!(Et.to>Oe&&Et.from<=Oe));sn++);if(Et.to>=vt)return x(ne,te,ie,ce,ge,Ce,Le);x(ne,te.slice(0,Et.to-Oe),ie,ce,null,Ce,Le),ce=null,te=te.slice(Et.to-Oe),Oe=Et.to}}}function Pi(x,z,ne,te){var ie=!te&&ne.widgetNode;ie&&x.map.push(x.pos,x.pos+z,ie),!te&&x.cm.display.input.needsContentAttribute&&(ie||(ie=x.content.appendChild(document.createElement("span"))),ie.setAttribute("cm-marker",ne.id)),ie&&(x.cm.display.input.setUneditable(ie),x.content.appendChild(ie)),x.pos+=z,x.trailingSpace=!1}function ki(x,z,ne){var te=x.markedSpans,ie=x.text,ce=0;if(!te){for(var ge=1;ge<ne.length;ge+=2)z.addToken(z,ie.slice(ce,ce=ne[ge]),ii(ne[ge+1],z.cm.options));return}for(var Ce=ie.length,Le=0,Oe=1,vt="",Et,sn,nn=0,Bn,Vn,vr,Dr,Rr;;){if(nn==Le){Bn=Vn=vr=sn="",Rr=null,Dr=null,nn=1/0;for(var Mr=[],$r=void 0,Jr=0;Jr<te.length;++Jr){var ei=te[Jr],wi=ei.marker;if(wi.type=="bookmark"&&ei.from==Le&&wi.widgetNode)Mr.push(wi);else if(ei.from<=Le&&(ei.to==null||ei.to>Le||wi.collapsed&&ei.to==Le&&ei.from==Le)){if(ei.to!=null&&ei.to!=Le&&nn>ei.to&&(nn=ei.to,Vn=""),wi.className&&(Bn+=" "+wi.className),wi.css&&(sn=(sn?sn+";":"")+wi.css),wi.startStyle&&ei.from==Le&&(vr+=" "+wi.startStyle),wi.endStyle&&ei.to==nn&&($r||($r=[])).push(wi.endStyle,ei.to),wi.title&&((Rr||(Rr={})).title=wi.title),wi.attributes)for(var Ji in wi.attributes)(Rr||(Rr={}))[Ji]=wi.attributes[Ji];wi.collapsed&&(!Dr||Vr(Dr.marker,wi)<0)&&(Dr=ei)}else ei.from>Le&&nn>ei.from&&(nn=ei.from)}if($r)for(var Na=0;Na<$r.length;Na+=2)$r[Na+1]==nn&&(Vn+=" "+$r[Na]);if(!Dr||Dr.from==Le)for(var da=0;da<Mr.length;++da)Pi(z,0,Mr[da]);if(Dr&&(Dr.from||0)==Le){if(Pi(z,(Dr.to==null?Ce+1:Dr.to)-Le,Dr.marker,Dr.from==null),Dr.to==null)return;Dr.to==Le&&(Dr=!1)}}if(Le>=Ce)break;for(var co=Math.min(Ce,nn);;){if(vt){var uo=Le+vt.length;if(!Dr){var _a=uo>co?vt.slice(0,co-Le):vt;z.addToken(z,_a,Et?Et+Bn:Bn,vr,Le+_a.length==nn?Vn:"",sn,Rr)}if(uo>=co){vt=vt.slice(co-Le),Le=co;break}Le=uo,vr=""}vt=ie.slice(ce,ce=ne[Oe++]),Et=ii(ne[Oe++],z.cm.options)}}}function Qr(x,z,ne){this.line=z,this.rest=yi(z),this.size=this.rest?ct(Zt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=gi(x,z)}function Vi(x,z,ne){for(var te=[],ie,ce=z;ce<ne;ce=ie){var ge=new Qr(x.doc,Ge(x.doc,ce),ce);ie=ce+ge.size,te.push(ge)}return te}var $i=null;function ci(x){$i?$i.ops.push(x):x.ownsGroup=$i={ops:[x],delayedCallbacks:[]}}function Pr(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 ie=x.ops[te];if(ie.cursorActivityHandlers)for(;ie.cursorActivityCalled<ie.cursorActivityHandlers.length;)ie.cursorActivityHandlers[ie.cursorActivityCalled++].call(null,ie.cm)}}while(ne<z.length)}function Ur(x,z){var ne=x.ownsGroup;if(ne)try{Pr(ne)}finally{$i=null,z(ne)}}var zr=null;function Or(x,z){var ne=Pn(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;$i?ie=$i.delayedCallbacks:zr?ie=zr:(ie=zr=[],setTimeout(ai,0));for(var ce=function(Ce){ie.push(function(){return ne[Ce].apply(null,te)})},ge=0;ge<ne.length;++ge)ce(ge)}}function ai(){var x=zr;zr=null;for(var z=0;z<x.length;++z)x[z]()}function ri(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var ce=z.changes[ie];ce=="text"?na(x,z):ce=="gutter"?mi(x,z,ne,te):ce=="class"?vi(x,z):ce=="widget"&&Gi(x,z,te)}z.changes=null}function Ai(x){return x.node==x.text&&(x.node=Xe("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),be&&De<8&&(x.node.style.zIndex=2)),x.node}function Ki(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=Ai(z);z.background=te.insertBefore(Xe("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Hi(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):Si(x,z)}function na(x,z){var ne=z.text.className,te=Hi(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,vi(x,z)):ne&&(z.text.className=ne)}function vi(x,z){Ki(x,z),z.line.wrapClass?Ai(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 mi(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 ie=Ai(z);z.gutterBackground=Xe("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),ie.insertBefore(z.gutterBackground,z.text)}var ce=z.line.gutterMarkers;if(x.options.lineNumbers||ce){var ge=Ai(z),Ce=z.gutter=Xe("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Ce),ge.insertBefore(Ce,z.text),z.line.gutterClass&&(Ce.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!ce||!ce["CodeMirror-linenumbers"])&&(z.lineNumber=Ce.appendChild(Xe("div",Jt(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),ce)for(var Le=0;Le<x.display.gutterSpecs.length;++Le){var Oe=x.display.gutterSpecs[Le].className,vt=ce.hasOwnProperty(Oe)&&ce[Oe];vt&&Ce.appendChild(Xe("div",[vt],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Oe]+"px; width: "+te.gutterWidth[Oe]+"px"))}}}function Gi(x,z,ne){z.alignable&&(z.alignable=null);for(var te=Me("CodeMirror-linewidget"),ie=z.node.firstChild,ce=void 0;ie;ie=ce)ce=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);oa(x,z,ne)}function ca(x,z,ne,te){var ie=Hi(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),vi(x,z),mi(x,z,ne,te),oa(x,z,te),z.node}function oa(x,z,ne){if(ta(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)ta(x,z.rest[te],z,ne,!1)}function ta(x,z,ne,te,ie){if(z.widgets)for(var ce=Ai(ne),ge=0,Ce=z.widgets;ge<Ce.length;++ge){var Le=Ce[ge],Oe=Xe("div",[Le.node],"CodeMirror-linewidget"+(Le.className?" "+Le.className:""));Le.handleMouseEvents||Oe.setAttribute("cm-ignore-events","true"),ts(Le,Oe,ne,te),x.display.input.setUneditable(Oe),ie&&Le.above?ce.insertBefore(Oe,ne.gutter||ne.text):ce.appendChild(Oe),Or(Le,"redraw")}}function ts(x,z,ne,te){if(x.noHScroll){(ne.alignable||(ne.alignable=[])).push(z);var ie=te.wrapperWidth;z.style.left=te.fixedPos+"px",x.coverGutter||(ie-=te.gutterTotalWidth,z.style.paddingLeft=te.gutterTotalWidth+"px"),z.style.width=ie+"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(!Tt(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;"),Mt(z.display.measure,Xe("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function oo(x,z){for(var ne=kr(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=Mt(x.measure,Xe("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 en-x.display.nativeBarWidth}function fa(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 Eo(x,z,ne){var te=x.options.lineWrapping,ie=te&&fa(x);if(!z.measure.heights||te&&z.measure.width!=ie){var ce=z.measure.heights=[];if(te){z.measure.width=ie;for(var ge=z.text.firstChild.getClientRects(),Ce=0;Ce<ge.length-1;Ce++){var Le=ge[Ce],Oe=ge[Ce+1];Math.abs(Le.bottom-Oe.bottom)>2&&ce.push((Le.bottom+Oe.top)/2-ne.top)}}ce.push(ne.bottom-ne.top)}}function ko(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 ie=0;ie<x.rest.length;ie++)if(ct(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function ns(x,z){z=Lr(z);var ne=ct(z),te=x.display.externalMeasured=new Qr(x.doc,z,ne);te.lineN=ne;var ie=te.built=Si(x,te);return te.text=ie.pre,Mt(x.display.lineMeasure,ie.pre),te}function Ro(x,z,ne,te){return Bi(x,Oa(x,z),ne,te)}function Xa(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 Oa(x,z){var ne=ct(z),te=Xa(x,ne);te&&!te.text?te=null:te&&te.changes&&(ri(x,te,ne,Ti(x)),x.curOp.forceUpdate=!0),te||(te=ns(x,z));var ie=ko(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Bi(x,z,ne,te,ie){z.before&&(ne=-1);var ce=ne+(te||""),ge;return z.cache.hasOwnProperty(ce)?ge=z.cache[ce]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(Eo(x,z.view,z.rect),z.hasHeights=!0),ge=Ci(x,z,ne,te),ge.bogus||(z.cache[ce]=ge)),{left:ge.left,right:ge.right,top:ie?ge.rtop:ge.top,bottom:ie?ge.rbottom:ge.bottom}}var Lo={left:0,right:0,top:0,bottom:0};function rs(x,z,ne){for(var te,ie,ce,ge,Ce,Le,Oe=0;Oe<x.length;Oe+=3)if(Ce=x[Oe],Le=x[Oe+1],z<Ce?(ie=0,ce=1,ge="left"):z<Le?(ie=z-Ce,ce=ie+1):(Oe==x.length-3||z==Le&&x[Oe+3]>z)&&(ce=Le-Ce,ie=ce-1,z>=Le&&(ge="right")),ie!=null){if(te=x[Oe+2],Ce==Le&&ne==(te.insertLeft?"left":"right")&&(ge=ne),ne=="left"&&ie==0)for(;Oe&&x[Oe-2]==x[Oe-3]&&x[Oe-1].insertLeft;)te=x[(Oe-=3)+2],ge="left";if(ne=="right"&&ie==Le-Ce)for(;Oe<x.length-3&&x[Oe+3]==x[Oe+4]&&!x[Oe+5].insertLeft;)te=x[(Oe+=3)+2],ge="right";break}return{node:te,start:ie,end:ce,collapse:ge,coverStart:Ce,coverEnd:Le}}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 ie=x.length-1;ie>=0&&(ne=x[ie]).left==ne.right;ie--);return ne}function Ci(x,z,ne,te){var ie=rs(z.map,ne,te),ce=ie.node,ge=ie.start,Ce=ie.end,Le=ie.collapse,Oe;if(ce.nodeType==3){for(var vt=0;vt<4;vt++){for(;ge&&lt(z.line.text.charAt(ie.coverStart+ge));)--ge;for(;ie.coverStart+Ce<ie.coverEnd&&lt(z.line.text.charAt(ie.coverStart+Ce));)++Ce;if(be&&De<9&&ge==0&&Ce==ie.coverEnd-ie.coverStart?Oe=ce.parentNode.getBoundingClientRect():Oe=Do(ht(ce,ge,Ce).getClientRects(),te),Oe.left||Oe.right||ge==0)break;Ce=ge,ge=ge-1,Le="right"}be&&De<11&&(Oe=hi(x.display.measure,Oe))}else{ge>0&&(Le=te="right");var Et;x.options.lineWrapping&&(Et=ce.getClientRects()).length>1?Oe=Et[te=="right"?Et.length-1:0]:Oe=ce.getBoundingClientRect()}if(be&&De<9&&!ge&&(!Oe||!Oe.left&&!Oe.right)){var sn=ce.parentNode.getClientRects()[0];sn?Oe={left:sn.left,right:sn.left+Li(x.display),top:sn.top,bottom:sn.bottom}:Oe=Lo}for(var nn=Oe.top-z.rect.top,Bn=Oe.bottom-z.rect.top,Vn=(nn+Bn)/2,vr=z.view.measure.heights,Dr=0;Dr<vr.length-1&&!(Vn<vr[Dr]);Dr++);var Rr=Dr?vr[Dr-1]:0,Mr=vr[Dr],$r={left:(Le=="right"?Oe.right:Oe.left)-z.rect.left,right:(Le=="left"?Oe.left:Oe.right)-z.rect.left,top:Rr,bottom:Mr};return!Oe.left&&!Oe.right&&($r.bogus=!0),x.options.singleCursorHeightPerLine||($r.rtop=nn,$r.rbottom=Bn),$r}function hi(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!fn(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 zi(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 La(x){x.display.externalMeasure=null,Ve(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)zi(x.display.view[z])}function Ui(x){La(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function Ra(){return _e&&je?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fa(){return _e&&je?-(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 $a(x,z,ne,te,ie){if(!ie){var ce=to(z);ne.top+=ce,ne.bottom+=ce}if(te=="line")return ne;te||(te="local");var ge=Zn(z);if(te=="local"?ge+=eo(x.display):ge-=x.display.viewOffset,te=="page"||te=="window"){var Ce=x.display.lineSpace.getBoundingClientRect();ge+=Ce.top+(te=="window"?0:Fa());var Le=Ce.left+(te=="window"?0:Ra());ne.left+=Le,ne.right+=Le}return ne.top+=ge,ne.bottom+=ge,ne}function so(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=Ra(),ie-=Fa();else if(ne=="local"||!ne){var ce=x.display.sizer.getBoundingClientRect();te+=ce.left,ie+=ce.top}var ge=x.display.lineSpace.getBoundingClientRect();return{left:te-ge.left,top:ie-ge.top}}function lo(x,z,ne,te,ie){return te||(te=Ge(x.doc,z.line)),$a(x,te,Ro(x,te,z.ch,ie),ne)}function Da(x,z,ne,te,ie,ce){te=te||Ge(x.doc,z.line),ie||(ie=Oa(x,te));function ge(Bn,Vn){var vr=Bi(x,ie,Bn,Vn?"right":"left",ce);return Vn?vr.left=vr.right:vr.right=vr.left,$a(x,te,vr,ne)}var Ce=Sn(te,x.doc.direction),Le=z.ch,Oe=z.sticky;if(Le>=te.text.length?(Le=te.text.length,Oe="before"):Le<=0&&(Le=0,Oe="after"),!Ce)return ge(Oe=="before"?Le-1:Le,Oe=="before");function vt(Bn,Vn,vr){var Dr=Ce[Vn],Rr=Dr.level==1;return ge(vr?Bn-1:Bn,Rr!=vr)}var Et=an(Ce,Le,Oe),sn=Yt,nn=vt(Le,Et,Oe=="before");return sn!=null&&(nn.other=vt(Le,sn,Oe!="before")),nn}function bl(x,z){var ne=0;z=tn(x.doc,z),x.options.lineWrapping||(ne=Li(x.display)*z.ch);var te=Ge(x.doc,z.line),ie=Zn(te)+eo(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function jo(x,z,ne,te,ie){var ce=pt(x,z,ne);return ce.xRel=ie,te&&(ce.outside=te),ce}function Js(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return jo(te.first,0,null,-1,-1);var ie=kt(te,ne),ce=te.first+te.size-1;if(ie>ce)return jo(te.first+te.size-1,Ge(te,ce).text.length,null,1,1);z<0&&(z=0);for(var ge=Ge(te,ie);;){var Ce=_c(x,ge,ie,z,ne),Le=nr(ge,Ce.ch+(Ce.xRel>0||Ce.outside>0?1:0));if(!Le)return Ce;var Oe=Le.find(1);if(Oe.line==ie)return Oe;ge=Ge(te,ie=Oe.line)}}function Kl(x,z,ne,te){te-=to(z);var ie=z.text.length,ce=It(function(ge){return Bi(x,ne,ge-1).bottom<=te},ie,0);return ie=It(function(ge){return Bi(x,ne,ge).top>te},ce,ie),{begin:ce,end:ie}}function Hl(x,z,ne,te){ne||(ne=Oa(x,z));var ie=$a(x,z,Bi(x,ne,te),"line").top;return Kl(x,z,ne,ie)}function Cs(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function _c(x,z,ne,te,ie){ie-=Zn(z);var ce=Oa(x,z),ge=to(z),Ce=0,Le=z.text.length,Oe=!0,vt=Sn(z,x.doc.direction);if(vt){var Et=(x.options.lineWrapping?xl:is)(x,z,ne,ce,vt,te,ie);Oe=Et.level!=1,Ce=Oe?Et.from:Et.to-1,Le=Oe?Et.to:Et.from-1}var sn=null,nn=null,Bn=It(function(Jr){var ei=Bi(x,ce,Jr);return ei.top+=ge,ei.bottom+=ge,Cs(ei,te,ie,!1)?(ei.top<=ie&&ei.left<=te&&(sn=Jr,nn=ei),!0):!1},Ce,Le),Vn,vr,Dr=!1;if(nn){var Rr=te-nn.left<nn.right-te,Mr=Rr==Oe;Bn=sn+(Mr?0:1),vr=Mr?"after":"before",Vn=Rr?nn.left:nn.right}else{!Oe&&(Bn==Le||Bn==Ce)&&Bn++,vr=Bn==0?"after":Bn==z.text.length?"before":Bi(x,ce,Bn-(Oe?1:0)).bottom+ge<=ie==Oe?"after":"before";var $r=Da(x,pt(ne,Bn,vr),"line",z,ce);Vn=$r.left,Dr=ie<$r.top?-1:ie>=$r.bottom?1:0}return Bn=Ot(z.text,Bn,1),jo(ne,Bn,vr,Dr,te-Vn)}function is(x,z,ne,te,ie,ce,ge){var Ce=It(function(Et){var sn=ie[Et],nn=sn.level!=1;return Cs(Da(x,pt(ne,nn?sn.to:sn.from,nn?"before":"after"),"line",z,te),ce,ge,!0)},0,ie.length-1),Le=ie[Ce];if(Ce>0){var Oe=Le.level!=1,vt=Da(x,pt(ne,Oe?Le.from:Le.to,Oe?"after":"before"),"line",z,te);Cs(vt,ce,ge,!0)&&vt.top>ge&&(Le=ie[Ce-1])}return Le}function xl(x,z,ne,te,ie,ce,ge){var Ce=Kl(x,z,te,ge),Le=Ce.begin,Oe=Ce.end;/\s/.test(z.text.charAt(Oe-1))&&Oe--;for(var vt=null,Et=null,sn=0;sn<ie.length;sn++){var nn=ie[sn];if(!(nn.from>=Oe||nn.to<=Le)){var Bn=nn.level!=1,Vn=Bi(x,te,Bn?Math.min(Oe,nn.to)-1:Math.max(Le,nn.from)).right,vr=Vn<ce?ce-Vn+1e9:Vn-ce;(!vt||Et>vr)&&(vt=nn,Et=vr)}}return vt||(vt=ie[ie.length-1]),vt.from<Le&&(vt={from:Le,to:vt.to,level:vt.level}),vt.to>Oe&&(vt={from:vt.from,to:Oe,level:vt.level}),vt}var Vo;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Vo==null){Vo=Xe("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Vo.appendChild(document.createTextNode("x")),Vo.appendChild(Xe("br"));Vo.appendChild(document.createTextNode("x"))}Mt(x.measure,Vo);var ne=Vo.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Ve(x.measure),ne||1}function Li(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=Xe("span","xxxxxxxxxx"),ne=Xe("pre",[z],"CodeMirror-line-like");Mt(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function Ti(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,ce=z.gutters.firstChild,ge=0;ce;ce=ce.nextSibling,++ge){var Ce=x.display.gutterSpecs[ge].className;ne[Ce]=ce.offsetLeft+ce.clientLeft+ie,te[Ce]=ce.clientWidth}return{fixedPos:Wi(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Wi(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Ya(x){var z=as(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/Li(x.display)-3);return function(ie){if(gi(x.doc,ie))return 0;var ce=0;if(ie.widgets)for(var ge=0;ge<ie.widgets.length;ge++)ie.widgets[ge].height&&(ce+=ie.widgets[ge].height);return ne?ce+(Math.ceil(ie.text.length/te)||1)*z:ce+z}}function Aa(x){var z=x.doc,ne=Ya(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&ze(te,ie)})}function xo(x,z,ne,te){var ie=x.display;if(!ne&&kr(z).getAttribute("cm-not-content")=="true")return null;var ce,ge,Ce=ie.lineSpace.getBoundingClientRect();try{ce=z.clientX-Ce.left,ge=z.clientY-Ce.top}catch(Et){return null}var Le=Js(x,ce,ge),Oe;if(te&&Le.xRel>0&&(Oe=Ge(x.doc,Le.line).text).length==Le.ch){var vt=$e(Oe,Oe.length,x.options.tabSize)-Oe.length;Le=pt(Le.line,Math.max(0,Math.round((ce-fo(x.display).left)/Li(x.display))-vt))}return Le}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 za(x,z,ne,te){z==null&&(z=x.doc.first),ne==null&&(ne=x.doc.first+x.doc.size),te||(te=0);var ie=x.display;if(te&&ne<ie.viewTo&&(ie.updateLineNumbers==null||ie.updateLineNumbers>z)&&(ie.updateLineNumbers=z),x.curOp.viewChanged=!0,z>=ie.viewTo)gr&&bi(x.doc,z)<ie.viewTo&&To(x);else if(ne<=ie.viewFrom)gr&&Gr(x.doc,ne+te)>ie.viewFrom?To(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)To(x);else if(z<=ie.viewFrom){var ce=wo(x,ne,ne+te,1);ce?(ie.view=ie.view.slice(ce.index),ie.viewFrom=ce.lineN,ie.viewTo+=te):To(x)}else if(ne>=ie.viewTo){var ge=wo(x,z,z,-1);ge?(ie.view=ie.view.slice(0,ge.index),ie.viewTo=ge.lineN):To(x)}else{var Ce=wo(x,z,z,-1),Le=wo(x,ne,ne+te,1);Ce&&Le?(ie.view=ie.view.slice(0,Ce.index).concat(Vi(x,Ce.lineN,Le.lineN)).concat(ie.view.slice(Le.index)),ie.viewTo+=te):To(x)}var Oe=ie.externalMeasured;Oe&&(ne<Oe.lineN?Oe.lineN+=te:z<Oe.lineN+Oe.size&&(ie.externalMeasured=null))}function Ao(x,z,ne){x.curOp.viewChanged=!0;var te=x.display,ie=x.display.externalMeasured;if(ie&&z>=ie.lineN&&z<ie.lineN+ie.size&&(te.externalMeasured=null),!(z<te.viewFrom||z>=te.viewTo)){var ce=te.view[po(x,z)];if(ce.node!=null){var ge=ce.changes||(ce.changes=[]);gt(ge,ne)==-1&&ge.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 ie=po(x,z),ce,ge=x.display.view;if(!gr||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Ce=x.display.viewFrom,Le=0;Le<ie;Le++)Ce+=ge[Le].size;if(Ce!=z){if(te>0){if(ie==ge.length-1)return null;ce=Ce+ge[ie].size-z,ie++}else ce=Ce-z;z+=ce,ne+=ce}for(;bi(x.doc,ne)!=ne;){if(ie==(te<0?0:ge.length-1))return null;ne+=te*ge[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function os(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=Vi(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=Vi(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(Vi(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 ie=z[te];!ie.hidden&&(!ie.node||ie.changes)&&++ne}return ne}function wl(x){x.display.input.showSelection(x.display.input.prepareSelection())}function _u(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),ce=te.selection=document.createDocumentFragment(),ge=0;ge<ne.sel.ranges.length;ge++)if(!(!z&&ge==ne.sel.primIndex)){var Ce=ne.sel.ranges[ge];if(!(Ce.from().line>=x.display.viewTo||Ce.to().line<x.display.viewFrom)){var Le=Ce.empty();(Le||x.options.showCursorWhenSelecting)&&Eu(x,Ce.head,ie),Le||Od(x,Ce,ce)}}return te}function Eu(x,z,ne){var te=Da(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(Xe("div","\xA0","CodeMirror-cursor"));if(ie.style.left=te.left+"px",ie.style.top=te.top+"px",ie.style.height=Math.max(0,te.bottom-te.top)*x.options.cursorHeight+"px",te.other){var ce=ne.appendChild(Xe("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ce.style.display="",ce.style.left=te.other.left+"px",ce.style.top=te.other.top+"px",ce.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,ie=x.doc,ce=document.createDocumentFragment(),ge=fo(x.display),Ce=ge.left,Le=Math.max(te.sizerWidth,fa(x)-te.sizer.offsetLeft)-ge.right,Oe=ie.direction=="ltr";function vt(Mr,$r,Jr,ei){$r<0&&($r=0),$r=Math.round($r),ei=Math.round(ei),ce.appendChild(Xe("div",null,"CodeMirror-selected","position: absolute; left: "+Mr+`px;
top: `+$r+"px; width: "+(Jr==null?Le-Mr:Jr)+`px;
height: `+(ei-$r)+"px"))}function Et(Mr,$r,Jr){var ei=Ge(ie,Mr),wi=ei.text.length,Ji,Na;function da(_a,ho){return lo(x,pt(Mr,_a),"div",ei,ho)}function co(_a,ho,ui){var ma=Hl(x,ei,null,_a),ha=ho=="ltr"==(ui=="after")?"left":"right",ga=ui=="after"?ma.begin:ma.end-(/\s/.test(ei.text.charAt(ma.end-1))?2:1);return da(ga,ha)[ha]}var uo=Sn(ei,ie.direction);return Ht(uo,$r||0,Jr==null?wi:Jr,function(_a,ho,ui,ma){var ha=ui=="ltr",ga=da(_a,ha?"left":"right"),ba=da(ho-1,ha?"right":"left"),fl=$r==null&&_a==0,vo=Jr==null&&ho==wi,Za=ma==0,Oi=!uo||ma==uo.length-1;if(ba.top-ga.top<=3){var Pa=(Oe?fl:vo)&&Za,au=(Oe?vo:fl)&&Oi,bs=Pa?Ce:(ha?ga:ba).left,Ns=au?Le:(ha?ba:ga).right;vt(bs,ga.top,Ns-bs,ga.bottom)}else{var Yo,Ea,pl,ja;ha?(Yo=Oe&&fl&&Za?Ce:ga.left,Ea=Oe?Le:co(_a,ui,"before"),pl=Oe?Ce:co(ho,ui,"after"),ja=Oe&&vo&&Oi?Le:ba.right):(Yo=Oe?co(_a,ui,"before"):Ce,Ea=!Oe&&fl&&Za?Le:ga.right,pl=!Oe&&vo&&Oi?Ce:ba.left,ja=Oe?co(ho,ui,"after"):Le),vt(Yo,ga.top,Ea-Yo,ga.bottom),ga.bottom<ba.top&&vt(Ce,ga.bottom,null,ba.top),vt(pl,ba.top,ja-pl,ba.bottom)}(!Ji||Zl(ga,Ji)<0)&&(Ji=ga),Zl(ba,Ji)<0&&(Ji=ba),(!Na||Zl(ga,Na)<0)&&(Na=ga),Zl(ba,Na)<0&&(Na=ba)}),{start:Ji,end:Na}}var sn=z.from(),nn=z.to();if(sn.line==nn.line)Et(sn.line,sn.ch,nn.ch);else{var Bn=Ge(ie,sn.line),Vn=Ge(ie,nn.line),vr=Lr(Bn)==Lr(Vn),Dr=Et(sn.line,sn.ch,vr?Bn.text.length+1:null).end,Rr=Et(nn.line,vr?0:null,nn.ch).start;vr&&(Dr.top<Rr.top-2?(vt(Dr.right,Dr.top,null,Dr.bottom),vt(Ce,Rr.top,Rr.left,Rr.bottom)):vt(Dr.right,Dr.top,Rr.left-Dr.right,Dr.bottom)),Dr.bottom<Rr.top&&vt(Ce,Dr.bottom,null,Rr.top)}ne.appendChild(ce)}function Ec(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()||qs(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(),kc(x))}function ku(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,qs(x))},100)}function kc(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(St(x,"focus",x,z),x.state.focused=!0,Ut(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Pe&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),Ec(x))}function qs(x,z){x.state.delayingBlurEvent||(x.state.focused&&(St(x,"blur",x,z),x.state.focused=!1,Ke(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function jl(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],ce=x.options.lineWrapping,ge=void 0,Ce=0;if(!ie.hidden){if(be&&De<8){var Le=ie.node.offsetTop+ie.node.offsetHeight;ge=Le-ne,ne=Le}else{var Oe=ie.node.getBoundingClientRect();ge=Oe.bottom-Oe.top,!ce&&ie.text.firstChild&&(Ce=ie.text.firstChild.getBoundingClientRect().right-Oe.left-1)}var vt=ie.line.height-ge;if((vt>.005||vt<-.005)&&(ze(ie.line,ge),Lu(ie.line),ie.rest))for(var Et=0;Et<ie.rest.length;Et++)Lu(ie.rest[Et]);if(Ce>x.display.sizerWidth){var sn=Math.ceil(Ce/Li(x.display));sn>x.display.maxLineLength&&(x.display.maxLineLength=sn,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function Lu(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 Ta(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-eo(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,ce=kt(z,te),ge=kt(z,ie);if(ne&&ne.ensure){var Ce=ne.ensure.from.line,Le=ne.ensure.to.line;Ce<ce?(ce=Ce,ge=kt(z,Zn(Ge(z,Ce))+x.wrapper.clientHeight)):Math.min(Le,z.lastLine())>=ge&&(ce=kt(z,Zn(Ge(z,Le))-x.wrapper.clientHeight),ge=Le)}return{from:ce,to:Math.max(ge,ce+1)}}function ss(x,z){if(!$t(x,"scrollCursorIntoView")){var ne=x.display,te=ne.sizer.getBoundingClientRect(),ie=null;if(z.top+te.top<0?ie=!0:z.bottom+te.top>(window.innerHeight||document.documentElement.clientHeight)&&(ie=!1),ie!=null&&!He){var ce=Xe("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(ce),ce.scrollIntoView(ie),x.display.lineSpace.removeChild(ce)}}}function Ms(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?pt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?pt(z.line,z.ch+1,"before"):z);for(var ce=0;ce<5;ce++){var ge=!1,Ce=Da(x,z),Le=!ne||ne==z?Ce:Da(x,ne);ie={left:Math.min(Ce.left,Le.left),top:Math.min(Ce.top,Le.top)-te,right:Math.max(Ce.left,Le.left),bottom:Math.max(Ce.bottom,Le.bottom)+te};var Oe=Vl(x,ie),vt=x.doc.scrollTop,Et=x.doc.scrollLeft;if(Oe.scrollTop!=null&&(_s(x,Oe.scrollTop),Math.abs(x.doc.scrollTop-vt)>1&&(ge=!0)),Oe.scrollLeft!=null&&(Es(x,Oe.scrollLeft),Math.abs(x.doc.scrollLeft-Et)>1&&(ge=!0)),!ge)break}return ie}function Rd(x,z){var ne=Vl(x,z);ne.scrollTop!=null&&_s(x,ne.scrollTop),ne.scrollLeft!=null&&Es(x,ne.scrollLeft)}function Vl(x,z){var ne=x.display,te=as(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,ce=bo(x),ge={};z.bottom-z.top>ce&&(z.bottom=z.top+ce);var Ce=x.doc.height+Ss(ne),Le=z.top<te,Oe=z.bottom>Ce-te;if(z.top<ie)ge.scrollTop=Le?0:z.top;else if(z.bottom>ie+ce){var vt=Math.min(z.top,(Oe?Ce:z.bottom)-ce);vt!=ie&&(ge.scrollTop=vt)}var Et=x.options.fixedGutter?0:ne.gutters.offsetWidth,sn=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-Et,nn=fa(x)-ne.gutters.offsetWidth,Bn=z.right-z.left>nn;return Bn&&(z.right=z.left+nn),z.left<10?ge.scrollLeft=0:z.left<sn?ge.scrollLeft=Math.max(0,z.left+Et-(Bn?0:10)):z.right>nn+sn-3&&(ge.scrollLeft=z.right+(Bn?0:10)-nn),ge}function Lc(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 $d(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);Du(x,ne,te,z.margin)}}function Du(x,z,ne,te){var ie=Vl(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,ie.scrollLeft,ie.scrollTop)}function _s(x,z){Math.abs(x.doc.scrollTop-z)<2||(fe||Tc(x,{top:z}),Au(x,z,!0),fe&&Tc(x),nl(x,100))}function Au(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 Es(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,Ru(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=Xe("div",[Xe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=Xe("div",[Xe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),on(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),on(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,be&&De<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 ie=x.viewHeight-(z?te:0);this.vert.firstChild.style.height=Math.max(0,x.scrollHeight-x.clientHeight+ie)+"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 ce=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+ce)+"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=at&&!Ae?"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 ie=x.getBoundingClientRect(),ce=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);ce!=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 ks(x,z){z||(z=tl(x));var ne=x.display.barWidth,te=x.display.barHeight;Dc(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&jl(x),Dc(x,tl(x)),ne=x.display.barWidth,te=x.display.barHeight}function Dc(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 Tu={native:ls,null:mo};function Iu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ke(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Tu[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),on(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"?Es(x,z):_s(x,z)},x),x.display.scrollbars.addClass&&Ut(x.display.wrapper,x.display.scrollbars.addClass)}var Nd=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:++Nd},ci(x.curOp)}function cs(x){var z=x.curOp;z&&Ur(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;Fd(ne)})}function Fd(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 ie=0;ie<z.length;ie++)Hd(z[ie]);for(var ce=0;ce<z.length;ce++)Wd(z[ce]);for(var ge=0;ge<z.length;ge++)Zd(z[ge])}function zd(x){var z=x.cm,ne=z.display;Bu(z),x.updateMaxLine&&jn(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&&Ac(x.cm,x.update)}function Hd(x){var z=x.cm,ne=z.display;x.updatedDisplay&&jl(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-fa(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&&Es(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==et();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&ks(z,x.barMeasure),x.updatedDisplay&&Pc(z,x.barMeasure),x.selectionChanged&&Ec(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&&Ou(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Au(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&Es(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=Ms(z,tn(te,x.scrollToPos.from),tn(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,ie)}var ce=x.maybeHiddenMarkers,ge=x.maybeUnhiddenMarkers;if(ce)for(var Ce=0;Ce<ce.length;++Ce)ce[Ce].lines.length||St(ce[Ce],"hide");if(ge)for(var Le=0;Le<ge.length;++Le)ge[Le].lines.length&&St(ge[Le],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&St(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function pa(x,z){if(x.curOp)return z();Ls(x);try{return z()}finally{cs(x)}}function Sa(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ls(x);try{return z.apply(x,arguments)}finally{cs(x)}}}function ua(x){return function(){if(this.curOp)return x.apply(this,arguments);Ls(this);try{return x.apply(this,arguments)}finally{cs(this)}}}function Ia(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{cs(z)}}}function nl(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,Bt(Pu,x))}function Pu(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Gt(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(ce){if(te.line>=x.display.viewFrom){var ge=ce.styles,Ce=ce.text.length>x.options.maxHighlightLength?Ee(z.mode,te.state):null,Le=Xt(x,ce,te,!0);Ce&&(te.state=Ce),ce.styles=Le.styles;var Oe=ce.styleClasses,vt=Le.classes;vt?ce.styleClasses=vt:Oe&&(ce.styleClasses=null);for(var Et=!ge||ge.length!=ce.styles.length||Oe!=vt&&(!Oe||!vt||Oe.bgClass!=vt.bgClass||Oe.textClass!=vt.textClass),sn=0;!Et&&sn<ge.length;++sn)Et=ge[sn]!=ce.styles[sn];Et&&ie.push(te.line),ce.stateAfter=te.save(),te.nextLine()}else ce.text.length<=x.options.maxHighlightLength&&Kt(x,ce.text,te),ce.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),ie.length&&pa(x,function(){for(var ce=0;ce<ie.length;ce++)Ao(x,ie[ce],"text")})}}var Ul=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=Ta(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=fa(x),this.force=ne,this.dims=Ti(x),this.events=[]};Ul.prototype.signal=function(x,z){Ln(x,z)&&this.events.push(arguments)},Ul.prototype.finish=function(){for(var x=0;x<this.events.length;x++)St.apply(null,this.events[x])};function Bu(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 jd(x){if(x.hasFocus())return null;var z=et();if(!z||!Tt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Tt(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function Vd(x){if(!(!x||!x.activeElt||x.activeElt==et())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Tt(document.body,x.anchorNode)&&Tt(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 Ac(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=Ti(x));var ie=te.first+te.size,ce=Math.max(z.visible.from-x.options.viewportMargin,te.first),ge=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<ce&&ce-ne.viewFrom<20&&(ce=Math.max(te.first,ne.viewFrom)),ne.viewTo>ge&&ne.viewTo-ge<20&&(ge=Math.min(ie,ne.viewTo)),gr&&(ce=bi(x.doc,ce),ge=Gr(x.doc,ge));var Ce=ce!=ne.viewFrom||ge!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,ce,ge),ne.viewOffset=Zn(Ge(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Le=Wl(x);if(!Ce&&Le==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Oe=jd(x);return Le>4&&(ne.lineDiv.style.display="none"),Gd(x,ne.updateLineNumbers,z.dims),Le>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Oe),Ve(ne.cursorDiv),Ve(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Ce&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,nl(x,400)),ne.updateLineNumbers=null,!0}function Ou(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==fa(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Ss(x.display)-bo(x),ne.top)}),z.visible=Ta(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=Ta(x.display,x.doc,ne));if(!Ac(x,z))break;jl(x);var ie=tl(x);wl(x),ks(x,ie),Pc(x,ie),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 Tc(x,z){var ne=new Ul(x,z);if(Ac(x,ne)){jl(x),Ou(x,ne);var te=tl(x);wl(x),ks(x,te),Pc(x,te),ne.finish()}}function Gd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,ce=te.lineDiv,ge=ce.firstChild;function Ce(Bn){var Vn=Bn.nextSibling;return Pe&&at&&x.display.currentWheelTarget==Bn?Bn.style.display="none":Bn.parentNode.removeChild(Bn),Vn}for(var Le=te.view,Oe=te.viewFrom,vt=0;vt<Le.length;vt++){var Et=Le[vt];if(!Et.hidden)if(!Et.node||Et.node.parentNode!=ce){var sn=ca(x,Et,Oe,ne);ce.insertBefore(sn,ge)}else{for(;ge!=Et.node;)ge=Ce(ge);var nn=ie&&z!=null&&z<=Oe&&Et.lineNumber;Et.changes&&(gt(Et.changes,"gutter")>-1&&(nn=!1),ri(x,Et,Oe,ne)),nn&&(Ve(Et.lineNumber),Et.lineNumber.appendChild(document.createTextNode(Jt(x.options,Oe)))),ge=Et.node.nextSibling}Oe+=Et.size}for(;ge;)ge=Ce(ge)}function Ic(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Pc(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 Ru(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Wi(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,ce=te+"px",ge=0;ge<ne.length;ge++)if(!ne[ge].hidden){x.options.fixedGutter&&(ne[ge].gutter&&(ne[ge].gutter.style.left=ce),ne[ge].gutterBackground&&(ne[ge].gutterBackground.style.left=ce));var Ce=ne[ge].alignable;if(Ce)for(var Le=0;Le<Ce.length;Le++)Ce[Le].style.left=ce}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function Xl(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=Jt(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(Xe("div",[Xe("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ce=ie.firstChild.offsetWidth,ge=ie.offsetWidth-ce;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(ce,te.lineGutter.offsetWidth-ge)+1,te.lineNumWidth=te.lineNumInnerWidth+ge,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Ic(x.display),!0}return!1}function Bc(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var ce=x[ie],ge=null;if(typeof ce!="string"&&(ge=ce.style,ce=ce.className),ce=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:ce,style:ge})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function $u(x){var z=x.gutters,ne=x.gutterSpecs;Ve(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],ce=ie.className,ge=ie.style,Ce=z.appendChild(Xe("div",null,"CodeMirror-gutter "+ce));ge&&(Ce.style.cssText=ge),ce=="CodeMirror-linenumbers"&&(x.lineGutter=Ce,Ce.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Ic(x)}function Cl(x){$u(x.display),za(x),Ru(x)}function Ud(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=Xe("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=Xe("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Nt("div",null,"CodeMirror-code"),ie.selectionDiv=Xe("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=Xe("div",null,"CodeMirror-cursors"),ie.measure=Xe("div",null,"CodeMirror-measure"),ie.lineMeasure=Xe("div",null,"CodeMirror-measure"),ie.lineSpace=Nt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var ce=Nt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=Xe("div",[ce],null,"position: relative"),ie.sizer=Xe("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=Xe("div",null,null,"position: absolute; height: "+en+"px; width: 1px;"),ie.gutters=Xe("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=Xe("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=Xe("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),be&&De<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Pe&&!(fe&&it)&&(ie.scroller.draggable=!0),x&&(x.appendChild?x.appendChild(ie.wrapper):x(ie.wrapper)),ie.viewFrom=ie.viewTo=z.first,ie.reportedViewFrom=ie.reportedViewTo=z.first,ie.view=[],ie.renderedView=null,ie.externalMeasured=null,ie.viewOffset=0,ie.lastWrapHeight=ie.lastWrapWidth=0,ie.updateLineNumbers=null,ie.nativeBarWidth=ie.barHeight=ie.barWidth=0,ie.scrollbarsClipped=!1,ie.lineNumWidth=ie.lineNumInnerWidth=ie.lineNumChars=null,ie.alignWidgets=!1,ie.cachedCharWidth=ie.cachedTextHeight=ie.cachedPaddingH=null,ie.maxLine=null,ie.maxLineLength=0,ie.maxLineChanged=!1,ie.wheelDX=ie.wheelDY=ie.wheelStartX=ie.wheelStartY=null,ie.shift=!1,ie.selForContextMenu=null,ie.activeTouch=null,ie.gutterSpecs=Bc(te.gutters,te.lineNumbers),$u(ie),ne.init(ie)}var Yl=0,Ka=null;be?Ka=-.53:fe?Ka=15:_e?Ka=-.7:dt&&(Ka=-1/3);function rl(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 Nu(x){var z=rl(x);return z.x*=Ka,z.y*=Ka,z}function Fu(x,z){var ne=rl(z),te=ne.x,ie=ne.y,ce=x.display,ge=ce.scroller,Ce=ge.scrollWidth>ge.clientWidth,Le=ge.scrollHeight>ge.clientHeight;if(te&&Ce||ie&&Le){if(ie&&at&&Pe){e:for(var Oe=z.target,vt=ce.view;Oe!=ge;Oe=Oe.parentNode)for(var Et=0;Et<vt.length;Et++)if(vt[Et].node==Oe){x.display.currentWheelTarget=Oe;break e}}if(te&&!fe&&!Ne&&Ka!=null){ie&&Le&&_s(x,Math.max(0,ge.scrollTop+ie*Ka)),Es(x,Math.max(0,ge.scrollLeft+te*Ka)),(!ie||ie&&Le)&&qn(z),ce.wheelStartX=null;return}if(ie&&Ka!=null){var sn=ie*Ka,nn=x.doc.scrollTop,Bn=nn+ce.wrapper.clientHeight;sn<0?nn=Math.max(0,nn+sn-50):Bn=Math.min(x.doc.height,Bn+sn+50),Tc(x,{top:nn,bottom:Bn})}Yl<20&&(ce.wheelStartX==null?(ce.wheelStartX=ge.scrollLeft,ce.wheelStartY=ge.scrollTop,ce.wheelDX=te,ce.wheelDY=ie,setTimeout(function(){if(ce.wheelStartX!=null){var Vn=ge.scrollLeft-ce.wheelStartX,vr=ge.scrollTop-ce.wheelStartY,Dr=vr&&ce.wheelDY&&vr/ce.wheelDY||Vn&&ce.wheelDX&&Vn/ce.wheelDX;ce.wheelStartX=ce.wheelStartY=null,Dr&&(Ka=(Ka*Yl+Dr)/(Yl+1),++Yl)}},200)):(ce.wheelDX+=te,ce.wheelDY+=ie))}}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 Ni(ln(this.ranges[z].anchor),ln(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(Ct(z,te.from())>=0&&Ct(x,te.to())<=0)return ne}return-1};var Ni=function(x,z){this.anchor=x,this.head=z};Ni.prototype.from=function(){return qt(this.anchor,this.head)},Ni.prototype.to=function(){return En(this.anchor,this.head)},Ni.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Io(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(sn,nn){return Ct(sn.from(),nn.from())}),ne=gt(z,ie);for(var ce=1;ce<z.length;ce++){var ge=z[ce],Ce=z[ce-1],Le=Ct(Ce.to(),ge.from());if(te&&!ge.empty()?Le>0:Le>=0){var Oe=qt(Ce.from(),ge.from()),vt=En(Ce.to(),ge.to()),Et=Ce.empty()?ge.from()==ge.head:Ce.from()==Ce.head;ce<=ne&&--ne,z.splice(--ce,2,new Ni(Et?vt:Oe,Et?Oe:vt))}}return new go(z,ne)}function $o(x,z){return new go([new Ni(x,z||x)],0)}function us(x){return x.text?pt(x.from.line+x.text.length-1,Zt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function zu(x,z){if(Ct(x,z.from)<0)return x;if(Ct(x,z.to)<=0)return us(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+=us(z).ch-z.to.ch),pt(ne,te)}function Oc(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Ni(zu(ie.anchor,z),zu(ie.head,z)))}return Io(x.cm,ne,x.sel.primIndex)}function il(x,z,ne){return x.line==z.line?pt(ne.line,x.ch-z.ch+ne.ch):pt(ne.line+(x.line-z.line),x.ch)}function Rc(x,z,ne){for(var te=[],ie=pt(x.first,0),ce=ie,ge=0;ge<z.length;ge++){var Ce=z[ge],Le=il(Ce.from,ie,ce),Oe=il(us(Ce),ie,ce);if(ie=Ce.to,ce=Oe,ne=="around"){var vt=x.sel.ranges[ge],Et=Ct(vt.head,vt.anchor)<0;te[ge]=new Ni(Et?Oe:Le,Et?Le:Oe)}else te[ge]=new Ni(Le,Le)}return new go(te,x.sel.primIndex)}function $c(x){x.doc.mode=pn(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&&za(x)}function Ku(x,z){return z.from.ch==0&&z.to.ch==0&&Zt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function Nc(x,z,ne,te){function ie(Rr){return ne?ne[Rr]:null}function ce(Rr,Mr,$r){Yr(Rr,Mr,$r,te),Or(Rr,"change",Rr,z)}function ge(Rr,Mr){for(var $r=[],Jr=Rr;Jr<Mr;++Jr)$r.push(new ur(Oe[Jr],ie(Jr),te));return $r}var Ce=z.from,Le=z.to,Oe=z.text,vt=Ge(x,Ce.line),Et=Ge(x,Le.line),sn=Zt(Oe),nn=ie(Oe.length-1),Bn=Le.line-Ce.line;if(z.full)x.insert(0,ge(0,Oe.length)),x.remove(Oe.length,x.size-Oe.length);else if(Ku(x,z)){var Vn=ge(0,Oe.length-1);ce(Et,Et.text,nn),Bn&&x.remove(Ce.line,Bn),Vn.length&&x.insert(Ce.line,Vn)}else if(vt==Et)if(Oe.length==1)ce(vt,vt.text.slice(0,Ce.ch)+sn+vt.text.slice(Le.ch),nn);else{var vr=ge(1,Oe.length-1);vr.push(new ur(sn+vt.text.slice(Le.ch),nn,te)),ce(vt,vt.text.slice(0,Ce.ch)+Oe[0],ie(0)),x.insert(Ce.line+1,vr)}else if(Oe.length==1)ce(vt,vt.text.slice(0,Ce.ch)+Oe[0]+Et.text.slice(Le.ch),ie(0)),x.remove(Ce.line+1,Bn);else{ce(vt,vt.text.slice(0,Ce.ch)+Oe[0],ie(0)),ce(Et,sn+Et.text.slice(Le.ch),nn);var Dr=ge(1,Oe.length-1);Bn>1&&x.remove(Ce.line+1,Bn-1),x.insert(Ce.line+1,Dr)}Or(x,"change",x,z)}function ds(x,z,ne){function te(ie,ce,ge){if(ie.linked)for(var Ce=0;Ce<ie.linked.length;++Ce){var Le=ie.linked[Ce];if(Le.doc!=ce){var Oe=ge&&Le.sharedHist;ne&&!Oe||(z(Le.doc,Oe),te(Le.doc,ie,Oe))}}}te(x,null,!0)}function Jl(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,Aa(x),$c(x),ql(x),x.options.lineWrapping||jn(x),x.options.mode=z.modeOption,za(x)}function ql(x){(x.doc.direction=="rtl"?Ut:Ke)(x.display.lineDiv,"CodeMirror-rtl")}function Fc(x){pa(x,function(){ql(x),za(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 zc(x,z){var ne={from:ln(z.from),to:us(z),text:ut(x,z.from,z.to)};return Zc(x,ne,z.from.line,z.to.line+1),ds(x,function(te){return Zc(te,ne,z.from.line,z.to.line+1)},!0),ne}function Hu(x){for(;x.length;){var z=Zt(x);if(z.ranges)x.pop();else break}}function Kc(x,z){if(z)return Hu(x.done),Zt(x.done);if(x.done.length&&!Zt(x.done).ranges)return Zt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Zt(x.done)}function ec(x,z,ne,te){var ie=x.history;ie.undone.length=0;var ce=+new Date,ge,Ce;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>ce-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(ge=Kc(ie,ie.lastOp==te)))Ce=Zt(ge.changes),Ct(z.from,z.to)==0&&Ct(z.from,Ce.to)==0?Ce.to=us(z):ge.changes.push(zc(x,z));else{var Le=Zt(ie.done);for((!Le||!Le.ranges)&&tc(x.sel,ie.done),ge={changes:[zc(x,z)],generation:ie.generation},ie.done.push(ge);ie.done.length>ie.undoDepth;)ie.done.shift(),ie.done[0].ranges||ie.done.shift()}ie.done.push(ne),ie.generation=++ie.maxGeneration,ie.lastModTime=ie.lastSelTime=ce,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Ce||St(x,"historyAdded")}function Hc(x,z,ne,te){var ie=z.charAt(0);return ie=="*"||ie=="+"&&ne.ranges.length==te.ranges.length&&ne.somethingSelected()==te.somethingSelected()&&new Date-x.history.lastSelTime<=(x.cm?x.cm.options.historyEventDelay:500)}function Wc(x,z,ne,te){var ie=x.history,ce=te&&te.origin;ne==ie.lastSelOp||ce&&ie.lastSelOrigin==ce&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==ce||Hc(x,ce,Zt(ie.done),z))?ie.done[ie.done.length-1]=z:tc(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=ce,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Hu(ie.undone)}function tc(x,z){var ne=Zt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function Zc(x,z,ne,te){var ie=z["spans_"+x.id],ce=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(ge){ge.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[ce]=ge.markedSpans),++ce})}function jc(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=[],ie=0;ie<z.text.length;++ie)te.push(jc(ne[ie]));return te}function Wu(x,z){var ne=Xd(x,z),te=kn(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var ce=ne[ie],ge=te[ie];if(ce&&ge)e:for(var Ce=0;Ce<ge.length;++Ce){for(var Le=ge[Ce],Oe=0;Oe<ce.length;++Oe)if(ce[Oe].marker==Le.marker)continue e;ce.push(Le)}else ge&&(ne[ie]=ge)}return ne}function ol(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.ranges){te.push(ne?go.prototype.deepCopy.call(ce):ce);continue}var ge=ce.changes,Ce=[];te.push({changes:Ce});for(var Le=0;Le<ge.length;++Le){var Oe=ge[Le],vt=void 0;if(Ce.push({from:Oe.from,to:Oe.to,text:Oe.text}),z)for(var Et in Oe)(vt=Et.match(/^spans_(\d+)$/))&&gt(z,Number(vt[1]))>-1&&(Zt(Ce)[Et]=Oe[Et],delete Oe[Et])}}return te}function Vc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var ce=Ct(z,ie)<0;ce!=Ct(ne,ie)<0?(ie=z,z=ne):ce!=Ct(z,ne)<0&&(z=ne)}return new Ni(ie,z)}else return new Ni(ne||z,z)}function sl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),Ca(x,new go([Vc(x.sel.primary(),z,ne,ie)],0),te)}function Nr(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),ce=0;ce<x.sel.ranges.length;ce++)te[ce]=Vc(x.sel.ranges[ce],z[ce],null,ie);var ge=Io(x.cm,te,x.sel.primIndex);Ca(x,ge,ne)}function So(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,Ca(x,Io(x.cm,ie,x.sel.primIndex),te)}function Zu(x,z,ne,te){Ca(x,$o(z,ne),te)}function Yd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var ce=0;ce<ie.length;ce++)this.ranges[ce]=new Ni(tn(x,ie[ce].anchor),tn(x,ie[ce].head))},origin:ne&&ne.origin};return St(x,"beforeSelectionChange",x,te),x.cm&&St(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Io(x.cm,te.ranges,te.ranges.length-1):z}function no(x,z,ne){var te=x.history.done,ie=Zt(te);ie&&ie.ranges?(te[te.length-1]=z,nc(x,z,ne)):Ca(x,z,ne)}function Ca(x,z,ne){nc(x,z,ne),Wc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function nc(x,z,ne){(Ln(x,"beforeSelectionChange")||x.cm&&Ln(x.cm,"beforeSelectionChange"))&&(z=Yd(x,z,ne));var te=ne&&ne.bias||(Ct(z.primary().head,x.sel.primary().head)<0?-1:1);Jd(x,ll(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&Qs(x.cm)}function Jd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Dn(x.cm)),Or(x,"cursorActivity",x))}function qd(x){Jd(x,ll(x,x.sel,null,!1))}function ll(x,z,ne,te){for(var ie,ce=0;ce<z.ranges.length;ce++){var ge=z.ranges[ce],Ce=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[ce],Le=Gc(x,ge.anchor,Ce&&Ce.anchor,ne,te),Oe=Gc(x,ge.head,Ce&&Ce.head,ne,te);(ie||Le!=ge.anchor||Oe!=ge.head)&&(ie||(ie=z.ranges.slice(0,ce)),ie[ce]=new Ni(Le,Oe))}return ie?Io(x.cm,ie,z.primIndex):z}function ro(x,z,ne,te,ie){var ce=Ge(x,z.line);if(ce.markedSpans)for(var ge=0;ge<ce.markedSpans.length;++ge){var Ce=ce.markedSpans[ge],Le=Ce.marker,Oe="selectLeft"in Le?!Le.selectLeft:Le.inclusiveLeft,vt="selectRight"in Le?!Le.selectRight:Le.inclusiveRight;if((Ce.from==null||(Oe?Ce.from<=z.ch:Ce.from<z.ch))&&(Ce.to==null||(vt?Ce.to>=z.ch:Ce.to>z.ch))){if(ie&&(St(Le,"beforeCursorEnter"),Le.explicitlyCleared))if(ce.markedSpans){--ge;continue}else break;if(!Le.atomic)continue;if(ne){var Et=Le.find(te<0?1:-1),sn=void 0;if((te<0?vt:Oe)&&(Et=hs(x,Et,-te,Et&&Et.line==z.line?ce:null)),Et&&Et.line==z.line&&(sn=Ct(Et,ne))&&(te<0?sn<0:sn>0))return ro(x,Et,z,te,ie)}var nn=Le.find(te<0?-1:1);return(te<0?Oe:vt)&&(nn=hs(x,nn,te,nn.line==z.line?ce:null)),nn?ro(x,nn,z,te,ie):null}}return z}function Gc(x,z,ne,te,ie){var ce=te||1,ge=ro(x,z,ne,ce,ie)||!ie&&ro(x,z,ne,ce,!0)||ro(x,z,ne,-ce,ie)||!ie&&ro(x,z,ne,-ce,!0);return ge||(x.cantEdit=!0,pt(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?tn(x,pt(z.line-1)):null:ne>0&&z.ch==(te||Ge(x,z.line)).text.length?z.line<x.first+x.size-1?pt(z.line+1,0):null:new pt(z.line,z.ch+ne)}function ju(x){x.setSelection(pt(x.firstLine(),0),pt(x.lastLine()),qe)}function Uc(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(ie,ce,ge,Ce){ie&&(te.from=tn(x,ie)),ce&&(te.to=tn(x,ce)),ge&&(te.text=ge),Ce!==void 0&&(te.origin=Ce)}),St(x,"beforeChange",x,te),x.cm&&St(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 Sa(x.cm,Ds)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((Ln(x,"beforeChange")||x.cm&&Ln(x.cm,"beforeChange"))&&(z=Uc(x,z,!0),!z))){var te=xr&&!ne&&Xn(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)Vu(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else Vu(x,z)}}function Vu(x,z){if(!(z.text.length==1&&z.text[0]==""&&Ct(z.from,z.to)==0)){var ne=Oc(x,z);ec(x,z,ne,x.cm?x.cm.curOp.id:NaN),cl(x,z,ne,kn(x,z));var te=[];ds(x,function(ie,ce){!ce&&gt(te,ie.history)==-1&&(rc(ie.history,z),te.push(ie.history)),cl(ie,z,null,kn(ie,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,ce,ge=x.sel,Ce=z=="undo"?ie.done:ie.undone,Le=z=="undo"?ie.undone:ie.done,Oe=0;Oe<Ce.length&&(ce=Ce[Oe],!(ne?ce.ranges&&!ce.equals(x.sel):!ce.ranges));Oe++);if(Oe!=Ce.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(ce=Ce.pop(),ce.ranges){if(tc(ce,Le),ne&&!ce.equals(x.sel)){Ca(x,ce,{clearRedo:!1});return}ge=ce}else if(te){Ce.push(ce);return}else break;var vt=[];tc(ge,Le),Le.push({changes:vt,generation:ie.generation}),ie.generation=ce.generation||++ie.maxGeneration;for(var Et=Ln(x,"beforeChange")||x.cm&&Ln(x.cm,"beforeChange"),sn=function(Vn){var vr=ce.changes[Vn];if(vr.origin=z,Et&&!Uc(x,vr,!1))return Ce.length=0,{};vt.push(zc(x,vr));var Dr=Vn?Oc(x,vr):Zt(Ce);cl(x,vr,Dr,Wu(x,vr)),!Vn&&x.cm&&x.cm.scrollIntoView({from:vr.from,to:us(vr)});var Rr=[];ds(x,function(Mr,$r){!$r&&gt(Rr,Mr.history)==-1&&(rc(Mr.history,vr),Rr.push(Mr.history)),cl(Mr,vr,null,Wu(Mr,vr))})},nn=ce.changes.length-1;nn>=0;--nn){var Bn=sn(nn);if(Bn)return Bn.v}}}}function Xc(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Vt(x.sel.ranges,function(ie){return new Ni(pt(ie.anchor.line+z,ie.anchor.ch),pt(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){za(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 cl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return Sa(x.cm,cl)(x,z,ne,te);if(z.to.line<x.first){Xc(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 ie=z.text.length-1-(x.first-z.from.line);Xc(x,ie),z={from:pt(x.first,0),to:pt(z.to.line+ie,z.to.ch),text:[Zt(z.text)],origin:z.origin}}var ce=x.lastLine();z.to.line>ce&&(z={from:z.from,to:pt(ce,Ge(x,ce).text.length),text:[z.text[0]],origin:z.origin}),z.removed=ut(x,z.from,z.to),ne||(ne=Oc(x,z)),x.cm?Qd(x.cm,z,te):Nc(x,z,te),nc(x,ne,qe),x.cantEdit&&Gc(x,pt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,ce=z.from,ge=z.to,Ce=!1,Le=ce.line;x.options.lineWrapping||(Le=ct(Lr(Ge(te,ce.line))),te.iter(Le,ge.line+1,function(nn){if(nn==ie.maxLine)return Ce=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Dn(x),Nc(te,z,ne,Ya(x)),x.options.lineWrapping||(te.iter(Le,ce.line+z.text.length,function(nn){var Bn=Un(nn);Bn>ie.maxLineLength&&(ie.maxLine=nn,ie.maxLineLength=Bn,ie.maxLineChanged=!0,Ce=!1)}),Ce&&(x.curOp.updateMaxLine=!0)),Wn(te,ce.line),nl(x,400);var Oe=z.text.length-(ge.line-ce.line)-1;z.full?za(x):ce.line==ge.line&&z.text.length==1&&!Ku(x.doc,z)?Ao(x,ce.line,"text"):za(x,ce.line,ge.line+1,Oe);var vt=Ln(x,"changes"),Et=Ln(x,"change");if(Et||vt){var sn={from:ce,to:ge,text:z.text,removed:z.removed,origin:z.origin};Et&&Or(x,"change",x,sn),vt&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(sn)}x.display.selForContextMenu=null}function Ml(x,z,ne,te,ie){var ce;te||(te=ne),Ct(te,ne)<0&&(ce=[te,ne],ne=ce[0],te=ce[1]),typeof z=="string"&&(z=x.splitLines(z)),Ds(x,{from:ne,to:te,text:z,origin:ie})}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 ie=0;ie<x.length;++ie){var ce=x[ie],ge=!0;if(ce.ranges){ce.copied||(ce=x[ie]=ce.deepCopy(),ce.copied=!0);for(var Ce=0;Ce<ce.ranges.length;Ce++)eh(ce.ranges[Ce].anchor,z,ne,te),eh(ce.ranges[Ce].head,z,ne,te);continue}for(var Le=0;Le<ce.changes.length;++Le){var Oe=ce.changes[Le];if(ne<Oe.from.line)Oe.from=pt(Oe.from.line+te,Oe.from.ch),Oe.to=pt(Oe.to.line+te,Oe.to.ch);else if(z<=Oe.to.line){ge=!1;break}}ge||(x.splice(0,ie+1),ie=0)}}function rc(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;th(x.done,ne,te,ie),th(x.undone,ne,te,ie)}function ic(x,z,ne,te){var ie=z,ce=z;return typeof z=="number"?ce=Ge(x,On(x,z)):ie=ct(z),ie==null?null:(te(ce,ie)&&x.cm&&Ao(x.cm,ie,ne),ce)}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 ie=this.lines[ne];this.height-=ie.height,li(ie),Or(ie,"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 _l(x){this.children=x;for(var z=0,ne=0,te=0;te<x.length;++te){var ie=x[te];z+=ie.chunkSize(),ne+=ie.height,ie.parent=this}this.size=z,this.height=ne,this.parent=null}_l.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],ie=te.chunkSize();if(x<ie){var ce=Math.min(z,ie-x),ge=te.height;if(te.removeInner(x,ce),this.height-=ge-te.height,ie==ce&&(this.children.splice(ne--,1),te.parent=null),(z-=ce)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof As))){var Ce=[];this.collapse(Ce),this.children=[new As(Ce)],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 ie=this.children[te],ce=ie.chunkSize();if(x<=ce){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var ge=ie.lines.length%25+25,Ce=ge;Ce<ie.lines.length;){var Le=new As(ie.lines.slice(Ce,Ce+=25));ie.height-=Le.height,this.children.splice(++te,0,Le),Le.parent=this}ie.lines=ie.lines.slice(0,ge),this.maybeSpill()}break}x-=ce}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new _l(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=gt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new _l(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 ie=this.children[te],ce=ie.chunkSize();if(x<ce){var ge=Math.min(z,ce-x);if(ie.iterN(x,ge,ne))return!0;if((z-=ge)==0)break;x=0}else x-=ce}}};var El=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};El.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=ct(ne);if(!(te==null||!z)){for(var ie=0;ie<z.length;++ie)z[ie]==this&&z.splice(ie--,1);z.length||(ne.widgets=null);var ce=ao(this);ze(ne,Math.max(0,ne.height-ce)),x&&(pa(x,function(){nh(x,ne,-ce),Ao(x,te,"widget")}),Or(x,"lineWidgetCleared",x,this,te))}},El.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=ao(this)-z;ie&&(gi(this.doc,te)||ze(te,te.height+ie),ne&&pa(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,ie),Or(ne,"lineWidgetChanged",ne,x,ct(te))}))},In(El);function nh(x,z,ne){Zn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&Lc(x,ne)}function rh(x,z,ne,te){var ie=new El(x,ne,te),ce=x.cm;return ce&&ie.noHScroll&&(ce.display.alignWidgets=!0),ic(x,z,"widget",function(ge){var Ce=ge.widgets||(ge.widgets=[]);if(ie.insertAt==null?Ce.push(ie):Ce.splice(Math.min(Ce.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=ge,ce&&!gi(x,ge)){var Le=Zn(ge)<x.scrollTop;ze(ge,ge.height+ao(ie)),Le&&Lc(ce,ie.height),ce.curOp.forceUpdate=!0}return!0}),ce&&Or(ce,"lineWidgetAdded",ce,ie,typeof z=="number"?z:ct(z)),ie}var ih=0,Ts=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++ih};Ts.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ls(x),Ln(this,"clear")){var ne=this.find();ne&&Or(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,ce=0;ce<this.lines.length;++ce){var ge=this.lines[ce],Ce=hr(ge.markedSpans,this);x&&!this.collapsed?Ao(x,ct(ge),"text"):x&&(Ce.to!=null&&(ie=ct(ge)),Ce.from!=null&&(te=ct(ge))),ge.markedSpans=tr(ge.markedSpans,Ce),Ce.from==null&&this.collapsed&&!gi(this.doc,ge)&&x&&ze(ge,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Le=0;Le<this.lines.length;++Le){var Oe=Lr(this.lines[Le]),vt=Un(Oe);vt>x.display.maxLineLength&&(x.display.maxLine=Oe,x.display.maxLineLength=vt,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&za(x,te,ie+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&qd(x.doc)),x&&Or(x,"markerCleared",x,this,te,ie),z&&cs(x),this.parent&&this.parent.clear()}},Ts.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var ce=this.lines[ie],ge=hr(ce.markedSpans,this);if(ge.from!=null&&(ne=pt(z?ce:ct(ce),ge.from),x==-1))return ne;if(ge.to!=null&&(te=pt(z?ce:ct(ce),ge.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||pa(te,function(){var ie=z.line,ce=ct(z.line),ge=Xa(te,ce);if(ge&&(zi(ge),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!gi(ne.doc,ie)&&ne.height!=null){var Ce=ne.height;ne.height=null;var Le=ao(ne)-Ce;Le&&ze(ie,ie.height+Le)}Or(te,"markerChanged",te,x)})},Ts.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||gt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Ts.prototype.detachLine=function(x){if(this.lines.splice(gt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},In(Ts);function ps(x,z,ne,te,ie){if(te&&te.shared)return ra(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return Sa(x.cm,ps)(x,z,ne,te,ie);var ce=new Ts(x,ie),ge=Ct(z,ne);if(te&&bt(te,ce,!1),ge>0||ge==0&&ce.clearWhenEmpty!==!1)return ce;if(ce.replacedWith&&(ce.collapsed=!0,ce.widgetNode=Nt("span",[ce.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||ce.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(ce.widgetNode.insertLeft=!0)),ce.collapsed){if(Ir(x,z.line,z,ne,ce)||z.line!=ne.line&&Ir(x,ne.line,z,ne,ce))throw new Error("Inserting collapsed marker partially overlapping an existing one");Gn()}ce.addToHistory&&ec(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Ce=z.line,Le=x.cm,Oe;if(x.iter(Ce,ne.line+1,function(Et){Le&&ce.collapsed&&!Le.options.lineWrapping&&Lr(Et)==Le.display.maxLine&&(Oe=!0),ce.collapsed&&Ce!=z.line&&ze(Et,0),_r(Et,new Jn(ce,Ce==z.line?z.ch:null,Ce==ne.line?ne.ch:null)),++Ce}),ce.collapsed&&x.iter(z.line,ne.line+1,function(Et){gi(x,Et)&&ze(Et,0)}),ce.clearOnEnter&&on(ce,"beforeCursorEnter",function(){return ce.clear()}),ce.readOnly&&(mr(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),ce.collapsed&&(ce.id=++ih,ce.atomic=!0),Le){if(Oe&&(Le.curOp.updateMaxLine=!0),ce.collapsed)za(Le,z.line,ne.line+1);else if(ce.className||ce.startStyle||ce.endStyle||ce.css||ce.attributes||ce.title)for(var vt=z.line;vt<=ne.line;vt++)Ao(Le,vt,"text");ce.atomic&&qd(Le.doc),Or(Le,"markerAdded",Le,ce)}return ce}var xi=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};xi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Or(this,"clear")}},xi.prototype.find=function(x,z){return this.primary.find(x,z)},In(xi);function ra(x,z,ne,te,ie){te=bt(te),te.shared=!1;var ce=[ps(x,z,ne,te,ie)],ge=ce[0],Ce=te.widgetNode;return ds(x,function(Le){Ce&&(te.widgetNode=Ce.cloneNode(!0)),ce.push(ps(Le,tn(Le,z),tn(Le,ne),te,ie));for(var Oe=0;Oe<Le.linked.length;++Oe)if(Le.linked[Oe].isParent)return;ge=Zt(ce)}),new xi(ce,ge)}function Is(x){return x.findMarks(pt(x.first,0),x.clipPos(pt(x.lastLine())),function(z){return z.parent})}function ah(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),ce=x.clipPos(ie.from),ge=x.clipPos(ie.to);if(Ct(ce,ge)){var Ce=ps(x,ce,ge,te.primary,te.primary.type);te.markers.push(Ce),Ce.parent=te}}}function Co(x){for(var z=function(te){var ie=x[te],ce=[ie.primary.doc];ds(ie.primary.doc,function(Le){return ce.push(Le)});for(var ge=0;ge<ie.markers.length;ge++){var Ce=ie.markers[ge];gt(ce,Ce.doc)==-1&&(Ce.parent=null,ie.markers.splice(ge--,1))}},ne=0;ne<x.length;ne++)z(ne)}var oh=0,ya=function(x,z,ne,te,ie){if(!(this instanceof ya))return new ya(x,z,ne,te,ie);ne==null&&(ne=0),_l.call(this,[new As([new ur("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var ce=pt(ne,0);this.sel=$o(ce),this.history=new Ql(null),this.id=++oh,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),Nc(this,{from:ce,to:ce,text:x}),Ca(this,$o(ce),qe)};ya.prototype=se(_l.prototype,{constructor:ya,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=nt(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Ia(function(x){var z=pt(this.first,0),ne=this.first+this.size-1;Ds(this,{from:z,to:pt(ne,Ge(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),Ca(this,$o(z),qe)}),replaceRange:function(x,z,ne,te){z=tn(this,z),ne=ne?tn(this,ne):z,Ml(this,x,z,ne,te)},getRange:function(x,z,ne){var te=ut(this,tn(this,x),tn(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(Rt(this,x))return Ge(this,x)},getLineNumber:function(x){return ct(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Ge(this,x)),Lr(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return tn(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:Ia(function(x,z,ne){Zu(this,tn(this,typeof x=="number"?pt(x,z||0):x),null,ne)}),setSelection:Ia(function(x,z,ne){Zu(this,tn(this,x),tn(this,z||x),ne)}),extendSelection:Ia(function(x,z,ne){sl(this,tn(this,x),z&&tn(this,z),ne)}),extendSelections:Ia(function(x,z){Nr(this,Ue(this,x),z)}),extendSelectionsBy:Ia(function(x,z){var ne=Vt(this.sel.ranges,x);Nr(this,Ue(this,ne),z)}),setSelections:Ia(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Ni(tn(this,x[ie].anchor),tn(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),Ca(this,Io(this.cm,te,z),ne)}}),addSelection:Ia(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Ni(tn(this,x),tn(this,z||x))),Ca(this,Io(this.cm,te,te.length-1),ne)}),getSelection:function(x){for(var z=this.sel.ranges,ne,te=0;te<z.length;te++){var ie=ut(this,z[te].from(),z[te].to());ne=ne?ne.concat(ie):ie}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 ie=ut(this,ne[te].from(),ne[te].to());x!==!1&&(ie=ie.join(x||this.lineSeparator())),z[te]=ie}return z},replaceSelection:function(x,z,ne){for(var te=[],ie=0;ie<this.sel.ranges.length;ie++)te[ie]=x;this.replaceSelections(te,z,ne||"+input")},replaceSelections:Ia(function(x,z,ne){for(var te=[],ie=this.sel,ce=0;ce<ie.ranges.length;ce++){var ge=ie.ranges[ce];te[ce]={from:ge.from(),to:ge.to(),text:this.splitLines(x[ce]),origin:ne}}for(var Ce=z&&z!="end"&&Rc(this,te,z),Le=te.length-1;Le>=0;Le--)Ds(this,te[Le]);Ce?no(this,Ce):this.cm&&Qs(this.cm)}),undo:Ia(function(){fs(this,"undo")}),redo:Ia(function(){fs(this,"redo")}),undoSelection:Ia(function(){fs(this,"undo",!0)}),redoSelection:Ia(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 ie=0;ie<x.undone.length;ie++)x.undone[ie].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:Ia(function(x,z,ne){return ic(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&le(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:Ia(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&ic(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,le(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!Rt(this,x)||(z=x,x=Ge(this,x),!x))return null}else if(z=ct(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:Ia(function(x,z,ne){return ic(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass";if(!te[ie])te[ie]=ne;else{if(Me(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:Ia(function(x,z,ne){return ic(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",ce=te[ie];if(ce)if(ne==null)te[ie]=null;else{var ge=ce.match(Me(ne));if(!ge)return!1;var Ce=ge.index+ge[0].length;te[ie]=ce.slice(0,ge.index)+(!ge.index||Ce==ce.length?"":" ")+ce.slice(Ce)||null}else return!1;return!0})}),addLineWidget:Ia(function(x,z,ne){return rh(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return ps(this,tn(this,x),tn(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=tn(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=tn(this,x);var z=[],ne=Ge(this,x.line).markedSpans;if(ne)for(var te=0;te<ne.length;++te){var ie=ne[te];(ie.from==null||ie.from<=x.ch)&&(ie.to==null||ie.to>=x.ch)&&z.push(ie.marker.parent||ie.marker)}return z},findMarks:function(x,z,ne){x=tn(this,x),z=tn(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(ce){var ge=ce.markedSpans;if(ge)for(var Ce=0;Ce<ge.length;Ce++){var Le=ge[Ce];!(Le.to!=null&&ie==x.line&&x.ch>=Le.to||Le.from==null&&ie!=x.line||Le.from!=null&&ie==z.line&&Le.from>=z.ch)&&(!ne||ne(Le.marker))&&te.push(Le.marker.parent||Le.marker)}++ie}),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(ie){var ce=ie.text.length+te;if(ce>x)return z=x,!0;x-=ce,++ne}),tn(this,pt(ne,z))},indexFromPos:function(x){x=tn(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 ya(nt(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 ya(nt(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,Is(this)),te},unlinkDoc:function(x){if(x instanceof oi&&(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(Is(this));break}}if(x.history==this.history){var te=[x.id];ds(x,function(ie){return te.push(ie.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):qr(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ia(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&Fc(this.cm))})}),ya.prototype.eachLine=ya.prototype.iter;var Gu=0;function Qh(x){var z=this;if(kl(z),!($t(z,x)||oo(z.display,x))){qn(x),be&&(Gu=+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 ie=te.length,ce=Array(ie),ge=0,Ce=function(){++ge==ie&&Sa(z,function(){ne=tn(z.doc,ne);var nn={from:ne,to:ne,text:z.doc.splitLines(ce.filter(function(Bn){return Bn!=null}).join(z.doc.lineSeparator())),origin:"paste"};Ds(z.doc,nn),no(z.doc,$o(tn(z.doc,ne),tn(z.doc,us(nn))))})()},Le=function(nn,Bn){if(z.options.allowDropFileTypes&&gt(z.options.allowDropFileTypes,nn.type)==-1){Ce();return}var Vn=new FileReader;Vn.onerror=function(){return Ce()},Vn.onload=function(){var vr=Vn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(vr)){Ce();return}ce[Bn]=vr,Ce()},Vn.readAsText(nn)},Oe=0;Oe<te.length;Oe++)Le(te[Oe],Oe);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 vt=x.dataTransfer.getData("Text");if(vt){var Et;if(z.state.draggingText&&!z.state.draggingText.copy&&(Et=z.listSelections()),nc(z.doc,$o(ne,ne)),Et)for(var sn=0;sn<Et.length;++sn)Ml(z.doc,"",Et[sn].anchor,Et[sn].head,"drag");z.replaceSelection(vt,"around","paste"),z.display.input.focus()}}catch(nn){}}}}function ef(x,z){if(be&&(!x.state.draggingText||+new Date-Gu<100)){Er(z);return}if(!($t(x,z)||oo(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!dt)){var ne=Xe("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 Uu(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();Eu(x,ne,te),x.display.dragCursor||(x.display.dragCursor=Xe("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),Mt(x.display.dragCursor,te)}}function kl(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 ie=z[te].CodeMirror;ie&&ne.push(ie)}ne.length&&ne[0].operation(function(){for(var ce=0;ce<ne.length;ce++)x(ne[ce])})}}var cr=!1;function Xu(){cr||(Yc(),cr=!0)}function Yc(){var x;on(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(Jc)},100))}),on(window,"blur",function(){return Ll(qs)})}function Jc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var No={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"},ac=0;ac<10;ac++)No[ac+48]=No[ac+96]=String(ac);for(var qc=65;qc<=90;qc++)No[qc]=String.fromCharCode(qc);for(var oc=1;oc<=12;oc++)No[oc+111]=No[oc+63235]="F"+oc;var Xi={};Xi.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"},Xi.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"},Xi.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"},Xi.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"]},Xi.default=at?Xi.macDefault:Xi.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,ce,ge=0;ge<z.length-1;ge++){var Ce=z[ge];if(/^(cmd|meta|m)$/i.test(Ce))ce=!0;else if(/^a(lt)?$/i.test(Ce))ne=!0;else if(/^(c|ctrl|control)$/i.test(Ce))te=!0;else if(/^s(hift)?$/i.test(Ce))ie=!0;else throw new Error("Unrecognized modifier name: "+Ce)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),ce&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function Yu(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 ie=Vt(ne.split(" "),tf),ce=0;ce<ie.length;ce++){var ge=void 0,Ce=void 0;ce==ie.length-1?(Ce=ie.join(" "),ge=te):(Ce=ie.slice(0,ce+1).join(" "),ge="...");var Le=z[Ce];if(!Le)z[Ce]=ge;else if(Le!=ge)throw new Error("Inconsistent bindings for "+Ce)}delete x[ne]}for(var Oe in z)x[Oe]=z[Oe];return x}function ms(x,z,ne,te){z=io(z);var ie=z.call?z.call(x,te):z[x];if(ie===!1)return"nothing";if(ie==="...")return"multi";if(ie!=null&&ne(ie))return"handled";if(z.fallthrough){if(Object.prototype.toString.call(z.fallthrough)!="[object Array]")return ms(x,z.fallthrough,ne,te);for(var ce=0;ce<z.fallthrough.length;ce++){var ge=ms(x,z.fallthrough[ce],ne,te);if(ge)return ge}}}function sc(x){var z=typeof x=="string"?x:No[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),(mt?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(mt?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function ul(x,z){if(Ne&&x.keyCode==34&&x.char)return!1;var ne=No[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),Ps(ne,x,z))}function io(x){return typeof x=="string"?Xi[x]:x}function Po(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var ce=z(ne[ie]);te.length&&Ct(ce.from,Zt(te).to)<=0;){var ge=te.pop();if(Ct(ge.from,ce.from)<0){ce.from=ge.from;break}}te.push(ce)}pa(x,function(){for(var Ce=te.length-1;Ce>=0;Ce--)Ml(x.doc,"",te[Ce].from,te[Ce].to,"+delete");Qs(x)})}function Ha(x,z,ne){var te=Ot(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Go(x,z,ne){var te=Ha(x,z.ch,ne);return te==null?null:new pt(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var ce=Sn(ne,z.doc.direction);if(ce){var ge=ie<0?Zt(ce):ce[0],Ce=ie<0==(ge.level==1),Le=Ce?"after":"before",Oe;if(ge.level>0||z.doc.direction=="rtl"){var vt=Oa(z,ne);Oe=ie<0?ne.text.length-1:0;var Et=Bi(z,vt,Oe).top;Oe=It(function(sn){return Bi(z,vt,sn).top==Et},ie<0==(ge.level==1)?ge.from:ge.to-1,Oe),Le=="before"&&(Oe=Ha(ne,Oe,1))}else Oe=ie<0?ge.to:ge.from;return new pt(te,Oe,Le)}}return new pt(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Uo(x,z,ne,te){var ie=Sn(z,x.doc.direction);if(!ie)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 ce=an(ie,ne.ch,ne.sticky),ge=ie[ce];if(x.doc.direction=="ltr"&&ge.level%2==0&&(te>0?ge.to>ne.ch:ge.from<ne.ch))return Go(z,ne,te);var Ce=function(Dr,Rr){return Ha(z,Dr instanceof pt?Dr.ch:Dr,Rr)},Le,Oe=function(Dr){return x.options.lineWrapping?(Le=Le||Oa(x,z),Hl(x,z,Le,Dr)):{begin:0,end:z.text.length}},vt=Oe(ne.sticky=="before"?Ce(ne,-1):ne.ch);if(x.doc.direction=="rtl"||ge.level==1){var Et=ge.level==1==te<0,sn=Ce(ne,Et?1:-1);if(sn!=null&&(Et?sn<=ge.to&&sn<=vt.end:sn>=ge.from&&sn>=vt.begin)){var nn=Et?"before":"after";return new pt(ne.line,sn,nn)}}var Bn=function(Dr,Rr,Mr){for(var $r=function(Ji,Na){return Na?new pt(ne.line,Ce(Ji,1),"before"):new pt(ne.line,Ji,"after")};Dr>=0&&Dr<ie.length;Dr+=Rr){var Jr=ie[Dr],ei=Rr>0==(Jr.level!=1),wi=ei?Mr.begin:Ce(Mr.end,-1);if(Jr.from<=wi&&wi<Jr.to||(wi=ei?Jr.from:Ce(Jr.to,-1),Mr.begin<=wi&&wi<Mr.end))return $r(wi,ei)}},Vn=Bn(ce+te,te,vt);if(Vn)return Vn;var vr=te>0?vt.end:Ce(vt.begin,-1);return vr!=null&&!(te>0&&vr==z.text.length)&&(Vn=Bn(te>0?0:ie.length-1,te,Oe(vr)),Vn)?Vn:null}var Dl={selectAll:ju,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),qe)},killLine:function(x){return Po(x,function(z){if(z.empty()){var ne=Ge(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:pt(z.head.line+1,0)}:{from:z.head,to:pt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Po(x,function(z){return{from:pt(z.from().line,0),to:tn(x.doc,pt(z.to().line+1,0))}})},delLineLeft:function(x){return Po(x,function(z){return{from:pt(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(pt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(pt(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return Ju(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 qu(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")},Lt)},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")},Lt)},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},Lt)},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,ie=0;ie<ne.length;ie++){var ce=ne[ie].from(),ge=$e(x.getLine(ce.line),ce.ch,te);z.push(dn(te-ge%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return pa(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,ce=Ge(x.doc,ie.line).text;if(ce){if(ie.ch==ce.length&&(ie=new pt(ie.line,ie.ch-1)),ie.ch>0)ie=new pt(ie.line,ie.ch+1),x.replaceRange(ce.charAt(ie.ch-1)+ce.charAt(ie.ch-2),pt(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var ge=Ge(x.doc,ie.line-1).text;ge&&(ie=new pt(ie.line,1),x.replaceRange(ce.charAt(0)+x.doc.lineSeparator()+ge.charAt(ge.length-1),pt(ie.line-1,ge.length-1),ie,"+transpose"))}}ne.push(new Ni(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return pa(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 Ju(x,z){var ne=Ge(x.doc,z),te=Lr(ne);return te!=ne&&(z=ct(te)),dl(!0,x,te,z,1)}function qu(x,z){var ne=Ge(x.doc,z),te=ti(ne);return te!=ne&&(z=ct(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=Ju(x,z.line),te=Ge(x.doc,ne.line),ie=Sn(te,x.doc.direction);if(!ie||ie[0].level==0){var ce=Math.max(ne.ch,te.text.search(/\S/)),ge=z.line==ne.line&&z.ch<=ce&&z.ch;return pt(ne.line,ge?0:ce,ne.sticky)}return ne}function Ma(x,z,ne){if(typeof z=="string"&&(z=Dl[z],!z))return!1;x.display.input.ensurePolled();var te=x.display.shift,ie=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),ne&&(x.display.shift=!1),ie=z(x)!=Wt}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Xo(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=ms(z,x.state.keyMaps[te],ne,x);if(ie)return ie}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 ie=x.state.keySeq;if(ie){if(sc(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:nf.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),Qc(x,ie+" "+z,ne,te))return!0}return Qc(x,z,ne,te)}function Qc(x,z,ne,te){var ie=Xo(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Or(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(qn(ne),Ec(x)),!!ie}function _i(x,z){var ne=ul(z,!0);return ne?z.shiftKey&&!x.state.keySeq?Al(x,"Shift-"+ne,z,function(te){return Ma(x,te,!0)})||Al(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Ma(x,te)}):Al(x,ne,z,function(te){return Ma(x,te)}):!1}function Tl(x,z,ne){return Al(x,"'"+ne+"'",z,function(te){return Ma(x,te,!0)})}var gs=null;function lc(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=et(),!$t(z,x))){be&&De<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=_i(z,x);Ne&&(gs=te?ne:null,!te&&ne==88&&!yn&&(at?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),fe&&!at&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Tn(z)}}function Tn(x){var z=x.display.lineDiv;Ut(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ke(z,"CodeMirror-crosshair"),ot(document,"keyup",ne),ot(document,"mouseover",ne))}on(document,"keyup",ne),on(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),$t(this,x)}function ch(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(oo(z.display,x)||$t(z,x)||x.ctrlKey&&!x.altKey||at&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Ne&&ne==gs){gs=null,qn(x);return}if(!(Ne&&(!x.which||x.which<10)&&_i(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(Tl(z,x,ie)||z.display.input.onKeyPress(x))}}}var Qu=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+Qu>x&&Ct(z,this.pos)==0&&ne==this.button};var vs,cc;function rf(x,z){var ne=+new Date;return cc&&cc.compare(ne,x,z)?(vs=cc=null,"triple"):vs&&vs.compare(ne,x,z)?(cc=new ed(ne,x,z),vs=null,"double"):(vs=new ed(ne,x,z),cc=null,"single")}function Wa(x){var z=this,ne=z.display;if(!($t(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,oo(ne,x)){Pe||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!Ja(z,x)){var te=xo(z,x),ie=Qn(x),ce=te?rf(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&Bs(z,ie,te,ce,x))&&(ie==1?te?tu(z,te,ce,x):kr(x)==ne.scroller&&qn(x):ie==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(We?z.display.input.onContextMenu(x):ku(z)))}}}function Bs(x,z,ne,te,ie){var ce="Click";return te=="double"?ce="Double"+ce:te=="triple"&&(ce="Triple"+ce),ce=(z==1?"Left":z==2?"Middle":"Right")+ce,Al(x,Ps(ce,ie),ie,function(ge){if(typeof ge=="string"&&(ge=Dl[ge]),!ge)return!1;var Ce=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Ce=ge(x,ne)!=Wt}finally{x.state.suppressEdits=!1}return Ce})}function eu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var ce=xt?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=ce?"rectangle":z=="single"?"char":z=="double"?"word":"line"}return(ie.extend==null||x.doc.extend)&&(ie.extend=x.doc.extend||ne.shiftKey),ie.addNew==null&&(ie.addNew=at?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(at?ne.altKey:ne.ctrlKey)),ie}function tu(x,z,ne,te){be?setTimeout(Bt(Sl,x),0):x.curOp.focus=et();var ie=eu(x,ne,te),ce=x.doc.sel,ge;x.options.dragDrop&&Kr&&!x.isReadOnly()&&ne=="single"&&(ge=ce.contains(z))>-1&&(Ct((ge=ce.ranges[ge]).from(),z)<0||z.xRel>0)&&(Ct(ge.to(),z)>0||z.xRel<0)?af(x,te,z,ie):td(x,te,z,ie)}function af(x,z,ne,te){var ie=x.display,ce=!1,ge=Sa(x,function(Oe){Pe&&(ie.scroller.draggable=!1),x.state.draggingText=!1,ot(ie.wrapper.ownerDocument,"mouseup",ge),ot(ie.wrapper.ownerDocument,"mousemove",Ce),ot(ie.scroller,"dragstart",Le),ot(ie.scroller,"drop",ge),ce||(qn(Oe),te.addNew||sl(x.doc,ne,null,null,te.extend),Pe&&!dt||be&&De==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Ce=function(Oe){ce=ce||Math.abs(z.clientX-Oe.clientX)+Math.abs(z.clientY-Oe.clientY)>=10},Le=function(){return ce=!0};Pe&&(ie.scroller.draggable=!0),x.state.draggingText=ge,ge.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),on(ie.wrapper.ownerDocument,"mouseup",ge),on(ie.wrapper.ownerDocument,"mousemove",Ce),on(ie.scroller,"dragstart",Le),on(ie.scroller,"drop",ge),ku(x),setTimeout(function(){return ie.input.focus()},20)}function uh(x,z,ne){if(ne=="char")return new Ni(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Ni(pt(z.line,0),tn(x.doc,pt(z.line+1,0)));var te=ne(x,z);return new Ni(te.from,te.to)}function td(x,z,ne,te){var ie=x.display,ce=x.doc;qn(z);var ge,Ce,Le=ce.sel,Oe=Le.ranges;if(te.addNew&&!te.extend?(Ce=ce.sel.contains(ne),Ce>-1?ge=Oe[Ce]:ge=new Ni(ne,ne)):(ge=ce.sel.primary(),Ce=ce.sel.primIndex),te.unit=="rectangle")te.addNew||(ge=new Ni(ne,ne)),ne=xo(x,z,!0,!0),Ce=-1;else{var vt=uh(x,ne,te.unit);te.extend?ge=Vc(ge,vt.anchor,vt.head,te.extend):ge=vt}te.addNew?Ce==-1?(Ce=Oe.length,Ca(ce,Io(x,Oe.concat([ge]),Ce),{scroll:!1,origin:"*mouse"})):Oe.length>1&&Oe[Ce].empty()&&te.unit=="char"&&!te.extend?(Ca(ce,Io(x,Oe.slice(0,Ce).concat(Oe.slice(Ce+1)),0),{scroll:!1,origin:"*mouse"}),Le=ce.sel):So(ce,Ce,ge,Ye):(Ce=0,Ca(ce,new go([ge],0),Ye),Le=ce.sel);var Et=ne;function sn(Mr){if(Ct(Et,Mr)!=0)if(Et=Mr,te.unit=="rectangle"){for(var $r=[],Jr=x.options.tabSize,ei=$e(Ge(ce,ne.line).text,ne.ch,Jr),wi=$e(Ge(ce,Mr.line).text,Mr.ch,Jr),Ji=Math.min(ei,wi),Na=Math.max(ei,wi),da=Math.min(ne.line,Mr.line),co=Math.min(x.lastLine(),Math.max(ne.line,Mr.line));da<=co;da++){var uo=Ge(ce,da).text,_a=mn(uo,Ji,Jr);Ji==Na?$r.push(new Ni(pt(da,_a),pt(da,_a))):uo.length>_a&&$r.push(new Ni(pt(da,_a),pt(da,mn(uo,Na,Jr))))}$r.length||$r.push(new Ni(ne,ne)),Ca(ce,Io(x,Le.ranges.slice(0,Ce).concat($r),Ce),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Mr)}else{var ho=ge,ui=uh(x,Mr,te.unit),ma=ho.anchor,ha;Ct(ui.anchor,ma)>0?(ha=ui.head,ma=qt(ho.from(),ui.anchor)):(ha=ui.anchor,ma=En(ho.to(),ui.head));var ga=Le.ranges.slice(0);ga[Ce]=dh(x,new Ni(tn(ce,ma),ha)),Ca(ce,Io(x,ga,Ce),Ye)}}var nn=ie.wrapper.getBoundingClientRect(),Bn=0;function Vn(Mr){var $r=++Bn,Jr=xo(x,Mr,!0,te.unit=="rectangle");if(Jr)if(Ct(Jr,Et)!=0){x.curOp.focus=et(),sn(Jr);var ei=Ta(ie,ce);(Jr.line>=ei.to||Jr.line<ei.from)&&setTimeout(Sa(x,function(){Bn==$r&&Vn(Mr)}),150)}else{var wi=Mr.clientY<nn.top?-20:Mr.clientY>nn.bottom?20:0;wi&&setTimeout(Sa(x,function(){Bn==$r&&(ie.scroller.scrollTop+=wi,Vn(Mr))}),50)}}function vr(Mr){x.state.selectingText=!1,Bn=1/0,Mr&&(qn(Mr),ie.input.focus()),ot(ie.wrapper.ownerDocument,"mousemove",Dr),ot(ie.wrapper.ownerDocument,"mouseup",Rr),ce.history.lastSelOrigin=null}var Dr=Sa(x,function(Mr){Mr.buttons===0||!Qn(Mr)?vr(Mr):Vn(Mr)}),Rr=Sa(x,vr);x.state.selectingText=Rr,on(ie.wrapper.ownerDocument,"mousemove",Dr),on(ie.wrapper.ownerDocument,"mouseup",Rr)}function dh(x,z){var ne=z.anchor,te=z.head,ie=Ge(x.doc,ne.line);if(Ct(ne,te)==0&&ne.sticky==te.sticky)return z;var ce=Sn(ie);if(!ce)return z;var ge=an(ce,ne.ch,ne.sticky),Ce=ce[ge];if(Ce.from!=ne.ch&&Ce.to!=ne.ch)return z;var Le=ge+(Ce.from==ne.ch==(Ce.level!=1)?0:1);if(Le==0||Le==ce.length)return z;var Oe;if(te.line!=ne.line)Oe=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var vt=an(ce,te.ch,te.sticky),Et=vt-ge||(te.ch-ne.ch)*(Ce.level==1?-1:1);vt==Le-1||vt==Le?Oe=Et<0:Oe=Et>0}var sn=ce[Le+(Oe?-1:0)],nn=Oe==(sn.level==1),Bn=nn?sn.from:sn.to,Vn=nn?"after":"before";return ne.ch==Bn&&ne.sticky==Vn?z:new Ni(new pt(ne.line,Bn,Vn),te)}function uc(x,z,ne,te){var ie,ce;if(z.touches)ie=z.touches[0].clientX,ce=z.touches[0].clientY;else try{ie=z.clientX,ce=z.clientY}catch(sn){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&qn(z);var ge=x.display,Ce=ge.lineDiv.getBoundingClientRect();if(ce>Ce.bottom||!Ln(x,ne))return ir(z);ce-=Ce.top-ge.viewOffset;for(var Le=0;Le<x.display.gutterSpecs.length;++Le){var Oe=ge.gutters.childNodes[Le];if(Oe&&Oe.getBoundingClientRect().right>=ie){var vt=kt(x.doc,ce),Et=x.display.gutterSpecs[Le];return St(x,ne,x,vt,Et.className,z),ir(z)}}}function Ja(x,z){return uc(x,z,"gutterClick",!0)}function Os(x,z){oo(x.display,z)||hh(x,z)||$t(x,z,"contextmenu")||We||x.display.input.onContextMenu(z)}function hh(x,z){return Ln(x,"gutterContextMenu")?uc(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-"),Ui(x)}var Rs={toString:function(){return"CodeMirror.Init"}},fh={},nu={};function of(x){var z=x.optionHandlers;function ne(te,ie,ce,ge){x.defaults[te]=ie,ce&&(z[te]=ge?function(Ce,Le,Oe){Oe!=Rs&&ce(Ce,Le,Oe)}:ce)}x.defineOption=ne,x.Init=Rs,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,$c(te)},!0),ne("indentUnit",2,$c,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){al(te),Ui(te),za(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var ce=[],ge=te.doc.first;te.doc.iter(function(Le){for(var Oe=0;;){var vt=Le.text.indexOf(ie,Oe);if(vt==-1)break;Oe=vt+ie.length,ce.push(pt(ge,vt))}ge++});for(var Ce=ce.length-1;Ce>=0;Ce--)Ml(te.doc,ie,ce[Ce],pt(ce[Ce].line,ce[Ce].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,ce){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),ce!=Rs&&te.refresh()}),ne("specialCharPlaceholder",Fi,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",it?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ne("spellcheck",!1,function(te,ie){return te.getInputField().spellcheck=ie},!0),ne("autocorrect",!1,function(te,ie){return te.getInputField().autocorrect=ie},!0),ne("autocapitalize",!1,function(te,ie){return te.getInputField().autocapitalize=ie},!0),ne("rtlMoveVisually",!jt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){nd(te),Cl(te)},!0),ne("keyMap","default",function(te,ie,ce){var ge=io(ie),Ce=ce!=Rs&&io(ce);Ce&&Ce.detach&&Ce.detach(te,ge),ge.attach&&ge.attach(te,Ce||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,ph,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=Bc(ie,te.options.lineNumbers),Cl(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?Wi(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return ks(te)},!0),ne("scrollbarStyle","native",function(te){Iu(te),ks(te),te.display.scrollbars.setScrollTop(te.doc.scrollTop),te.display.scrollbars.setScrollLeft(te.doc.scrollLeft)},!0),ne("lineNumbers",!1,function(te,ie){te.display.gutterSpecs=Bc(te.options.gutters,ie),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,ie){ie=="nocursor"&&(qs(te),te.display.input.blur()),te.display.input.readOnlyChanged(ie)}),ne("screenReaderLabel",null,function(te,ie){ie=ie===""?null:ie,te.display.input.screenReaderLabelChanged(ie)}),ne("disableInput",!1,function(te,ie){ie||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,ie){return te.doc.history.undoDepth=ie}),ne("historyEventDelay",1250),ne("viewportMargin",10,function(te){return te.refresh()},!0),ne("maxHighlightLength",1e4,al,!0),ne("moveInputWithCursor",!0,function(te,ie){ie||te.display.input.resetPosition()}),ne("tabindex",null,function(te,ie){return te.display.input.getField().tabIndex=ie||""}),ne("autofocus",null),ne("direction","ltr",function(te,ie){return te.doc.setDirection(ie)},!0),ne("phrases",null)}function sf(x,z,ne){var te=ne&&ne!=Rs;if(!z!=!te){var ie=x.display.dragFunctions,ce=z?on:ot;ce(x.display.scroller,"dragstart",ie.start),ce(x.display.scroller,"dragenter",ie.enter),ce(x.display.scroller,"dragover",ie.over),ce(x.display.scroller,"dragleave",ie.leave),ce(x.display.scroller,"drop",ie.drop)}}function ph(x){x.options.lineWrapping?(Ut(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ke(x.display.wrapper,"CodeMirror-wrap"),jn(x)),Aa(x),za(x),Ui(x),setTimeout(function(){return ks(x)},100)}function oi(x,z){var ne=this;if(!(this instanceof oi))return new oi(x,z);this.options=z=z?bt(z):{},bt(fh,z,!1);var te=z.value;typeof te=="string"?te=new ya(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new oi.inputStyles[z.inputStyle](this),ce=this.display=new Ud(x,te,ie,z);ce.wrapper.CodeMirror=this,nd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Iu(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&&!it&&ce.input.focus(),be&&De<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xu(),Ls(this),this.curOp.forceUpdate=!0,Jl(this,te),z.autofocus&&!it||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&kc(ne)},20):qs(this);for(var ge in nu)nu.hasOwnProperty(ge)&&nu[ge](this,z[ge],Rs);Xl(this),z.finishInit&&z.finishInit(this);for(var Ce=0;Ce<rd.length;++Ce)rd[Ce](this);cs(this),Pe&&z.lineWrapping&&getComputedStyle(ce.lineDiv).textRendering=="optimizelegibility"&&(ce.lineDiv.style.textRendering="auto")}oi.defaults=fh,oi.optionHandlers=nu;function lf(x){var z=x.display;on(z.scroller,"mousedown",Sa(x,Wa)),be&&De<11?on(z.scroller,"dblclick",Sa(x,function(Le){if(!$t(x,Le)){var Oe=xo(x,Le);if(!(!Oe||Ja(x,Le)||oo(x.display,Le))){qn(Le);var vt=x.findWordAt(Oe);sl(x.doc,vt.anchor,vt.head)}}})):on(z.scroller,"dblclick",function(Le){return $t(x,Le)||qn(Le)}),on(z.scroller,"contextmenu",function(Le){return Os(x,Le)}),on(z.input.getField(),"contextmenu",function(Le){z.scroller.contains(Le.target)||Os(x,Le)});var ne,te={end:0};function ie(){z.activeTouch&&(ne=setTimeout(function(){return z.activeTouch=null},1e3),te=z.activeTouch,te.end=+new Date)}function ce(Le){if(Le.touches.length!=1)return!1;var Oe=Le.touches[0];return Oe.radiusX<=1&&Oe.radiusY<=1}function ge(Le,Oe){if(Oe.left==null)return!0;var vt=Oe.left-Le.left,Et=Oe.top-Le.top;return vt*vt+Et*Et>20*20}on(z.scroller,"touchstart",function(Le){if(!$t(x,Le)&&!ce(Le)&&!Ja(x,Le)){z.input.ensurePolled(),clearTimeout(ne);var Oe=+new Date;z.activeTouch={start:Oe,moved:!1,prev:Oe-te.end<=300?te:null},Le.touches.length==1&&(z.activeTouch.left=Le.touches[0].pageX,z.activeTouch.top=Le.touches[0].pageY)}}),on(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),on(z.scroller,"touchend",function(Le){var Oe=z.activeTouch;if(Oe&&!oo(z,Le)&&Oe.left!=null&&!Oe.moved&&new Date-Oe.start<300){var vt=x.coordsChar(z.activeTouch,"page"),Et;!Oe.prev||ge(Oe,Oe.prev)?Et=new Ni(vt,vt):!Oe.prev.prev||ge(Oe,Oe.prev.prev)?Et=x.findWordAt(vt):Et=new Ni(pt(vt.line,0),tn(x.doc,pt(vt.line+1,0))),x.setSelection(Et.anchor,Et.head),x.focus(),qn(Le)}ie()}),on(z.scroller,"touchcancel",ie),on(z.scroller,"scroll",function(){z.scroller.clientHeight&&(_s(x,z.scroller.scrollTop),Es(x,z.scroller.scrollLeft,!0),St(x,"scroll",x))}),on(z.scroller,"mousewheel",function(Le){return Fu(x,Le)}),on(z.scroller,"DOMMouseScroll",function(Le){return Fu(x,Le)}),on(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Le){$t(x,Le)||Er(Le)},over:function(Le){$t(x,Le)||(Uu(x,Le),Er(Le))},start:function(Le){return ef(x,Le)},drop:Sa(x,Qh),leave:function(Le){$t(x,Le)||kl(x)}};var Ce=z.input.getField();on(Ce,"keyup",function(Le){return lh.call(x,Le)}),on(Ce,"keydown",Sa(x,lc)),on(Ce,"keypress",Sa(x,ch)),on(Ce,"focus",function(Le){return kc(x,Le)}),on(Ce,"blur",function(Le){return qs(x,Le)})}var rd=[];oi.defineInitHook=function(x){return rd.push(x)};function Fo(x,z,ne,te){var ie=x.doc,ce;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?ce=Gt(x,z).state:ne="prev");var ge=x.options.tabSize,Ce=Ge(ie,z),Le=$e(Ce.text,null,ge);Ce.stateAfter&&(Ce.stateAfter=null);var Oe=Ce.text.match(/^\s*/)[0],vt;if(!te&&!/\S/.test(Ce.text))vt=0,ne="not";else if(ne=="smart"&&(vt=ie.mode.indent(ce,Ce.text.slice(Oe.length),Ce.text),vt==Wt||vt>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?vt=$e(Ge(ie,z-1).text,null,ge):vt=0:ne=="add"?vt=Le+x.options.indentUnit:ne=="subtract"?vt=Le-x.options.indentUnit:typeof ne=="number"&&(vt=Le+ne),vt=Math.max(0,vt);var Et="",sn=0;if(x.options.indentWithTabs)for(var nn=Math.floor(vt/ge);nn;--nn)sn+=ge,Et+=" ";if(sn<vt&&(Et+=dn(vt-sn)),Et!=Oe)return Ml(ie,Et,pt(z,0),pt(z,Oe.length),"+input"),Ce.stateAfter=null,!0;for(var Bn=0;Bn<ie.sel.ranges.length;Bn++){var Vn=ie.sel.ranges[Bn];if(Vn.head.line==z&&Vn.head.ch<Oe.length){var vr=pt(z,Oe.length);So(ie,Bn,new Ni(vr,vr));break}}}var zo=null;function $s(x){zo=x}function id(x,z,ne,te,ie){var ce=x.doc;x.display.shift=!1,te||(te=ce.sel);var ge=+new Date-200,Ce=ie=="paste"||x.state.pasteIncoming>ge,Le=qr(z),Oe=null;if(Ce&&te.ranges.length>1)if(zo&&zo.text.join(`
`)==z){if(te.ranges.length%zo.text.length==0){Oe=[];for(var vt=0;vt<zo.text.length;vt++)Oe.push(ce.splitLines(zo.text[vt]))}}else Le.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Oe=Vt(Le,function(Dr){return[Dr]}));for(var Et=x.curOp.updateInput,sn=te.ranges.length-1;sn>=0;sn--){var nn=te.ranges[sn],Bn=nn.from(),Vn=nn.to();nn.empty()&&(ne&&ne>0?Bn=pt(Bn.line,Bn.ch-ne):x.state.overwrite&&!Ce?Vn=pt(Vn.line,Math.min(Ge(ce,Vn.line).text.length,Vn.ch+Zt(Le).length)):Ce&&zo&&zo.lineWise&&zo.text.join(`
`)==Le.join(`
`)&&(Bn=Vn=pt(Bn.line,0)));var vr={from:Bn,to:Vn,text:Oe?Oe[sn%Oe.length]:Le,origin:ie||(Ce?"paste":x.state.cutIncoming>ge?"cut":"+input")};Ds(x.doc,vr),Or(x,"inputRead",x,vr)}z&&!Ce&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=Et),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&&pa(z,function(){return id(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 ie=ne.ranges[te];if(!(ie.head.ch>100||te&&ne.ranges[te-1].head.line==ie.head.line)){var ce=x.getModeAt(ie.head),ge=!1;if(ce.electricChars){for(var Ce=0;Ce<ce.electricChars.length;Ce++)if(z.indexOf(ce.electricChars.charAt(Ce))>-1){ge=Fo(x,ie.head.line,"smart");break}}else ce.electricInput&&ce.electricInput.test(Ge(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(ge=Fo(x,ie.head.line,"smart"));ge&&Or(x,"electricInput",x,ie.head.line)}}}function Il(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,ce={anchor:pt(ie,0),head:pt(ie+1,0)};ne.push(ce),z.push(x.getRange(ce.anchor,ce.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=Xe("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=Xe("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Pe?x.style.width="1000px":x.setAttribute("wrap","off"),rt&&(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,ie){var ce=this.options,ge=ce[te];ce[te]==ie&&te!="mode"||(ce[te]=ie,z.hasOwnProperty(te)&&Sa(this,z[te])(this,ie,ge),St(this,"optionChange",this,te))},getOption:function(te){return this.options[te]},getDoc:function(){return this.doc},addKeyMap:function(te,ie){this.state.keyMaps[ie?"push":"unshift"](io(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,ce=0;ce<ie.length;++ce)if(ie[ce]==te||ie[ce].name==te)return ie.splice(ce,1),!0},addOverlay:ua(function(te,ie){var ce=te.token?te:x.getMode(this.options,te);if(ce.startState)throw new Error("Overlays may not be stateful.");zt(this.state.overlays,{mode:ce,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(ge){return ge.priority}),this.state.modeGen++,za(this)}),removeOverlay:ua(function(te){for(var ie=this.state.overlays,ce=0;ce<ie.length;++ce){var ge=ie[ce].modeSpec;if(ge==te||typeof te=="string"&&ge.name==te){ie.splice(ce,1),this.state.modeGen++,za(this);return}}}),indentLine:ua(function(te,ie,ce){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),Rt(this.doc,te)&&Fo(this,te,ie,ce)}),indentSelection:ua(function(te){for(var ie=this.doc.sel.ranges,ce=-1,ge=0;ge<ie.length;ge++){var Ce=ie[ge];if(Ce.empty())Ce.head.line>ce&&(Fo(this,Ce.head.line,te,!0),ce=Ce.head.line,ge==this.doc.sel.primIndex&&Qs(this));else{var Le=Ce.from(),Oe=Ce.to(),vt=Math.max(ce,Le.line);ce=Math.min(this.lastLine(),Oe.line-(Oe.ch?0:1))+1;for(var Et=vt;Et<ce;++Et)Fo(this,Et,te);var sn=this.doc.sel.ranges;Le.ch==0&&ie.length==sn.length&&sn[ge].from().ch>0&&So(this.doc,ge,new Ni(Le,sn[ge].to()),qe)}}}),getTokenAt:function(te,ie){return Hn(this,te,ie)},getLineTokens:function(te,ie){return Hn(this,pt(te),ie,!0)},getTokenTypeAt:function(te){te=tn(this.doc,te);var ie=Ft(this,Ge(this.doc,te.line)),ce=0,ge=(ie.length-1)/2,Ce=te.ch,Le;if(Ce==0)Le=ie[2];else for(;;){var Oe=ce+ge>>1;if((Oe?ie[Oe*2-1]:0)>=Ce)ge=Oe;else if(ie[Oe*2+1]<Ce)ce=Oe+1;else{Le=ie[Oe*2+2];break}}var vt=Le?Le.indexOf("overlay "):-1;return vt<0?Le:vt==0?null:Le.slice(0,vt-1)},getModeAt:function(te){var ie=this.doc.mode;return ie.innerMode?x.innerMode(ie,this.getTokenAt(te).state).mode:ie},getHelper:function(te,ie){return this.getHelpers(te,ie)[0]},getHelpers:function(te,ie){var ce=[];if(!ne.hasOwnProperty(ie))return ce;var ge=ne[ie],Ce=this.getModeAt(te);if(typeof Ce[ie]=="string")ge[Ce[ie]]&&ce.push(ge[Ce[ie]]);else if(Ce[ie])for(var Le=0;Le<Ce[ie].length;Le++){var Oe=ge[Ce[ie][Le]];Oe&&ce.push(Oe)}else Ce.helperType&&ge[Ce.helperType]?ce.push(ge[Ce.helperType]):ge[Ce.name]&&ce.push(ge[Ce.name]);for(var vt=0;vt<ge._global.length;vt++){var Et=ge._global[vt];Et.pred(Ce,this)&&gt(ce,Et.val)==-1&&ce.push(Et.val)}return ce},getStateAfter:function(te,ie){var ce=this.doc;return te=On(ce,te==null?ce.first+ce.size-1:te),Gt(this,te+1,ie).state},cursorCoords:function(te,ie){var ce,ge=this.doc.sel.primary();return te==null?ce=ge.head:typeof te=="object"?ce=tn(this.doc,te):ce=te?ge.from():ge.to(),Da(this,ce,ie||"page")},charCoords:function(te,ie){return lo(this,tn(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=so(this,te,ie||"page"),Js(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=so(this,{top:te,left:0},ie||"page").top,kt(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,ce){var ge=!1,Ce;if(typeof te=="number"){var Le=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>Le&&(te=Le,ge=!0),Ce=Ge(this.doc,te)}else Ce=te;return $a(this,Ce,{top:0,left:0},ie||"page",ce||ge).top+(ge?this.doc.height-Zn(Ce):0)},defaultTextHeight:function(){return as(this.display)},defaultCharWidth:function(){return Li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,ce,ge,Ce){var Le=this.display;te=Da(this,tn(this.doc,te));var Oe=te.bottom,vt=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Le.sizer.appendChild(ie),ge=="over")Oe=te.top;else if(ge=="above"||ge=="near"){var Et=Math.max(Le.wrapper.clientHeight,this.doc.height),sn=Math.max(Le.sizer.clientWidth,Le.lineSpace.clientWidth);(ge=="above"||te.bottom+ie.offsetHeight>Et)&&te.top>ie.offsetHeight?Oe=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=Et&&(Oe=te.bottom),vt+ie.offsetWidth>sn&&(vt=sn-ie.offsetWidth)}ie.style.top=Oe+"px",ie.style.left=ie.style.right="",Ce=="right"?(vt=Le.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Ce=="left"?vt=0:Ce=="middle"&&(vt=(Le.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=vt+"px"),ce&&Rd(this,{left:vt,top:Oe,right:vt+ie.offsetWidth,bottom:Oe+ie.offsetHeight})},triggerOnKeyDown:ua(lc),triggerOnKeyPress:ua(ch),triggerOnKeyUp:lh,triggerOnMouseDown:ua(Wa),execCommand:function(te){if(Dl.hasOwnProperty(te))return Dl[te].call(null,this)},triggerElectric:ua(function(te){od(this,te)}),findPosH:function(te,ie,ce,ge){var Ce=1;ie<0&&(Ce=-1,ie=-ie);for(var Le=tn(this.doc,te),Oe=0;Oe<ie&&(Le=ru(this.doc,Le,Ce,ce,ge),!Le.hitSide);++Oe);return Le},moveH:ua(function(te,ie){var ce=this;this.extendSelectionsBy(function(ge){return ce.display.shift||ce.doc.extend||ge.empty()?ru(ce.doc,ge.head,te,ie,ce.options.rtlMoveVisually):te<0?ge.from():ge.to()},Lt)}),deleteH:ua(function(te,ie){var ce=this.doc.sel,ge=this.doc;ce.somethingSelected()?ge.replaceSelection("",null,"+delete"):Po(this,function(Ce){var Le=ru(ge,Ce.head,te,ie,!1);return te<0?{from:Le,to:Ce.head}:{from:Ce.head,to:Le}})}),findPosV:function(te,ie,ce,ge){var Ce=1,Le=ge;ie<0&&(Ce=-1,ie=-ie);for(var Oe=tn(this.doc,te),vt=0;vt<ie;++vt){var Et=Da(this,Oe,"div");if(Le==null?Le=Et.left:Et.left=Le,Oe=gh(this,Et,Ce,ce),Oe.hitSide)break}return Oe},moveV:ua(function(te,ie){var ce=this,ge=this.doc,Ce=[],Le=!this.display.shift&&!ge.extend&&ge.sel.somethingSelected();if(ge.extendSelectionsBy(function(vt){if(Le)return te<0?vt.from():vt.to();var Et=Da(ce,vt.head,"div");vt.goalColumn!=null&&(Et.left=vt.goalColumn),Ce.push(Et.left);var sn=gh(ce,Et,te,ie);return ie=="page"&&vt==ge.sel.primary()&&Lc(ce,lo(ce,sn,"div").top-Et.top),sn},Lt),Ce.length)for(var Oe=0;Oe<ge.sel.ranges.length;Oe++)ge.sel.ranges[Oe].goalColumn=Ce[Oe]}),findWordAt:function(te){var ie=this.doc,ce=Ge(ie,te.line).text,ge=te.ch,Ce=te.ch;if(ce){var Le=this.getHelper(te,"wordChars");(te.sticky=="before"||Ce==ce.length)&&ge?--ge:++Ce;for(var Oe=ce.charAt(ge),vt=pe(Oe,Le)?function(Et){return pe(Et,Le)}:/\s/.test(Oe)?function(Et){return/\s/.test(Et)}:function(Et){return!/\s/.test(Et)&&!pe(Et)};ge>0&&vt(ce.charAt(ge-1));)--ge;for(;Ce<ce.length&&vt(ce.charAt(Ce));)++Ce}return new Ni(pt(te.line,ge),pt(te.line,Ce))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ut(this.display.cursorDiv,"CodeMirror-overwrite"):Ke(this.display.cursorDiv,"CodeMirror-overwrite"),St(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==et()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ua(function(te,ie){el(this,te,ie)}),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:fa(this)}},scrollIntoView:ua(function(te,ie){te==null?(te={from:this.doc.sel.primary().head,to:null},ie==null&&(ie=this.options.cursorScrollMargin)):typeof te=="number"?te={from:pt(te,0),to:null}:te.from==null&&(te={from:te,to:null}),te.to||(te.to=te.from),te.margin=ie||0,te.from.line!=null?$d(this,te):Du(this,te.from,te.to,te.margin)}),setSize:ua(function(te,ie){var ce=this,ge=function(Le){return typeof Le=="number"||/^\d+$/.test(String(Le))?Le+"px":Le};te!=null&&(this.display.wrapper.style.width=ge(te)),ie!=null&&(this.display.wrapper.style.height=ge(ie)),this.options.lineWrapping&&La(this);var Ce=this.display.viewFrom;this.doc.iter(Ce,this.display.viewTo,function(Le){if(Le.widgets){for(var Oe=0;Oe<Le.widgets.length;Oe++)if(Le.widgets[Oe].noHScroll){Ao(ce,Ce,"widget");break}}++Ce}),this.curOp.forceUpdate=!0,St(this,"refresh",this)}),operation:function(te){return pa(this,te)},startOperation:function(){return Ls(this)},endOperation:function(){return cs(this)},refresh:ua(function(){var te=this.display.cachedTextHeight;za(this),this.curOp.forceUpdate=!0,Ui(this),el(this,this.doc.scrollLeft,this.doc.scrollTop),Ic(this.display),(te==null||Math.abs(te-as(this.display))>.5||this.options.lineWrapping)&&Aa(this),St(this,"refresh",this)}),swapDoc:ua(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),Jl(this,te),Ui(this),this.display.input.reset(),el(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Or(this,"swapDoc",this,ie),ie}),phrase:function(te){var ie=this.options.phrases;return ie&&Object.prototype.hasOwnProperty.call(ie,te)?ie[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}},In(x),x.registerHelper=function(te,ie,ce){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=ce},x.registerGlobalHelper=function(te,ie,ce,ge){x.registerHelper(te,ie,ge),ne[te]._global.push({pred:ce,val:ge})}}function ru(x,z,ne,te,ie){var ce=z,ge=ne,Ce=Ge(x,z.line),Le=ie&&x.direction=="rtl"?-ne:ne;function Oe(){var Rr=z.line+Le;return Rr<x.first||Rr>=x.first+x.size?!1:(z=new pt(Rr,z.ch,z.sticky),Ce=Ge(x,Rr))}function vt(Rr){var Mr;if(te=="codepoint"){var $r=Ce.text.charCodeAt(z.ch+(te>0?0:-1));isNaN($r)?Mr=null:Mr=new pt(z.line,Math.max(0,Math.min(Ce.text.length,z.ch+ne*($r>=55296&&$r<56320?2:1))),-ne)}else ie?Mr=Uo(x.cm,Ce,z,ne):Mr=Go(Ce,z,ne);if(Mr==null)if(!Rr&&Oe())z=dl(ie,x.cm,Ce,z.line,Le);else return!1;else z=Mr;return!0}if(te=="char"||te=="codepoint")vt();else if(te=="column")vt(!0);else if(te=="word"||te=="group")for(var Et=null,sn=te=="group",nn=x.cm&&x.cm.getHelper(z,"wordChars"),Bn=!0;!(ne<0&&!vt(!Bn));Bn=!1){var Vn=Ce.text.charAt(z.ch)||`
`,vr=pe(Vn,nn)?"w":sn&&Vn==`
`?"n":!sn||/\s/.test(Vn)?null:"p";if(sn&&!Bn&&!vr&&(vr="s"),Et&&Et!=vr){ne<0&&(ne=1,vt(),z.sticky="after");break}if(vr&&(Et=vr),ne>0&&!vt(!Bn))break}var Dr=Gc(x,z,ce,ge,!0);return bn(ce,Dr)&&(Dr.hitSide=!0),Dr}function gh(x,z,ne,te){var ie=x.doc,ce=z.left,ge;if(te=="page"){var Ce=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Le=Math.max(Ce-.5*as(x.display),3);ge=(ne>0?z.bottom:z.top)+ne*Le}else te=="line"&&(ge=ne>0?z.bottom+3:z.top-3);for(var Oe;Oe=Js(x,ce,ge),!!Oe.outside;){if(ne<0?ge<=0:ge>=ie.height){Oe.hitSide=!0;break}ge+=ne*5}return Oe}var Zi=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};Zi.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;mh(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function ce(Ce){for(var Le=Ce.target;Le;Le=Le.parentNode){if(Le==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Le.className))break}return!1}on(ie,"paste",function(Ce){!ce(Ce)||$t(te,Ce)||ad(Ce,te)||De<=11&&setTimeout(Sa(te,function(){return z.updateFromDOM()}),20)}),on(ie,"compositionstart",function(Ce){z.composing={data:Ce.data,done:!1}}),on(ie,"compositionupdate",function(Ce){z.composing||(z.composing={data:Ce.data,done:!1})}),on(ie,"compositionend",function(Ce){z.composing&&(Ce.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),on(ie,"touchstart",function(){return ne.forceCompositionEnd()}),on(ie,"input",function(){z.composing||z.readFromDOMSoon()});function ge(Ce){if(!(!ce(Ce)||$t(te,Ce))){if(te.somethingSelected())$s({lineWise:!1,text:te.getSelections()}),Ce.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Le=Il(te);$s({lineWise:!0,text:Le.text}),Ce.type=="cut"&&te.operation(function(){te.setSelections(Le.ranges,0,qe),te.replaceSelection("",null,"cut")})}else return;if(Ce.clipboardData){Ce.clipboardData.clearData();var Oe=zo.text.join(`
`);if(Ce.clipboardData.setData("Text",Oe),Ce.clipboardData.getData("Text")==Oe){Ce.preventDefault();return}}var vt=sd(),Et=vt.firstChild;te.display.lineSpace.insertBefore(vt,te.display.lineSpace.firstChild),Et.value=zo.text.join(`
`);var sn=document.activeElement;Dt(Et),setTimeout(function(){te.display.lineSpace.removeChild(vt),sn.focus(),sn==ie&&ne.showPrimarySelection()},50)}}on(ie,"copy",ge),on(ie,"cut",ge)},Zi.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Zi.prototype.prepareSelection=function(){var x=_u(this.cm,!1);return x.focus=document.activeElement==this.div,x},Zi.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},Zi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zi.prototype.showPrimarySelection=function(){var x=this.getSelection(),z=this.cm,ne=z.doc.sel.primary(),te=ne.from(),ie=ne.to();if(z.display.viewTo==z.display.viewFrom||te.line>=z.display.viewTo||ie.line<z.display.viewFrom){x.removeAllRanges();return}var ce=iu(z,x.anchorNode,x.anchorOffset),ge=iu(z,x.focusNode,x.focusOffset);if(!(ce&&!ce.bad&&ge&&!ge.bad&&Ct(qt(ce,ge),te)==0&&Ct(En(ce,ge),ie)==0)){var Ce=z.display.view,Le=te.line>=z.display.viewFrom&&vh(z,te)||{node:Ce[0].measure.map[2],offset:0},Oe=ie.line<z.display.viewTo&&vh(z,ie);if(!Oe){var vt=Ce[Ce.length-1].measure,Et=vt.maps?vt.maps[vt.maps.length-1]:vt.map;Oe={node:Et[Et.length-1],offset:Et[Et.length-2]-Et[Et.length-3]}}if(!Le||!Oe){x.removeAllRanges();return}var sn=x.rangeCount&&x.getRangeAt(0),nn;try{nn=ht(Le.node,Le.offset,Oe.offset,Oe.node)}catch(Bn){}nn&&(!fe&&z.state.focused?(x.collapse(Le.node,Le.offset),nn.collapsed||(x.removeAllRanges(),x.addRange(nn))):(x.removeAllRanges(),x.addRange(nn)),sn&&x.anchorNode==null?x.addRange(sn):fe&&this.startGracePeriod()),this.rememberSelection()}},Zi.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)},Zi.prototype.showMultipleSelections=function(x){Mt(this.cm.display.cursorDiv,x.cursors),Mt(this.cm.display.selectionDiv,x.selection)},Zi.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},Zi.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Tt(this.div,z)},Zi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Zi.prototype.blur=function(){this.div.blur()},Zi.prototype.getField=function(){return this.div},Zi.prototype.supportsTouch=function(){return!0},Zi.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():pa(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)},Zi.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},Zi.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(je&&_e&&this.cm.display.gutterSpecs.length&&cf(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=iu(z,x.anchorNode,x.anchorOffset),te=iu(z,x.focusNode,x.focusOffset);ne&&te&&pa(z,function(){Ca(z.doc,$o(ne,te),qe),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},Zi.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(),ie=ne.to();if(te.ch==0&&te.line>x.firstLine()&&(te=pt(te.line-1,Ge(x.doc,te.line-1).length)),ie.ch==Ge(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=pt(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var ce,ge,Ce;te.line==z.viewFrom||(ce=po(x,te.line))==0?(ge=ct(z.view[0].line),Ce=z.view[0].node):(ge=ct(z.view[ce].line),Ce=z.view[ce-1].node.nextSibling);var Le=po(x,ie.line),Oe,vt;if(Le==z.view.length-1?(Oe=z.viewTo-1,vt=z.lineDiv.lastChild):(Oe=ct(z.view[Le+1].line)-1,vt=z.view[Le+1].node.previousSibling),!Ce)return!1;for(var Et=x.doc.splitLines(uf(x,Ce,vt,ge,Oe)),sn=ut(x.doc,pt(ge,0),pt(Oe,Ge(x.doc,Oe).text.length));Et.length>1&&sn.length>1;)if(Zt(Et)==Zt(sn))Et.pop(),sn.pop(),Oe--;else if(Et[0]==sn[0])Et.shift(),sn.shift(),ge++;else break;for(var nn=0,Bn=0,Vn=Et[0],vr=sn[0],Dr=Math.min(Vn.length,vr.length);nn<Dr&&Vn.charCodeAt(nn)==vr.charCodeAt(nn);)++nn;for(var Rr=Zt(Et),Mr=Zt(sn),$r=Math.min(Rr.length-(Et.length==1?nn:0),Mr.length-(sn.length==1?nn:0));Bn<$r&&Rr.charCodeAt(Rr.length-Bn-1)==Mr.charCodeAt(Mr.length-Bn-1);)++Bn;if(Et.length==1&&sn.length==1&&ge==te.line)for(;nn&&nn>te.ch&&Rr.charCodeAt(Rr.length-Bn-1)==Mr.charCodeAt(Mr.length-Bn-1);)nn--,Bn++;Et[Et.length-1]=Rr.slice(0,Rr.length-Bn).replace(/^\u200b+/,""),Et[0]=Et[0].slice(nn).replace(/\u200b+$/,"");var Jr=pt(ge,nn),ei=pt(Oe,sn.length?Zt(sn).length-Bn:0);if(Et.length>1||Et[0]||Ct(Jr,ei))return Ml(x.doc,Et,Jr,ei,"+input"),!0},Zi.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zi.prototype.reset=function(){this.forceCompositionEnd()},Zi.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zi.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))},Zi.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&pa(this.cm,function(){return za(x.cm)})},Zi.prototype.setUneditable=function(x){x.contentEditable="false"},Zi.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||Sa(this.cm,id)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},Zi.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},Zi.prototype.onContextMenu=function(){},Zi.prototype.resetPosition=function(){},Zi.prototype.needsContentAttribute=!0;function vh(x,z){var ne=Xa(x,z.line);if(!ne||ne.hidden)return null;var te=Ge(x.doc,z.line),ie=ko(ne,te,z.line),ce=Sn(te,x.doc.direction),ge="left";if(ce){var Ce=an(ce,z.ch);ge=Ce%2?"right":"left"}var Le=rs(ie.map,z.ch,ge);return Le.offset=Le.collapse=="right"?Le.end:Le.start,Le}function cf(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 uf(x,z,ne,te,ie){var ce="",ge=!1,Ce=x.doc.lineSeparator(),Le=!1;function Oe(nn){return function(Bn){return Bn.id==nn}}function vt(){ge&&(ce+=Ce,Le&&(ce+=Ce),ge=Le=!1)}function Et(nn){nn&&(vt(),ce+=nn)}function sn(nn){if(nn.nodeType==1){var Bn=nn.getAttribute("cm-text");if(Bn){Et(Bn);return}var Vn=nn.getAttribute("cm-marker"),vr;if(Vn){var Dr=x.findMarks(pt(te,0),pt(ie+1,0),Oe(+Vn));Dr.length&&(vr=Dr[0].find(0))&&Et(ut(x.doc,vr.from,vr.to).join(Ce));return}if(nn.getAttribute("contenteditable")=="false")return;var Rr=/^(pre|div|p|li|table|br)$/i.test(nn.nodeName);if(!/^br$/i.test(nn.nodeName)&&nn.textContent.length==0)return;Rr&&vt();for(var Mr=0;Mr<nn.childNodes.length;Mr++)sn(nn.childNodes[Mr]);/^(pre|p)$/i.test(nn.nodeName)&&(Le=!0),Rr&&(ge=!0)}else nn.nodeType==3&&Et(nn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;sn(z),z!=ne;)z=z.nextSibling,Le=!1;return ce}function iu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return Pl(x.clipPos(pt(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 ie=0;ie<x.display.view.length;ie++){var ce=x.display.view[ie];if(ce.node==te)return df(ce,z,ne)}}function df(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Tt(te,z))return Pl(pt(ct(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var ce=x.rest?Zt(x.rest):x.line;return Pl(pt(ct(ce),ce.text.length),ie)}var ge=z.nodeType==3?z:null,Ce=z;for(!ge&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(ge=z.firstChild,ne&&(ne=ge.nodeValue.length));Ce.parentNode!=te;)Ce=Ce.parentNode;var Le=x.measure,Oe=Le.maps;function vt(vr,Dr,Rr){for(var Mr=-1;Mr<(Oe?Oe.length:0);Mr++)for(var $r=Mr<0?Le.map:Oe[Mr],Jr=0;Jr<$r.length;Jr+=3){var ei=$r[Jr+2];if(ei==vr||ei==Dr){var wi=ct(Mr<0?x.line:x.rest[Mr]),Ji=$r[Jr]+Rr;return(Rr<0||ei!=vr)&&(Ji=$r[Jr+(Rr?1:0)]),pt(wi,Ji)}}}var Et=vt(ge,Ce,ne);if(Et)return Pl(Et,ie);for(var sn=Ce.nextSibling,nn=ge?ge.nodeValue.length-ne:0;sn;sn=sn.nextSibling){if(Et=vt(sn,sn.firstChild,0),Et)return Pl(pt(Et.line,Et.ch-nn),ie);nn+=sn.textContent.length}for(var Bn=Ce.previousSibling,Vn=ne;Bn;Bn=Bn.previousSibling){if(Et=vt(Bn,Bn.firstChild,-1),Et)return Pl(pt(Et.line,Et.ch+Vn),ie);Vn+=Bn.textContent.length}}var Yi=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.hasSelection=!1,this.composing=null};Yi.prototype.init=function(x){var z=this,ne=this,te=this.cm;this.createField(x);var ie=this.textarea;x.wrapper.insertBefore(this.wrapper,x.wrapper.firstChild),rt&&(ie.style.width="0px"),on(ie,"input",function(){be&&De>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),on(ie,"paste",function(ge){$t(te,ge)||ad(ge,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function ce(ge){if(!$t(te,ge)){if(te.somethingSelected())$s({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Ce=Il(te);$s({lineWise:!0,text:Ce.text}),ge.type=="cut"?te.setSelections(Ce.ranges,null,qe):(ne.prevInput="",ie.value=Ce.text.join(`
`),Dt(ie))}else return;ge.type=="cut"&&(te.state.cutIncoming=+new Date)}}on(ie,"cut",ce),on(ie,"copy",ce),on(x.scroller,"paste",function(ge){if(!(oo(x,ge)||$t(te,ge))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Ce=new Event("paste");Ce.clipboardData=ge.clipboardData,ie.dispatchEvent(Ce)}}),on(x.lineSpace,"selectstart",function(ge){oo(x,ge)||qn(ge)}),on(ie,"compositionstart",function(){var ge=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:ge,range:te.markText(ge,te.getCursor("to"),{className:"CodeMirror-composing"})}}),on(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},Yi.prototype.createField=function(x){this.wrapper=sd(),this.textarea=this.wrapper.firstChild},Yi.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},Yi.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=_u(x);if(x.options.moveInputWithCursor){var ie=Da(x,ne.sel.primary().head,"div"),ce=z.wrapper.getBoundingClientRect(),ge=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+ge.top-ce.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+ge.left-ce.left))}return te},Yi.prototype.showSelection=function(x){var z=this.cm,ne=z.display;Mt(ne.cursorDiv,x.cursors),Mt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},Yi.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&&Dt(this.textarea),be&&De>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",be&&De>=9&&(this.hasSelection=null))}},Yi.prototype.getField=function(){return this.textarea},Yi.prototype.supportsTouch=function(){return!1},Yi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!it||et()!=this.textarea))try{this.textarea.focus()}catch(x){}},Yi.prototype.blur=function(){this.textarea.blur()},Yi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Yi.prototype.receivedFocus=function(){this.slowPoll()},Yi.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},Yi.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)},Yi.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||Cr(ne)&&!te&&!this.composing||z.isReadOnly()||z.options.disableInput||z.state.keySeq)return!1;var ie=ne.value;if(ie==te&&!z.somethingSelected())return!1;if(be&&De>=9&&this.hasSelection===ie||at&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var ce=ie.charCodeAt(0);if(ce==8203&&!te&&(te="\u200B"),ce==8666)return this.reset(),this.cm.execCommand("undo")}for(var ge=0,Ce=Math.min(te.length,ie.length);ge<Ce&&te.charCodeAt(ge)==ie.charCodeAt(ge);)++ge;return pa(z,function(){id(z,ie.slice(ge),te.length-ge,null,x.composing?"*compose":null),ie.length>1e3||ie.indexOf(`
`)>-1?ne.value=x.prevInput="":x.prevInput=ie,x.composing&&(x.composing.range.clear(),x.composing.range=z.markText(x.composing.start,z.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Yi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Yi.prototype.onKeyPress=function(){be&&De>=9&&(this.hasSelection=null),this.fastPoll()},Yi.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var ce=xo(ne,x),ge=te.scroller.scrollTop;if(!ce||Ne)return;var Ce=ne.options.resetSelectionOnContextMenu;Ce&&ne.doc.sel.contains(ce)==-1&&Sa(ne,Ca)(ne.doc,$o(ce),qe);var Le=ie.style.cssText,Oe=z.wrapper.style.cssText,vt=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-vt.top-5)+"px; left: "+(x.clientX-vt.left-5)+`px;
z-index: 1000; background: `+(be?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Et;Pe&&(Et=window.scrollY),te.input.focus(),Pe&&window.scrollTo(null,Et),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=nn,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function sn(){if(ie.selectionStart!=null){var Vn=ne.somethingSelected(),vr="\u200B"+(Vn?ie.value:"");ie.value="\u21DA",ie.value=vr,z.prevInput=Vn?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=vr.length,te.selForContextMenu=ne.doc.sel}}function nn(){if(z.contextMenuPending==nn&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Oe,ie.style.cssText=Le,be&&De<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=ge),ie.selectionStart!=null)){(!be||be&&De<9)&&sn();var Vn=0,vr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?Sa(ne,ju)(ne):Vn++<10?te.detectingSelectAll=setTimeout(vr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(vr,200)}}if(be&&De>=9&&sn(),We){Er(x);var Bn=function(){ot(window,"mouseup",Bn),setTimeout(nn,20)};on(window,"mouseup",Bn)}else setTimeout(nn,50)},Yi.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},Yi.prototype.setUneditable=function(){},Yi.prototype.needsContentAttribute=!1;function hl(x,z){if(z=z?bt(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=et();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Ce.getValue()}var ie;if(x.form&&(on(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var ce=x.form;ie=ce.submit;try{var ge=ce.submit=function(){te(),ce.submit=ie,ce.submit(),ce.submit=ge}}catch(Le){}}z.finishInit=function(Le){Le.save=te,Le.getTextArea=function(){return x},Le.toTextArea=function(){Le.toTextArea=isNaN,te(),x.parentNode.removeChild(Le.getWrapperElement()),x.style.display="",x.form&&(ot(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Ce=oi(function(Le){return x.parentNode.insertBefore(Le,x.nextSibling)},z);return Ce}function Bl(x){x.off=ot,x.on=on,x.wheelEventPixels=Nu,x.Doc=ya,x.splitLines=qr,x.countColumn=$e,x.findColumn=mn,x.isWordChar=de,x.Pass=Wt,x.signal=St,x.Line=ur,x.changeEnd=us,x.scrollbarModel=Tu,x.Pos=pt,x.cmpPos=Ct,x.modes=Rn,x.mimeModes=br,x.resolveMode=vn,x.getMode=pn,x.modeExtensions=Nn,x.extendMode=st,x.copyState=Ee,x.startState=ke,x.innerMode=Te,x.commands=Dl,x.keyMap=Xi,x.keyName=ul,x.isModifierKey=sc,x.lookupKey=ms,x.normalizeKeyMap=Yu,x.StringStream=Ie,x.SharedTextMarker=xi,x.TextMarker=Ts,x.LineWidget=El,x.e_preventDefault=qn,x.e_stopPropagation=dr,x.e_stop=Er,x.addClass=Ut,x.contains=Tt,x.rmClass=Ke,x.keyNames=No}of(oi),ld(oi);var ys="iter insert remove copy getEditor constructor".split(" ");for(var Bo in ya.prototype)ya.prototype.hasOwnProperty(Bo)&&gt(ys,Bo)<0&&(oi.prototype[Bo]=function(x){return function(){return x.apply(this.doc,arguments)}}(ya.prototype[Bo]));return In(ya),oi.inputStyles={textarea:Yi,contenteditable:Zi},oi.defineMode=function(x){!oi.defaults.mode&&x!="null"&&(oi.defaults.mode=x),Kn.apply(this,arguments)},oi.defineMIME=ar,oi.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),oi.defineMIME("text/plain","null"),oi.defineExtension=function(x,z){oi.prototype[x]=z},oi.defineDocExtension=function(x,z){ya.prototype[x]=z},oi.fromTextArea=hl,Bl(oi),oi.version="5.58.2",oi})},25419:function(Mn,rn,ue){(function(fe){fe(ue(89780),ue(15525),ue(98101))})(function(fe){"use strict";fe.defineMode("markdown",function(Ze,Fe){var tt=fe.getMode(Ze,"text/html"),be=tt.name=="null";function De($e){if(fe.findModeByName){var xe=fe.findModeByName($e);xe&&($e=xe.mime||xe.mimes[0])}var gt=fe.getMode(Ze,$e);return gt.name=="null"?null:gt}Fe.highlightFormatting===void 0&&(Fe.highlightFormatting=!1),Fe.maxBlockquoteDepth===void 0&&(Fe.maxBlockquoteDepth=0),Fe.taskLists===void 0&&(Fe.taskLists=!1),Fe.strikethrough===void 0&&(Fe.strikethrough=!1),Fe.emoji===void 0&&(Fe.emoji=!1),Fe.fencedCodeBlockHighlighting===void 0&&(Fe.fencedCodeBlockHighlighting=!0),Fe.fencedCodeBlockDefaultMode===void 0&&(Fe.fencedCodeBlockDefaultMode="text/plain"),Fe.xml===void 0&&(Fe.xml=!0),Fe.tokenTypeOverrides===void 0&&(Fe.tokenTypeOverrides={});var Pe={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 we in Pe)Pe.hasOwnProperty(we)&&Fe.tokenTypeOverrides[we]&&(Pe[we]=Fe.tokenTypeOverrides[we]);var _e=/^([*\-_])(?:\s*\1){2,}\s*$/,Ne=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,dt=/^\[(x| )\](?=\s)/i,Ae=Fe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,He=/^ {0,3}(?:\={1,}|-{2,})\s*$/,rt=/^[^#!\[\]*_\\<>` "'(~:]+/,je=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,it=/^\s*\[[^\]]+?\]:.*$/,at=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,xt=" ";function jt($e,xe,gt){return xe.f=xe.inline=gt,gt($e,xe)}function Qe($e,xe,gt){return xe.f=xe.block=gt,gt($e,xe)}function mt($e){return!$e||!/\S/.test($e.string)}function We($e){if($e.linkTitle=!1,$e.linkHref=!1,$e.linkText=!1,$e.em=!1,$e.strong=!1,$e.strikethrough=!1,$e.quote=0,$e.indentedCode=!1,$e.f==Ke){var xe=be;if(!xe){var gt=fe.innerMode(tt,$e.htmlState);xe=gt.mode.name=="xml"&&gt.state.tagStart===null&&!gt.state.context&&gt.state.tokenize.isInText}xe&&($e.f=Nt,$e.block=Me,$e.htmlState=null)}return $e.trailingSpace=0,$e.trailingSpaceNewLine=!1,$e.prevLine=$e.thisLine,$e.thisLine={stream:null},null}function Me($e,xe){var gt=$e.column()===xe.indentation,en=mt(xe.prevLine.stream),Wt=xe.indentedCode,qe=xe.prevLine.hr,Ye=xe.list!==!1,Lt=(xe.listStack[xe.listStack.length-1]||0)+3;xe.indentedCode=!1;var mn=xe.indentation;if(xe.indentationDiff===null&&(xe.indentationDiff=xe.indentation,Ye)){for(xe.list=null;mn<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=mn-xe.listStack[xe.listStack.length-1])}var Qt=!en&&!qe&&!xe.prevLine.header&&(!Ye||!Wt)&&!xe.prevLine.fencedCodeEnd,dn=(xe.list===!1||qe||en)&&xe.indentation<=Lt&&$e.match(_e),Zt=null;if(xe.indentationDiff>=4&&(Wt||xe.prevLine.fencedCodeEnd||xe.prevLine.header||en))return $e.skipToEnd(),xe.indentedCode=!0,Pe.code;if($e.eatSpace())return null;if(gt&&xe.indentation<=Lt&&(Zt=$e.match(Ae))&&Zt[1].length<=6)return xe.quote=0,xe.header=Zt[1].length,xe.thisLine.header=!0,Fe.highlightFormatting&&(xe.formatting="header"),xe.f=xe.inline,Mt(xe);if(xe.indentation<=Lt&&$e.eat(">"))return xe.quote=gt?1:xe.quote+1,Fe.highlightFormatting&&(xe.formatting="quote"),$e.eatSpace(),Mt(xe);if(!dn&&!xe.setext&&gt&&xe.indentation<=Lt&&(Zt=$e.match(Ne))){var Vt=Zt[1]?"ol":"ul";return xe.indentation=mn+$e.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,Fe.taskLists&&$e.match(dt,!1)&&(xe.taskList=!0),xe.f=xe.inline,Fe.highlightFormatting&&(xe.formatting=["list","list-"+Vt]),Mt(xe)}else{if(gt&&xe.indentation<=Lt&&(Zt=$e.match(je,!0)))return xe.quote=0,xe.fencedEndRE=new RegExp(Zt[1]+"+ *$"),xe.localMode=Fe.fencedCodeBlockHighlighting&&De(Zt[2]||Fe.fencedCodeBlockDefaultMode),xe.localMode&&(xe.localState=fe.startState(xe.localMode)),xe.f=xe.block=Ve,Fe.highlightFormatting&&(xe.formatting="code-block"),xe.code=-1,Mt(xe);if(xe.setext||(!Qt||!Ye)&&!xe.quote&&xe.list===!1&&!xe.code&&!dn&&!it.test($e.string)&&(Zt=$e.lookAhead(1))&&(Zt=Zt.match(He)))return xe.setext?(xe.header=xe.setext,xe.setext=0,$e.skipToEnd(),Fe.highlightFormatting&&(xe.formatting="header")):(xe.header=Zt[0].charAt(0)=="="?1:2,xe.setext=xe.header),xe.thisLine.header=!0,xe.f=xe.inline,Mt(xe);if(dn)return $e.skipToEnd(),xe.hr=!0,xe.thisLine.hr=!0,Pe.hr;if($e.peek()==="[")return jt($e,xe,ft)}return jt($e,xe,xe.inline)}function Ke($e,xe){var gt=tt.token($e,xe.htmlState);if(!be){var en=fe.innerMode(tt,xe.htmlState);(en.mode.name=="xml"&&en.state.tagStart===null&&!en.state.context&&en.state.tokenize.isInText||xe.md_inside&&$e.current().indexOf(">")>-1)&&(xe.f=Nt,xe.block=Me,xe.htmlState=null)}return gt}function Ve($e,xe){var gt=xe.listStack[xe.listStack.length-1]||0,en=xe.indentation<gt,Wt=gt+3;if(xe.fencedEndRE&&xe.indentation<=Wt&&(en||$e.match(xe.fencedEndRE))){Fe.highlightFormatting&&(xe.formatting="code-block");var qe;return en||(qe=Mt(xe)),xe.localMode=xe.localState=null,xe.block=Me,xe.f=Nt,xe.fencedEndRE=null,xe.code=0,xe.thisLine.fencedCodeEnd=!0,en?Qe($e,xe,xe.block):qe}else return xe.localMode?xe.localMode.token($e,xe.localState):($e.skipToEnd(),Pe.code)}function Mt($e){var xe=[];if($e.formatting){xe.push(Pe.formatting),typeof $e.formatting=="string"&&($e.formatting=[$e.formatting]);for(var gt=0;gt<$e.formatting.length;gt++)xe.push(Pe.formatting+"-"+$e.formatting[gt]),$e.formatting[gt]==="header"&&xe.push(Pe.formatting+"-"+$e.formatting[gt]+"-"+$e.header),$e.formatting[gt]==="quote"&&(!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=$e.quote?xe.push(Pe.formatting+"-"+$e.formatting[gt]+"-"+$e.quote):xe.push("error"))}if($e.taskOpen)return xe.push("meta"),xe.length?xe.join(" "):null;if($e.taskClosed)return xe.push("property"),xe.length?xe.join(" "):null;if($e.linkHref?xe.push(Pe.linkHref,"url"):($e.strong&&xe.push(Pe.strong),$e.em&&xe.push(Pe.em),$e.strikethrough&&xe.push(Pe.strikethrough),$e.emoji&&xe.push(Pe.emoji),$e.linkText&&xe.push(Pe.linkText),$e.code&&xe.push(Pe.code),$e.image&&xe.push(Pe.image),$e.imageAltText&&xe.push(Pe.imageAltText,"link"),$e.imageMarker&&xe.push(Pe.imageMarker)),$e.header&&xe.push(Pe.header,Pe.header+"-"+$e.header),$e.quote&&(xe.push(Pe.quote),!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=$e.quote?xe.push(Pe.quote+"-"+$e.quote):xe.push(Pe.quote+"-"+Fe.maxBlockquoteDepth)),$e.list!==!1){var en=($e.listStack.length-1)%3;en?en===1?xe.push(Pe.list2):xe.push(Pe.list3):xe.push(Pe.list1)}return $e.trailingSpaceNewLine?xe.push("trailing-space-new-line"):$e.trailingSpace&&xe.push("trailing-space-"+($e.trailingSpace%2?"a":"b")),xe.length?xe.join(" "):null}function Xe($e,xe){if($e.match(rt,!0))return Mt(xe)}function Nt($e,xe){var gt=xe.text($e,xe);if(typeof gt!="undefined")return gt;if(xe.list)return xe.list=null,Mt(xe);if(xe.taskList){var en=$e.match(dt,!0)[1]===" ";return en?xe.taskOpen=!0:xe.taskClosed=!0,Fe.highlightFormatting&&(xe.formatting="task"),xe.taskList=!1,Mt(xe)}if(xe.taskOpen=!1,xe.taskClosed=!1,xe.header&&$e.match(/^#+$/,!0))return Fe.highlightFormatting&&(xe.formatting="header"),Mt(xe);var Wt=$e.next();if(xe.linkTitle){xe.linkTitle=!1;var qe=Wt;Wt==="("&&(qe=")"),qe=(qe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+qe+"\\\\]+|\\\\\\\\|\\\\.)"+qe;if($e.match(new RegExp(Ye),!0))return Pe.linkHref}if(Wt==="`"){var Lt=xe.formatting;Fe.highlightFormatting&&(xe.formatting="code"),$e.eatWhile("`");var mn=$e.current().length;if(xe.code==0&&(!xe.quote||mn==1))return xe.code=mn,Mt(xe);if(mn==xe.code){var Qt=Mt(xe);return xe.code=0,Qt}else return xe.formatting=Lt,Mt(xe)}else if(xe.code)return Mt(xe);if(Wt==="\\"&&($e.next(),Fe.highlightFormatting)){var dn=Mt(xe),Zt=Pe.formatting+"-escape";return dn?dn+" "+Zt:Zt}if(Wt==="!"&&$e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return xe.imageMarker=!0,xe.image=!0,Fe.highlightFormatting&&(xe.formatting="image"),Mt(xe);if(Wt==="["&&xe.imageMarker&&$e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return xe.imageMarker=!1,xe.imageAltText=!0,Fe.highlightFormatting&&(xe.formatting="image"),Mt(xe);if(Wt==="]"&&xe.imageAltText){Fe.highlightFormatting&&(xe.formatting="image");var dn=Mt(xe);return xe.imageAltText=!1,xe.image=!1,xe.inline=xe.f=Tt,dn}if(Wt==="["&&!xe.image)return xe.linkText&&$e.match(/^.*?\]/)||(xe.linkText=!0,Fe.highlightFormatting&&(xe.formatting="link")),Mt(xe);if(Wt==="]"&&xe.linkText){Fe.highlightFormatting&&(xe.formatting="link");var dn=Mt(xe);return xe.linkText=!1,xe.inline=xe.f=$e.match(/\(.*?\)| ?\[.*?\]/,!1)?Tt:Nt,dn}if(Wt==="<"&&$e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=ht,Fe.highlightFormatting&&(xe.formatting="link");var dn=Mt(xe);return dn?dn+=" ":dn="",dn+Pe.linkInline}if(Wt==="<"&&$e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=ht,Fe.highlightFormatting&&(xe.formatting="link");var dn=Mt(xe);return dn?dn+=" ":dn="",dn+Pe.linkEmail}if(Fe.xml&&Wt==="<"&&$e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Vt=$e.string.indexOf(">",$e.pos);if(Vt!=-1){var zt=$e.string.substring($e.start,Vt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(zt)&&(xe.md_inside=!0)}return $e.backUp(1),xe.htmlState=fe.startState(tt),Qe($e,xe,Ke)}if(Fe.xml&&Wt==="<"&&$e.match(/^\/\w*?>/))return xe.md_inside=!1,"tag";if(Wt==="*"||Wt==="_"){for(var ye=1,se=$e.pos==1?" ":$e.string.charAt($e.pos-2);ye<3&&$e.eat(Wt);)ye++;var oe=$e.peek()||" ",de=!/\s/.test(oe)&&(!at.test(oe)||/\s/.test(se)||at.test(se)),pe=!/\s/.test(se)&&(!at.test(se)||/\s/.test(oe)||at.test(oe)),le=null,Be=null;if(ye%2&&(!xe.em&&de&&(Wt==="*"||!pe||at.test(se))?le=!0:xe.em==Wt&&pe&&(Wt==="*"||!de||at.test(oe))&&(le=!1)),ye>1&&(!xe.strong&&de&&(Wt==="*"||!pe||at.test(se))?Be=!0:xe.strong==Wt&&pe&&(Wt==="*"||!de||at.test(oe))&&(Be=!1)),Be!=null||le!=null){Fe.highlightFormatting&&(xe.formatting=le==null?"strong":Be==null?"em":"strong em"),le===!0&&(xe.em=Wt),Be===!0&&(xe.strong=Wt);var Qt=Mt(xe);return le===!1&&(xe.em=!1),Be===!1&&(xe.strong=!1),Qt}}else if(Wt===" "&&($e.eat("*")||$e.eat("_"))){if($e.peek()===" ")return Mt(xe);$e.backUp(1)}if(Fe.strikethrough){if(Wt==="~"&&$e.eatWhile(Wt)){if(xe.strikethrough){Fe.highlightFormatting&&(xe.formatting="strikethrough");var Qt=Mt(xe);return xe.strikethrough=!1,Qt}else if($e.match(/^[^\s]/,!1))return xe.strikethrough=!0,Fe.highlightFormatting&&(xe.formatting="strikethrough"),Mt(xe)}else if(Wt===" "&&$e.match(/^~~/,!0)){if($e.peek()===" ")return Mt(xe);$e.backUp(2)}}if(Fe.emoji&&Wt===":"&&$e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){xe.emoji=!0,Fe.highlightFormatting&&(xe.formatting="emoji");var lt=Mt(xe);return xe.emoji=!1,lt}return Wt===" "&&($e.match(/^ +$/,!1)?xe.trailingSpace++:xe.trailingSpace&&(xe.trailingSpaceNewLine=!0)),Mt(xe)}function ht($e,xe){var gt=$e.next();if(gt===">"){xe.f=xe.inline=Nt,Fe.highlightFormatting&&(xe.formatting="link");var en=Mt(xe);return en?en+=" ":en="",en+Pe.linkInline}return $e.match(/^[^>]+/,!0),Pe.linkInline}function Tt($e,xe){if($e.eatSpace())return null;var gt=$e.next();return gt==="("||gt==="["?(xe.f=xe.inline=Ut(gt==="("?")":"]"),Fe.highlightFormatting&&(xe.formatting="link-string"),xe.linkHref=!0,Mt(xe)):"error"}var et={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Ut($e){return function(xe,gt){var en=xe.next();if(en===$e){gt.f=gt.inline=Nt,Fe.highlightFormatting&&(gt.formatting="link-string");var Wt=Mt(gt);return gt.linkHref=!1,Wt}return xe.match(et[$e]),gt.linkHref=!0,Mt(gt)}}function ft($e,xe){return $e.match(/^([^\]\\]|\\.)*\]:/,!1)?(xe.f=Dt,$e.next(),Fe.highlightFormatting&&(xe.formatting="link"),xe.linkText=!0,Mt(xe)):jt($e,xe,Nt)}function Dt($e,xe){if($e.match(/^\]:/,!0)){xe.f=xe.inline=Bt,Fe.highlightFormatting&&(xe.formatting="link");var gt=Mt(xe);return xe.linkText=!1,gt}return $e.match(/^([^\]\\]|\\.)+/,!0),Pe.linkText}function Bt($e,xe){return $e.eatSpace()?null:($e.match(/^[^\s]+/,!0),$e.peek()===void 0?xe.linkTitle=!0:$e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),xe.f=xe.inline=Nt,Pe.linkHref+" url")}var bt={startState:function(){return{f:Me,prevLine:{stream:null},thisLine:{stream:null},block:Me,htmlState:null,indentation:0,inline:Nt,text:Xe,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($e){return{f:$e.f,prevLine:$e.prevLine,thisLine:$e.thisLine,block:$e.block,htmlState:$e.htmlState&&fe.copyState(tt,$e.htmlState),indentation:$e.indentation,localMode:$e.localMode,localState:$e.localMode?fe.copyState($e.localMode,$e.localState):null,inline:$e.inline,text:$e.text,formatting:!1,linkText:$e.linkText,linkTitle:$e.linkTitle,linkHref:$e.linkHref,code:$e.code,em:$e.em,strong:$e.strong,strikethrough:$e.strikethrough,emoji:$e.emoji,header:$e.header,setext:$e.setext,hr:$e.hr,taskList:$e.taskList,list:$e.list,listStack:$e.listStack.slice(0),quote:$e.quote,indentedCode:$e.indentedCode,trailingSpace:$e.trailingSpace,trailingSpaceNewLine:$e.trailingSpaceNewLine,md_inside:$e.md_inside,fencedEndRE:$e.fencedEndRE}},token:function($e,xe){if(xe.formatting=!1,$e!=xe.thisLine.stream){if(xe.header=0,xe.hr=!1,$e.match(/^\s*$/,!0))return We(xe),null;if(xe.prevLine=xe.thisLine,xe.thisLine={stream:$e},xe.taskList=!1,xe.trailingSpace=0,xe.trailingSpaceNewLine=!1,!xe.localState&&(xe.f=xe.block,xe.f!=Ke)){var gt=$e.match(/^\s*/,!0)[0].replace(/\t/g,xt).length;if(xe.indentation=gt,xe.indentationDiff=null,gt>0)return null}}return xe.f($e,xe)},innerMode:function($e){return $e.block==Ke?{state:$e.htmlState,mode:tt}:$e.localState?{state:$e.localState,mode:$e.localMode}:{state:$e,mode:bt}},indent:function($e,xe,gt){return $e.block==Ke&&tt.indent?tt.indent($e.htmlState,xe,gt):$e.localState&&$e.localMode.indent?$e.localMode.indent($e.localState,xe,gt):fe.Pass},blankLine:We,getType:Mt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return bt},"xml"),fe.defineMIME("text/markdown","markdown"),fe.defineMIME("text/x-markdown","markdown")})},98101:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";fe.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 Ze=0;Ze<fe.modeInfo.length;Ze++){var Fe=fe.modeInfo[Ze];Fe.mimes&&(Fe.mime=Fe.mimes[0])}fe.findModeByMIME=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var De=fe.modeInfo[be];if(De.mime==tt)return De;if(De.mimes){for(var Pe=0;Pe<De.mimes.length;Pe++)if(De.mimes[Pe]==tt)return De}}if(/\+xml$/.test(tt))return fe.findModeByMIME("application/xml");if(/\+json$/.test(tt))return fe.findModeByMIME("application/json")},fe.findModeByExtension=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var De=fe.modeInfo[be];if(De.ext){for(var Pe=0;Pe<De.ext.length;Pe++)if(De.ext[Pe]==tt)return De}}},fe.findModeByFileName=function(tt){for(var be=0;be<fe.modeInfo.length;be++){var De=fe.modeInfo[be];if(De.file&&De.file.test(tt))return De}var Pe=tt.lastIndexOf("."),we=Pe>-1&&tt.substring(Pe+1,tt.length);if(we)return fe.findModeByExtension(we)},fe.findModeByName=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var De=fe.modeInfo[be];if(De.name.toLowerCase()==tt)return De;if(De.alias){for(var Pe=0;Pe<De.alias.length;Pe++)if(De.alias[Pe].toLowerCase()==tt)return De}}}})},67549:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";fe.defineMode("stex",function(Ze,Fe){"use strict";function tt(rt,je){rt.cmdState.push(je)}function be(rt){return rt.cmdState.length>0?rt.cmdState[rt.cmdState.length-1]:null}function De(rt){var je=rt.cmdState.pop();je&&je.closeBracket()}function Pe(rt){for(var je=rt.cmdState,it=je.length-1;it>=0;it--){var at=je[it];if(at.name!="DEFAULT")return at}return{styleIdentifier:function(){return null}}}function we(rt,je,it){return function(){this.name=rt,this.bracketNo=0,this.style=je,this.styles=it,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _e={};_e.importmodule=we("importmodule","tag",["string","builtin"]),_e.documentclass=we("documentclass","tag",["","atom"]),_e.usepackage=we("usepackage","tag",["atom"]),_e.begin=we("begin","tag",["atom"]),_e.end=we("end","tag",["atom"]),_e.label=we("label","tag",["atom"]),_e.ref=we("ref","tag",["atom"]),_e.eqref=we("eqref","tag",["atom"]),_e.cite=we("cite","tag",["atom"]),_e.bibitem=we("bibitem","tag",["atom"]),_e.Bibitem=we("Bibitem","tag",["atom"]),_e.RBibitem=we("RBibitem","tag",["atom"]),_e.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Ne(rt,je){rt.f=je}function dt(rt,je){var it;if(rt.match(/^\\[a-zA-Z@]+/)){var at=rt.current().slice(1);return it=_e.hasOwnProperty(at)?_e[at]:_e.DEFAULT,it=new it,tt(je,it),Ne(je,He),it.style}if(rt.match(/^\\[$&%#{}_]/)||rt.match(/^\\[,;!\/\\]/))return"tag";if(rt.match("\\["))return Ne(je,function(jt,Qe){return Ae(jt,Qe,"\\]")}),"keyword";if(rt.match("\\("))return Ne(je,function(jt,Qe){return Ae(jt,Qe,"\\)")}),"keyword";if(rt.match("$$"))return Ne(je,function(jt,Qe){return Ae(jt,Qe,"$$")}),"keyword";if(rt.match("$"))return Ne(je,function(jt,Qe){return Ae(jt,Qe,"$")}),"keyword";var xt=rt.next();if(xt=="%")return rt.skipToEnd(),"comment";if(xt=="}"||xt=="]"){if(it=be(je),it)it.closeBracket(xt),Ne(je,He);else return"error";return"bracket"}else return xt=="{"||xt=="["?(it=_e.DEFAULT,it=new it,tt(je,it),"bracket"):/\d/.test(xt)?(rt.eatWhile(/[\w.%]/),"atom"):(rt.eatWhile(/[\w\-_]/),it=Pe(je),it.name=="begin"&&(it.argument=rt.current()),it.styleIdentifier())}function Ae(rt,je,it){if(rt.eatSpace())return null;if(it&&rt.match(it))return Ne(je,dt),"keyword";if(rt.match(/^\\[a-zA-Z@]+/))return"tag";if(rt.match(/^[a-zA-Z]+/))return"variable-2";if(rt.match(/^\\[$&%#{}_]/)||rt.match(/^\\[,;!\/]/)||rt.match(/^[\^_&]/))return"tag";if(rt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(rt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var at=rt.next();return at=="{"||at=="}"||at=="["||at=="]"||at=="("||at==")"?"bracket":at=="%"?(rt.skipToEnd(),"comment"):"error"}function He(rt,je){var it=rt.peek(),at;return it=="{"||it=="["?(at=be(je),at.openBracket(it),rt.eat(it),Ne(je,dt),"bracket"):/[ \t\r]/.test(it)?(rt.eat(it),null):(Ne(je,dt),De(je),dt(rt,je))}return{startState:function(){var rt=Fe.inMathMode?function(je,it){return Ae(je,it)}:dt;return{cmdState:[],f:rt}},copyState:function(rt){return{cmdState:rt.cmdState.slice(),f:rt.f}},token:function(rt,je){return je.f(rt,je)},blankLine:function(rt){rt.f=dt,rt.cmdState.length=0},lineComment:"%"}}),fe.defineMIME("text/x-stex","stex"),fe.defineMIME("text/x-latex","stex")})},15525:function(Mn,rn,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";var Ze={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},Fe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};fe.defineMode("xml",function(tt,be){var De=tt.indentUnit,Pe={},we=be.htmlMode?Ze:Fe;for(var _e in we)Pe[_e]=we[_e];for(var _e in be)Pe[_e]=be[_e];var Ne,dt;function Ae(ht,Tt){function et(Dt){return Tt.tokenize=Dt,Dt(ht,Tt)}var Ut=ht.next();if(Ut=="<")return ht.eat("!")?ht.eat("[")?ht.match("CDATA[")?et(je("atom","]]>")):null:ht.match("--")?et(je("comment","-->")):ht.match("DOCTYPE",!0,!0)?(ht.eatWhile(/[\w\._\-]/),et(it(1))):null:ht.eat("?")?(ht.eatWhile(/[\w\._\-]/),Tt.tokenize=je("meta","?>"),"meta"):(Ne=ht.eat("/")?"closeTag":"openTag",Tt.tokenize=He,"tag bracket");if(Ut=="&"){var ft;return ht.eat("#")?ht.eat("x")?ft=ht.eatWhile(/[a-fA-F\d]/)&&ht.eat(";"):ft=ht.eatWhile(/[\d]/)&&ht.eat(";"):ft=ht.eatWhile(/[\w\.\-:]/)&&ht.eat(";"),ft?"atom":"error"}else return ht.eatWhile(/[^&<]/),null}Ae.isInText=!0;function He(ht,Tt){var et=ht.next();if(et==">"||et=="/"&&ht.eat(">"))return Tt.tokenize=Ae,Ne=et==">"?"endTag":"selfcloseTag","tag bracket";if(et=="=")return Ne="equals",null;if(et=="<"){Tt.tokenize=Ae,Tt.state=Qe,Tt.tagName=Tt.tagStart=null;var Ut=Tt.tokenize(ht,Tt);return Ut?Ut+" tag error":"tag error"}else return/[\'\"]/.test(et)?(Tt.tokenize=rt(et),Tt.stringStartCol=ht.column(),Tt.tokenize(ht,Tt)):(ht.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function rt(ht){var Tt=function(et,Ut){for(;!et.eol();)if(et.next()==ht){Ut.tokenize=He;break}return"string"};return Tt.isInAttribute=!0,Tt}function je(ht,Tt){return function(et,Ut){for(;!et.eol();){if(et.match(Tt)){Ut.tokenize=Ae;break}et.next()}return ht}}function it(ht){return function(Tt,et){for(var Ut;(Ut=Tt.next())!=null;){if(Ut=="<")return et.tokenize=it(ht+1),et.tokenize(Tt,et);if(Ut==">")if(ht==1){et.tokenize=Ae;break}else return et.tokenize=it(ht-1),et.tokenize(Tt,et)}return"meta"}}function at(ht,Tt,et){this.prev=ht.context,this.tagName=Tt,this.indent=ht.indented,this.startOfLine=et,(Pe.doNotIndent.hasOwnProperty(Tt)||ht.context&&ht.context.noIndent)&&(this.noIndent=!0)}function xt(ht){ht.context&&(ht.context=ht.context.prev)}function jt(ht,Tt){for(var et;;){if(!ht.context||(et=ht.context.tagName,!Pe.contextGrabbers.hasOwnProperty(et)||!Pe.contextGrabbers[et].hasOwnProperty(Tt)))return;xt(ht)}}function Qe(ht,Tt,et){return ht=="openTag"?(et.tagStart=Tt.column(),mt):ht=="closeTag"?We:Qe}function mt(ht,Tt,et){return ht=="word"?(et.tagName=Tt.current(),dt="tag",Ve):Pe.allowMissingTagName&&ht=="endTag"?(dt="tag bracket",Ve(ht,Tt,et)):(dt="error",mt)}function We(ht,Tt,et){if(ht=="word"){var Ut=Tt.current();return et.context&&et.context.tagName!=Ut&&Pe.implicitlyClosed.hasOwnProperty(et.context.tagName)&&xt(et),et.context&&et.context.tagName==Ut||Pe.matchClosing===!1?(dt="tag",Me):(dt="tag error",Ke)}else return Pe.allowMissingTagName&&ht=="endTag"?(dt="tag bracket",Me(ht,Tt,et)):(dt="error",Ke)}function Me(ht,Tt,et){return ht!="endTag"?(dt="error",Me):(xt(et),Qe)}function Ke(ht,Tt,et){return dt="error",Me(ht,Tt,et)}function Ve(ht,Tt,et){if(ht=="word")return dt="attribute",Mt;if(ht=="endTag"||ht=="selfcloseTag"){var Ut=et.tagName,ft=et.tagStart;return et.tagName=et.tagStart=null,ht=="selfcloseTag"||Pe.autoSelfClosers.hasOwnProperty(Ut)?jt(et,Ut):(jt(et,Ut),et.context=new at(et,Ut,ft==et.indented)),Qe}return dt="error",Ve}function Mt(ht,Tt,et){return ht=="equals"?Xe:(Pe.allowMissing||(dt="error"),Ve(ht,Tt,et))}function Xe(ht,Tt,et){return ht=="string"?Nt:ht=="word"&&Pe.allowUnquoted?(dt="string",Ve):(dt="error",Ve(ht,Tt,et))}function Nt(ht,Tt,et){return ht=="string"?Nt:Ve(ht,Tt,et)}return{startState:function(ht){var Tt={tokenize:Ae,state:Qe,indented:ht||0,tagName:null,tagStart:null,context:null};return ht!=null&&(Tt.baseIndent=ht),Tt},token:function(ht,Tt){if(!Tt.tagName&&ht.sol()&&(Tt.indented=ht.indentation()),ht.eatSpace())return null;Ne=null;var et=Tt.tokenize(ht,Tt);return(et||Ne)&&et!="comment"&&(dt=null,Tt.state=Tt.state(Ne||et,ht,Tt),dt&&(et=dt=="error"?et+" error":dt)),et},indent:function(ht,Tt,et){var Ut=ht.context;if(ht.tokenize.isInAttribute)return ht.tagStart==ht.indented?ht.stringStartCol+1:ht.indented+De;if(Ut&&Ut.noIndent)return fe.Pass;if(ht.tokenize!=He&&ht.tokenize!=Ae)return et?et.match(/^(\s*)/)[0].length:0;if(ht.tagName)return Pe.multilineTagIndentPastTag!==!1?ht.tagStart+ht.tagName.length+2:ht.tagStart+De*(Pe.multilineTagIndentFactor||1);if(Pe.alignCDATA&&/<!\[CDATA\[/.test(Tt))return 0;var ft=Tt&&/^<(\/)?([\w_:\.-]*)/.exec(Tt);if(ft&&ft[1])for(;Ut;)if(Ut.tagName==ft[2]){Ut=Ut.prev;break}else if(Pe.implicitlyClosed.hasOwnProperty(Ut.tagName))Ut=Ut.prev;else break;else if(ft)for(;Ut;){var Dt=Pe.contextGrabbers[Ut.tagName];if(Dt&&Dt.hasOwnProperty(ft[2]))Ut=Ut.prev;else break}for(;Ut&&Ut.prev&&!Ut.startOfLine;)Ut=Ut.prev;return Ut?Ut.indent+De:ht.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Pe.htmlMode?"html":"xml",helperType:Pe.htmlMode?"html":"xml",skipAttribute:function(ht){ht.state==Xe&&(ht.state=Ve)},xmlCurrentTag:function(ht){return ht.tagName?{name:ht.tagName,close:ht.type=="closeTag"}:null},xmlCurrentContext:function(ht){for(var Tt=[],et=ht.context;et;et=et.prev)et.tagName&&Tt.push(et.tagName);return Tt.reverse()}}}),fe.defineMIME("text/xml","xml"),fe.defineMIME("application/xml","xml"),fe.mimeModes.hasOwnProperty("text/html")||fe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(Mn,rn,ue){"use strict";ue.d(rn,{hP:function(){return zt}});var fe=function(ye,se){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,de){oe.__proto__=de}||function(oe,de){for(var pe in de)Object.prototype.hasOwnProperty.call(de,pe)&&(oe[pe]=de[pe])})(ye,se)};function Ze(ye,se){function oe(){this.constructor=ye}fe(ye,se),ye.prototype=se===null?Object.create(se):(oe.prototype=se.prototype,new oe)}function Fe(ye,se,oe,de){return new(oe||(oe=Promise))(function(pe,le){function Be(It){try{Ot(de.next(It))}catch(Ht){le(Ht)}}function lt(It){try{Ot(de.throw(It))}catch(Ht){le(Ht)}}function Ot(It){var Ht;It.done?pe(It.value):(Ht=It.value,Ht instanceof oe?Ht:new oe(function(Yt){Yt(Ht)})).then(Be,lt)}Ot((de=de.apply(ye,se||[])).next())})}function tt(ye,se){var oe,de,pe,le,Be={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return le={next:lt(0),throw:lt(1),return:lt(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function lt(Ot){return function(It){return function(Ht){if(oe)throw new TypeError("Generator is already executing.");for(;Be;)try{if(oe=1,de&&(pe=2&Ht[0]?de.return:Ht[0]?de.throw||((pe=de.return)&&pe.call(de),0):de.next)&&!(pe=pe.call(de,Ht[1])).done)return pe;switch(de=0,pe&&(Ht=[2&Ht[0],pe.value]),Ht[0]){case 0:case 1:pe=Ht;break;case 4:return Be.label++,{value:Ht[1],done:!1};case 5:Be.label++,de=Ht[1],Ht=[0];continue;case 7:Ht=Be.ops.pop(),Be.trys.pop();continue;default:if(pe=Be.trys,!((pe=pe.length>0&&pe[pe.length-1])||Ht[0]!==6&&Ht[0]!==2)){Be=0;continue}if(Ht[0]===3&&(!pe||Ht[1]>pe[0]&&Ht[1]<pe[3])){Be.label=Ht[1];break}if(Ht[0]===6&&Be.label<pe[1]){Be.label=pe[1],pe=Ht;break}if(pe&&Be.label<pe[2]){Be.label=pe[2],Be.ops.push(Ht);break}pe[2]&&Be.ops.pop(),Be.trys.pop();continue}Ht=se.call(ye,Be)}catch(Yt){Ht=[6,Yt],de=0}finally{oe=pe=0}if(5&Ht[0])throw Ht[1];return{value:Ht[0]?Ht[1]:void 0,done:!0}}([Ot,It])}}}function be(){for(var ye=0,se=0,oe=arguments.length;se<oe;se++)ye+=arguments[se].length;var de=Array(ye),pe=0;for(se=0;se<oe;se++)for(var le=arguments[se],Be=0,lt=le.length;Be<lt;Be++,pe++)de[pe]=le[Be];return de}var De=function(){function ye(){}return ye.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ye.setAttributes=function(se,oe){for(var de=0,pe=oe;de<pe.length;de++){var le=pe[de],Be=le[0],lt=le[1];se.setAttribute(Be,lt)}},ye.createRect=function(se,oe,de){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",se.toString()),pe.setAttribute("height",oe.toString()),de&&ye.setAttributes(pe,de),pe},ye.createLine=function(se,oe,de,pe,le){var Be=document.createElementNS("http://www.w3.org/2000/svg","line");return Be.setAttribute("x1",se.toString()),Be.setAttribute("y1",oe.toString()),Be.setAttribute("x2",de.toString()),Be.setAttribute("y2",pe.toString()),le&&ye.setAttributes(Be,le),Be},ye.createPolygon=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","polygon");return de.setAttribute("points",se),oe&&ye.setAttributes(de,oe),de},ye.createCircle=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","circle");return de.setAttribute("cx",(se/2).toString()),de.setAttribute("cy",(se/2).toString()),de.setAttribute("r",se.toString()),oe&&ye.setAttributes(de,oe),de},ye.createEllipse=function(se,oe,de){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(se/2).toString()),pe.setAttribute("cy",(oe/2).toString()),pe.setAttribute("rx",(se/2).toString()),pe.setAttribute("ry",(oe/2).toString()),de&&ye.setAttributes(pe,de),pe},ye.createGroup=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return se&&ye.setAttributes(oe,se),oe},ye.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ye.createMarker=function(se,oe,de,pe,le,Be,lt){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return ye.setAttributes(Ot,[["id",se],["orient",oe],["markerWidth",de.toString()],["markerHeight",pe.toString()],["refX",le.toString()],["refY",Be.toString()]]),Ot.appendChild(lt),Ot},ye.createText=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),se&&ye.setAttributes(oe,se),oe},ye.createTSpan=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","tspan");return de.textContent=se,oe&&ye.setAttributes(de,oe),de},ye.createImage=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return se&&ye.setAttributes(oe,se),oe},ye.createPoint=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return de.x=se,de.y=oe,de},ye.createPath=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","path");return de.setAttribute("d",se),oe&&ye.setAttributes(de,oe),de},ye}(),Pe=function(){function ye(){}return ye.addKey=function(se){ye.key=se},Object.defineProperty(ye,"isLicensed",{get:function(){return!!ye.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ye.key)},enumerable:!1,configurable:!0}),ye}(),we=function(){function ye(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ye.prototype.rasterize=function(se,oe,de){var pe=this;return new Promise(function(le){var Be=de!==void 0?de:document.createElement("canvas");se===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var lt=document.createElementNS("http://www.w3.org/2000/svg","svg");lt.setAttribute("xmlns","http://www.w3.org/2000/svg"),lt.setAttribute("width",oe.width.baseVal.valueAsString),lt.setAttribute("height",oe.height.baseVal.valueAsString),lt.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),lt.innerHTML=oe.innerHTML,pe.naturalSize===!0?(lt.width.baseVal.value=se.naturalWidth,lt.height.baseVal.value=se.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(lt.width.baseVal.value=pe.width,lt.height.baseVal.value=pe.height),Be.width=lt.width.baseVal.value,Be.height=lt.height.baseVal.value;var Ot=lt.outerHTML,It=Be.getContext("2d");pe.markersOnly!==!0&&It.drawImage(se,0,0,Be.width,Be.height);var Ht=window.URL,Yt=new Image(Be.width,Be.height);Yt.setAttribute("crossOrigin","anonymous");var an=new Blob([Ot],{type:"image/svg+xml"}),cn=Ht.createObjectURL(an);Yt.onload=function(){It.drawImage(Yt,0,0),Ht.revokeObjectURL(cn);var Sn=Be.toDataURL(pe.imageType,pe.imageQuality);le(Sn)},Yt.src=cn})},ye}(),_e=function(){},Ne=function(){function ye(se){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+se+"_"}return Object.defineProperty(ye.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ye.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(ye.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ye.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},ye.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)},ye.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 dt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ae("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ae("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ye.prototype.removeStyleSheet=function(){var se;this.styleSheet&&(((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ye}(),dt=function(ye,se){this.selector=ye,this.style=se},Ae=function(ye,se){this.localName=ye,this.style=se},He=function(){function ye(se,oe,de,pe,le){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=se,this.displayMode=oe,this.markerItems=de,this.uiStyleSettings=pe,this.styles=le,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ye.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 de=document.createElement("div");de.className=this.toolbarBlockStyleClass.name,de.style.whiteSpace="nowrap",this.uiContainer.appendChild(de),this.addActionButton(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(le){var Be=document.createElement("div");Be.className=""+oe.toolbarButtonStyleClass.name,Be.setAttribute("data-type-name",le.typeName),Be.innerHTML=le.icon,Be.addEventListener("click",function(){oe.markerToolbarButtonClicked(Be,le)}),oe.buttons.push(Be),oe.markerButtons.push(Be)}),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 pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<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(pe,'<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()},ye.prototype.addButtonClickListener=function(se){this.buttonClickListeners.push(se)},ye.prototype.removeButtonClickListener=function(se){this.buttonClickListeners.indexOf(se)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(se),1)},ye.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ye.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]))}},ye.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")},ye.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)})},ye.prototype.addActionButton=function(se,oe,de){var pe=this,le=document.createElement("div");switch(le.className=""+this.toolbarButtonStyleClass.name,le.innerHTML=oe,le.setAttribute("data-action",de),le.addEventListener("click",function(){pe.actionToolbarButtonClicked(le,de)}),de){case"select":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":le.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":le.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":le.style.fill=this.uiStyleSettings.closeButtonColor}se.appendChild(le),this.buttons.push(le)},ye.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ye.prototype.markerToolbarButtonClicked=function(se,oe){this.setActiveButton(se),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(de){return de("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},ye.prototype.actionToolbarButtonClicked=function(se,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(de){return de("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ye.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)},ye.prototype.setActiveMarkerButton=function(se){var oe=this.markerButtons.find(function(de){return de.getAttribute("data-type-name")===se});oe&&this.setActiveButton(oe)},ye.prototype.setCurrentMarker=function(se){var oe=this;this.currentMarker=se,this.buttons.filter(function(de){return/delete|notes/.test(de.getAttribute("data-action"))}).forEach(function(de){oe.currentMarker===void 0?(de.style.fillOpacity="0.4",de.style.pointerEvents="none"):(de.style.fillOpacity="1",de.style.pointerEvents="all")})},ye}(),rt=function(){function ye(se,oe,de,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=se,this.displayMode=oe,this.uiStyleSettings=de,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ye.prototype.addStyles=function(){var se;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
background-color: `+((se=this.uiStyleSettings.toolboxBackgroundColor)!==null&&se!==void 0?se:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new dt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ye.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)},ye.prototype.setPanelButtons=function(se){var oe,de,pe=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+" "+((de=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&de!==void 0?de:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(le){var Be;le.uiStyleSettings=pe.uiStyleSettings;var lt=document.createElement("div");lt.className=pe.toolboxButtonStyleClass.name+" "+((Be=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Be!==void 0?Be:pe.toolboxButtonStyleColorsClass.name),lt.innerHTML=le.icon,lt.title=le.title,lt.addEventListener("click",function(){pe.panelButtonClick(le)}),pe.panelButtons.push(lt),pe.buttonRow.appendChild(lt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ye.prototype.panelButtonClick=function(se){var oe=this,de=-1;if(se!==this.activePanel){de=this.panels.indexOf(se),this.panelRow.innerHTML="";var pe=se.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),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(le,Be){var lt,Ot;le.className=oe.toolboxButtonStyleClass.name+" "+(Be===de?""+((lt=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&lt!==void 0?lt:oe.toolboxActiveButtonStyleColorsClass.name):""+((Ot=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:oe.toolboxButtonStyleColorsClass.name))})},ye}(),je=function(ye,se){this.title=ye,this.icon=se},it=function(ye){function se(oe,de,pe,le){var Be=ye.call(this,oe,le||'<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 Be.colors=[],Be.addTransparent=!1,Be.colorBoxes=[],Be.colors=de,Be.currentColor=pe,Be.setCurrentColor=Be.setCurrentColor.bind(Be),Be.getColorBox=Be.getColorBox.bind(Be),Be}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var le=oe.getColorBox(pe);de.appendChild(le),oe.colorBoxes.push(le)}),de},se.prototype.getColorBox=function(oe){var de=this,pe=this.uiStyleSettings.toolbarHeight/4,le=this.uiStyleSettings.toolbarHeight-pe,Be=document.createElement("div");Be.style.display="inline-block",Be.style.boxSizing="content-box",Be.style.width=le-2+"px",Be.style.height=le-2+"px",Be.style.padding="1px",Be.style.marginRight="2px",Be.style.marginBottom="2px",Be.style.borderWidth="2px",Be.style.borderStyle="solid",Be.style.borderRadius=(le+2)/2+"px",Be.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Be.addEventListener("click",function(){de.setCurrentColor(oe,Be)});var lt=document.createElement("div");return lt.style.display="inline-block",lt.style.width=le-2+"px",lt.style.height=le-2+"px",lt.style.backgroundColor=oe,lt.style.borderRadius=le/2+"px",oe==="transparent"&&(lt.style.fill=this.uiStyleSettings.toolboxAccentColor,lt.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>`),Be.appendChild(lt),Be},se.prototype.setCurrentColor=function(oe,de){var pe=this;this.currentColor=oe,this.colorBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},se}(je),at=function(){function ye(se,oe,de){this._state="new",this._isSelected=!1,this._container=se,this._overlayContainer=oe,this.globalSettings=de,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ye.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ye.prototype.ownsTarget=function(se){return!1},Object.defineProperty(ye.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ye.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ye.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ye.prototype.pointerDown=function(se,oe){},ye.prototype.dblClick=function(se,oe){},ye.prototype.manipulate=function(se){},ye.prototype.pointerUp=function(se){this.stateChanged()},ye.prototype.dispose=function(){},ye.prototype.addMarkerVisualToContainer=function(se){this.container.childNodes.length>0?this.container.insertBefore(se,this.container.childNodes[0]):this.container.appendChild(se)},ye.prototype.getState=function(){return{typeName:ye.typeName,state:this.state,notes:this.notes}},ye.prototype.restoreState=function(se){this._state=se.state,this.notes=se.notes},ye.prototype.scale=function(se,oe){},ye.prototype.colorChanged=function(se){this.onColorChanged&&this.onColorChanged(se),this.stateChanged()},ye.prototype.fillColorChanged=function(se){this.onFillColorChanged&&this.onFillColorChanged(se),this.stateChanged()},ye.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)}},ye.typeName="MarkerBase",ye}(),xt=function(){function ye(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ye.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},ye}(),jt=function(){function ye(){this.GRIP_SIZE=10,this.visual=De.createGroup(),this.visual.appendChild(De.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(De.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ye.prototype.ownsTarget=function(se){return se===this.visual||se===this.visual.childNodes[0]||se===this.visual.childNodes[1]},ye}(),Qe=function(){function ye(){}return ye.toITransformMatrix=function(se){return{a:se.a,b:se.b,c:se.c,d:se.d,e:se.e,f:se.f}},ye.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},ye}(),mt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.left=0,le.top=0,le.width=0,le.height=0,le.defaultSize={x:50,y:20},le.offsetX=0,le.offsetY=0,le.rotationAngle=0,le.CB_DISTANCE=10,le._suppressMarkerCreateEvent=!1,le.container.transform.baseVal.appendItem(De.createTransform()),le.setupControlBox(),le}return Ze(se,ye),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 de=De.createTransform();this._visual.transform.baseVal.appendItem(de)},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),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 pe=this.unrotatePoint(oe);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(de),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(de)){this.activeGrip=this.rotatorGrip;var le=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=le.x-this.width/2,this.top=le.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Be=this.container.transform.baseVal.getItem(0);Be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},se.prototype.pointerUp=function(oe){var de=this.state;ye.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",de==="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 de=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(de.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(de.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(de):this.state==="rotate"&&this.rotate(oe)},se.prototype.resize=function(oe){var de=this.manipulationStartLeft,pe=this.manipulationStartWidth,le=this.manipulationStartTop,Be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:de=this.manipulationStartLeft+oe.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-de;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=this.manipulationStartWidth+oe.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:le=this.manipulationStartTop+oe.y-this.manipulationStartY,Be=this.manipulationStartHeight+this.manipulationStartTop-le;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Be=this.manipulationStartHeight+oe.y-this.manipulationStartY}pe>=0?(this.left=de,this.width=pe):(this.left=de+pe,this.width=-pe),Be>=0?(this.top=le,this.height=Be):(this.top=le+Be,this.height=-Be),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 de=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*de,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 de=this.container.getCTM(),pe=De.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(de)).x,y:pe.y}},se.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var de=this.container.getCTM();de=de.inverse();var pe=De.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(de)).x,y:pe.y}},se.prototype.select=function(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=De.createGroup();var oe=De.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=De.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=De.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 xt,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 jt;return oe.visual.transform.baseVal.appendItem(De.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,de=-oe/2,pe=de,le=(this.width+this.CB_DISTANCE)/2-oe/2,Be=(this.height+this.CB_DISTANCE)/2-oe/2,lt=this.height+this.CB_DISTANCE-oe/2,Ot=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,de,pe),this.positionGrip(this.controlGrips.topCenter.visual,le,pe),this.positionGrip(this.controlGrips.topRight.visual,Ot,pe),this.positionGrip(this.controlGrips.centerLeft.visual,de,Be),this.positionGrip(this.controlGrips.centerRight.visual,Ot,Be),this.positionGrip(this.controlGrips.bottomLeft.visual,de,lt),this.positionGrip(this.controlGrips.bottomCenter.visual,le,lt),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,lt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,le,pe-3*this.CB_DISTANCE)},se.prototype.positionGrip=function(oe,de,pe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,pe),oe.transform.baseVal.replaceItem(le,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:Qe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Qe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.left=de.left,this.top=de.top,this.width=de.width,this.height=de.height,this.rotationAngle=de.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Qe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,de.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Qe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,de.containerTransformMatrix))},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de);var pe=this.rotatePoint({x:this.left,y:this.top}),le=this.unrotatePoint({x:pe.x*oe,y:pe.y*de});this.left=le.x,this.top=le.y,this.width=this.width*oe,this.height=this.height*de,this.adjustControlBox()},se}(at),We=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=De.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,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),De.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&De.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&De.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&De.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&De.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},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.opacity=de.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setSize()},se.title="Rectangle marker",se}(mt),Me=function(ye){function se(oe,de,pe,le){var Be=ye.call(this,oe,le||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Be.widths=[],Be.widthBoxes=[],Be.widths=de,Be.currentWidth=pe,Be.setCurrentWidth=Be.setCurrentWidth.bind(Be),Be}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",this.widths.forEach(function(pe){var le=document.createElement("div");le.style.display="flex",le.style.flexGrow="2",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=pe===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentWidth(pe,le)}),de.appendChild(le);var Be=document.createElement("div");Be.innerText=pe.toString(),Be.style.marginRight="5px",le.appendChild(Be);var lt=document.createElement("div");lt.style.minHeight="20px",lt.style.flexGrow="2",lt.style.display="flex",lt.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=pe+"px solid "+oe.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",lt.appendChild(Ot),le.appendChild(lt),oe.widthBoxes.push(le)}),de},se.prototype.setCurrentWidth=function(oe,de){var pe=this;this.currentWidth=oe,this.widthBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},se}(je),Ke=function(ye){function se(oe,de,pe,le){var Be=ye.call(this,oe,le||'<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 Be.styles=[],Be.styleBoxes=[],Be.styles=de,Be.currentStyle=pe,Be.setCurrentStyle=Be.setCurrentStyle.bind(Be),Be}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",this.styles.forEach(function(pe){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/oe.styles.length-5+"%",le.style.borderColor=pe===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentStyle(pe,le)}),de.appendChild(le);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.overflow="hidden";var lt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
</svg>`;Be.innerHTML=lt,le.appendChild(Be),oe.styleBoxes.push(le)}),de},se.prototype.setCurrentStyle=function(oe,de){var pe=this;this.currentStyle=oe,this.styleBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},se}(je),Ve=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new it("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ke("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.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),Mt=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"},Xe=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.x1=0,le.y1=0,le.x2=0,le.y2=0,le.defaultLength=50,le.manipulationStartX=0,le.manipulationStartY=0,le.manipulationStartX1=0,le.manipulationStartY1=0,le.manipulationStartX2=0,le.manipulationStartY2=0,le.setupControlBox(),le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),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(de)?this.activeGrip=this.grip1:this.grip2.ownsTarget(de)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},se.prototype.pointerUp=function(oe){var de=this.state;ye.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",de==="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(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=De.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 jt;return oe.visual.transform.baseVal.appendItem(De.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,de,pe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,pe),oe.transform.baseVal.replaceItem(le,0)},se.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.x1=de.x1,this.y1=de.y1,this.x2=de.x2,this.y2=de.y2},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.x1=this.x1*oe,this.y1=this.y1*de,this.x2=this.x2*oe,this.y2=this.y2*de,this.adjustVisual(),this.adjustControlBox()},se}(at),Nt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new it("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ke("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},se.prototype.createVisual=function(){this.visual=De.createGroup(),this.selectorLine=De.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=De.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,de){ye.prototype.pointerDown.call(this,oe,de),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()),De.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),De.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),De.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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.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}(Xe),ht=function(ye){function se(oe,de,pe,le){var Be=ye.call(this,oe,le||'<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 Be.fonts=[],Be.fontBoxes=[],Be.fonts=de,Be.currentFont=pe,Be.setCurrentFont=Be.setCurrentFont.bind(Be),Be}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.flexGrow="2",this.fonts.forEach(function(pe){var le=document.createElement("div");le.style.display="inline-block",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/oe.fonts.length-5+"%",le.style.borderColor=pe===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentFont(pe,le)}),de.appendChild(le);var Be=document.createElement("div");Be.style.display="flex",Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.fontFamily=pe,Be.style.overflow="hidden";var lt=document.createElement("div");lt.style.whiteSpace="nowrap",lt.style.overflow="hidden",lt.style.textOverflow="ellipsis",lt.innerHTML="The quick brown fox jumps over the lazy dog",Be.appendChild(lt),le.appendChild(Be),oe.fontBoxes.push(le)}),de},se.prototype.setCurrentFont=function(oe,de){var pe=this;this.currentFont=oe,this.fontBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},se}(je),Tt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.color="transparent",le.padding=5,le.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",le.text=le.DEFAULT_TEXT,le.isMoved=!1,le.color=pe.defaultColor,le.fontFamily=pe.defaultFontFamily,le.defaultSize={x:100,y:30},le.setColor=le.setColor.bind(le),le.setFont=le.setFont.bind(le),le.renderText=le.renderText.bind(le),le.sizeText=le.sizeText.bind(le),le.textEditDivClicked=le.textEditDivClicked.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.setSize=le.setSize.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.colorPanel=new it("Color",pe.defaultColorSet,pe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.fontFamilyPanel=new ht("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){if(ye.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var de=!1;return this.textElement.childNodes.forEach(function(pe){pe===oe&&(de=!0)}),de},se.prototype.createVisual=function(){this.visual=De.createGroup(),this.bgRectangle=De.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=De.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(De.createTransform()),this.textElement.transform.baseVal.appendItem(De.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),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(de){oe.textElement.appendChild(De.createTSpan(de.trim()===""?" ":de.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},se.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),de=1;if(oe.width>0&&oe.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/oe.width,le=(1*this.height-this.height*this.padding*2/100)/oe.height;de=Math.min(pe,le)}return de},se.prototype.getTextPosition=function(oe){var de=this.textElement.getBBox(),pe=0,le=0;return de.width>0&&de.height>0&&(pe=(this.width-de.width*oe)/2,le=this.height/2-de.height*oe/2),{x:pe,y:le}},se.prototype.sizeText=function(){var oe=this.textElement.getBBox(),de=this.getTextScale(),pe=this.getTextPosition(de);pe.y-=oe.y*de,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+de+", "+de+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(de,de))},se.prototype.manipulate=function(oe){ye.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){ye.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(De.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),De.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},se.prototype.pointerUp=function(oe){var de=this.state;de==="creating"&&(this._suppressMarkerCreateEvent=!0),ye.prototype.pointerUp.call(this,oe),this.setSize(),(de==="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(de){de.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var de=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&de>.9;)de-=.1,oe.textEditor.style.fontSize=Math.max(de,.9)+"em"}),this.textEditor.addEventListener("keyup",function(de){de.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(de){if(de.clipboardData){var pe=de.clipboardData.getData("text"),le=window.getSelection();if(!le.rangeCount)return!1;le.deleteFromDocument(),le.getRangeAt(0).insertNode(document.createTextNode(pe)),de.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(),de=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),le={x:pe.width*oe,y:pe.height*oe};de.x-=le.x/2,de.y-=le.y/2,this.textEditor.style.top=de.y+"px",this.textEditor.style.left=de.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-de.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(){ye.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},se.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ye.prototype.deselect.call(this)},se.prototype.dblClick=function(oe,de){ye.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setColor=function(oe){this.textElement&&De.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&&De.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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.color=de.color,this.fontFamily=de.fontFamily,this.padding=de.padding,this.text=de.text,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),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}(mt),et=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.color="transparent",le.lineWidth=3,le.drawing=!1,le.pixelRatio=1,le.color=pe.defaultColor,le.lineWidth=pe.defaultStrokeWidth,le.pixelRatio=pe.freehandPixelRatio,le.setColor=le.setColor.bind(le),le.addCanvas=le.addCanvas.bind(le),le.finishCreation=le.finishCreation.bind(le),le.setLineWidth=le.setLineWidth.bind(le),le.colorPanel=new it("Color",pe.defaultColorSet,pe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.lineWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.lineWidthPanel.onWidthChanged=le.setLineWidth,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},se.prototype.createVisual=function(){this.visual=De.createGroup(),this.drawingImage=De.createImage(),this.visual.appendChild(this.drawingImage);var oe=De.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,de){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):ye.prototype.pointerDown.call(this,oe,de)},se.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),De.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),De.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()):ye.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(),ye.prototype.select.call(this)},se.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ye.prototype.deselect.call(this)},se.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),de=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=de[0],le=de[1],Be=de[2],lt=de[3],Ot=!1,It=0;It<this.canvasElement.height;It++)for(var Ht=0;Ht<this.canvasElement.width;Ht++)oe.data[It*this.canvasElement.width*4+4*Ht+3]>0&&(Ot=!0,It<le&&(le=It),Ht<pe&&(pe=Ht),It>lt&&(lt=It),Ht>Be&&(Be=Ht));if(Ot){this.left=pe/this.pixelRatio,this.top=le/this.pixelRatio,this.width=(Be-pe)/this.pixelRatio,this.height=(lt-le)/this.pixelRatio;var Yt=document.createElement("canvas");Yt.width=Be-pe,Yt.height=lt-le,Yt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,le,Be-pe,lt-le),0,0),this.drawingImgUrl=Yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},se.prototype.setDrawingImage=function(){De.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),De.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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){this.createVisual(),ye.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),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}(mt),Ut=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,pe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return le.typeBoxes=[],le.currentType=de,le.setCurrentType=le.setCurrentType.bind(le),le}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2";for(var pe=function(lt){var Ot="both";switch(lt){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=Ot===le.currentType?le.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){oe.setCurrentType(Ot,It)}),de.appendChild(It),Ot==="both"||Ot==="start"){var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ht.style.marginLeft="5px",It.appendChild(Ht)}var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.alignItems="center",Yt.style.minHeight="20px",Yt.style.flexGrow="2";var an=document.createElement("hr");if(an.style.minWidth="20px",an.style.border="0px",an.style.borderTop="3px solid "+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee"),an.style.flexGrow="2",Yt.appendChild(an),It.appendChild(Yt),Ot==="both"||Ot==="end"){var cn=document.createElement("div");cn.style.display="flex",cn.style.alignItems="center",cn.style.minHeight="20px",cn.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,cn.style.marginRight="5px",It.appendChild(cn)}le.typeBoxes.push(It)},le=this,Be=0;Be<4;Be++)pe(Be);return de},se.prototype.setCurrentType=function(oe,de){var pe=this;this.currentType=oe,this.typeBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},se}(je),ft=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.arrowType="end",le.arrowBaseHeight=10,le.arrowBaseWidth=10,le.getArrowPoints=le.getArrowPoints.bind(le),le.setArrowType=le.setArrowType.bind(le),le.arrowTypePanel=new Ut("Arrow type","end"),le.arrowTypePanel.onArrowTypeChanged=le.setArrowType,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},se.prototype.getArrowPoints=function(oe,de){var pe=this.arrowBaseWidth+2*this.strokeWidth,le=this.arrowBaseHeight+2*this.strokeWidth;return oe-pe/2+","+(de+le/2)+" "+oe+","+(de-le/2)+" "+(oe+pe/2)+","+(de+le/2)},se.prototype.createTips=function(){this.arrow1=De.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(De.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=De.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(De.createTransform()),this.visual.appendChild(this.arrow2)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ye.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",De.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),De.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 de=this.arrow1.transform.baseVal.getItem(0);de.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(de,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.arrowType=de.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}(Nt),Dt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.fillColor=pe.defaultFillColor,le.strokeWidth=0,le.fillPanel=new it("Color",pe.defaultColorSet,pe.defaultFillColor),le.fillPanel.onColorChanged=le.setFillColor,le}return Ze(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.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),Bt=function(ye){function se(oe,de,pe,le){var Be=ye.call(this,oe,le||'<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 Be.opacities=[],Be.opacityBoxes=[],Be.opacities=de,Be.currentOpacity=pe,Be.setCurrentOpacity=Be.setCurrentOpacity.bind(Be),Be}return Ze(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",de.style.justifyContent="space-between",this.opacities.forEach(function(pe){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="center",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=pe===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentOpacity(pe,le)}),de.appendChild(le);var Be=document.createElement("div");Be.innerText=100*pe+"%",le.appendChild(Be),oe.opacityBoxes.push(le)}),de},se.prototype.setCurrentOpacity=function(oe,de){var pe=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},se}(je),bt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.setOpacity=le.setOpacity.bind(le),le.fillColor=pe.defaultHighlightColor,le.strokeWidth=0,le.opacity=pe.defaultHighlightOpacity,le.fillPanel=new it("Color",pe.defaultColorSet,le.fillColor),le.fillPanel.onColorChanged=le.setFillColor,le.opacityPanel=new Bt("Opacity",pe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return Ze(se,ye),se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&De.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=ye.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}(Dt),$e='<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>',gt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.bgColor="transparent",le.tipPosition={x:0,y:0},le.tipBase1Position={x:0,y:0},le.tipBase2Position={x:0,y:0},le.tipMoving=!1,le.color=pe.defaultStrokeColor,le.bgColor=pe.defaultFillColor,le.fontFamily=pe.defaultFontFamily,le.defaultSize={x:100,y:30},le.setBgColor=le.setBgColor.bind(le),le.getTipPoints=le.getTipPoints.bind(le),le.positionTip=le.positionTip.bind(le),le.setTipPoints=le.setTipPoints.bind(le),le.colorPanel=new it("Text color",pe.defaultColorSet,le.color,$e),le.colorPanel.onColorChanged=le.setColor,le.bgColorPanel=new it("Fill color",pe.defaultColorSet,le.bgColor,xe),le.bgColorPanel.onColorChanged=le.setBgColor,le.fontFamilyPanel=new ht("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.tipGrip=new jt,le.tipGrip.visual.transform.baseVal.appendItem(De.createTransform()),le.controlBox.appendChild(le.tipGrip.visual),le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return ye.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},se.prototype.createTip=function(){De.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=De.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},se.prototype.pointerDown=function(oe,de){this.state==="new"&&ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(de)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ye.prototype.pointerDown.call(this,oe,de)},se.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ye.prototype.pointerUp.call(this,oe);else{var de=this.state==="creating";ye.prototype.pointerUp.call(this,oe),this.setTipPoints(de),this.positionTip()}},se.prototype.manipulate=function(oe){if(this.tipMoving){var de=this.unrotatePoint(oe);this.tipPosition={x:de.x-this.manipulationStartLeft,y:de.y-this.manipulationStartTop},this.positionTip()}else ye.prototype.manipulate.call(this,oe)},se.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(De.setAttributes(this.bgRectangle,[["fill",oe]]),De.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 de=Math.min(this.height/2,15),pe=this.height/5;oe&&(this.tipPosition={x:de+pe/2,y:this.height+20});var le=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:0},this.tipBase2Position={x:de+pe,y:0}):(this.tipBase1Position={x:0,y:de},this.tipBase2Position={x:0,y:de+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-pe,y:0},this.tipBase2Position={x:this.width-de,y:0}):(this.tipBase1Position={x:this.width,y:de},this.tipBase2Position={x:this.width,y:de+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?le<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-pe,y:this.height},this.tipBase2Position={x:this.width-de,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-de-pe},this.tipBase2Position={x:this.width,y:this.height-de}):le<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:this.height},this.tipBase2Position={x:de+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-de},this.tipBase2Position={x:0,y:this.height-de-pe})},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.positionTip()},se.prototype.positionTip=function(){De.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(),ye.prototype.select.call(this)},se.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.bgColor=de.bgColor,this.tipPosition=de.tipPosition,ye.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*de},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}(Tt),en=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.fillColor=pe.defaultFillColor,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.setOpacity=le.setOpacity.bind(le),le.createVisual=le.createVisual.bind(le),le.strokePanel=new it("Line color",be(pe.defaultColorSet,["transparent"]),pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new it("Fill color",be(pe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ke("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.opacityPanel=new Bt("Opacity",pe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=De.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,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),De.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){ye.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&De.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&De.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&De.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&De.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&De.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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.opacity=de.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),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}(mt),Wt=function(ye){function se(oe,de,pe){return ye.call(this,oe,de,pe)||this}return Ze(se,ye),Object.defineProperty(se.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},se.prototype.createTips=function(){this.tip1=De.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(De.createTransform()),this.visual.appendChild(this.tip1),this.tip2=De.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(De.createTransform()),this.visual.appendChild(this.tip2)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ye.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(De.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()]]),De.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),de=this.tip1.transform.baseVal.getItem(0);de.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(de,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,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=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.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}(Nt),qe=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.strokePanel.colors=pe.defaultColorSet,le.fillColor="transparent",le}return Ze(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.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}(en),Ye=function(){function ye(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ye.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))},ye.prototype.replaceLastUndoStep=function(se){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=se)},ye.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ye.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}},ye.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ye}(),Lt=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.curveX=0,le.curveY=0,le.manipulationStartCurveX=0,le.manipulationStartCurveY=0,le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.positionGrips=le.positionGrips.bind(le),le.addControlGrips=le.addControlGrips.bind(le),le.adjustVisual=le.adjustVisual.bind(le),le.setupControlBox=le.setupControlBox.bind(le),le.resize=le.resize.bind(le),le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new it("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ke("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.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=De.createGroup(),this.selectorCurve=De.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=De.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,de){ye.prototype.pointerDown.call(this,oe,de),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(de)&&(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()),De.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),De.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),De.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setupControlBox=function(){ye.prototype.setupControlBox.call(this),this.curveControlLine1=De.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=De.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,ye.prototype.addControlGrips.call(this)},se.prototype.positionGrips=function(){ye.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),ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ye.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,de){this.curveX=this.curveX*oe,this.curveY=this.curveY*de,ye.prototype.scale.call(this,oe,de)},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},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.curveX=de.curveX,this.curveY=de.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}(Xe),mn=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,de,pe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.textColor="transparent",le.fontSize="1rem",le.isMoved=!1,le.captionText="Caption",le.PADDING=5,le.captionBoxWidth=0,le.captionBoxHeight=0,le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.fillColor=pe.defaultFillColor,le.textColor=pe.defaultStrokeColor,le.fontFamily=pe.defaultFontFamily,le.fontSize=pe.defaultCaptionFontSize,le.captionText=pe.defaultCaptionText,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le.sizeCaption=le.sizeCaption.bind(le),le.setCaptionText=le.setCaptionText.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.finishTextEditing=le.finishTextEditing.bind(le),le.setFont=le.setFont.bind(le),le.setTextColor=le.setTextColor.bind(le),le.strokePanel=new it("Line color",be(pe.defaultColorSet,["transparent"]),le.strokeColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new it("Fill color",be(pe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new Me("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ke("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.fontFamilyPanel=new ht("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.textColorPanel=new it("Text color",pe.defaultColorSet,le.textColor,$e),le.textColorPanel.onColorChanged=le.setTextColor,le}return Ze(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},se.prototype.createVisual=function(){this.visual=De.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=De.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=De.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=De.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,de){ye.prototype.pointerDown.call(this,oe,de),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){ye.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){ye.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),De.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')"]]),De.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(de){de.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(de){de.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(de){de.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&&De.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&&De.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),De.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},se.prototype.pointerUp=function(oe){ye.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,de){ye.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&De.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&De.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&De.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&De.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},ye.prototype.getState.call(this));return oe.typeName=this.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.textColor=de.textColor,this.fontFamily=de.fontFamily,this.captionText=de.captionText,this.fontSize=de.fontSize,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),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}(mt),Qt=function(){function ye(se,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=se,this.cancelable=oe}return Object.defineProperty(ye.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ye.prototype.preventDefault=function(){this._defaultPrevented=!0},ye}(),dn=function(ye){function se(oe,de,pe){var le=ye.call(this,oe,!1)||this;return le.dataUrl=de,le.state=pe,le}return Ze(se,ye),se}(Qt),Zt=function(ye){function se(oe,de,pe){pe===void 0&&(pe=!1);var le=ye.call(this,oe,pe)||this;return le.marker=de,le}return Ze(se,ye),se}(Qt),Vt=function(){function ye(){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 ye.prototype.addEventListener=function(se,oe){this[se].push(oe)},ye.prototype.removeEventListener=function(se,oe){var de=this[se].indexOf(oe);de>-1&&this[se].splice(de,1)},ye}(),zt=function(){function ye(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 Mt,this._isOpen=!1,this.undoRedoManager=new Ye,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ye.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(ye.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ve,et,ft,Tt,qe,en,bt,gt,Wt,Dt,Nt,Lt,mn]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ve,et,ft,Tt,en,bt,gt]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ve,et,ft,Tt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(se){var oe=this;this._availableMarkerTypes.splice(0),se.forEach(function(de){if(typeof de=="string"){var pe=oe.ALL_MARKER_TYPES.find(function(le){return le.typeName===de});pe!==void 0&&oe._availableMarkerTypes.push(pe)}else oe._availableMarkerTypes.push(de)})},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.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(ye.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ye.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ye.prototype.show=function(){var se=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new Qt(se))})},ye.prototype.render=function(){return Fe(this,void 0,void 0,function(){var se;return tt(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(se=new we).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()]}})})},ye.prototype.close=function(se){var oe=this;if(se===void 0&&(se=!1),this.isOpen){var de=!1;se||this.eventListeners.beforeclose.forEach(function(pe){var le=new Qt(oe,!0);pe(le),le.defaultPrevented&&(de=!0)}),de||(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(pe){return pe(new Qt(oe))}),this.detachEvents(),this._isOpen=!1)}},ye.prototype.addMarkersToToolbar=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];(se=this._availableMarkerTypes).push.apply(se,oe)},ye.prototype.addRenderEventListener=function(se){this.addEventListener("render",function(oe){se(oe.dataUrl,oe.state)})},ye.prototype.removeRenderEventListener=function(se){},ye.prototype.addCloseEventListener=function(se){this.addEventListener("close",function(){se()})},ye.prototype.removeCloseEventListener=function(se){},ye.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))},ye.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,de=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/se;this.resize(oe,de)},ye.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ye.prototype.resize=function(se,oe){this._isResizing=!0;var de=se/this.imageWidth,pe=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(de,pe),this._isResizing=!1},ye.prototype.scaleMarkers=function(se,oe){var de,pe=this;this._currentMarker&&this._currentMarker instanceof Tt?this._currentMarker.scale(se,oe):(de=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(le){le!==pe._currentMarker&&le.scale(se,oe)}),de!==void 0&&this.setCurrentMarker(de)},ye.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"},ye.prototype.setTopLeft=function(){var se=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=se.left-oe.left,this.top=se.top-oe.top},ye.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)},ye.prototype.addDefs=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];this.defs=De.createDefs(),this.addDefsToImage(),(se=this.defs).append.apply(se,oe)},ye.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ye.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)},ye.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ye.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ye.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)},ye.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ye.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)},ye.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()},ye.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")},ye.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"},ye.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ye.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 rt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ye.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ye.prototype.removeMarker=function(se){this.markerImage.removeChild(se.container),this.markers.indexOf(se)>-1&&this.markers.splice(this.markers.indexOf(se),1),se.dispose()},ye.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())},ye.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()}},ye.prototype.deleteSelectedMarker=function(){var se=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var le=new Zt(se,se._currentMarker,!0);pe(le),le.defaultPrevented&&(oe=!0)}),!oe){var de=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(pe){return pe(new Zt(se,de))})}}},ye.prototype.clear=function(){var se=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Be){var lt=new Zt(se,void 0,!0);Be(lt),lt.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var de=function(Be){var lt=pe.markers[Be];pe.setCurrentMarker(pe.markers[Be]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(Ot){return Ot(new Zt(se,lt))})},pe=this,le=this.markers.length-1;le>=0;le--)de(le);this.addUndoStep()}},Object.defineProperty(ye.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ye.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))},ye.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)},ye.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ye.prototype.addUndoStep=function(){var se=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),de=this.undoRedoManager.getLastUndoStep();if(!de||de.width===oe.width&&de.height===oe.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(le){return le(new Qt(se))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(le){return le(new Qt(se))})}},ye.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ye.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(de){return de(new Qt(se))}))},ye.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ye.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(de){return de(new Qt(se))}))},ye.prototype.stepZoom=function(){var se=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=se<this.zoomSteps.length-1?this.zoomSteps[se+1]:this.zoomSteps[0]},ye.prototype.panTo=function(se){this.contentDiv.scrollBy({left:this.prevPanPoint.x-se.x,top:this.prevPanPoint.y-se.y}),this.prevPanPoint=se},ye.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var se,oe,de=this;return tt(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return se=pe.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(le){return le(new dn(de,se,oe))}),this.close(!0),[2]}})})},ye.prototype.getState=function(se){se===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(de){return oe.markers.push(de.getState())}),oe},ye.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(de){var pe=oe._availableMarkerTypes.find(function(Be){return Be.typeName===de.typeName});if(pe!==void 0){var le=oe.addNewMarker(pe);le.restoreState(de),oe.markers.push(le)}}),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(de){return de(new Qt(oe))})},ye.prototype.addNewMarker=function(se){var oe=De.createGroup();return this.markerImage.appendChild(oe),new se(oe,this.overlayContainer,this.settings)},ye.prototype.createNewMarker=function(se){var oe,de=this;(oe=typeof se=="string"?this._availableMarkerTypes.find(function(pe){return pe.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(pe){return pe(new Zt(de,de._currentMarker))}))},ye.prototype.markerCreated=function(se){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(se),this.setCurrentMarker(se),se instanceof et&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(et):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(de){return de(new Zt(oe,oe._currentMarker))})},ye.prototype.colorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=se,this.settings.defaultStrokeColor=se)},ye.prototype.fillColorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=se)},ye.prototype.markerStateChanged=function(se){var oe=this;this.eventListeners.markerchange.forEach(function(de){return de(new Zt(oe,se))})},ye.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(de){return de(new Zt(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(de){return de(new Zt(oe,oe._currentMarker))}))},ye.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(de){return de.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))},ye.prototype.onDblClick=function(se){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(de){return de.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()}},ye.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}))},ye.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()},ye.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ye.prototype.onKeyUp=function(se){this._currentMarker===void 0||this.notesArea!==void 0||se.key!=="Delete"&&se.key!=="Backspace"||this.deleteSelectedMarker()},ye.prototype.clientToLocalCoordinates=function(se,oe){var de=this.markerImage.getBoundingClientRect();return{x:(se-de.left)/this.zoomLevel,y:(oe-de.top)/this.zoomLevel}},ye.prototype.onWindowResize=function(){this.positionUI()},ye.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()},ye.prototype.addLicenseKey=function(se){Pe.addKey(se)},ye.prototype.addEventListener=function(se,oe){this.eventListeners.addEventListener(se,oe)},ye.prototype.removeEventListener=function(se,oe){this.eventListeners.removeEventListener(se,oe)},ye.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(ye.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ye.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 Qt(se))}))},ye.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 Qt(se))}))},ye.instanceCounter=0,ye}()},5630:function(Mn,rn,ue){"use strict";var fe=ue(60499),Ze=ue(85899),Fe=ue(18642),tt=ue(72190),be=ue(42244),De=ue(92310),Pe=ue.n(De),we=ue(18929),_e=ue(59301),Ne=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],dt=(0,_e.forwardRef)(function(Ae,He){var rt,je=Ae.prefixCls,it=je===void 0?"rc-checkbox":je,at=Ae.className,xt=Ae.style,jt=Ae.checked,Qe=Ae.disabled,mt=Ae.defaultChecked,We=mt===void 0?!1:mt,Me=Ae.type,Ke=Me===void 0?"checkbox":Me,Ve=Ae.title,Mt=Ae.onChange,Xe=(0,be.Z)(Ae,Ne),Nt=(0,_e.useRef)(null),ht=(0,we.Z)(We,{value:jt}),Tt=(0,tt.Z)(ht,2),et=Tt[0],Ut=Tt[1];(0,_e.useImperativeHandle)(He,function(){return{focus:function(){var bt;(bt=Nt.current)===null||bt===void 0||bt.focus()},blur:function(){var bt;(bt=Nt.current)===null||bt===void 0||bt.blur()},input:Nt.current}});var ft=Pe()(it,at,(rt={},(0,Fe.Z)(rt,"".concat(it,"-checked"),et),(0,Fe.Z)(rt,"".concat(it,"-disabled"),Qe),rt)),Dt=function(bt){Qe||("checked"in Ae||Ut(bt.target.checked),Mt==null||Mt({target:(0,Ze.Z)((0,Ze.Z)({},Ae),{},{type:Ke,checked:bt.target.checked}),stopPropagation:function(){bt.stopPropagation()},preventDefault:function(){bt.preventDefault()},nativeEvent:bt.nativeEvent}))};return _e.createElement("span",{className:ft,title:Ve,style:xt},_e.createElement("input",(0,fe.Z)({},Xe,{className:"".concat(it,"-input"),ref:Nt,onChange:Dt,disabled:Qe,checked:!!et,type:Ke})),_e.createElement("span",{className:"".concat(it,"-inner")}))});rn.Z=dt},31561:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ke}});var fe=ue(60499),Ze=ue(18642),Fe=ue(72190),tt=ue(42244),be=ue(35593),De=ue(92310),Pe=ue.n(De),we=ue(8654),_e=ue(59301),Ne=ue(10228),dt=ue(16089),Ae=Ne.Z.ESC,He=Ne.Z.TAB;function rt(Ve){var Mt=Ve.visible,Xe=Ve.triggerRef,Nt=Ve.onVisibleChange,ht=Ve.autoFocus,Tt=Ve.overlayRef,et=_e.useRef(!1),Ut=function(){if(Mt){var bt,$e;(bt=Xe.current)===null||bt===void 0||($e=bt.focus)===null||$e===void 0||$e.call(bt),Nt==null||Nt(!1)}},ft=function(){var bt;return(bt=Tt.current)!==null&&bt!==void 0&&bt.focus?(Tt.current.focus(),et.current=!0,!0):!1},Dt=function(bt){switch(bt.keyCode){case Ae:Ut();break;case He:{var $e=!1;et.current||($e=ft()),$e?bt.preventDefault():Ut();break}}};_e.useEffect(function(){return Mt?(window.addEventListener("keydown",Dt),ht&&(0,dt.Z)(ft,3),function(){window.removeEventListener("keydown",Dt),et.current=!1}):function(){et.current=!1}},[Mt])}var je=(0,_e.forwardRef)(function(Ve,Mt){var Xe=Ve.overlay,Nt=Ve.arrow,ht=Ve.prefixCls,Tt=(0,_e.useMemo)(function(){var Ut;return typeof Xe=="function"?Ut=Xe():Ut=Xe,Ut},[Xe]),et=(0,we.sQ)(Mt,Tt==null?void 0:Tt.ref);return _e.createElement(_e.Fragment,null,Nt&&_e.createElement("div",{className:"".concat(ht,"-arrow")}),_e.cloneElement(Tt,{ref:(0,we.Yr)(Tt)?et:void 0}))}),it=je,at={adjustX:1,adjustY:1},xt=[0,0],jt={topLeft:{points:["bl","tl"],overflow:at,offset:[0,-4],targetOffset:xt},top:{points:["bc","tc"],overflow:at,offset:[0,-4],targetOffset:xt},topRight:{points:["br","tr"],overflow:at,offset:[0,-4],targetOffset:xt},bottomLeft:{points:["tl","bl"],overflow:at,offset:[0,4],targetOffset:xt},bottom:{points:["tc","bc"],overflow:at,offset:[0,4],targetOffset:xt},bottomRight:{points:["tr","br"],overflow:at,offset:[0,4],targetOffset:xt}},Qe=jt,mt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function We(Ve,Mt){var Xe,Nt=Ve.arrow,ht=Nt===void 0?!1:Nt,Tt=Ve.prefixCls,et=Tt===void 0?"rc-dropdown":Tt,Ut=Ve.transitionName,ft=Ve.animation,Dt=Ve.align,Bt=Ve.placement,bt=Bt===void 0?"bottomLeft":Bt,$e=Ve.placements,xe=$e===void 0?Qe:$e,gt=Ve.getPopupContainer,en=Ve.showAction,Wt=Ve.hideAction,qe=Ve.overlayClassName,Ye=Ve.overlayStyle,Lt=Ve.visible,mn=Ve.trigger,Qt=mn===void 0?["hover"]:mn,dn=Ve.autoFocus,Zt=Ve.overlay,Vt=Ve.children,zt=Ve.onVisibleChange,ye=(0,tt.Z)(Ve,mt),se=_e.useState(),oe=(0,Fe.Z)(se,2),de=oe[0],pe=oe[1],le="visible"in Ve?Lt:de,Be=_e.useRef(null),lt=_e.useRef(null),Ot=_e.useRef(null);_e.useImperativeHandle(Mt,function(){return Be.current});var It=function(ot){pe(ot),zt==null||zt(ot)};rt({visible:le,triggerRef:Ot,onVisibleChange:It,autoFocus:dn,overlayRef:lt});var Ht=function(ot){var St=Ve.onOverlayClick;pe(!1),St&&St(ot)},Yt=function(){return _e.createElement(it,{ref:lt,overlay:Zt,prefixCls:et,arrow:ht})},an=function(){return typeof Zt=="function"?Yt:Yt()},cn=function(){var ot=Ve.minOverlayWidthMatchTrigger,St=Ve.alignPoint;return"minOverlayWidthMatchTrigger"in Ve?ot:!St},Sn=function(){var ot=Ve.openClassName;return ot!==void 0?ot:"".concat(et,"-open")},wt=_e.cloneElement(Vt,{className:Pe()((Xe=Vt.props)===null||Xe===void 0?void 0:Xe.className,le&&Sn()),ref:(0,we.Yr)(Vt)?(0,we.sQ)(Ot,Vt.ref):void 0}),on=Wt;return!on&&Qt.indexOf("contextMenu")!==-1&&(on=["click"]),_e.createElement(be.Z,(0,fe.Z)({builtinPlacements:xe},ye,{prefixCls:et,ref:Be,popupClassName:Pe()(qe,(0,Ze.Z)({},"".concat(et,"-show-arrow"),ht)),popupStyle:Ye,action:Qt,showAction:en,hideAction:on,popupPlacement:bt,popupAlign:Dt,popupTransitionName:Ut,popupAnimation:ft,popupVisible:le,stretch:cn()?"minWidth":"",popup:an(),onPopupVisibleChange:It,onPopupClick:Ht,getPopupContainer:gt}),wt)}var Me=_e.forwardRef(We),Ke=Me},93681:function(Mn,rn,ue){"use strict";ue.r(rn),ue.d(rn,{BaseInput:function(){return Ne},default:function(){return jt}});var fe=ue(60499),Ze=ue(85899),Fe=ue(18642),tt=ue(43749),be=ue(92310),De=ue.n(be),Pe=ue(59301),we=ue(5643),_e=function(mt){var We,Me,Ke=mt.inputElement,Ve=mt.prefixCls,Mt=mt.prefix,Xe=mt.suffix,Nt=mt.addonBefore,ht=mt.addonAfter,Tt=mt.className,et=mt.style,Ut=mt.disabled,ft=mt.readOnly,Dt=mt.focused,Bt=mt.triggerFocus,bt=mt.allowClear,$e=mt.value,xe=mt.handleReset,gt=mt.hidden,en=mt.classes,Wt=mt.classNames,qe=mt.dataAttrs,Ye=mt.styles,Lt=mt.components,mn=(Lt==null?void 0:Lt.affixWrapper)||"span",Qt=(Lt==null?void 0:Lt.groupWrapper)||"span",dn=(Lt==null?void 0:Lt.wrapper)||"span",Zt=(Lt==null?void 0:Lt.groupAddon)||"span",Vt=(0,Pe.useRef)(null),zt=function(Yt){var an;(an=Vt.current)!==null&&an!==void 0&&an.contains(Yt.target)&&(Bt==null||Bt())},ye=function(){var Yt;if(!bt)return null;var an=!Ut&&!ft&&$e,cn="".concat(Ve,"-clear-icon"),Sn=(0,tt.Z)(bt)==="object"&&bt!==null&&bt!==void 0&&bt.clearIcon?bt.clearIcon:"\u2716";return Pe.createElement("span",{onClick:xe,onMouseDown:function(on){return on.preventDefault()},className:De()(cn,(Yt={},(0,Fe.Z)(Yt,"".concat(cn,"-hidden"),!an),(0,Fe.Z)(Yt,"".concat(cn,"-has-suffix"),!!Xe),Yt)),role:"button",tabIndex:-1},Sn)},se=(0,Pe.cloneElement)(Ke,{value:$e,hidden:gt,className:De()((We=Ke.props)===null||We===void 0?void 0:We.className,!(0,we.X3)(mt)&&!(0,we.He)(mt)&&Tt)||null,style:(0,Ze.Z)((0,Ze.Z)({},(Me=Ke.props)===null||Me===void 0?void 0:Me.style),!(0,we.X3)(mt)&&!(0,we.He)(mt)?et:{})});if((0,we.X3)(mt)){var oe,de="".concat(Ve,"-affix-wrapper"),pe=De()(de,(oe={},(0,Fe.Z)(oe,"".concat(de,"-disabled"),Ut),(0,Fe.Z)(oe,"".concat(de,"-focused"),Dt),(0,Fe.Z)(oe,"".concat(de,"-readonly"),ft),(0,Fe.Z)(oe,"".concat(de,"-input-with-clear-btn"),Xe&&bt&&$e),oe),!(0,we.He)(mt)&&Tt,en==null?void 0:en.affixWrapper,Wt==null?void 0:Wt.affixWrapper),le=(Xe||bt)&&Pe.createElement("span",{className:De()("".concat(Ve,"-suffix"),Wt==null?void 0:Wt.suffix),style:Ye==null?void 0:Ye.suffix},ye(),Xe);se=Pe.createElement(mn,(0,fe.Z)({className:pe,style:(0,Ze.Z)((0,Ze.Z)({},(0,we.He)(mt)?void 0:et),Ye==null?void 0:Ye.affixWrapper),hidden:!(0,we.He)(mt)&&gt,onClick:zt},qe==null?void 0:qe.affixWrapper,{ref:Vt}),Mt&&Pe.createElement("span",{className:De()("".concat(Ve,"-prefix"),Wt==null?void 0:Wt.prefix),style:Ye==null?void 0:Ye.prefix},Mt),(0,Pe.cloneElement)(Ke,{value:$e,hidden:null}),le)}if((0,we.He)(mt)){var Be="".concat(Ve,"-group"),lt="".concat(Be,"-addon"),Ot=De()("".concat(Ve,"-wrapper"),Be,en==null?void 0:en.wrapper),It=De()("".concat(Ve,"-group-wrapper"),Tt,en==null?void 0:en.group);return Pe.createElement(Qt,{className:It,style:et,hidden:gt},Pe.createElement(dn,{className:Ot},Nt&&Pe.createElement(Zt,{className:lt},Nt),(0,Pe.cloneElement)(se,{hidden:null}),ht&&Pe.createElement(Zt,{className:lt},ht)))}return se},Ne=_e,dt=ue(77654),Ae=ue(72190),He=ue(42244),rt=ue(18929),je=ue(2738),it=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],at=(0,Pe.forwardRef)(function(Qe,mt){var We=Qe.autoComplete,Me=Qe.onChange,Ke=Qe.onFocus,Ve=Qe.onBlur,Mt=Qe.onPressEnter,Xe=Qe.onKeyDown,Nt=Qe.prefixCls,ht=Nt===void 0?"rc-input":Nt,Tt=Qe.disabled,et=Qe.htmlSize,Ut=Qe.className,ft=Qe.maxLength,Dt=Qe.suffix,Bt=Qe.showCount,bt=Qe.type,$e=bt===void 0?"text":bt,xe=Qe.classes,gt=Qe.classNames,en=Qe.styles,Wt=(0,He.Z)(Qe,it),qe=(0,rt.Z)(Qe.defaultValue,{value:Qe.value}),Ye=(0,Ae.Z)(qe,2),Lt=Ye[0],mn=Ye[1],Qt=(0,Pe.useState)(!1),dn=(0,Ae.Z)(Qt,2),Zt=dn[0],Vt=dn[1],zt=(0,Pe.useRef)(null),ye=function(It){zt.current&&(0,we.nH)(zt.current,It)};(0,Pe.useImperativeHandle)(mt,function(){return{focus:ye,blur:function(){var It;(It=zt.current)===null||It===void 0||It.blur()},setSelectionRange:function(It,Ht,Yt){var an;(an=zt.current)===null||an===void 0||an.setSelectionRange(It,Ht,Yt)},select:function(){var It;(It=zt.current)===null||It===void 0||It.select()},input:zt.current}}),(0,Pe.useEffect)(function(){Vt(function(Ot){return Ot&&Tt?!1:Ot})},[Tt]);var se=function(It){Qe.value===void 0&&mn(It.target.value),zt.current&&(0,we.rJ)(zt.current,It,Me)},oe=function(It){Mt&&It.key==="Enter"&&Mt(It),Xe==null||Xe(It)},de=function(It){Vt(!0),Ke==null||Ke(It)},pe=function(It){Vt(!1),Ve==null||Ve(It)},le=function(It){mn(""),ye(),zt.current&&(0,we.rJ)(zt.current,It,Me)},Be=function(){var It=(0,je.Z)(Qe,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Pe.createElement("input",(0,fe.Z)({autoComplete:We},It,{onChange:se,onFocus:de,onBlur:pe,onKeyDown:oe,className:De()(ht,(0,Fe.Z)({},"".concat(ht,"-disabled"),Tt),gt==null?void 0:gt.input),style:en==null?void 0:en.input,ref:zt,size:et,type:$e}))},lt=function(){var It=Number(ft)>0;if(Dt||Bt){var Ht=(0,we.D7)(Lt),Yt=(0,dt.Z)(Ht).length,an=(0,tt.Z)(Bt)==="object"?Bt.formatter({value:Ht,count:Yt,maxLength:ft}):"".concat(Yt).concat(It?" / ".concat(ft):"");return Pe.createElement(Pe.Fragment,null,!!Bt&&Pe.createElement("span",{className:De()("".concat(ht,"-show-count-suffix"),(0,Fe.Z)({},"".concat(ht,"-show-count-has-suffix"),!!Dt),gt==null?void 0:gt.count),style:(0,Ze.Z)({},en==null?void 0:en.count)},an),Dt)}return null};return Pe.createElement(Ne,(0,fe.Z)({},Wt,{prefixCls:ht,className:Ut,inputElement:Be(),handleReset:le,value:(0,we.D7)(Lt),focused:Zt,triggerFocus:ye,suffix:lt(),disabled:Tt,classes:xe,classNames:gt,styles:en}))}),xt=at,jt=xt},5643:function(Mn,rn,ue){"use strict";ue.d(rn,{D7:function(){return be},He:function(){return fe},X3:function(){return Ze},nH:function(){return tt},rJ:function(){return Fe}});function fe(De){return!!(De.addonBefore||De.addonAfter)}function Ze(De){return!!(De.prefix||De.suffix||De.allowClear)}function Fe(De,Pe,we,_e){if(we){var Ne=Pe;if(Pe.type==="click"){var dt=De.cloneNode(!0);Ne=Object.create(Pe,{target:{value:dt},currentTarget:{value:dt}}),dt.value="",we(Ne);return}if(_e!==void 0){Ne=Object.create(Pe,{target:{value:De},currentTarget:{value:De}}),De.value=_e,we(Ne);return}we(Ne)}}function tt(De,Pe){if(De){De.focus(Pe);var we=Pe||{},_e=we.cursor;if(_e){var Ne=De.value.length;switch(_e){case"start":De.setSelectionRange(0,0);break;case"end":De.setSelectionRange(Ne,Ne);break;default:De.setSelectionRange(0,Ne)}}}}function be(De){return typeof De=="undefined"||De===null?"":String(De)}},15285:function(Mn,rn,ue){"use strict";ue.d(rn,{iz:function(){return Jt},ck:function(){return ni},BW:function(){return Rt},sN:function(){return ni},Wd:function(){return ut},ZP:function(){return An},Xl:function(){return Xe}});var fe=ue(60499),Ze=ue(18642),Fe=ue(85899),tt=ue(77654),be=ue(72190),De=ue(42244),Pe=ue(92310),we=ue.n(Pe),_e=ue(83836),Ne=ue(18929),dt=ue(13697),Ae=ue(48736),He=ue(59301),rt=ue(4676),je=He.createContext(null);function it(Ue,At){return Ue===void 0?null:"".concat(Ue,"-").concat(At)}function at(Ue){var At=He.useContext(je);return it(At,Ue)}var xt=ue(80547),jt=["children","locked"],Qe=He.createContext(null);function mt(Ue,At){var Pt=(0,Fe.Z)({},Ue);return Object.keys(At).forEach(function(Xt){var Ft=At[Xt];Ft!==void 0&&(Pt[Xt]=Ft)}),Pt}function We(Ue){var At=Ue.children,Pt=Ue.locked,Xt=(0,De.Z)(Ue,jt),Ft=He.useContext(Qe),Gt=(0,xt.Z)(function(){return mt(Ft,Xt)},[Ft,Xt],function(Kt,un){return!Pt&&(Kt[0]!==un[0]||!(0,dt.Z)(Kt[1],un[1],!0))});return He.createElement(Qe.Provider,{value:Gt},At)}var Me=[],Ke=He.createContext(null);function Ve(){return He.useContext(Ke)}var Mt=He.createContext(Me);function Xe(Ue){var At=He.useContext(Mt);return He.useMemo(function(){return Ue!==void 0?[].concat((0,tt.Z)(At),[Ue]):At},[At,Ue])}var Nt=He.createContext(null),ht=He.createContext({}),Tt=ht,et=ue(29194);function Ut(Ue){var At=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,et.Z)(Ue)){var Pt=Ue.nodeName.toLowerCase(),Xt=["input","select","textarea","button"].includes(Pt)||Ue.isContentEditable||Pt==="a"&&!!Ue.getAttribute("href"),Ft=Ue.getAttribute("tabindex"),Gt=Number(Ft),Kt=null;return Ft&&!Number.isNaN(Gt)?Kt=Gt:Xt&&Kt===null&&(Kt=0),Xt&&Ue.disabled&&(Kt=null),Kt!==null&&(Kt>=0||At&&Kt<0)}return!1}function ft(Ue){var At=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pt=(0,tt.Z)(Ue.querySelectorAll("*")).filter(function(Xt){return Ut(Xt,At)});return Ut(Ue,At)&&Pt.unshift(Ue),Pt}var Dt=null;function Bt(){Dt=document.activeElement}function bt(){Dt=null}function $e(){if(Dt)try{Dt.focus()}catch(Ue){}}function xe(Ue,At){if(At.keyCode===9){var Pt=ft(Ue),Xt=Pt[At.shiftKey?0:Pt.length-1],Ft=Xt===document.activeElement||Ue===document.activeElement;if(Ft){var Gt=Pt[At.shiftKey?Pt.length-1:0];Gt.focus(),At.preventDefault()}}}var gt=ue(10228),en=ue(16089),Wt=gt.Z.LEFT,qe=gt.Z.RIGHT,Ye=gt.Z.UP,Lt=gt.Z.DOWN,mn=gt.Z.ENTER,Qt=gt.Z.ESC,dn=gt.Z.HOME,Zt=gt.Z.END,Vt=[Ye,Lt,Wt,qe];function zt(Ue,At,Pt,Xt){var Ft,Gt,Kt,un,xn="prev",_n="next",Hn="children",Yn="parent";if(Ue==="inline"&&Xt===mn)return{inlineTrigger:!0};var yr=(Ft={},(0,Ze.Z)(Ft,Ye,xn),(0,Ze.Z)(Ft,Lt,_n),Ft),rr=(Gt={},(0,Ze.Z)(Gt,Wt,Pt?_n:xn),(0,Ze.Z)(Gt,qe,Pt?xn:_n),(0,Ze.Z)(Gt,Lt,Hn),(0,Ze.Z)(Gt,mn,Hn),Gt),Wn=(Kt={},(0,Ze.Z)(Kt,Ye,xn),(0,Ze.Z)(Kt,Lt,_n),(0,Ze.Z)(Kt,mn,Hn),(0,Ze.Z)(Kt,Qt,Yn),(0,Ze.Z)(Kt,Wt,Pt?Hn:Yn),(0,Ze.Z)(Kt,qe,Pt?Yn:Hn),Kt),xr={inline:yr,horizontal:rr,vertical:Wn,inlineSub:yr,horizontalSub:Wn,verticalSub:Wn},gr=(un=xr["".concat(Ue).concat(At?"":"Sub")])===null||un===void 0?void 0:un[Xt];switch(gr){case xn:return{offset:-1,sibling:!0};case _n:return{offset:1,sibling:!0};case Yn:return{offset:-1,sibling:!1};case Hn:return{offset:1,sibling:!1};default:return null}}function ye(Ue){for(var At=Ue;At;){if(At.getAttribute("data-menu-list"))return At;At=At.parentElement}return null}function se(Ue,At){for(var Pt=Ue||document.activeElement;Pt;){if(At.has(Pt))return Pt;Pt=Pt.parentElement}return null}function oe(Ue,At){var Pt=ft(Ue,!0);return Pt.filter(function(Xt){return At.has(Xt)})}function de(Ue,At,Pt){var Xt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ue)return null;var Ft=oe(Ue,At),Gt=Ft.length,Kt=Ft.findIndex(function(un){return Pt===un});return Xt<0?Kt===-1?Kt=Gt-1:Kt-=1:Xt>0&&(Kt+=1),Kt=(Kt+Gt)%Gt,Ft[Kt]}var pe=function(At,Pt){var Xt=new Set,Ft=new Map,Gt=new Map;return At.forEach(function(Kt){var un=document.querySelector("[data-menu-id='".concat(it(Pt,Kt),"']"));un&&(Xt.add(un),Gt.set(un,Kt),Ft.set(Kt,un))}),{elements:Xt,key2element:Ft,element2key:Gt}};function le(Ue,At,Pt,Xt,Ft,Gt,Kt,un,xn,_n){var Hn=He.useRef(),Yn=He.useRef();Yn.current=At;var yr=function(){en.Z.cancel(Hn.current)};return He.useEffect(function(){return function(){yr()}},[]),function(rr){var Wn=rr.which;if([].concat(Vt,[mn,Qt,dn,Zt]).includes(Wn)){var xr=Gt(),gr=pe(xr,Xt),mr=gr,Gn=mr.elements,Jn=mr.key2element,hr=mr.element2key,tr=Jn.get(At),_r=se(tr,Gn),Wr=hr.get(_r),fr=zt(Ue,Kt(Wr,!0).length===1,Pt,Wn);if(!fr&&Wn!==dn&&Wn!==Zt)return;(Vt.includes(Wn)||[dn,Zt].includes(Wn))&&rr.preventDefault();var kn=function(Tr){if(Tr){var si=Tr,or=Tr.querySelector("a");or!=null&&or.getAttribute("href")&&(si=or);var nr=hr.get(Tr);un(nr),yr(),Hn.current=(0,en.Z)(function(){Yn.current===nr&&si.focus()})}};if([dn,Zt].includes(Wn)||fr.sibling||!_r){var Cn;!_r||Ue==="inline"?Cn=Ft.current:Cn=ye(_r);var Xn,Fn=oe(Cn,Gn);Wn===dn?Xn=Fn[0]:Wn===Zt?Xn=Fn[Fn.length-1]:Xn=de(Cn,Gn,_r,fr.offset),kn(Xn)}else if(fr.inlineTrigger)xn(Wr);else if(fr.offset>0)xn(Wr,!0),yr(),Hn.current=(0,en.Z)(function(){gr=pe(xr,Xt);var Vr=_r.getAttribute("aria-controls"),Tr=document.getElementById(Vr),si=de(Tr,gr.elements);kn(si)},5);else if(fr.offset<0){var Sr=Kt(Wr,!0),Ar=Sr[Sr.length-2],lr=Jn.get(Ar);xn(Ar,!1),kn(lr)}}_n==null||_n(rr)}}function Be(Ue){Promise.resolve().then(Ue)}var lt="__RC_UTIL_PATH_SPLIT__",Ot=function(At){return At.join(lt)},It=function(At){return At.split(lt)},Ht="rc-menu-more";function Yt(){var Ue=He.useState({}),At=(0,be.Z)(Ue,2),Pt=At[1],Xt=(0,He.useRef)(new Map),Ft=(0,He.useRef)(new Map),Gt=He.useState([]),Kt=(0,be.Z)(Gt,2),un=Kt[0],xn=Kt[1],_n=(0,He.useRef)(0),Hn=(0,He.useRef)(!1),Yn=function(){Hn.current||Pt({})},yr=(0,He.useCallback)(function(Jn,hr){var tr=Ot(hr);Ft.current.set(tr,Jn),Xt.current.set(Jn,tr),_n.current+=1;var _r=_n.current;Be(function(){_r===_n.current&&Yn()})},[]),rr=(0,He.useCallback)(function(Jn,hr){var tr=Ot(hr);Ft.current.delete(tr),Xt.current.delete(Jn)},[]),Wn=(0,He.useCallback)(function(Jn){xn(Jn)},[]),xr=(0,He.useCallback)(function(Jn,hr){var tr=Xt.current.get(Jn)||"",_r=It(tr);return hr&&un.includes(_r[0])&&_r.unshift(Ht),_r},[un]),gr=(0,He.useCallback)(function(Jn,hr){return Jn.some(function(tr){var _r=xr(tr,!0);return _r.includes(hr)})},[xr]),mr=function(){var hr=(0,tt.Z)(Xt.current.keys());return un.length&&hr.push(Ht),hr},Gn=(0,He.useCallback)(function(Jn){var hr="".concat(Xt.current.get(Jn)).concat(lt),tr=new Set;return(0,tt.Z)(Ft.current.keys()).forEach(function(_r){_r.startsWith(hr)&&tr.add(Ft.current.get(_r))}),tr},[]);return He.useEffect(function(){return function(){Hn.current=!0}},[]),{registerPath:yr,unregisterPath:rr,refreshOverflowKeys:Wn,isSubPathKey:gr,getKeyPath:xr,getKeys:mr,getSubPathKeys:Gn}}function an(Ue){var At=He.useRef(Ue);At.current=Ue;var Pt=He.useCallback(function(){for(var Xt,Ft=arguments.length,Gt=new Array(Ft),Kt=0;Kt<Ft;Kt++)Gt[Kt]=arguments[Kt];return(Xt=At.current)===null||Xt===void 0?void 0:Xt.call.apply(Xt,[At].concat(Gt))},[]);return Ue?Pt:void 0}var cn=Math.random().toFixed(5).toString().slice(2),Sn=0;function wt(Ue){var At=(0,Ne.Z)(Ue,{value:Ue}),Pt=(0,be.Z)(At,2),Xt=Pt[0],Ft=Pt[1];return He.useEffect(function(){Sn+=1;var Gt="".concat(cn,"-").concat(Sn);Ft("rc-menu-uuid-".concat(Gt))},[]),Xt}var on=ue(38705),Pn=ue(17212),ot=ue(39153),St=ue(55401),$t=ue(2738),Dn=ue(8654);function Ln(Ue,At,Pt,Xt){var Ft=He.useContext(Qe),Gt=Ft.activeKey,Kt=Ft.onActive,un=Ft.onInactive,xn={active:Gt===Ue};return At||(xn.onMouseEnter=function(_n){Pt==null||Pt({key:Ue,domEvent:_n}),Kt(Ue)},xn.onMouseLeave=function(_n){Xt==null||Xt({key:Ue,domEvent:_n}),un(Ue)}),xn}function In(Ue){var At=He.useContext(Qe),Pt=At.mode,Xt=At.rtl,Ft=At.inlineIndent;if(Pt!=="inline")return null;var Gt=Ue;return Xt?{paddingRight:Gt*Ft}:{paddingLeft:Gt*Ft}}function qn(Ue){var At=Ue.icon,Pt=Ue.props,Xt=Ue.children,Ft;return At===null||At===!1?null:(typeof At=="function"?Ft=He.createElement(At,(0,Fe.Z)({},Pt)):typeof At!="boolean"&&(Ft=At),Ft||Xt||null)}var dr=["item"];function ir(Ue){var At=Ue.item,Pt=(0,De.Z)(Ue,dr);return Object.defineProperty(Pt,"item",{get:function(){return(0,Ae.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),At}}),Pt}var Er=["title","attribute","elementRef"],kr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Qn=["active"],Kr=function(Ue){(0,ot.Z)(Pt,Ue);var At=(0,St.Z)(Pt);function Pt(){return(0,on.Z)(this,Pt),At.apply(this,arguments)}return(0,Pn.Z)(Pt,[{key:"render",value:function(){var Ft=this.props,Gt=Ft.title,Kt=Ft.attribute,un=Ft.elementRef,xn=(0,De.Z)(Ft,Er),_n=(0,$t.Z)(xn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Ae.ZP)(!Kt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),He.createElement(_e.Z.Item,(0,fe.Z)({},Kt,{title:typeof Gt=="string"?Gt:void 0},_n,{ref:un}))}}]),Pt}(He.Component),jr=He.forwardRef(function(Ue,At){var Pt,Xt=Ue.style,Ft=Ue.className,Gt=Ue.eventKey,Kt=Ue.warnKey,un=Ue.disabled,xn=Ue.itemIcon,_n=Ue.children,Hn=Ue.role,Yn=Ue.onMouseEnter,yr=Ue.onMouseLeave,rr=Ue.onClick,Wn=Ue.onKeyDown,xr=Ue.onFocus,gr=(0,De.Z)(Ue,kr),mr=at(Gt),Gn=He.useContext(Qe),Jn=Gn.prefixCls,hr=Gn.onItemClick,tr=Gn.disabled,_r=Gn.overflowDisabled,Wr=Gn.itemIcon,fr=Gn.selectedKeys,kn=Gn.onActive,Cn=He.useContext(Tt),Xn=Cn._internalRenderMenuItem,Fn="".concat(Jn,"-item"),Sr=He.useRef(),Ar=He.useRef(),lr=tr||un,Vr=(0,Dn.x1)(At,Ar),Tr=Xe(Gt),si=function(jn){return{key:Gt,keyPath:(0,tt.Z)(Tr).reverse(),item:Sr.current,domEvent:jn}},or=xn||Wr,nr=Ln(Gt,lr,Yn,yr),Ir=nr.active,Lr=(0,De.Z)(nr,Qn),ti=fr.includes(Gt),yi=In(Tr.length),bi=function(jn){if(!lr){var ur=si(jn);rr==null||rr(ir(ur)),hr(ur)}},Gr=function(jn){if(Wn==null||Wn(jn),jn.which===gt.Z.ENTER){var ur=si(jn);rr==null||rr(ir(ur)),hr(ur)}},gi=function(jn){kn(Gt),xr==null||xr(jn)},pi={};Ue.role==="option"&&(pi["aria-selected"]=ti);var Zn=He.createElement(Kr,(0,fe.Z)({ref:Sr,elementRef:Vr,role:Hn===null?"none":Hn||"menuitem",tabIndex:un?null:-1,"data-menu-id":_r&&mr?null:mr},gr,Lr,pi,{component:"li","aria-disabled":un,style:(0,Fe.Z)((0,Fe.Z)({},yi),Xt),className:we()(Fn,(Pt={},(0,Ze.Z)(Pt,"".concat(Fn,"-active"),Ir),(0,Ze.Z)(Pt,"".concat(Fn,"-selected"),ti),(0,Ze.Z)(Pt,"".concat(Fn,"-disabled"),lr),Pt),Ft),onClick:bi,onKeyDown:Gr,onFocus:gi}),_n,He.createElement(qn,{props:(0,Fe.Z)((0,Fe.Z)({},Ue),{},{isSelected:ti}),icon:or}));return Xn&&(Zn=Xn(Zn,Ue,{selected:ti})),Zn});function Hr(Ue,At){var Pt=Ue.eventKey,Xt=Ve(),Ft=Xe(Pt);return He.useEffect(function(){if(Xt)return Xt.registerPath(Pt,Ft),function(){Xt.unregisterPath(Pt,Ft)}},[Ft]),Xt?null:He.createElement(jr,(0,fe.Z)({},Ue,{ref:At}))}var ni=He.forwardRef(Hr),Br=["className","children"],qr=function(At,Pt){var Xt=At.className,Ft=At.children,Gt=(0,De.Z)(At,Br),Kt=He.useContext(Qe),un=Kt.prefixCls,xn=Kt.mode,_n=Kt.rtl;return He.createElement("ul",(0,fe.Z)({className:we()(un,_n&&"".concat(un,"-rtl"),"".concat(un,"-sub"),"".concat(un,"-").concat(xn==="inline"?"inline":"vertical"),Xt),role:"menu"},Gt,{"data-menu-list":!0,ref:Pt}),Ft)},Cr=He.forwardRef(qr);Cr.displayName="SubMenuList";var yn=Cr,wn=ue(11592);function fn(Ue,At){return(0,wn.Z)(Ue).map(function(Pt,Xt){if(He.isValidElement(Pt)){var Ft,Gt,Kt=Pt.key,un=(Ft=(Gt=Pt.props)===null||Gt===void 0?void 0:Gt.eventKey)!==null&&Ft!==void 0?Ft:Kt,xn=un==null;xn&&(un="tmp_key-".concat([].concat((0,tt.Z)(At),[Xt]).join("-")));var _n={key:un,eventKey:un};return He.cloneElement(Pt,_n)}return Pt})}var Rn=ue(35593),br={adjustX:1,adjustY:1},Kn={topLeft:{points:["bl","tl"],overflow:br},topRight:{points:["br","tr"],overflow:br},bottomLeft:{points:["tl","bl"],overflow:br},bottomRight:{points:["tr","br"],overflow:br},leftTop:{points:["tr","tl"],overflow:br},leftBottom:{points:["br","bl"],overflow:br},rightTop:{points:["tl","tr"],overflow:br},rightBottom:{points:["bl","br"],overflow:br}},ar={topLeft:{points:["bl","tl"],overflow:br},topRight:{points:["br","tr"],overflow:br},bottomLeft:{points:["tl","bl"],overflow:br},bottomRight:{points:["tr","br"],overflow:br},rightTop:{points:["tr","tl"],overflow:br},rightBottom:{points:["br","bl"],overflow:br},leftTop:{points:["tl","tr"],overflow:br},leftBottom:{points:["bl","br"],overflow:br}},vn=null;function pn(Ue,At,Pt){if(At)return At;if(Pt)return Pt[Ue]||Pt.other}var Nn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function st(Ue){var At=Ue.prefixCls,Pt=Ue.visible,Xt=Ue.children,Ft=Ue.popup,Gt=Ue.popupStyle,Kt=Ue.popupClassName,un=Ue.popupOffset,xn=Ue.disabled,_n=Ue.mode,Hn=Ue.onVisibleChange,Yn=He.useContext(Qe),yr=Yn.getPopupContainer,rr=Yn.rtl,Wn=Yn.subMenuOpenDelay,xr=Yn.subMenuCloseDelay,gr=Yn.builtinPlacements,mr=Yn.triggerSubMenuAction,Gn=Yn.forceSubMenuRender,Jn=Yn.rootClassName,hr=Yn.motion,tr=Yn.defaultMotions,_r=He.useState(!1),Wr=(0,be.Z)(_r,2),fr=Wr[0],kn=Wr[1],Cn=rr?(0,Fe.Z)((0,Fe.Z)({},ar),gr):(0,Fe.Z)((0,Fe.Z)({},Kn),gr),Xn=Nn[_n],Fn=pn(_n,hr,tr),Sr=He.useRef(Fn);_n!=="inline"&&(Sr.current=Fn);var Ar=(0,Fe.Z)((0,Fe.Z)({},Sr.current),{},{leavedClassName:"".concat(At,"-hidden"),removeOnLeave:!1,motionAppear:!0}),lr=He.useRef();return He.useEffect(function(){return lr.current=(0,en.Z)(function(){kn(Pt)}),function(){en.Z.cancel(lr.current)}},[Pt]),He.createElement(Rn.Z,{prefixCls:At,popupClassName:we()("".concat(At,"-popup"),(0,Ze.Z)({},"".concat(At,"-rtl"),rr),Kt,Jn),stretch:_n==="horizontal"?"minWidth":null,getPopupContainer:yr,builtinPlacements:Cn,popupPlacement:Xn,popupVisible:fr,popup:Ft,popupStyle:Gt,popupAlign:un&&{offset:un},action:xn?[]:[mr],mouseEnterDelay:Wn,mouseLeaveDelay:xr,onPopupVisibleChange:Hn,forceRender:Gn,popupMotion:Ar,fresh:!0},Xt)}var Ee=ue(77900);function Te(Ue){var At=Ue.id,Pt=Ue.open,Xt=Ue.keyPath,Ft=Ue.children,Gt="inline",Kt=He.useContext(Qe),un=Kt.prefixCls,xn=Kt.forceSubMenuRender,_n=Kt.motion,Hn=Kt.defaultMotions,Yn=Kt.mode,yr=He.useRef(!1);yr.current=Yn===Gt;var rr=He.useState(!yr.current),Wn=(0,be.Z)(rr,2),xr=Wn[0],gr=Wn[1],mr=yr.current?Pt:!1;He.useEffect(function(){yr.current&&gr(!1)},[Yn]);var Gn=(0,Fe.Z)({},pn(Gt,_n,Hn));Xt.length>1&&(Gn.motionAppear=!1);var Jn=Gn.onVisibleChanged;return Gn.onVisibleChanged=function(hr){return!yr.current&&!hr&&gr(!0),Jn==null?void 0:Jn(hr)},xr?null:He.createElement(We,{mode:Gt,locked:!yr.current},He.createElement(Ee.default,(0,fe.Z)({visible:mr},Gn,{forceRender:xn,removeOnLeave:!1,leavedClassName:"".concat(un,"-hidden")}),function(hr){var tr=hr.className,_r=hr.style;return He.createElement(yn,{id:At,className:tr,style:_r},Ft)}))}var ke=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ie=["active"],Ge=function(At){var Pt,Xt=At.style,Ft=At.className,Gt=At.title,Kt=At.eventKey,un=At.warnKey,xn=At.disabled,_n=At.internalPopupClose,Hn=At.children,Yn=At.itemIcon,yr=At.expandIcon,rr=At.popupClassName,Wn=At.popupOffset,xr=At.popupStyle,gr=At.onClick,mr=At.onMouseEnter,Gn=At.onMouseLeave,Jn=At.onTitleClick,hr=At.onTitleMouseEnter,tr=At.onTitleMouseLeave,_r=(0,De.Z)(At,ke),Wr=at(Kt),fr=He.useContext(Qe),kn=fr.prefixCls,Cn=fr.mode,Xn=fr.openKeys,Fn=fr.disabled,Sr=fr.overflowDisabled,Ar=fr.activeKey,lr=fr.selectedKeys,Vr=fr.itemIcon,Tr=fr.expandIcon,si=fr.onItemClick,or=fr.onOpenChange,nr=fr.onActive,Ir=He.useContext(Tt),Lr=Ir._internalRenderSubMenuItem,ti=He.useContext(Nt),yi=ti.isSubPathKey,bi=Xe(),Gr="".concat(kn,"-submenu"),gi=Fn||xn,pi=He.useRef(),Zn=He.useRef(),Un=Yn!=null?Yn:Vr,jn=yr!=null?yr:Tr,ur=Xn.includes(Kt),Yr=!Sr&&ur,li=yi(lr,Kt),fi=Ln(Kt,gi,hr,tr),di=fi.active,ii=(0,De.Z)(fi,Ie),Si=He.useState(!1),Fi=(0,be.Z)(Si,2),Ii=Fi[0],la=Fi[1],ea=function(Hi){gi||la(Hi)},Pi=function(Hi){ea(!0),mr==null||mr({key:Kt,domEvent:Hi})},ki=function(Hi){ea(!1),Gn==null||Gn({key:Kt,domEvent:Hi})},Qr=He.useMemo(function(){return di||(Cn!=="inline"?Ii||yi([Ar],Kt):!1)},[Cn,di,Ar,Ii,Kt,yi]),Vi=In(bi.length),$i=function(Hi){gi||(Jn==null||Jn({key:Kt,domEvent:Hi}),Cn==="inline"&&or(Kt,!ur))},ci=an(function(Ki){gr==null||gr(ir(Ki)),si(Ki)}),Pr=function(Hi){Cn!=="inline"&&or(Kt,Hi)},Ur=function(){nr(Kt)},zr=Wr&&"".concat(Wr,"-popup"),Or=He.createElement("div",(0,fe.Z)({role:"menuitem",style:Vi,className:"".concat(Gr,"-title"),tabIndex:gi?null:-1,ref:pi,title:typeof Gt=="string"?Gt:null,"data-menu-id":Sr&&Wr?null:Wr,"aria-expanded":Yr,"aria-haspopup":!0,"aria-controls":zr,"aria-disabled":gi,onClick:$i,onFocus:Ur},ii),Gt,He.createElement(qn,{icon:Cn!=="horizontal"?jn:void 0,props:(0,Fe.Z)((0,Fe.Z)({},At),{},{isOpen:Yr,isSubMenu:!0})},He.createElement("i",{className:"".concat(Gr,"-arrow")}))),ai=He.useRef(Cn);if(Cn!=="inline"&&bi.length>1?ai.current="vertical":ai.current=Cn,!Sr){var ri=ai.current;Or=He.createElement(st,{mode:ri,prefixCls:Gr,visible:!_n&&Yr&&Cn!=="inline",popupClassName:rr,popupOffset:Wn,popupStyle:xr,popup:He.createElement(We,{mode:ri==="horizontal"?"vertical":ri},He.createElement(yn,{id:zr,ref:Zn},Hn)),disabled:gi,onVisibleChange:Pr},Or)}var Ai=He.createElement(_e.Z.Item,(0,fe.Z)({role:"none"},_r,{component:"li",style:Xt,className:we()(Gr,"".concat(Gr,"-").concat(Cn),Ft,(Pt={},(0,Ze.Z)(Pt,"".concat(Gr,"-open"),Yr),(0,Ze.Z)(Pt,"".concat(Gr,"-active"),Qr),(0,Ze.Z)(Pt,"".concat(Gr,"-selected"),li),(0,Ze.Z)(Pt,"".concat(Gr,"-disabled"),gi),Pt)),onMouseEnter:Pi,onMouseLeave:ki}),Or,!Sr&&He.createElement(Te,{id:zr,open:Yr,keyPath:bi},Hn));return Lr&&(Ai=Lr(Ai,At,{selected:li,active:Qr,open:Yr,disabled:gi})),He.createElement(We,{onItemClick:ci,mode:Cn==="horizontal"?"vertical":Cn,itemIcon:Un,expandIcon:jn},Ai)};function ut(Ue){var At=Ue.eventKey,Pt=Ue.children,Xt=Xe(At),Ft=fn(Pt,Xt),Gt=Ve();He.useEffect(function(){if(Gt)return Gt.registerPath(At,Xt),function(){Gt.unregisterPath(At,Xt)}},[Xt]);var Kt;return Gt?Kt=Ft:Kt=He.createElement(Ge,Ue,Ft),He.createElement(Mt.Provider,{value:Xt},Kt)}var nt=ue(43749),ze=["className","title","eventKey","children"],ct=["children"],kt=function(At){var Pt=At.className,Xt=At.title,Ft=At.eventKey,Gt=At.children,Kt=(0,De.Z)(At,ze),un=He.useContext(Qe),xn=un.prefixCls,_n="".concat(xn,"-item-group");return He.createElement("li",(0,fe.Z)({role:"presentation"},Kt,{onClick:function(Yn){return Yn.stopPropagation()},className:we()(_n,Pt)}),He.createElement("div",{role:"presentation",className:"".concat(_n,"-title"),title:typeof Xt=="string"?Xt:void 0},Xt),He.createElement("ul",{role:"group",className:"".concat(_n,"-list")},Gt))};function Rt(Ue){var At=Ue.children,Pt=(0,De.Z)(Ue,ct),Xt=Xe(Pt.eventKey),Ft=fn(At,Xt),Gt=Ve();return Gt?Ft:He.createElement(kt,(0,$t.Z)(Pt,["warnKey"]),Ft)}function Jt(Ue){var At=Ue.className,Pt=Ue.style,Xt=He.useContext(Qe),Ft=Xt.prefixCls,Gt=Ve();return Gt?null:He.createElement("li",{role:"separator",className:we()("".concat(Ft,"-item-divider"),At),style:Pt})}var pt=["label","children","key","type"];function Ct(Ue){return(Ue||[]).map(function(At,Pt){if(At&&(0,nt.Z)(At)==="object"){var Xt=At,Ft=Xt.label,Gt=Xt.children,Kt=Xt.key,un=Xt.type,xn=(0,De.Z)(Xt,pt),_n=Kt!=null?Kt:"tmp-".concat(Pt);return Gt||un==="group"?un==="group"?He.createElement(Rt,(0,fe.Z)({key:_n},xn,{title:Ft}),Ct(Gt)):He.createElement(ut,(0,fe.Z)({key:_n},xn,{title:Ft}),Ct(Gt)):un==="divider"?He.createElement(Jt,(0,fe.Z)({key:_n},xn)):He.createElement(ni,(0,fe.Z)({key:_n},xn),Ft)}return null}).filter(function(At){return At})}function bn(Ue,At,Pt){var Xt=Ue;return At&&(Xt=Ct(At)),fn(Xt,Pt)}var ln=["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"],En=[],qt=He.forwardRef(function(Ue,At){var Pt,Xt,Ft=Ue,Gt=Ft.prefixCls,Kt=Gt===void 0?"rc-menu":Gt,un=Ft.rootClassName,xn=Ft.style,_n=Ft.className,Hn=Ft.tabIndex,Yn=Hn===void 0?0:Hn,yr=Ft.items,rr=Ft.children,Wn=Ft.direction,xr=Ft.id,gr=Ft.mode,mr=gr===void 0?"vertical":gr,Gn=Ft.inlineCollapsed,Jn=Ft.disabled,hr=Ft.disabledOverflow,tr=Ft.subMenuOpenDelay,_r=tr===void 0?.1:tr,Wr=Ft.subMenuCloseDelay,fr=Wr===void 0?.1:Wr,kn=Ft.forceSubMenuRender,Cn=Ft.defaultOpenKeys,Xn=Ft.openKeys,Fn=Ft.activeKey,Sr=Ft.defaultActiveFirst,Ar=Ft.selectable,lr=Ar===void 0?!0:Ar,Vr=Ft.multiple,Tr=Vr===void 0?!1:Vr,si=Ft.defaultSelectedKeys,or=Ft.selectedKeys,nr=Ft.onSelect,Ir=Ft.onDeselect,Lr=Ft.inlineIndent,ti=Lr===void 0?24:Lr,yi=Ft.motion,bi=Ft.defaultMotions,Gr=Ft.triggerSubMenuAction,gi=Gr===void 0?"hover":Gr,pi=Ft.builtinPlacements,Zn=Ft.itemIcon,Un=Ft.expandIcon,jn=Ft.overflowedIndicator,ur=jn===void 0?"...":jn,Yr=Ft.overflowedIndicatorPopupClassName,li=Ft.getPopupContainer,fi=Ft.onClick,di=Ft.onOpenChange,ii=Ft.onKeyDown,Si=Ft.openAnimation,Fi=Ft.openTransitionName,Ii=Ft._internalRenderMenuItem,la=Ft._internalRenderSubMenuItem,ea=(0,De.Z)(Ft,ln),Pi=He.useMemo(function(){return bn(rr,yr,En)},[rr,yr]),ki=He.useState(!1),Qr=(0,be.Z)(ki,2),Vi=Qr[0],$i=Qr[1],ci=He.useRef(),Pr=wt(xr),Ur=Wn==="rtl",zr=(0,Ne.Z)(Cn,{value:Xn,postState:function(Ti){return Ti||En}}),Or=(0,be.Z)(zr,2),ai=Or[0],ri=Or[1],Ai=function(Ti){var Wi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ya(){ri(Ti),di==null||di(Ti)}Wi?(0,rt.flushSync)(Ya):Ya()},Ki=He.useState(ai),Hi=(0,be.Z)(Ki,2),na=Hi[0],vi=Hi[1],mi=He.useRef(!1),Gi=He.useMemo(function(){return(mr==="inline"||mr==="vertical")&&Gn?["vertical",Gn]:[mr,!1]},[mr,Gn]),ca=(0,be.Z)(Gi,2),oa=ca[0],ta=ca[1],ts=oa==="inline",ao=He.useState(oa),oo=(0,be.Z)(ao,2),eo=oo[0],Ss=oo[1],fo=He.useState(ta),ka=(0,be.Z)(fo,2),fa=ka[0],bo=ka[1];He.useEffect(function(){Ss(oa),bo(ta),mi.current&&(ts?ri(na):Ai(En))},[oa,ta]);var Eo=He.useState(0),ko=(0,be.Z)(Eo,2),ns=ko[0],Ro=ko[1],Xa=ns>=Pi.length-1||eo!=="horizontal"||hr;He.useEffect(function(){ts&&vi(ai)},[ai]),He.useEffect(function(){return mi.current=!0,function(){mi.current=!1}},[]);var Oa=Yt(),Bi=Oa.registerPath,Lo=Oa.unregisterPath,rs=Oa.refreshOverflowKeys,Do=Oa.isSubPathKey,Ci=Oa.getKeyPath,hi=Oa.getKeys,zi=Oa.getSubPathKeys,La=He.useMemo(function(){return{registerPath:Bi,unregisterPath:Lo}},[Bi,Lo]),Ui=He.useMemo(function(){return{isSubPathKey:Do}},[Do]);He.useEffect(function(){rs(Xa?En:Pi.slice(ns+1).map(function(Li){return Li.key}))},[ns,Xa]);var Ra=(0,Ne.Z)(Fn||Sr&&((Pt=Pi[0])===null||Pt===void 0?void 0:Pt.key),{value:Fn}),Fa=(0,be.Z)(Ra,2),to=Fa[0],$a=Fa[1],so=an(function(Li){$a(Li)}),lo=an(function(){$a(void 0)});(0,He.useImperativeHandle)(At,function(){return{list:ci.current,focus:function(Ti){var Wi,Ya=hi(),Aa=pe(Ya,Pr),xo=Aa.elements,po=Aa.key2element,za=Aa.element2key,Ao=oe(ci.current,xo),To=to!=null?to:Ao[0]?za.get(Ao[0]):(Wi=Pi.find(function(Wl){return!Wl.props.disabled}))===null||Wi===void 0?void 0:Wi.key,wo=po.get(To);if(To&&wo){var os;wo==null||(os=wo.focus)===null||os===void 0||os.call(wo,Ti)}}}});var Da=(0,Ne.Z)(si||[],{value:or,postState:function(Ti){return Array.isArray(Ti)?Ti:Ti==null?En:[Ti]}}),bl=(0,be.Z)(Da,2),jo=bl[0],Js=bl[1],Kl=function(Ti){if(lr){var Wi=Ti.key,Ya=jo.includes(Wi),Aa;Tr?Ya?Aa=jo.filter(function(po){return po!==Wi}):Aa=[].concat((0,tt.Z)(jo),[Wi]):Aa=[Wi],Js(Aa);var xo=(0,Fe.Z)((0,Fe.Z)({},Ti),{},{selectedKeys:Aa});Ya?Ir==null||Ir(xo):nr==null||nr(xo)}!Tr&&ai.length&&eo!=="inline"&&Ai(En)},Hl=an(function(Li){fi==null||fi(ir(Li)),Kl(Li)}),Cs=an(function(Li,Ti){var Wi=ai.filter(function(Aa){return Aa!==Li});if(Ti)Wi.push(Li);else if(eo!=="inline"){var Ya=zi(Li);Wi=Wi.filter(function(Aa){return!Ya.has(Aa)})}(0,dt.Z)(ai,Wi,!0)||Ai(Wi,!0)}),_c=function(Ti,Wi){var Ya=Wi!=null?Wi:!ai.includes(Ti);Cs(Ti,Ya)},is=le(eo,to,Ur,Pr,ci,hi,Ci,$a,_c,ii);He.useEffect(function(){$i(!0)},[]);var xl=He.useMemo(function(){return{_internalRenderMenuItem:Ii,_internalRenderSubMenuItem:la}},[Ii,la]),Vo=eo!=="horizontal"||hr?Pi:Pi.map(function(Li,Ti){return He.createElement(We,{key:Li.key,overflowDisabled:Ti>ns},Li)}),as=He.createElement(_e.Z,(0,fe.Z)({id:xr,ref:ci,prefixCls:"".concat(Kt,"-overflow"),component:"ul",itemComponent:ni,className:we()(Kt,"".concat(Kt,"-root"),"".concat(Kt,"-").concat(eo),_n,(Xt={},(0,Ze.Z)(Xt,"".concat(Kt,"-inline-collapsed"),fa),(0,Ze.Z)(Xt,"".concat(Kt,"-rtl"),Ur),Xt),un),dir:Wn,style:xn,role:"menu",tabIndex:Yn,data:Vo,renderRawItem:function(Ti){return Ti},renderRawRest:function(Ti){var Wi=Ti.length,Ya=Wi?Pi.slice(-Wi):null;return He.createElement(ut,{eventKey:Ht,title:ur,disabled:Xa,internalPopupClose:Wi===0,popupClassName:Yr},Ya)},maxCount:eo!=="horizontal"||hr?_e.Z.INVALIDATE:_e.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ti){Ro(Ti)},onKeyDown:is},ea));return He.createElement(Tt.Provider,{value:xl},He.createElement(je.Provider,{value:Pr},He.createElement(We,{prefixCls:Kt,rootClassName:un,mode:eo,openKeys:ai,rtl:Ur,disabled:Jn,motion:Vi?yi:null,defaultMotions:Vi?bi:null,activeKey:to,onActive:so,onInactive:lo,selectedKeys:jo,inlineIndent:ti,subMenuOpenDelay:_r,subMenuCloseDelay:fr,forceSubMenuRender:kn,builtinPlacements:pi,triggerSubMenuAction:gi,getPopupContainer:li,itemIcon:Zn,expandIcon:Un,onItemClick:Hl,onOpenChange:Cs},He.createElement(Nt.Provider,{value:Ui},as),He.createElement("div",{style:{display:"none"},"aria-hidden":!0},He.createElement(Ke.Provider,{value:La},Pi)))))}),On=qt,tn=On;tn.Item=ni,tn.SubMenu=ut,tn.ItemGroup=Rt,tn.Divider=Jt;var An=tn},83836:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Bt}});var fe=ue(60499),Ze=ue(85899),Fe=ue(72190),tt=ue(42244),be=ue(59301),De=ue(92310),Pe=ue.n(De),we=ue(29301),_e=ue(34280),Ne=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],dt=void 0;function Ae(bt,$e){var xe=bt.prefixCls,gt=bt.invalidate,en=bt.item,Wt=bt.renderItem,qe=bt.responsive,Ye=bt.responsiveDisabled,Lt=bt.registerSize,mn=bt.itemKey,Qt=bt.className,dn=bt.style,Zt=bt.children,Vt=bt.display,zt=bt.order,ye=bt.component,se=ye===void 0?"div":ye,oe=(0,tt.Z)(bt,Ne),de=qe&&!Vt;function pe(It){Lt(mn,It)}be.useEffect(function(){return function(){pe(null)}},[]);var le=Wt&&en!==dt?Wt(en,{index:zt}):Zt,Be;gt||(Be={opacity:de?0:1,height:de?0:dt,overflowY:de?"hidden":dt,order:qe?zt:dt,pointerEvents:de?"none":dt,position:de?"absolute":dt});var lt={};de&&(lt["aria-hidden"]=!0);var Ot=be.createElement(se,(0,fe.Z)({className:Pe()(!gt&&xe,Qt),style:(0,Ze.Z)((0,Ze.Z)({},Be),dn)},lt,oe,{ref:$e}),le);return qe&&(Ot=be.createElement(we.Z,{onResize:function(Ht){var Yt=Ht.offsetWidth;pe(Yt)},disabled:Ye},Ot)),Ot}var He=be.forwardRef(Ae);He.displayName="Item";var rt=He,je=ue(6089),it=ue(4676),at=ue(16089);function xt(bt){if(typeof MessageChannel=="undefined")(0,at.Z)(bt);else{var $e=new MessageChannel;$e.port1.onmessage=function(){return bt()},$e.port2.postMessage(void 0)}}function jt(){var bt=be.useRef(null),$e=function(gt){bt.current||(bt.current=[],xt(function(){(0,it.unstable_batchedUpdates)(function(){bt.current.forEach(function(en){en()}),bt.current=null})})),bt.current.push(gt)};return $e}function Qe(bt,$e){var xe=be.useState($e),gt=(0,Fe.Z)(xe,2),en=gt[0],Wt=gt[1],qe=(0,je.Z)(function(Ye){bt(function(){Wt(Ye)})});return[en,qe]}var mt=be.createContext(null),We=["component"],Me=["className"],Ke=["className"],Ve=function($e,xe){var gt=be.useContext(mt);if(!gt){var en=$e.component,Wt=en===void 0?"div":en,qe=(0,tt.Z)($e,We);return be.createElement(Wt,(0,fe.Z)({},qe,{ref:xe}))}var Ye=gt.className,Lt=(0,tt.Z)(gt,Me),mn=$e.className,Qt=(0,tt.Z)($e,Ke);return be.createElement(mt.Provider,{value:null},be.createElement(rt,(0,fe.Z)({ref:xe,className:Pe()(Ye,mn)},Lt,Qt)))},Mt=be.forwardRef(Ve);Mt.displayName="RawItem";var Xe=Mt,Nt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],ht="responsive",Tt="invalidate";function et(bt){return"+ ".concat(bt.length," ...")}function Ut(bt,$e){var xe=bt.prefixCls,gt=xe===void 0?"rc-overflow":xe,en=bt.data,Wt=en===void 0?[]:en,qe=bt.renderItem,Ye=bt.renderRawItem,Lt=bt.itemKey,mn=bt.itemWidth,Qt=mn===void 0?10:mn,dn=bt.ssr,Zt=bt.style,Vt=bt.className,zt=bt.maxCount,ye=bt.renderRest,se=bt.renderRawRest,oe=bt.prefix,de=bt.suffix,pe=bt.component,le=pe===void 0?"div":pe,Be=bt.itemComponent,lt=bt.onVisibleChange,Ot=(0,tt.Z)(bt,Nt),It=dn==="full",Ht=jt(),Yt=Qe(Ht,null),an=(0,Fe.Z)(Yt,2),cn=an[0],Sn=an[1],wt=cn||0,on=Qe(Ht,new Map),Pn=(0,Fe.Z)(on,2),ot=Pn[0],St=Pn[1],$t=Qe(Ht,0),Dn=(0,Fe.Z)($t,2),Ln=Dn[0],In=Dn[1],qn=Qe(Ht,0),dr=(0,Fe.Z)(qn,2),ir=dr[0],Er=dr[1],kr=Qe(Ht,0),Qn=(0,Fe.Z)(kr,2),Kr=Qn[0],jr=Qn[1],Hr=Qe(Ht,0),ni=(0,Fe.Z)(Hr,2),Br=ni[0],qr=ni[1],Cr=(0,be.useState)(null),yn=(0,Fe.Z)(Cr,2),wn=yn[0],fn=yn[1],Rn=(0,be.useState)(null),br=(0,Fe.Z)(Rn,2),Kn=br[0],ar=br[1],vn=be.useMemo(function(){return Kn===null&&It?Number.MAX_SAFE_INTEGER:Kn||0},[Kn,cn]),pn=(0,be.useState)(!1),Nn=(0,Fe.Z)(pn,2),st=Nn[0],Ee=Nn[1],Te="".concat(gt,"-item"),ke=Math.max(Ln,ir),Ie=zt===ht,Ge=Wt.length&&Ie,ut=zt===Tt,nt=Ge||typeof zt=="number"&&Wt.length>zt,ze=(0,be.useMemo)(function(){var Gt=Wt;return Ge?cn===null&&It?Gt=Wt:Gt=Wt.slice(0,Math.min(Wt.length,wt/Qt)):typeof zt=="number"&&(Gt=Wt.slice(0,zt)),Gt},[Wt,Qt,cn,zt,Ge]),ct=(0,be.useMemo)(function(){return Ge?Wt.slice(vn+1):Wt.slice(ze.length)},[Wt,ze,Ge,vn]),kt=(0,be.useCallback)(function(Gt,Kt){var un;return typeof Lt=="function"?Lt(Gt):(un=Lt&&(Gt==null?void 0:Gt[Lt]))!==null&&un!==void 0?un:Kt},[Lt]),Rt=(0,be.useCallback)(qe||function(Gt){return Gt},[qe]);function Jt(Gt,Kt,un){Kn===Gt&&(Kt===void 0||Kt===wn)||(ar(Gt),un||(Ee(Gt<Wt.length-1),lt==null||lt(Gt)),Kt!==void 0&&fn(Kt))}function pt(Gt,Kt){Sn(Kt.clientWidth)}function Ct(Gt,Kt){St(function(un){var xn=new Map(un);return Kt===null?xn.delete(Gt):xn.set(Gt,Kt),xn})}function bn(Gt,Kt){Er(Kt),In(ir)}function ln(Gt,Kt){jr(Kt)}function En(Gt,Kt){qr(Kt)}function qt(Gt){return ot.get(kt(ze[Gt],Gt))}(0,_e.Z)(function(){if(wt&&typeof ke=="number"&&ze){var Gt=Kr+Br,Kt=ze.length,un=Kt-1;if(!Kt){Jt(0,null);return}for(var xn=0;xn<Kt;xn+=1){var _n=qt(xn);if(It&&(_n=_n||0),_n===void 0){Jt(xn-1,void 0,!0);break}if(Gt+=_n,un===0&&Gt<=wt||xn===un-1&&Gt+qt(un)<=wt){Jt(un,null);break}else if(Gt+ke>wt){Jt(xn-1,Gt-_n-Br+ir);break}}de&&qt(0)+Br>wt&&fn(null)}},[wt,ot,ir,Kr,Br,kt,ze]);var On=st&&!!ct.length,tn={};wn!==null&&Ge&&(tn={position:"absolute",left:wn,top:0});var An={prefixCls:Te,responsive:Ge,component:Be,invalidate:ut},Ue=Ye?function(Gt,Kt){var un=kt(Gt,Kt);return be.createElement(mt.Provider,{key:un,value:(0,Ze.Z)((0,Ze.Z)({},An),{},{order:Kt,item:Gt,itemKey:un,registerSize:Ct,display:Kt<=vn})},Ye(Gt,Kt))}:function(Gt,Kt){var un=kt(Gt,Kt);return be.createElement(rt,(0,fe.Z)({},An,{order:Kt,key:un,item:Gt,renderItem:Rt,itemKey:un,registerSize:Ct,display:Kt<=vn}))},At={order:On?vn:Number.MAX_SAFE_INTEGER,className:"".concat(Te,"-rest"),registerSize:bn,display:On},Pt=ye||et,Xt=se?be.createElement(mt.Provider,{value:(0,Ze.Z)((0,Ze.Z)({},An),At)},se(ct)):be.createElement(rt,(0,fe.Z)({},An,At),typeof Pt=="function"?Pt(ct):Pt),Ft=be.createElement(le,(0,fe.Z)({className:Pe()(!ut&&gt,Vt),style:Zt,ref:$e},Ot),oe&&be.createElement(rt,(0,fe.Z)({},An,{responsive:Ie,responsiveDisabled:!Ge,order:-1,className:"".concat(Te,"-prefix"),registerSize:ln,display:!0}),oe),ze.map(Ue),nt?Xt:null,de&&be.createElement(rt,(0,fe.Z)({},An,{responsive:Ie,responsiveDisabled:!Ge,order:vn,className:"".concat(Te,"-suffix"),registerSize:En,display:!0,style:tn}),de));return Ie?be.createElement(we.Z,{onResize:pt,disabled:!Ge},Ft):Ft}var ft=be.forwardRef(Ut);ft.displayName="Overflow",ft.Item=Xe,ft.RESPONSIVE=ht,ft.INVALIDATE=Tt;var Dt=ft,Bt=Dt},17115:function(Mn,rn,ue){"use strict";ue.d(rn,{ZP:function(){return Pe}});var fe=ue(72190),Ze=ue(59301),Fe=ue(47273),tt=0,be=(0,Fe.Z)();function De(){var we;return be?(we=tt,tt+=1):we="TEST_OR_SSR",we}function Pe(we){var _e=Ze.useState(),Ne=(0,fe.Z)(_e,2),dt=Ne[0],Ae=Ne[1];return Ze.useEffect(function(){Ae("rc_select_".concat(De()))},[]),we||dt}},77861:function(Mn,rn,ue){"use strict";ue.d(rn,{Ac:function(){return cn},Xo:function(){return ir},Wx:function(){return kr},ZP:function(){return Te},lk:function(){return mt}});var fe=ue(60499),Ze=ue(77654),Fe=ue(18642),tt=ue(85899),be=ue(72190),De=ue(42244),Pe=ue(43749),we=ue(18929),_e=ue(48736),Ne=ue(59301),dt=ue(92310),Ae=ue.n(dt),He=ue(34280),rt=ue(49658),je=ue(10228),it=ue(8654),at=function(Ie){var Ge=Ie.className,ut=Ie.customizeIcon,nt=Ie.customizeIconProps,ze=Ie.onMouseDown,ct=Ie.onClick,kt=Ie.children,Rt;return typeof ut=="function"?Rt=ut(nt):Rt=ut,Ne.createElement("span",{className:Ge,onMouseDown:function(pt){pt.preventDefault(),ze&&ze(pt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ct,"aria-hidden":!0},Rt!==void 0?Rt:Ne.createElement("span",{className:Ae()(Ge.split(/\s+/).map(function(Jt){return"".concat(Jt,"-icon")}))},kt))},xt=at;function jt(ke,Ie,Ge,ut,nt){var ze=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ct=arguments.length>6?arguments[6]:void 0,kt=arguments.length>7?arguments[7]:void 0,Rt=Ne.useMemo(function(){if((0,Pe.Z)(ut)==="object")return ut.clearIcon;if(nt)return nt},[ut,nt]),Jt=Ne.useMemo(function(){return!!(!ze&&ut&&(Ge.length||ct)&&!(kt==="combobox"&&ct===""))},[ut,ze,Ge.length,ct,kt]);return{allowClear:Jt,clearIcon:Ne.createElement(xt,{className:"".concat(ke,"-clear"),onMouseDown:Ie,customizeIcon:Rt},"\xD7")}}var Qe=Ne.createContext(null);function mt(){return Ne.useContext(Qe)}function We(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ie=Ne.useState(!1),Ge=(0,be.Z)(Ie,2),ut=Ge[0],nt=Ge[1],ze=Ne.useRef(null),ct=function(){window.clearTimeout(ze.current)};Ne.useEffect(function(){return ct},[]);var kt=function(Jt,pt){ct(),ze.current=window.setTimeout(function(){nt(Jt),pt&&pt()},ke)};return[ut,kt,ct]}function Me(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ie=Ne.useRef(null),Ge=Ne.useRef(null);Ne.useEffect(function(){return function(){window.clearTimeout(Ge.current)}},[]);function ut(nt){(nt||Ie.current===null)&&(Ie.current=nt),window.clearTimeout(Ge.current),Ge.current=window.setTimeout(function(){Ie.current=null},ke)}return[function(){return Ie.current},ut]}function Ke(ke,Ie,Ge,ut){var nt=Ne.useRef(null);nt.current={open:Ie,triggerOpen:Ge,customizedTrigger:ut},Ne.useEffect(function(){function ze(ct){var kt;if(!((kt=nt.current)!==null&&kt!==void 0&&kt.customizedTrigger)){var Rt=ct.target;Rt.shadowRoot&&ct.composed&&(Rt=ct.composedPath()[0]||Rt),nt.current.open&&ke().filter(function(Jt){return Jt}).every(function(Jt){return!Jt.contains(Rt)&&Jt!==Rt})&&nt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",ze),function(){return window.removeEventListener("mousedown",ze)}},[])}var Ve=ue(26112),Mt=ue(83836),Xe=function(Ie,Ge){var ut,nt,ze=Ie.prefixCls,ct=Ie.id,kt=Ie.inputElement,Rt=Ie.disabled,Jt=Ie.tabIndex,pt=Ie.autoFocus,Ct=Ie.autoComplete,bn=Ie.editable,ln=Ie.activeDescendantId,En=Ie.value,qt=Ie.maxLength,On=Ie.onKeyDown,tn=Ie.onMouseDown,An=Ie.onChange,Ue=Ie.onPaste,At=Ie.onCompositionStart,Pt=Ie.onCompositionEnd,Xt=Ie.open,Ft=Ie.attrs,Gt=kt||Ne.createElement("input",null),Kt=Gt,un=Kt.ref,xn=Kt.props,_n=xn.onKeyDown,Hn=xn.onChange,Yn=xn.onMouseDown,yr=xn.onCompositionStart,rr=xn.onCompositionEnd,Wn=xn.style;return(0,_e.Kp)(!("maxLength"in Gt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Gt=Ne.cloneElement(Gt,(0,tt.Z)((0,tt.Z)((0,tt.Z)({type:"search"},xn),{},{id:ct,ref:(0,it.sQ)(Ge,un),disabled:Rt,tabIndex:Jt,autoComplete:Ct||"off",autoFocus:pt,className:Ae()("".concat(ze,"-selection-search-input"),(ut=Gt)===null||ut===void 0||(nt=ut.props)===null||nt===void 0?void 0:nt.className),role:"combobox","aria-label":"Search","aria-expanded":Xt||!1,"aria-haspopup":"listbox","aria-owns":"".concat(ct,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(ct,"_list"),"aria-activedescendant":Xt?ln:void 0},Ft),{},{value:bn?En:"",maxLength:qt,readOnly:!bn,unselectable:bn?null:"on",style:(0,tt.Z)((0,tt.Z)({},Wn),{},{opacity:bn?null:0}),onKeyDown:function(gr){On(gr),_n&&_n(gr)},onMouseDown:function(gr){tn(gr),Yn&&Yn(gr)},onChange:function(gr){An(gr),Hn&&Hn(gr)},onCompositionStart:function(gr){At(gr),yr&&yr(gr)},onCompositionEnd:function(gr){Pt(gr),rr&&rr(gr)},onPaste:Ue})),Gt},Nt=Ne.forwardRef(Xe);Nt.displayName="Input";var ht=Nt;function Tt(ke){return Array.isArray(ke)?ke:ke!==void 0?[ke]:[]}var et=typeof window!="undefined"&&window.document&&window.document.documentElement,Ut=et;function ft(ke){return ke!=null}function Dt(ke){return!ke&&ke!==0}function Bt(ke){return["string","number"].includes((0,Pe.Z)(ke))}function bt(ke){var Ie=void 0;return ke&&(Bt(ke.title)?Ie=ke.title.toString():Bt(ke.label)&&(Ie=ke.label.toString())),Ie}function $e(ke,Ie){Ut?Ne.useLayoutEffect(ke,Ie):Ne.useEffect(ke,Ie)}function xe(ke){var Ie;return(Ie=ke.key)!==null&&Ie!==void 0?Ie:ke.value}var gt=function(Ie){Ie.preventDefault(),Ie.stopPropagation()},en=function(Ie){var Ge=Ie.id,ut=Ie.prefixCls,nt=Ie.values,ze=Ie.open,ct=Ie.searchValue,kt=Ie.autoClearSearchValue,Rt=Ie.inputRef,Jt=Ie.placeholder,pt=Ie.disabled,Ct=Ie.mode,bn=Ie.showSearch,ln=Ie.autoFocus,En=Ie.autoComplete,qt=Ie.activeDescendantId,On=Ie.tabIndex,tn=Ie.removeIcon,An=Ie.maxTagCount,Ue=Ie.maxTagTextLength,At=Ie.maxTagPlaceholder,Pt=At===void 0?function(Ar){return"+ ".concat(Ar.length," ...")}:At,Xt=Ie.tagRender,Ft=Ie.onToggleOpen,Gt=Ie.onRemove,Kt=Ie.onInputChange,un=Ie.onInputPaste,xn=Ie.onInputKeyDown,_n=Ie.onInputMouseDown,Hn=Ie.onInputCompositionStart,Yn=Ie.onInputCompositionEnd,yr=Ne.useRef(null),rr=(0,Ne.useState)(0),Wn=(0,be.Z)(rr,2),xr=Wn[0],gr=Wn[1],mr=(0,Ne.useState)(!1),Gn=(0,be.Z)(mr,2),Jn=Gn[0],hr=Gn[1],tr="".concat(ut,"-selection"),_r=ze||Ct==="multiple"&&kt===!1||Ct==="tags"?ct:"",Wr=Ct==="tags"||Ct==="multiple"&&kt===!1||bn&&(ze||Jn);$e(function(){gr(yr.current.scrollWidth)},[_r]);function fr(Ar,lr,Vr,Tr,si){return Ne.createElement("span",{className:Ae()("".concat(tr,"-item"),(0,Fe.Z)({},"".concat(tr,"-item-disabled"),Vr)),title:bt(Ar)},Ne.createElement("span",{className:"".concat(tr,"-item-content")},lr),Tr&&Ne.createElement(xt,{className:"".concat(tr,"-item-remove"),onMouseDown:gt,onClick:si,customizeIcon:tn},"\xD7"))}function kn(Ar,lr,Vr,Tr,si){var or=function(Ir){gt(Ir),Ft(!ze)};return Ne.createElement("span",{onMouseDown:or},Xt({label:lr,value:Ar,disabled:Vr,closable:Tr,onClose:si}))}function Cn(Ar){var lr=Ar.disabled,Vr=Ar.label,Tr=Ar.value,si=!pt&&!lr,or=Vr;if(typeof Ue=="number"&&(typeof Vr=="string"||typeof Vr=="number")){var nr=String(or);nr.length>Ue&&(or="".concat(nr.slice(0,Ue),"..."))}var Ir=function(ti){ti&&ti.stopPropagation(),Gt(Ar)};return typeof Xt=="function"?kn(Tr,or,lr,si,Ir):fr(Ar,or,lr,si,Ir)}function Xn(Ar){var lr=typeof Pt=="function"?Pt(Ar):Pt;return fr({title:lr},lr,!1)}var Fn=Ne.createElement("div",{className:"".concat(tr,"-search"),style:{width:xr},onFocus:function(){hr(!0)},onBlur:function(){hr(!1)}},Ne.createElement(ht,{ref:Rt,open:ze,prefixCls:ut,id:Ge,inputElement:null,disabled:pt,autoFocus:ln,autoComplete:En,editable:Wr,activeDescendantId:qt,value:_r,onKeyDown:xn,onMouseDown:_n,onChange:Kt,onPaste:un,onCompositionStart:Hn,onCompositionEnd:Yn,tabIndex:On,attrs:(0,Ve.Z)(Ie,!0)}),Ne.createElement("span",{ref:yr,className:"".concat(tr,"-search-mirror"),"aria-hidden":!0},_r,"\xA0")),Sr=Ne.createElement(Mt.Z,{prefixCls:"".concat(tr,"-overflow"),data:nt,renderItem:Cn,renderRest:Xn,suffix:Fn,itemKey:xe,maxCount:An});return Ne.createElement(Ne.Fragment,null,Sr,!nt.length&&!_r&&Ne.createElement("span",{className:"".concat(tr,"-placeholder")},Jt))},Wt=en,qe=function(Ie){var Ge=Ie.inputElement,ut=Ie.prefixCls,nt=Ie.id,ze=Ie.inputRef,ct=Ie.disabled,kt=Ie.autoFocus,Rt=Ie.autoComplete,Jt=Ie.activeDescendantId,pt=Ie.mode,Ct=Ie.open,bn=Ie.values,ln=Ie.placeholder,En=Ie.tabIndex,qt=Ie.showSearch,On=Ie.searchValue,tn=Ie.activeValue,An=Ie.maxLength,Ue=Ie.onInputKeyDown,At=Ie.onInputMouseDown,Pt=Ie.onInputChange,Xt=Ie.onInputPaste,Ft=Ie.onInputCompositionStart,Gt=Ie.onInputCompositionEnd,Kt=Ie.title,un=Ne.useState(!1),xn=(0,be.Z)(un,2),_n=xn[0],Hn=xn[1],Yn=pt==="combobox",yr=Yn||qt,rr=bn[0],Wn=On||"";Yn&&tn&&!_n&&(Wn=tn),Ne.useEffect(function(){Yn&&Hn(!1)},[Yn,tn]);var xr=pt!=="combobox"&&!Ct&&!qt?!1:!!Wn,gr=Kt===void 0?bt(rr):Kt,mr=function(){if(rr)return null;var Jn=xr?{visibility:"hidden"}:void 0;return Ne.createElement("span",{className:"".concat(ut,"-selection-placeholder"),style:Jn},ln)};return Ne.createElement(Ne.Fragment,null,Ne.createElement("span",{className:"".concat(ut,"-selection-search")},Ne.createElement(ht,{ref:ze,prefixCls:ut,id:nt,open:Ct,inputElement:Ge,disabled:ct,autoFocus:kt,autoComplete:Rt,editable:yr,activeDescendantId:Jt,value:Wn,onKeyDown:Ue,onMouseDown:At,onChange:function(Jn){Hn(!0),Pt(Jn)},onPaste:Xt,onCompositionStart:Ft,onCompositionEnd:Gt,tabIndex:En,attrs:(0,Ve.Z)(Ie,!0),maxLength:Yn?An:void 0})),!Yn&&rr?Ne.createElement("span",{className:"".concat(ut,"-selection-item"),title:gr,style:xr?{visibility:"hidden"}:void 0},rr.label):null,mr())},Ye=qe;function Lt(ke){return![je.Z.ESC,je.Z.SHIFT,je.Z.BACKSPACE,je.Z.TAB,je.Z.WIN_KEY,je.Z.ALT,je.Z.META,je.Z.WIN_KEY_RIGHT,je.Z.CTRL,je.Z.SEMICOLON,je.Z.EQUALS,je.Z.CAPS_LOCK,je.Z.CONTEXT_MENU,je.Z.F1,je.Z.F2,je.Z.F3,je.Z.F4,je.Z.F5,je.Z.F6,je.Z.F7,je.Z.F8,je.Z.F9,je.Z.F10,je.Z.F11,je.Z.F12].includes(ke)}var mn=function(Ie,Ge){var ut=(0,Ne.useRef)(null),nt=(0,Ne.useRef)(!1),ze=Ie.prefixCls,ct=Ie.open,kt=Ie.mode,Rt=Ie.showSearch,Jt=Ie.tokenWithEnter,pt=Ie.autoClearSearchValue,Ct=Ie.onSearch,bn=Ie.onSearchSubmit,ln=Ie.onToggleOpen,En=Ie.onInputKeyDown,qt=Ie.domRef;Ne.useImperativeHandle(Ge,function(){return{focus:function(){ut.current.focus()},blur:function(){ut.current.blur()}}});var On=Me(0),tn=(0,be.Z)(On,2),An=tn[0],Ue=tn[1],At=function(Wn){var xr=Wn.which;(xr===je.Z.UP||xr===je.Z.DOWN)&&Wn.preventDefault(),En&&En(Wn),xr===je.Z.ENTER&&kt==="tags"&&!nt.current&&!ct&&(bn==null||bn(Wn.target.value)),Lt(xr)&&ln(!0)},Pt=function(){Ue(!0)},Xt=(0,Ne.useRef)(null),Ft=function(Wn){Ct(Wn,!0,nt.current)!==!1&&ln(!0)},Gt=function(){nt.current=!0},Kt=function(Wn){nt.current=!1,kt!=="combobox"&&Ft(Wn.target.value)},un=function(Wn){var xr=Wn.target.value;if(Jt&&Xt.current&&/[\r\n]/.test(Xt.current)){var gr=Xt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");xr=xr.replace(gr,Xt.current)}Xt.current=null,Ft(xr)},xn=function(Wn){var xr=Wn.clipboardData,gr=xr.getData("text");Xt.current=gr},_n=function(Wn){var xr=Wn.target;if(xr!==ut.current){var gr=document.body.style.msTouchAction!==void 0;gr?setTimeout(function(){ut.current.focus()}):ut.current.focus()}},Hn=function(Wn){var xr=An();Wn.target!==ut.current&&!xr&&kt!=="combobox"&&Wn.preventDefault(),(kt!=="combobox"&&(!Rt||!xr)||!ct)&&(ct&&pt!==!1&&Ct("",!0,!1),ln())},Yn={inputRef:ut,onInputKeyDown:At,onInputMouseDown:Pt,onInputChange:un,onInputPaste:xn,onInputCompositionStart:Gt,onInputCompositionEnd:Kt},yr=kt==="multiple"||kt==="tags"?Ne.createElement(Wt,(0,fe.Z)({},Ie,Yn)):Ne.createElement(Ye,(0,fe.Z)({},Ie,Yn));return Ne.createElement("div",{ref:qt,className:"".concat(ze,"-selector"),onClick:_n,onMouseDown:Hn},yr)},Qt=Ne.forwardRef(mn);Qt.displayName="Selector";var dn=Qt,Zt=ue(35593),Vt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],zt=function(Ie){var Ge=Ie===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Ge,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Ge,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Ge,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Ge,adjustY:1},htmlRegion:"scroll"}}},ye=function(Ie,Ge){var ut=Ie.prefixCls,nt=Ie.disabled,ze=Ie.visible,ct=Ie.children,kt=Ie.popupElement,Rt=Ie.animation,Jt=Ie.transitionName,pt=Ie.dropdownStyle,Ct=Ie.dropdownClassName,bn=Ie.direction,ln=bn===void 0?"ltr":bn,En=Ie.placement,qt=Ie.builtinPlacements,On=Ie.dropdownMatchSelectWidth,tn=Ie.dropdownRender,An=Ie.dropdownAlign,Ue=Ie.getPopupContainer,At=Ie.empty,Pt=Ie.getTriggerDOMNode,Xt=Ie.onPopupVisibleChange,Ft=Ie.onPopupMouseEnter,Gt=(0,De.Z)(Ie,Vt),Kt="".concat(ut,"-dropdown"),un=kt;tn&&(un=tn(kt));var xn=Ne.useMemo(function(){return qt||zt(On)},[qt,On]),_n=Rt?"".concat(Kt,"-").concat(Rt):Jt,Hn=typeof On=="number",Yn=Ne.useMemo(function(){return Hn?null:On===!1?"minWidth":"width"},[On,Hn]),yr=pt;Hn&&(yr=(0,tt.Z)((0,tt.Z)({},yr),{},{width:On}));var rr=Ne.useRef(null);return Ne.useImperativeHandle(Ge,function(){return{getPopupElement:function(){return rr.current}}}),Ne.createElement(Zt.Z,(0,fe.Z)({},Gt,{showAction:Xt?["click"]:[],hideAction:Xt?["click"]:[],popupPlacement:En||(ln==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:xn,prefixCls:Kt,popupTransitionName:_n,popup:Ne.createElement("div",{ref:rr,onMouseEnter:Ft},un),stretch:Yn,popupAlign:An,popupVisible:ze,getPopupContainer:Ue,popupClassName:Ae()(Ct,(0,Fe.Z)({},"".concat(Kt,"-empty"),At)),popupStyle:yr,getTriggerDOMNode:Pt,onPopupVisibleChange:Xt}),ct)},se=Ne.forwardRef(ye);se.displayName="SelectTrigger";var oe=se,de=ue(48745);function pe(ke,Ie){var Ge=ke.key,ut;return"value"in ke&&(ut=ke.value),Ge!=null?Ge:ut!==void 0?ut:"rc-index-key-".concat(Ie)}function le(ke,Ie){var Ge=ke||{},ut=Ge.label,nt=Ge.value,ze=Ge.options,ct=Ge.groupLabel,kt=ut||(Ie?"children":"label");return{label:kt,value:nt||"value",options:ze||"options",groupLabel:ct||kt}}function Be(ke){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ge=Ie.fieldNames,ut=Ie.childrenAsData,nt=[],ze=le(Ge,!1),ct=ze.label,kt=ze.value,Rt=ze.options,Jt=ze.groupLabel;function pt(Ct,bn){Ct.forEach(function(ln){if(bn||!(Rt in ln)){var En=ln[kt];nt.push({key:pe(ln,nt.length),groupOption:bn,data:ln,label:ln[ct],value:En})}else{var qt=ln[Jt];qt===void 0&&ut&&(qt=ln.label),nt.push({key:pe(ln,nt.length),group:!0,data:ln,label:qt}),pt(ln[Rt],!0)}})}return pt(ke,!1),nt}function lt(ke){var Ie=(0,tt.Z)({},ke);return"props"in Ie||Object.defineProperty(Ie,"props",{get:function(){return(0,_e.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ie}}),Ie}function Ot(ke,Ie){if(!Ie||!Ie.length)return null;var Ge=!1;function ut(ze,ct){var kt=(0,de.Z)(ct),Rt=kt[0],Jt=kt.slice(1);if(!Rt)return[ze];var pt=ze.split(Rt);return Ge=Ge||pt.length>1,pt.reduce(function(Ct,bn){return[].concat((0,Ze.Z)(Ct),(0,Ze.Z)(ut(bn,Jt)))},[]).filter(function(Ct){return Ct})}var nt=ut(ke,Ie);return Ge?nt:null}var It=["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"],Ht=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Yt(ke){return ke==="tags"||ke==="multiple"}var an=Ne.forwardRef(function(ke,Ie){var Ge,ut,nt=ke.id,ze=ke.prefixCls,ct=ke.className,kt=ke.showSearch,Rt=ke.tagRender,Jt=ke.direction,pt=ke.omitDomProps,Ct=ke.displayValues,bn=ke.onDisplayValuesChange,ln=ke.emptyOptions,En=ke.notFoundContent,qt=En===void 0?"Not Found":En,On=ke.onClear,tn=ke.mode,An=ke.disabled,Ue=ke.loading,At=ke.getInputElement,Pt=ke.getRawInputElement,Xt=ke.open,Ft=ke.defaultOpen,Gt=ke.onDropdownVisibleChange,Kt=ke.activeValue,un=ke.onActiveValueChange,xn=ke.activeDescendantId,_n=ke.searchValue,Hn=ke.autoClearSearchValue,Yn=ke.onSearch,yr=ke.onSearchSplit,rr=ke.tokenSeparators,Wn=ke.allowClear,xr=ke.suffixIcon,gr=ke.clearIcon,mr=ke.OptionList,Gn=ke.animation,Jn=ke.transitionName,hr=ke.dropdownStyle,tr=ke.dropdownClassName,_r=ke.dropdownMatchSelectWidth,Wr=ke.dropdownRender,fr=ke.dropdownAlign,kn=ke.placement,Cn=ke.builtinPlacements,Xn=ke.getPopupContainer,Fn=ke.showAction,Sr=Fn===void 0?[]:Fn,Ar=ke.onFocus,lr=ke.onBlur,Vr=ke.onKeyUp,Tr=ke.onKeyDown,si=ke.onMouseDown,or=(0,De.Z)(ke,It),nr=Yt(tn),Ir=(kt!==void 0?kt:nr)||tn==="combobox",Lr=(0,tt.Z)({},or);Ht.forEach(function(Ci){delete Lr[Ci]}),pt==null||pt.forEach(function(Ci){delete Lr[Ci]});var ti=Ne.useState(!1),yi=(0,be.Z)(ti,2),bi=yi[0],Gr=yi[1];Ne.useEffect(function(){Gr((0,rt.Z)())},[]);var gi=Ne.useRef(null),pi=Ne.useRef(null),Zn=Ne.useRef(null),Un=Ne.useRef(null),jn=Ne.useRef(null),ur=We(),Yr=(0,be.Z)(ur,3),li=Yr[0],fi=Yr[1],di=Yr[2];Ne.useImperativeHandle(Ie,function(){var Ci,hi;return{focus:(Ci=Un.current)===null||Ci===void 0?void 0:Ci.focus,blur:(hi=Un.current)===null||hi===void 0?void 0:hi.blur,scrollTo:function(La){var Ui;return(Ui=jn.current)===null||Ui===void 0?void 0:Ui.scrollTo(La)}}});var ii=Ne.useMemo(function(){var Ci;if(tn!=="combobox")return _n;var hi=(Ci=Ct[0])===null||Ci===void 0?void 0:Ci.value;return typeof hi=="string"||typeof hi=="number"?String(hi):""},[_n,tn,Ct]),Si=tn==="combobox"&&typeof At=="function"&&At()||null,Fi=typeof Pt=="function"&&Pt(),Ii=(0,it.x1)(pi,Fi==null||(Ge=Fi.props)===null||Ge===void 0?void 0:Ge.ref),la=Ne.useState(!1),ea=(0,be.Z)(la,2),Pi=ea[0],ki=ea[1];(0,He.Z)(function(){ki(!0)},[]);var Qr=(0,we.Z)(!1,{defaultValue:Ft,value:Xt}),Vi=(0,be.Z)(Qr,2),$i=Vi[0],ci=Vi[1],Pr=Pi?$i:!1,Ur=!qt&&ln;(An||Ur&&Pr&&tn==="combobox")&&(Pr=!1);var zr=Ur?!1:Pr,Or=Ne.useCallback(function(Ci){var hi=Ci!==void 0?Ci:!Pr;An||(ci(hi),Pr!==hi&&(Gt==null||Gt(hi)))},[An,Pr,ci,Gt]),ai=Ne.useMemo(function(){return(rr||[]).some(function(Ci){return[`
`,`\r
`].includes(Ci)})},[rr]),ri=function(hi,zi,La){var Ui=!0,Ra=hi;un==null||un(null);var Fa=La?null:Ot(hi,rr);return tn!=="combobox"&&Fa&&(Ra="",yr==null||yr(Fa),Or(!1),Ui=!1),Yn&&ii!==Ra&&Yn(Ra,{source:zi?"typing":"effect"}),Ui},Ai=function(hi){!hi||!hi.trim()||Yn(hi,{source:"submit"})};Ne.useEffect(function(){!Pr&&!nr&&tn!=="combobox"&&ri("",!1,!1)},[Pr]),Ne.useEffect(function(){$i&&An&&ci(!1),An&&fi(!1)},[An]);var Ki=Me(),Hi=(0,be.Z)(Ki,2),na=Hi[0],vi=Hi[1],mi=function(hi){var zi=na(),La=hi.which;if(La===je.Z.ENTER&&(tn!=="combobox"&&hi.preventDefault(),Pr||Or(!0)),vi(!!ii),La===je.Z.BACKSPACE&&!zi&&nr&&!ii&&Ct.length){for(var Ui=(0,Ze.Z)(Ct),Ra=null,Fa=Ui.length-1;Fa>=0;Fa-=1){var to=Ui[Fa];if(!to.disabled){Ui.splice(Fa,1),Ra=to;break}}Ra&&bn(Ui,{type:"remove",values:[Ra]})}for(var $a=arguments.length,so=new Array($a>1?$a-1:0),lo=1;lo<$a;lo++)so[lo-1]=arguments[lo];if(Pr&&jn.current){var Da;(Da=jn.current).onKeyDown.apply(Da,[hi].concat(so))}Tr==null||Tr.apply(void 0,[hi].concat(so))},Gi=function(hi){for(var zi=arguments.length,La=new Array(zi>1?zi-1:0),Ui=1;Ui<zi;Ui++)La[Ui-1]=arguments[Ui];if(Pr&&jn.current){var Ra;(Ra=jn.current).onKeyUp.apply(Ra,[hi].concat(La))}Vr==null||Vr.apply(void 0,[hi].concat(La))},ca=function(hi){var zi=Ct.filter(function(La){return La!==hi});bn(zi,{type:"remove",values:[hi]})},oa=Ne.useRef(!1),ta=function(){fi(!0),An||(Ar&&!oa.current&&Ar.apply(void 0,arguments),Sr.includes("focus")&&Or(!0)),oa.current=!0},ts=function(){fi(!1,function(){oa.current=!1,Or(!1)}),!An&&(ii&&(tn==="tags"?Yn(ii,{source:"submit"}):tn==="multiple"&&Yn("",{source:"blur"})),lr&&lr.apply(void 0,arguments))},ao=[];Ne.useEffect(function(){return function(){ao.forEach(function(Ci){return clearTimeout(Ci)}),ao.splice(0,ao.length)}},[]);var oo=function(hi){var zi,La=hi.target,Ui=(zi=Zn.current)===null||zi===void 0?void 0:zi.getPopupElement();if(Ui&&Ui.contains(La)){var Ra=setTimeout(function(){var so=ao.indexOf(Ra);if(so!==-1&&ao.splice(so,1),di(),!bi&&!Ui.contains(document.activeElement)){var lo;(lo=Un.current)===null||lo===void 0||lo.focus()}});ao.push(Ra)}for(var Fa=arguments.length,to=new Array(Fa>1?Fa-1:0),$a=1;$a<Fa;$a++)to[$a-1]=arguments[$a];si==null||si.apply(void 0,[hi].concat(to))},eo=Ne.useState({}),Ss=(0,be.Z)(eo,2),fo=Ss[1];function ka(){fo({})}var fa;Fi&&(fa=function(hi){Or(hi)}),Ke(function(){var Ci;return[gi.current,(Ci=Zn.current)===null||Ci===void 0?void 0:Ci.getPopupElement()]},zr,Or,!!Fi);var bo=Ne.useMemo(function(){return(0,tt.Z)((0,tt.Z)({},ke),{},{notFoundContent:qt,open:Pr,triggerOpen:zr,id:nt,showSearch:Ir,multiple:nr,toggleOpen:Or})},[ke,qt,zr,Pr,nt,Ir,nr,Or]),Eo=!!xr||Ue,ko;Eo&&(ko=Ne.createElement(xt,{className:Ae()("".concat(ze,"-arrow"),(0,Fe.Z)({},"".concat(ze,"-arrow-loading"),Ue)),customizeIcon:xr,customizeIconProps:{loading:Ue,searchValue:ii,open:Pr,focused:li,showSearch:Ir}}));var ns=function(){var hi;On==null||On(),(hi=Un.current)===null||hi===void 0||hi.focus(),bn([],{type:"clear",values:Ct}),ri("",!1,!1)},Ro=jt(ze,ns,Ct,Wn,gr,An,ii,tn),Xa=Ro.allowClear,Oa=Ro.clearIcon,Bi=Ne.createElement(mr,{ref:jn}),Lo=Ae()(ze,ct,(ut={},(0,Fe.Z)(ut,"".concat(ze,"-focused"),li),(0,Fe.Z)(ut,"".concat(ze,"-multiple"),nr),(0,Fe.Z)(ut,"".concat(ze,"-single"),!nr),(0,Fe.Z)(ut,"".concat(ze,"-allow-clear"),Wn),(0,Fe.Z)(ut,"".concat(ze,"-show-arrow"),Eo),(0,Fe.Z)(ut,"".concat(ze,"-disabled"),An),(0,Fe.Z)(ut,"".concat(ze,"-loading"),Ue),(0,Fe.Z)(ut,"".concat(ze,"-open"),Pr),(0,Fe.Z)(ut,"".concat(ze,"-customize-input"),Si),(0,Fe.Z)(ut,"".concat(ze,"-show-search"),Ir),ut)),rs=Ne.createElement(oe,{ref:Zn,disabled:An,prefixCls:ze,visible:zr,popupElement:Bi,animation:Gn,transitionName:Jn,dropdownStyle:hr,dropdownClassName:tr,direction:Jt,dropdownMatchSelectWidth:_r,dropdownRender:Wr,dropdownAlign:fr,placement:kn,builtinPlacements:Cn,getPopupContainer:Xn,empty:ln,getTriggerDOMNode:function(){return pi.current},onPopupVisibleChange:fa,onPopupMouseEnter:ka},Fi?Ne.cloneElement(Fi,{ref:Ii}):Ne.createElement(dn,(0,fe.Z)({},ke,{domRef:pi,prefixCls:ze,inputElement:Si,ref:Un,id:nt,showSearch:Ir,autoClearSearchValue:Hn,mode:tn,activeDescendantId:xn,tagRender:Rt,values:Ct,open:Pr,onToggleOpen:Or,activeValue:Kt,searchValue:ii,onSearch:ri,onSearchSubmit:Ai,onRemove:ca,tokenWithEnter:ai}))),Do;return Fi?Do=rs:Do=Ne.createElement("div",(0,fe.Z)({className:Lo},Lr,{ref:gi,onMouseDown:oo,onKeyDown:mi,onKeyUp:Gi,onFocus:ta,onBlur:ts}),li&&!Pr&&Ne.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(Ct.map(function(Ci){var hi=Ci.label,zi=Ci.value;return["number","string"].includes((0,Pe.Z)(hi))?hi:zi}).join(", "))),rs,ko,Xa&&Oa),Ne.createElement(Qe.Provider,{value:bo},Do)}),cn=an,Sn=function(ke,Ie){var Ge=Ne.useRef({values:new Map,options:new Map}),ut=Ne.useMemo(function(){var ze=Ge.current,ct=ze.values,kt=ze.options,Rt=ke.map(function(Ct){if(Ct.label===void 0){var bn;return(0,tt.Z)((0,tt.Z)({},Ct),{},{label:(bn=ct.get(Ct.value))===null||bn===void 0?void 0:bn.label})}return Ct}),Jt=new Map,pt=new Map;return Rt.forEach(function(Ct){Jt.set(Ct.value,Ct),pt.set(Ct.value,Ie.get(Ct.value)||kt.get(Ct.value))}),Ge.current.values=Jt,Ge.current.options=pt,Rt},[ke,Ie]),nt=Ne.useCallback(function(ze){return Ie.get(ze)||Ge.current.options.get(ze)},[Ie]);return[ut,nt]};function wt(ke,Ie){return Tt(ke).join("").toUpperCase().includes(Ie)}var on=function(ke,Ie,Ge,ut,nt){return Ne.useMemo(function(){if(!Ge||ut===!1)return ke;var ze=Ie.options,ct=Ie.label,kt=Ie.value,Rt=[],Jt=typeof ut=="function",pt=Ge.toUpperCase(),Ct=Jt?ut:function(ln,En){return nt?wt(En[nt],pt):En[ze]?wt(En[ct!=="children"?ct:"label"],pt):wt(En[kt],pt)},bn=Jt?function(ln){return lt(ln)}:function(ln){return ln};return ke.forEach(function(ln){if(ln[ze]){var En=Ct(Ge,bn(ln));if(En)Rt.push(ln);else{var qt=ln[ze].filter(function(On){return Ct(Ge,bn(On))});qt.length&&Rt.push((0,tt.Z)((0,tt.Z)({},ln),{},(0,Fe.Z)({},ze,qt)))}return}Ct(Ge,bn(ln))&&Rt.push(ln)}),Rt},[ke,ut,nt,Ge,Ie])},Pn=ue(17115),ot=ue(11592),St=["children","value"],$t=["children"];function Dn(ke){var Ie=ke,Ge=Ie.key,ut=Ie.props,nt=ut.children,ze=ut.value,ct=(0,De.Z)(ut,St);return(0,tt.Z)({key:Ge,value:ze!==void 0?ze:Ge,children:nt},ct)}function Ln(ke){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,ot.Z)(ke).map(function(Ge,ut){if(!Ne.isValidElement(Ge)||!Ge.type)return null;var nt=Ge,ze=nt.type.isSelectOptGroup,ct=nt.key,kt=nt.props,Rt=kt.children,Jt=(0,De.Z)(kt,$t);return Ie||!ze?Dn(Ge):(0,tt.Z)((0,tt.Z)({key:"__RC_SELECT_GRP__".concat(ct===null?ut:ct,"__"),label:ct},Jt),{},{options:Ln(Rt)})}).filter(function(Ge){return Ge})}function In(ke,Ie,Ge,ut,nt){return Ne.useMemo(function(){var ze=ke,ct=!ke;ct&&(ze=Ln(Ie));var kt=new Map,Rt=new Map,Jt=function(bn,ln,En){En&&typeof En=="string"&&bn.set(ln[En],ln)};function pt(Ct){for(var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ln=0;ln<Ct.length;ln+=1){var En=Ct[ln];!En[Ge.options]||bn?(kt.set(En[Ge.value],En),Jt(Rt,En,Ge.label),Jt(Rt,En,ut),Jt(Rt,En,nt)):pt(En[Ge.options],!0)}}return pt(ze),{options:ze,valueOptions:kt,labelOptions:Rt}},[ke,Ie,Ge,ut,nt])}function qn(ke){var Ie=Ne.useRef();Ie.current=ke;var Ge=Ne.useCallback(function(){return Ie.current.apply(Ie,arguments)},[]);return Ge}var dr=function(){return null};dr.isSelectOptGroup=!0;var ir=dr,Er=function(){return null};Er.isSelectOption=!0;var kr=Er,Qn=ue(80547),Kr=ue(2738),jr=ue(48911),Hr=Ne.createContext(null),ni=Hr;function Br(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var qr=["disabled","title","children","style","className"];function Cr(ke){return typeof ke=="string"||typeof ke=="number"}var yn=function(Ie,Ge){var ut=mt(),nt=ut.prefixCls,ze=ut.id,ct=ut.open,kt=ut.multiple,Rt=ut.mode,Jt=ut.searchValue,pt=ut.toggleOpen,Ct=ut.notFoundContent,bn=ut.onPopupScroll,ln=Ne.useContext(ni),En=ln.flattenOptions,qt=ln.onActiveValue,On=ln.defaultActiveFirstOption,tn=ln.onSelect,An=ln.menuItemSelectedIcon,Ue=ln.rawValues,At=ln.fieldNames,Pt=ln.virtual,Xt=ln.direction,Ft=ln.listHeight,Gt=ln.listItemHeight,Kt="".concat(nt,"-item"),un=(0,Qn.Z)(function(){return En},[ct,En],function(fr,kn){return kn[0]&&fr[1]!==kn[1]}),xn=Ne.useRef(null),_n=function(kn){kn.preventDefault()},Hn=function(kn){xn.current&&xn.current.scrollTo(typeof kn=="number"?{index:kn}:kn)},Yn=function(kn){for(var Cn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Xn=un.length,Fn=0;Fn<Xn;Fn+=1){var Sr=(kn+Fn*Cn+Xn)%Xn,Ar=un[Sr],lr=Ar.group,Vr=Ar.data;if(!lr&&!Vr.disabled)return Sr}return-1},yr=Ne.useState(function(){return Yn(0)}),rr=(0,be.Z)(yr,2),Wn=rr[0],xr=rr[1],gr=function(kn){var Cn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;xr(kn);var Xn={source:Cn?"keyboard":"mouse"},Fn=un[kn];if(!Fn){qt(null,-1,Xn);return}qt(Fn.value,kn,Xn)};(0,Ne.useEffect)(function(){gr(On!==!1?Yn(0):-1)},[un.length,Jt]);var mr=Ne.useCallback(function(fr){return Ue.has(fr)&&Rt!=="combobox"},[Rt,(0,Ze.Z)(Ue).toString(),Ue.size]);(0,Ne.useEffect)(function(){var fr=setTimeout(function(){if(!kt&&ct&&Ue.size===1){var Cn=Array.from(Ue)[0],Xn=un.findIndex(function(Fn){var Sr=Fn.data;return Sr.value===Cn});Xn!==-1&&(gr(Xn),Hn(Xn))}});if(ct){var kn;(kn=xn.current)===null||kn===void 0||kn.scrollTo(void 0)}return function(){return clearTimeout(fr)}},[ct,Jt,En.length]);var Gn=function(kn){kn!==void 0&&tn(kn,{selected:!Ue.has(kn)}),kt||pt(!1)};if(Ne.useImperativeHandle(Ge,function(){return{onKeyDown:function(kn){var Cn=kn.which,Xn=kn.ctrlKey;switch(Cn){case je.Z.N:case je.Z.P:case je.Z.UP:case je.Z.DOWN:{var Fn=0;if(Cn===je.Z.UP?Fn=-1:Cn===je.Z.DOWN?Fn=1:Br()&&Xn&&(Cn===je.Z.N?Fn=1:Cn===je.Z.P&&(Fn=-1)),Fn!==0){var Sr=Yn(Wn+Fn,Fn);Hn(Sr),gr(Sr,!0)}break}case je.Z.ENTER:{var Ar=un[Wn];Ar&&!Ar.data.disabled?Gn(Ar.value):Gn(void 0),ct&&kn.preventDefault();break}case je.Z.ESC:pt(!1),ct&&kn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(kn){Hn(kn)}}}),un.length===0)return Ne.createElement("div",{role:"listbox",id:"".concat(ze,"_list"),className:"".concat(Kt,"-empty"),onMouseDown:_n},Ct);var Jn=Object.keys(At).map(function(fr){return At[fr]}),hr=function(kn){return kn.label};function tr(fr,kn){var Cn=fr.group;return{role:Cn?"presentation":"option",id:"".concat(ze,"_list_").concat(kn)}}var _r=function(kn){var Cn=un[kn];if(!Cn)return null;var Xn=Cn.data||{},Fn=Xn.value,Sr=Cn.group,Ar=(0,Ve.Z)(Xn,!0),lr=hr(Cn);return Cn?Ne.createElement("div",(0,fe.Z)({"aria-label":typeof lr=="string"&&!Sr?lr:null},Ar,{key:kn},tr(Cn,kn),{"aria-selected":mr(Fn)}),Fn):null},Wr={role:"listbox",id:"".concat(ze,"_list")};return Ne.createElement(Ne.Fragment,null,Pt&&Ne.createElement("div",(0,fe.Z)({},Wr,{style:{height:0,width:0,overflow:"hidden"}}),_r(Wn-1),_r(Wn),_r(Wn+1)),Ne.createElement(jr.Z,{itemKey:"key",ref:xn,data:un,height:Ft,itemHeight:Gt,fullHeight:!1,onMouseDown:_n,onScroll:bn,virtual:Pt,direction:Xt,innerProps:Pt?null:Wr},function(fr,kn){var Cn,Xn=fr.group,Fn=fr.groupOption,Sr=fr.data,Ar=fr.label,lr=fr.value,Vr=Sr.key;if(Xn){var Tr,si=(Tr=Sr.title)!==null&&Tr!==void 0?Tr:Cr(Ar)?Ar.toString():void 0;return Ne.createElement("div",{className:Ae()(Kt,"".concat(Kt,"-group")),title:si},Ar!==void 0?Ar:Vr)}var or=Sr.disabled,nr=Sr.title,Ir=Sr.children,Lr=Sr.style,ti=Sr.className,yi=(0,De.Z)(Sr,qr),bi=(0,Kr.Z)(yi,Jn),Gr=mr(lr),gi="".concat(Kt,"-option"),pi=Ae()(Kt,gi,ti,(Cn={},(0,Fe.Z)(Cn,"".concat(gi,"-grouped"),Fn),(0,Fe.Z)(Cn,"".concat(gi,"-active"),Wn===kn&&!or),(0,Fe.Z)(Cn,"".concat(gi,"-disabled"),or),(0,Fe.Z)(Cn,"".concat(gi,"-selected"),Gr),Cn)),Zn=hr(fr),Un=!An||typeof An=="function"||Gr,jn=typeof Zn=="number"?Zn:Zn||lr,ur=Cr(jn)?jn.toString():void 0;return nr!==void 0&&(ur=nr),Ne.createElement("div",(0,fe.Z)({},(0,Ve.Z)(bi),Pt?{}:tr(fr,kn),{"aria-selected":Gr,className:pi,title:ur,onMouseMove:function(){Wn===kn||or||gr(kn)},onClick:function(){or||Gn(lr)},style:Lr}),Ne.createElement("div",{className:"".concat(gi,"-content")},jn),Ne.isValidElement(An)||Gr,Un&&Ne.createElement(xt,{className:"".concat(Kt,"-option-state"),customizeIcon:An,customizeIconProps:{isSelected:Gr}},Gr?"\u2713":null))}))},wn=Ne.forwardRef(yn);wn.displayName="OptionList";var fn=wn;function Rn(ke){var Ie=ke.mode,Ge=ke.options,ut=ke.children,nt=ke.backfill,ze=ke.allowClear,ct=ke.placeholder,kt=ke.getInputElement,Rt=ke.showSearch,Jt=ke.onSearch,pt=ke.defaultOpen,Ct=ke.autoFocus,bn=ke.labelInValue,ln=ke.value,En=ke.inputValue,qt=ke.optionLabelProp,On=isMultiple(Ie),tn=Rt!==void 0?Rt:On||Ie==="combobox",An=Ge||convertChildrenToData(ut);if(warning(Ie!=="tags"||An.every(function(Xt){return!Xt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ie==="tags"||Ie==="combobox"){var Ue=An.some(function(Xt){return Xt.options?Xt.options.some(function(Ft){return typeof("value"in Ft?Ft.value:Ft.key)=="number"}):typeof("value"in Xt?Xt.value:Xt.key)=="number"});warning(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ie!=="combobox"||!qt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ie==="combobox"||!nt,"`backfill` only works with `combobox` mode."),warning(Ie==="combobox"||!kt,"`getInputElement` only work with `combobox` mode."),noteOnce(Ie!=="combobox"||!kt||!ze||!ct,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Jt&&!tn&&Ie!=="combobox"&&Ie!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!pt||Ct,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ln!=null){var At=toArray(ln);warning(!bn||At.every(function(Xt){return _typeof(Xt)==="object"&&("key"in Xt||"value"in Xt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!On||Array.isArray(ln),"`value` should be array when `mode` is `multiple` or `tags`")}if(ut){var Pt=null;toNodeArray(ut).some(function(Xt){if(!React.isValidElement(Xt)||!Xt.type)return!1;var Ft=Xt,Gt=Ft.type;if(Gt.isSelectOption)return!1;if(Gt.isSelectOptGroup){var Kt=toNodeArray(Xt.props.children).every(function(un){return!React.isValidElement(un)||!Xt.type||un.type.isSelectOption?!0:(Pt=un.type,!1)});return!Kt}return Pt=Gt,!0}),Pt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Pt.displayName||Pt.name||Pt,"`.")),warning(En===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function br(ke,Ie){if(ke){var Ge=function ut(nt){for(var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ct=0;ct<nt.length;ct++){var kt=nt[ct];if(kt[Ie==null?void 0:Ie.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!ze&&Array.isArray(kt[Ie==null?void 0:Ie.options])&&ut(kt[Ie==null?void 0:Ie.options],!0))break}};Ge(ke)}}var Kn=null,ar=["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"],vn=["inputValue"];function pn(ke){return!ke||(0,Pe.Z)(ke)!=="object"}var Nn=Ne.forwardRef(function(ke,Ie){var Ge=ke.id,ut=ke.mode,nt=ke.prefixCls,ze=nt===void 0?"rc-select":nt,ct=ke.backfill,kt=ke.fieldNames,Rt=ke.inputValue,Jt=ke.searchValue,pt=ke.onSearch,Ct=ke.autoClearSearchValue,bn=Ct===void 0?!0:Ct,ln=ke.onSelect,En=ke.onDeselect,qt=ke.dropdownMatchSelectWidth,On=qt===void 0?!0:qt,tn=ke.filterOption,An=ke.filterSort,Ue=ke.optionFilterProp,At=ke.optionLabelProp,Pt=ke.options,Xt=ke.children,Ft=ke.defaultActiveFirstOption,Gt=ke.menuItemSelectedIcon,Kt=ke.virtual,un=ke.direction,xn=ke.listHeight,_n=xn===void 0?200:xn,Hn=ke.listItemHeight,Yn=Hn===void 0?20:Hn,yr=ke.value,rr=ke.defaultValue,Wn=ke.labelInValue,xr=ke.onChange,gr=(0,De.Z)(ke,ar),mr=(0,Pn.ZP)(Ge),Gn=Yt(ut),Jn=!!(!Pt&&Xt),hr=Ne.useMemo(function(){return tn===void 0&&ut==="combobox"?!1:tn},[tn,ut]),tr=Ne.useMemo(function(){return le(kt,Jn)},[JSON.stringify(kt),Jn]),_r=(0,we.Z)("",{value:Jt!==void 0?Jt:Rt,postState:function(Ur){return Ur||""}}),Wr=(0,be.Z)(_r,2),fr=Wr[0],kn=Wr[1],Cn=In(Pt,Xt,tr,Ue,At),Xn=Cn.valueOptions,Fn=Cn.labelOptions,Sr=Cn.options,Ar=Ne.useCallback(function(Pr){var Ur=Tt(Pr);return Ur.map(function(zr){var Or,ai,ri,Ai,Ki;if(pn(zr))Or=zr;else{var Hi;ri=zr.key,ai=zr.label,Or=(Hi=zr.value)!==null&&Hi!==void 0?Hi:ri}var na=Xn.get(Or);if(na){var vi;if(ai===void 0&&(ai=na==null?void 0:na[At||tr.label]),ri===void 0&&(ri=(vi=na==null?void 0:na.key)!==null&&vi!==void 0?vi:Or),Ai=na==null?void 0:na.disabled,Ki=na==null?void 0:na.title,0)var mi}return{label:ai,value:Or,key:ri,disabled:Ai,title:Ki}})},[tr,At,Xn]),lr=(0,we.Z)(rr,{value:yr}),Vr=(0,be.Z)(lr,2),Tr=Vr[0],si=Vr[1],or=Ne.useMemo(function(){var Pr,Ur=Ar(Tr);return ut==="combobox"&&Dt((Pr=Ur[0])===null||Pr===void 0?void 0:Pr.value)?[]:Ur},[Tr,Ar,ut]),nr=Sn(or,Xn),Ir=(0,be.Z)(nr,2),Lr=Ir[0],ti=Ir[1],yi=Ne.useMemo(function(){if(!ut&&Lr.length===1){var Pr=Lr[0];if(Pr.value===null&&(Pr.label===null||Pr.label===void 0))return[]}return Lr.map(function(Ur){var zr;return(0,tt.Z)((0,tt.Z)({},Ur),{},{label:(zr=Ur.label)!==null&&zr!==void 0?zr:Ur.value})})},[ut,Lr]),bi=Ne.useMemo(function(){return new Set(Lr.map(function(Pr){return Pr.value}))},[Lr]);Ne.useEffect(function(){if(ut==="combobox"){var Pr,Ur=(Pr=Lr[0])===null||Pr===void 0?void 0:Pr.value;kn(ft(Ur)?String(Ur):"")}},[Lr]);var Gr=qn(function(Pr,Ur){var zr,Or=Ur!=null?Ur:Pr;return zr={},(0,Fe.Z)(zr,tr.value,Pr),(0,Fe.Z)(zr,tr.label,Or),zr}),gi=Ne.useMemo(function(){if(ut!=="tags")return Sr;var Pr=(0,Ze.Z)(Sr),Ur=function(Or){return Xn.has(Or)};return(0,Ze.Z)(Lr).sort(function(zr,Or){return zr.value<Or.value?-1:1}).forEach(function(zr){var Or=zr.value;Ur(Or)||Pr.push(Gr(Or,zr.label))}),Pr},[Gr,Sr,Xn,Lr,ut]),pi=on(gi,tr,fr,hr,Ue),Zn=Ne.useMemo(function(){return ut!=="tags"||!fr||pi.some(function(Pr){return Pr[Ue||"value"]===fr})||pi.some(function(Pr){return Pr[tr.value]===fr})?pi:[Gr(fr)].concat((0,Ze.Z)(pi))},[Gr,Ue,ut,pi,fr,tr]),Un=Ne.useMemo(function(){return An?(0,Ze.Z)(Zn).sort(function(Pr,Ur){return An(Pr,Ur)}):Zn},[Zn,An]),jn=Ne.useMemo(function(){return Be(Un,{fieldNames:tr,childrenAsData:Jn})},[Un,tr,Jn]),ur=function(Ur){var zr=Ar(Ur);if(si(zr),xr&&(zr.length!==Lr.length||zr.some(function(ri,Ai){var Ki;return((Ki=Lr[Ai])===null||Ki===void 0?void 0:Ki.value)!==(ri==null?void 0:ri.value)}))){var Or=Wn?zr:zr.map(function(ri){return ri.value}),ai=zr.map(function(ri){return lt(ti(ri.value))});xr(Gn?Or:Or[0],Gn?ai:ai[0])}},Yr=Ne.useState(null),li=(0,be.Z)(Yr,2),fi=li[0],di=li[1],ii=Ne.useState(0),Si=(0,be.Z)(ii,2),Fi=Si[0],Ii=Si[1],la=Ft!==void 0?Ft:ut!=="combobox",ea=Ne.useCallback(function(Pr,Ur){var zr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Or=zr.source,ai=Or===void 0?"keyboard":Or;Ii(Ur),ct&&ut==="combobox"&&Pr!==null&&ai==="keyboard"&&di(String(Pr))},[ct,ut]),Pi=function(Ur,zr,Or){var ai=function(){var oa,ta=ti(Ur);return[Wn?{label:ta==null?void 0:ta[tr.label],value:Ur,key:(oa=ta==null?void 0:ta.key)!==null&&oa!==void 0?oa:Ur}:Ur,lt(ta)]};if(zr&&ln){var ri=ai(),Ai=(0,be.Z)(ri,2),Ki=Ai[0],Hi=Ai[1];ln(Ki,Hi)}else if(!zr&&En&&Or!=="clear"){var na=ai(),vi=(0,be.Z)(na,2),mi=vi[0],Gi=vi[1];En(mi,Gi)}},ki=qn(function(Pr,Ur){var zr,Or=Gn?Ur.selected:!0;Or?zr=Gn?[].concat((0,Ze.Z)(Lr),[Pr]):[Pr]:zr=Lr.filter(function(ai){return ai.value!==Pr}),ur(zr),Pi(Pr,Or),ut==="combobox"?di(""):(!Yt||bn)&&(kn(""),di(""))}),Qr=function(Ur,zr){ur(Ur);var Or=zr.type,ai=zr.values;(Or==="remove"||Or==="clear")&&ai.forEach(function(ri){Pi(ri.value,!1,Or)})},Vi=function(Ur,zr){if(kn(Ur),di(null),zr.source==="submit"){var Or=(Ur||"").trim();if(Or){var ai=Array.from(new Set([].concat((0,Ze.Z)(bi),[Or])));ur(ai),Pi(Or,!0),kn("")}return}zr.source!=="blur"&&(ut==="combobox"&&ur(Ur),pt==null||pt(Ur))},$i=function(Ur){var zr=Ur;ut!=="tags"&&(zr=Ur.map(function(ai){var ri=Fn.get(ai);return ri==null?void 0:ri.value}).filter(function(ai){return ai!==void 0}));var Or=Array.from(new Set([].concat((0,Ze.Z)(bi),(0,Ze.Z)(zr))));ur(Or),Or.forEach(function(ai){Pi(ai,!0)})},ci=Ne.useMemo(function(){var Pr=Kt!==!1&&On!==!1;return(0,tt.Z)((0,tt.Z)({},Cn),{},{flattenOptions:jn,onActiveValue:ea,defaultActiveFirstOption:la,onSelect:ki,menuItemSelectedIcon:Gt,rawValues:bi,fieldNames:tr,virtual:Pr,direction:un,listHeight:_n,listItemHeight:Yn,childrenAsData:Jn})},[Cn,jn,ea,la,ki,Gt,bi,tr,Kt,On,_n,Yn,Jn]);return Ne.createElement(ni.Provider,{value:ci},Ne.createElement(cn,(0,fe.Z)({},gr,{id:mr,prefixCls:ze,ref:Ie,omitDomProps:vn,mode:ut,displayValues:yi,onDisplayValuesChange:Qr,direction:un,searchValue:fr,onSearch:Vi,autoClearSearchValue:bn,onSearchSplit:$i,dropdownMatchSelectWidth:On,OptionList:fn,emptyOptions:!jn.length,activeValue:fi,activeDescendantId:"".concat(mr,"_list_").concat(Fi)})))}),st=Nn;st.Option=kr,st.OptGroup=ir;var Ee=st,Te=Ee},9296:function(Mn,rn,ue){"use strict";ue.r(rn),ue.d(rn,{ResizableTextArea:function(){return Nt},default:function(){return Dt}});var fe=ue(60499),Ze=ue(85899),Fe=ue(18642),tt=ue(43749),be=ue(72190),De=ue(42244),Pe=ue(77654),we=ue(92310),_e=ue.n(we),Ne=ue(93681),dt=ue(5643),Ae=ue(18929),He=ue(59301),rt=ue(29301),je=ue(34280),it=ue(16089),at=`
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;
`,xt=["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"],jt={},Qe;function mt(Bt){var bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=Bt.getAttribute("id")||Bt.getAttribute("data-reactid")||Bt.getAttribute("name");if(bt&&jt[$e])return jt[$e];var xe=window.getComputedStyle(Bt),gt=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),en=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Wt=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),qe=xt.map(function(Lt){return"".concat(Lt,":").concat(xe.getPropertyValue(Lt))}).join(";"),Ye={sizingStyle:qe,paddingSize:en,borderSize:Wt,boxSizing:gt};return bt&&$e&&(jt[$e]=Ye),Ye}function We(Bt){var bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Qe||(Qe=document.createElement("textarea"),Qe.setAttribute("tab-index","-1"),Qe.setAttribute("aria-hidden","true"),document.body.appendChild(Qe)),Bt.getAttribute("wrap")?Qe.setAttribute("wrap",Bt.getAttribute("wrap")):Qe.removeAttribute("wrap");var gt=mt(Bt,bt),en=gt.paddingSize,Wt=gt.borderSize,qe=gt.boxSizing,Ye=gt.sizingStyle;Qe.setAttribute("style","".concat(Ye,";").concat(at)),Qe.value=Bt.value||Bt.placeholder||"";var Lt=void 0,mn=void 0,Qt,dn=Qe.scrollHeight;if(qe==="border-box"?dn+=Wt:qe==="content-box"&&(dn-=en),$e!==null||xe!==null){Qe.value=" ";var Zt=Qe.scrollHeight-en;$e!==null&&(Lt=Zt*$e,qe==="border-box"&&(Lt=Lt+en+Wt),dn=Math.max(Lt,dn)),xe!==null&&(mn=Zt*xe,qe==="border-box"&&(mn=mn+en+Wt),Qt=dn>mn?"":"hidden",dn=Math.min(mn,dn))}var Vt={height:dn,overflowY:Qt,resize:"none"};return Lt&&(Vt.minHeight=Lt),mn&&(Vt.maxHeight=mn),Vt}var Me=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Ke=0,Ve=1,Mt=2,Xe=He.forwardRef(function(Bt,bt){var $e=Bt,xe=$e.prefixCls,gt=$e.onPressEnter,en=$e.defaultValue,Wt=$e.value,qe=$e.autoSize,Ye=$e.onResize,Lt=$e.className,mn=$e.style,Qt=$e.disabled,dn=$e.onChange,Zt=$e.onInternalAutoSize,Vt=(0,De.Z)($e,Me),zt=(0,Ae.Z)(en,{value:Wt,postState:function(ir){return ir!=null?ir:""}}),ye=(0,be.Z)(zt,2),se=ye[0],oe=ye[1],de=function(ir){oe(ir.target.value),dn==null||dn(ir)},pe=He.useRef();He.useImperativeHandle(bt,function(){return{textArea:pe.current}});var le=He.useMemo(function(){return qe&&(0,tt.Z)(qe)==="object"?[qe.minRows,qe.maxRows]:[]},[qe]),Be=(0,be.Z)(le,2),lt=Be[0],Ot=Be[1],It=!!qe,Ht=function(){try{if(document.activeElement===pe.current){var ir=pe.current,Er=ir.selectionStart,kr=ir.selectionEnd,Qn=ir.scrollTop;pe.current.setSelectionRange(Er,kr),pe.current.scrollTop=Qn}}catch(Kr){}},Yt=He.useState(Mt),an=(0,be.Z)(Yt,2),cn=an[0],Sn=an[1],wt=He.useState(),on=(0,be.Z)(wt,2),Pn=on[0],ot=on[1],St=function(){Sn(Ke)};(0,je.Z)(function(){It&&St()},[Wt,lt,Ot,It]),(0,je.Z)(function(){if(cn===Ke)Sn(Ve);else if(cn===Ve){var dr=We(pe.current,!1,lt,Ot);Sn(Mt),ot(dr)}else Ht()},[cn]);var $t=He.useRef(),Dn=function(){it.Z.cancel($t.current)},Ln=function(ir){cn===Mt&&(Ye==null||Ye(ir),qe&&(Dn(),$t.current=(0,it.Z)(function(){St()})))};He.useEffect(function(){return Dn},[]);var In=It?Pn:null,qn=(0,Ze.Z)((0,Ze.Z)({},mn),In);return(cn===Ke||cn===Ve)&&(qn.overflowY="hidden",qn.overflowX="hidden"),He.createElement(rt.Z,{onResize:Ln,disabled:!(qe||Ye)},He.createElement("textarea",(0,fe.Z)({},Vt,{ref:pe,style:qn,className:_e()(xe,Lt,(0,Fe.Z)({},"".concat(xe,"-disabled"),Qt)),disabled:Qt,value:se,onChange:de})))}),Nt=Xe,ht=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Tt(Bt,bt){return(0,Pe.Z)(Bt||"").slice(0,bt).join("")}function et(Bt,bt,$e,xe){var gt=$e;return Bt?gt=Tt($e,xe):(0,Pe.Z)(bt||"").length<$e.length&&(0,Pe.Z)($e||"").length>xe&&(gt=bt),gt}var Ut=He.forwardRef(function(Bt,bt){var $e,xe=Bt.defaultValue,gt=Bt.value,en=Bt.onFocus,Wt=Bt.onBlur,qe=Bt.onChange,Ye=Bt.allowClear,Lt=Bt.maxLength,mn=Bt.onCompositionStart,Qt=Bt.onCompositionEnd,dn=Bt.suffix,Zt=Bt.prefixCls,Vt=Zt===void 0?"rc-textarea":Zt,zt=Bt.classes,ye=Bt.showCount,se=Bt.className,oe=Bt.style,de=Bt.disabled,pe=Bt.hidden,le=Bt.classNames,Be=Bt.styles,lt=Bt.onResize,Ot=(0,De.Z)(Bt,ht),It=(0,Ae.Z)(xe,{value:gt,defaultValue:xe}),Ht=(0,be.Z)(It,2),Yt=Ht[0],an=Ht[1],cn=(0,He.useRef)(null),Sn=He.useState(!1),wt=(0,be.Z)(Sn,2),on=wt[0],Pn=wt[1],ot=He.useState(!1),St=(0,be.Z)(ot,2),$t=St[0],Dn=St[1],Ln=He.useRef(),In=He.useRef(0),qn=He.useState(null),dr=(0,be.Z)(qn,2),ir=dr[0],Er=dr[1],kr=function(){var pn;(pn=cn.current)===null||pn===void 0||pn.textArea.focus()};(0,He.useImperativeHandle)(bt,function(){return{resizableTextArea:cn.current,focus:kr,blur:function(){var pn;(pn=cn.current)===null||pn===void 0||pn.textArea.blur()}}}),(0,He.useEffect)(function(){Pn(function(vn){return!de&&vn})},[de]);var Qn=Number(Lt)>0,Kr=function(pn){Dn(!0),Ln.current=Yt,In.current=pn.currentTarget.selectionStart,mn==null||mn(pn)},jr=function(pn){Dn(!1);var Nn=pn.currentTarget.value;if(Qn){var st,Ee=In.current>=Lt+1||In.current===((st=Ln.current)===null||st===void 0?void 0:st.length);Nn=et(Ee,Ln.current,Nn,Lt)}Nn!==Yt&&(an(Nn),(0,dt.rJ)(pn.currentTarget,pn,qe,Nn)),Qt==null||Qt(pn)},Hr=function(pn){var Nn=pn.target.value;if(!$t&&Qn){var st=pn.target.selectionStart>=Lt+1||pn.target.selectionStart===Nn.length||!pn.target.selectionStart;Nn=et(st,Yt,Nn,Lt)}an(Nn),(0,dt.rJ)(pn.currentTarget,pn,qe,Nn)},ni=function(pn){var Nn=Ot.onPressEnter,st=Ot.onKeyDown;pn.key==="Enter"&&Nn&&Nn(pn),st==null||st(pn)},Br=function(pn){Pn(!0),en==null||en(pn)},qr=function(pn){Pn(!1),Wt==null||Wt(pn)},Cr=function(pn){var Nn;an(""),kr(),(0,dt.rJ)((Nn=cn.current)===null||Nn===void 0?void 0:Nn.textArea,pn,qe)},yn=(0,dt.D7)(Yt);!$t&&Qn&&gt==null&&(yn=Tt(yn,Lt));var wn=dn,fn;if(ye){var Rn=(0,Pe.Z)(yn).length;(0,tt.Z)(ye)==="object"?fn=ye.formatter({value:yn,count:Rn,maxLength:Lt}):fn="".concat(Rn).concat(Qn?" / ".concat(Lt):""),wn=He.createElement(He.Fragment,null,wn,He.createElement("span",{className:_e()("".concat(Vt,"-data-count"),le==null?void 0:le.count),style:Be==null?void 0:Be.count},fn))}var br=function(pn){var Nn;lt==null||lt(pn),(Nn=cn.current)!==null&&Nn!==void 0&&Nn.textArea.style.height&&Er(!0)},Kn=!Ot.autoSize&&!ye&&!Ye,ar=He.createElement(Ne.BaseInput,{value:yn,allowClear:Ye,handleReset:Cr,suffix:wn,prefixCls:Vt,classes:{affixWrapper:_e()(zt==null?void 0:zt.affixWrapper,($e={},(0,Fe.Z)($e,"".concat(Vt,"-show-count"),ye),(0,Fe.Z)($e,"".concat(Vt,"-textarea-allow-clear"),Ye),$e))},disabled:de,focused:on,className:se,style:(0,Ze.Z)((0,Ze.Z)({},oe),ir&&!Kn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof fn=="string"?fn:void 0}},hidden:pe,inputElement:He.createElement(Nt,(0,fe.Z)({},Ot,{onKeyDown:ni,onChange:Hr,onFocus:Br,onBlur:qr,onCompositionStart:Kr,onCompositionEnd:jr,className:le==null?void 0:le.textarea,style:(0,Ze.Z)((0,Ze.Z)({},Be==null?void 0:Be.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:de,prefixCls:Vt,onResize:br,ref:cn}))});return ar}),ft=Ut,Dt=ft},8224:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return Ze}});var fe=ue(4676);function Ze(Fe,tt,be,De){var Pe=fe.unstable_batchedUpdates?function(_e){fe.unstable_batchedUpdates(be,_e)}:be;return Fe!=null&&Fe.addEventListener&&Fe.addEventListener(tt,Pe,De),{remove:function(){Fe!=null&&Fe.removeEventListener&&Fe.removeEventListener(tt,Pe,De)}}}},55468:function(Mn,rn,ue){"use strict";ue.d(rn,{g1:function(){return dt},os:function(){return He}});var fe=/margin|padding|width|height|max|min|offset/,Ze={left:!0,top:!0},Fe={cssFloat:1,styleFloat:1,float:1};function tt(rt){return rt.nodeType===1?rt.ownerDocument.defaultView.getComputedStyle(rt,null):{}}function be(rt,je,it){if(je=je.toLowerCase(),it==="auto"){if(je==="height")return rt.offsetHeight;if(je==="width")return rt.offsetWidth}return je in Ze||(Ze[je]=fe.test(je)),Ze[je]?parseFloat(it)||0:it}function De(rt,je){var it=arguments.length,at=tt(rt);return je=Fe[je]?"cssFloat"in rt.style?"cssFloat":"styleFloat":je,it===1?at:be(rt,je,at[je]||rt.style[je])}function Pe(rt,je,it){var at=arguments.length;if(je=Fe[je]?"cssFloat"in rt.style?"cssFloat":"styleFloat":je,at===3)return typeof it=="number"&&fe.test(je)&&(it="".concat(it,"px")),rt.style[je]=it,it;for(var xt in je)je.hasOwnProperty(xt)&&Pe(rt,xt,je[xt]);return tt(rt)}function we(rt){return rt===document.body?document.documentElement.clientWidth:rt.offsetWidth}function _e(rt){return rt===document.body?window.innerHeight||document.documentElement.clientHeight:rt.offsetHeight}function Ne(){var rt=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),je=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:rt,height:je}}function dt(){var rt=document.documentElement.clientWidth,je=window.innerHeight||document.documentElement.clientHeight;return{width:rt,height:je}}function Ae(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function He(rt){var je=rt.getBoundingClientRect(),it=document.documentElement;return{left:je.left+(window.pageXOffset||it.scrollLeft)-(it.clientLeft||document.body.clientLeft||0),top:je.top+(window.pageYOffset||it.scrollTop)-(it.clientTop||document.body.clientTop||0)}}},48911:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return zt}});var fe=ue(60499),Ze=ue(43749),Fe=ue(85899),tt=ue(18642),be=ue(72190),De=ue(42244),Pe=ue(92310),we=ue.n(Pe),_e=ue(29301),Ne=ue(70425),dt=ue(34280),Ae=ue(59301),He=ue(4676),rt=Ae.forwardRef(function(ye,se){var oe=ye.height,de=ye.offsetY,pe=ye.offsetX,le=ye.children,Be=ye.prefixCls,lt=ye.onInnerResize,Ot=ye.innerProps,It=ye.rtl,Ht=ye.extra,Yt={},an={display:"flex",flexDirection:"column"};return de!==void 0&&(Yt={height:oe,position:"relative",overflow:"hidden"},an=(0,Fe.Z)((0,Fe.Z)({},an),{},(0,tt.Z)((0,tt.Z)((0,tt.Z)((0,tt.Z)((0,tt.Z)({transform:"translateY(".concat(de,"px)")},It?"marginRight":"marginLeft",-pe),"position","absolute"),"left",0),"right",0),"top",0))),Ae.createElement("div",{style:Yt},Ae.createElement(_e.Z,{onResize:function(Sn){var wt=Sn.offsetHeight;wt&&lt&&lt()}},Ae.createElement("div",(0,fe.Z)({style:an,className:we()((0,tt.Z)({},"".concat(Be,"-holder-inner"),Be)),ref:se},Ot),le,Ht)))});rt.displayName="Filler";var je=rt;function it(ye){var se=ye.children,oe=ye.setRef,de=Ae.useCallback(function(pe){oe(pe)},[]);return Ae.cloneElement(se,{ref:de})}function at(ye,se,oe,de,pe,le,Be,lt){var Ot=lt.getKey;return ye.slice(se,oe+1).map(function(It,Ht){var Yt=se+Ht,an=Be(It,Yt,{style:{width:de},offsetX:pe}),cn=Ot(It);return Ae.createElement(it,{key:cn,setRef:function(wt){return le(It,wt)}},an)})}function xt(ye,se,oe,de){var pe=oe-ye,le=se-oe,Be=Math.min(pe,le)*2;if(de<=Be){var lt=Math.floor(de/2);return de%2?oe+lt+1:oe-lt}return pe>le?oe-(de-le):oe+(de-pe)}function jt(ye,se,oe){var de=ye.length,pe=se.length,le,Be;if(de===0&&pe===0)return null;de<pe?(le=ye,Be=se):(le=se,Be=ye);var lt={__EMPTY_ITEM__:!0};function Ot(Sn){return Sn!==void 0?oe(Sn):lt}for(var It=null,Ht=Math.abs(de-pe)!==1,Yt=0;Yt<Be.length;Yt+=1){var an=Ot(le[Yt]),cn=Ot(Be[Yt]);if(an!==cn){It=Yt,Ht=Ht||an!==Ot(Be[Yt+1]);break}}return It===null?null:{index:It,multiple:Ht}}function Qe(ye,se,oe){var de=Ae.useState(ye),pe=(0,be.Z)(de,2),le=pe[0],Be=pe[1],lt=Ae.useState(null),Ot=(0,be.Z)(lt,2),It=Ot[0],Ht=Ot[1];return Ae.useEffect(function(){var Yt=jt(le||[],ye||[],se);(Yt==null?void 0:Yt.index)!==void 0&&(oe==null||oe(Yt.index),Ht(ye[Yt.index])),Be(ye)},[ye]),[It]}var mt=ue(16089),We=(typeof navigator=="undefined"?"undefined":(0,Ze.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Me=We,Ke=function(ye,se,oe,de){var pe=(0,Ae.useRef)(!1),le=(0,Ae.useRef)(null);function Be(){clearTimeout(le.current),pe.current=!0,le.current=setTimeout(function(){pe.current=!1},50)}var lt=(0,Ae.useRef)({top:ye,bottom:se,left:oe,right:de});return lt.current.top=ye,lt.current.bottom=se,lt.current.left=oe,lt.current.right=de,function(Ot,It){var Ht=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Yt=Ot?It<0&&lt.current.left||It>0&&lt.current.right:It<0&&lt.current.top||It>0&&lt.current.bottom;return Ht&&Yt?(clearTimeout(le.current),pe.current=!1):(!Yt||pe.current)&&Be(),!pe.current&&Yt}};function Ve(ye,se,oe,de,pe,le,Be){var lt=(0,Ae.useRef)(0),Ot=(0,Ae.useRef)(null),It=(0,Ae.useRef)(null),Ht=(0,Ae.useRef)(!1),Yt=Ke(se,oe,de,pe);function an(ot,St){if(mt.Z.cancel(Ot.current),!Yt(!1,St)){var $t=ot;if(!$t._virtualHandled)$t._virtualHandled=!0;else return;lt.current+=St,It.current=St,Me||$t.preventDefault(),Ot.current=(0,mt.Z)(function(){var Dn=Ht.current?10:1;Be(lt.current*Dn,!1),lt.current=0})}}function cn(ot,St){Be(St,!0),Me||ot.preventDefault()}var Sn=(0,Ae.useRef)(null),wt=(0,Ae.useRef)(null);function on(ot){if(ye){mt.Z.cancel(wt.current),wt.current=(0,mt.Z)(function(){Sn.current=null},2);var St=ot.deltaX,$t=ot.deltaY,Dn=ot.shiftKey,Ln=St,In=$t;(Sn.current==="sx"||!Sn.current&&Dn&&$t&&!St)&&(Ln=$t,In=0,Sn.current="sx");var qn=Math.abs(Ln),dr=Math.abs(In);Sn.current===null&&(Sn.current=le&&qn>dr?"x":"y"),Sn.current==="y"?an(ot,In):cn(ot,Ln)}}function Pn(ot){ye&&(Ht.current=ot.detail===It.current)}return[on,Pn]}function Mt(ye,se,oe,de){var pe=Ae.useMemo(function(){return[new Map,[]]},[ye,oe.id,de]),le=(0,be.Z)(pe,2),Be=le[0],lt=le[1],Ot=function(Ht){var Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ht,an=Be.get(Ht),cn=Be.get(Yt);if(an===void 0||cn===void 0)for(var Sn=ye.length,wt=lt.length;wt<Sn;wt+=1){var on,Pn=ye[wt],ot=se(Pn);Be.set(ot,wt);var St=(on=oe.get(ot))!==null&&on!==void 0?on:de;if(lt[wt]=(lt[wt-1]||0)+St,ot===Ht&&(an=wt),ot===Yt&&(cn=wt),an!==void 0&&cn!==void 0)break}return{top:lt[an-1]||0,bottom:lt[cn]}};return Ot}var Xe=ue(38705),Nt=ue(17212),ht=function(){function ye(){(0,Xe.Z)(this,ye),(0,tt.Z)(this,"maps",void 0),(0,tt.Z)(this,"id",0),(0,tt.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Nt.Z)(ye,[{key:"set",value:function(oe,de){this.diffRecords.set(oe,this.maps[oe]),this.maps[oe]=de,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}}]),ye}(),Tt=ht;function et(ye){var se=parseFloat(ye);return isNaN(se)?0:se}function Ut(ye,se,oe){var de=Ae.useState(0),pe=(0,be.Z)(de,2),le=pe[0],Be=pe[1],lt=(0,Ae.useRef)(new Map),Ot=(0,Ae.useRef)(new Tt),It=(0,Ae.useRef)(0);function Ht(){It.current+=1}function Yt(){var cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ht();var Sn=function(){var Pn=!1;lt.current.forEach(function(ot,St){if(ot&&ot.offsetParent){var $t=ot.offsetHeight,Dn=getComputedStyle(ot),Ln=Dn.marginTop,In=Dn.marginBottom,qn=et(Ln),dr=et(In),ir=$t+qn+dr;Ot.current.get(St)!==ir&&(Ot.current.set(St,ir),Pn=!0)}}),Pn&&Be(function(ot){return ot+1})};if(cn)Sn();else{It.current+=1;var wt=It.current;Promise.resolve().then(function(){wt===It.current&&Sn()})}}function an(cn,Sn){var wt=ye(cn),on=lt.current.get(wt);Sn?(lt.current.set(wt,Sn),Yt()):lt.current.delete(wt),!on!=!Sn&&(Sn?se==null||se(cn):oe==null||oe(cn))}return(0,Ae.useEffect)(function(){return Ht},[]),[an,Yt,Ot.current,le]}var ft=14/15;function Dt(ye,se,oe){var de=(0,Ae.useRef)(!1),pe=(0,Ae.useRef)(0),le=(0,Ae.useRef)(0),Be=(0,Ae.useRef)(null),lt=(0,Ae.useRef)(null),Ot,It=function(cn){if(de.current){var Sn=Math.ceil(cn.touches[0].pageX),wt=Math.ceil(cn.touches[0].pageY),on=pe.current-Sn,Pn=le.current-wt,ot=Math.abs(on)>Math.abs(Pn);ot?pe.current=Sn:le.current=wt;var St=oe(ot,ot?on:Pn,!1,cn);St&&cn.preventDefault(),clearInterval(lt.current),St&&(lt.current=setInterval(function(){ot?on*=ft:Pn*=ft;var $t=Math.floor(ot?on:Pn);(!oe(ot,$t,!0)||Math.abs($t)<=.1)&&clearInterval(lt.current)},16))}},Ht=function(){de.current=!1,Ot()},Yt=function(cn){Ot(),cn.touches.length===1&&!de.current&&(de.current=!0,pe.current=Math.ceil(cn.touches[0].pageX),le.current=Math.ceil(cn.touches[0].pageY),Be.current=cn.target,Be.current.addEventListener("touchmove",It,{passive:!1}),Be.current.addEventListener("touchend",Ht,{passive:!0}))};Ot=function(){Be.current&&(Be.current.removeEventListener("touchmove",It),Be.current.removeEventListener("touchend",Ht))},(0,dt.Z)(function(){return ye&&se.current.addEventListener("touchstart",Yt,{passive:!0}),function(){var an;(an=se.current)===null||an===void 0||an.removeEventListener("touchstart",Yt),Ot(),clearInterval(lt.current)}},[ye])}function Bt(ye){return Math.floor(Math.pow(ye,.5))}function bt(ye,se){var oe="touches"in ye?ye.touches[0]:ye;return oe[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function $e(ye,se,oe){Ae.useEffect(function(){var de=se.current;if(ye&&de){var pe=!1,le,Be,lt=function(){mt.Z.cancel(le)},Ot=function an(){lt(),le=(0,mt.Z)(function(){oe(Be),an()})},It=function(){pe=!1,lt()},Ht=function(cn){if(!(cn.target.draggable||cn.button!==0)){var Sn=cn;Sn._virtualHandled||(Sn._virtualHandled=!0,pe=!0)}},Yt=function(cn){if(pe){var Sn=bt(cn,!1),wt=de.getBoundingClientRect(),on=wt.top,Pn=wt.bottom;if(Sn<=on){var ot=on-Sn;Be=-Bt(ot),Ot()}else if(Sn>=Pn){var St=Sn-Pn;Be=Bt(St),Ot()}else lt()}};return de.addEventListener("mousedown",Ht),de.ownerDocument.addEventListener("mouseup",It),de.ownerDocument.addEventListener("mousemove",Yt),de.ownerDocument.addEventListener("dragend",It),function(){de.removeEventListener("mousedown",Ht),de.ownerDocument.removeEventListener("mouseup",It),de.ownerDocument.removeEventListener("mousemove",Yt),de.ownerDocument.removeEventListener("dragend",It),lt()}}},[ye])}var xe=10;function gt(ye,se,oe,de,pe,le,Be,lt){var Ot=Ae.useRef(),It=Ae.useState(null),Ht=(0,be.Z)(It,2),Yt=Ht[0],an=Ht[1];return(0,dt.Z)(function(){if(Yt&&Yt.times<xe){if(!ye.current){an(function(qr){return(0,Fe.Z)({},qr)});return}le();var cn=Yt.targetAlign,Sn=Yt.originAlign,wt=Yt.index,on=Yt.offset,Pn=ye.current.clientHeight,ot=!1,St=cn,$t=null;if(Pn){for(var Dn=cn||Sn,Ln=0,In=0,qn=0,dr=Math.min(se.length-1,wt),ir=0;ir<=dr;ir+=1){var Er=pe(se[ir]);In=Ln;var kr=oe.get(Er);qn=In+(kr===void 0?de:kr),Ln=qn}for(var Qn=Dn==="top"?on:Pn-on,Kr=dr;Kr>=0;Kr-=1){var jr=pe(se[Kr]),Hr=oe.get(jr);if(Hr===void 0){ot=!0;break}if(Qn-=Hr,Qn<=0)break}switch(Dn){case"top":$t=In-on;break;case"bottom":$t=qn-Pn+on;break;default:{var ni=ye.current.scrollTop,Br=ni+Pn;In<ni?St="top":qn>Br&&(St="bottom")}}$t!==null&&Be($t),$t!==Yt.lastTop&&(ot=!0)}ot&&an((0,Fe.Z)((0,Fe.Z)({},Yt),{},{times:Yt.times+1,targetAlign:St,lastTop:$t}))}},[Yt,ye.current]),function(cn){if(cn==null){lt();return}if(mt.Z.cancel(Ot.current),typeof cn=="number")Be(cn);else if(cn&&(0,Ze.Z)(cn)==="object"){var Sn,wt=cn.align;"index"in cn?Sn=cn.index:Sn=se.findIndex(function(ot){return pe(ot)===cn.key});var on=cn.offset,Pn=on===void 0?0:on;an({times:0,index:Sn,offset:Pn,originAlign:wt})}}}var en=Ae.forwardRef(function(ye,se){var oe=ye.prefixCls,de=ye.rtl,pe=ye.scrollOffset,le=ye.scrollRange,Be=ye.onStartMove,lt=ye.onStopMove,Ot=ye.onScroll,It=ye.horizontal,Ht=ye.spinSize,Yt=ye.containerSize,an=ye.style,cn=ye.thumbStyle,Sn=ye.showScrollBar,wt=Ae.useState(!1),on=(0,be.Z)(wt,2),Pn=on[0],ot=on[1],St=Ae.useState(null),$t=(0,be.Z)(St,2),Dn=$t[0],Ln=$t[1],In=Ae.useState(null),qn=(0,be.Z)(In,2),dr=qn[0],ir=qn[1],Er=!de,kr=Ae.useRef(),Qn=Ae.useRef(),Kr=Ae.useState(Sn),jr=(0,be.Z)(Kr,2),Hr=jr[0],ni=jr[1],Br=Ae.useRef(),qr=function(){Sn===!0||Sn===!1||(clearTimeout(Br.current),ni(!0),Br.current=setTimeout(function(){ni(!1)},3e3))},Cr=le-Yt||0,yn=Yt-Ht||0,wn=Ae.useMemo(function(){if(pe===0||Cr===0)return 0;var st=pe/Cr;return st*yn},[pe,Cr,yn]),fn=function(Ee){Ee.stopPropagation(),Ee.preventDefault()},Rn=Ae.useRef({top:wn,dragging:Pn,pageY:Dn,startTop:dr});Rn.current={top:wn,dragging:Pn,pageY:Dn,startTop:dr};var br=function(Ee){ot(!0),Ln(bt(Ee,It)),ir(Rn.current.top),Be(),Ee.stopPropagation(),Ee.preventDefault()};Ae.useEffect(function(){var st=function(Ie){Ie.preventDefault()},Ee=kr.current,Te=Qn.current;return Ee.addEventListener("touchstart",st,{passive:!1}),Te.addEventListener("touchstart",br,{passive:!1}),function(){Ee.removeEventListener("touchstart",st),Te.removeEventListener("touchstart",br)}},[]);var Kn=Ae.useRef();Kn.current=Cr;var ar=Ae.useRef();ar.current=yn,Ae.useEffect(function(){if(Pn){var st,Ee=function(Ie){var Ge=Rn.current,ut=Ge.dragging,nt=Ge.pageY,ze=Ge.startTop;mt.Z.cancel(st);var ct=kr.current.getBoundingClientRect(),kt=Yt/(It?ct.width:ct.height);if(ut){var Rt=(bt(Ie,It)-nt)*kt,Jt=ze;!Er&&It?Jt-=Rt:Jt+=Rt;var pt=Kn.current,Ct=ar.current,bn=Ct?Jt/Ct:0,ln=Math.ceil(bn*pt);ln=Math.max(ln,0),ln=Math.min(ln,pt),st=(0,mt.Z)(function(){Ot(ln,It)})}},Te=function(){ot(!1),lt()};return window.addEventListener("mousemove",Ee,{passive:!0}),window.addEventListener("touchmove",Ee,{passive:!0}),window.addEventListener("mouseup",Te,{passive:!0}),window.addEventListener("touchend",Te,{passive:!0}),function(){window.removeEventListener("mousemove",Ee),window.removeEventListener("touchmove",Ee),window.removeEventListener("mouseup",Te),window.removeEventListener("touchend",Te),mt.Z.cancel(st)}}},[Pn]),Ae.useEffect(function(){return qr(),function(){clearTimeout(Br.current)}},[pe]),Ae.useImperativeHandle(se,function(){return{delayHidden:qr}});var vn="".concat(oe,"-scrollbar"),pn={position:"absolute",visibility:Hr?null:"hidden"},Nn={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return It?(Object.assign(pn,{height:8,left:0,right:0,bottom:0}),Object.assign(Nn,(0,tt.Z)({height:"100%",width:Ht},Er?"left":"right",wn))):(Object.assign(pn,(0,tt.Z)({width:8,top:0,bottom:0},Er?"right":"left",0)),Object.assign(Nn,{width:"100%",height:Ht,top:wn})),Ae.createElement("div",{ref:kr,className:we()(vn,(0,tt.Z)((0,tt.Z)((0,tt.Z)({},"".concat(vn,"-horizontal"),It),"".concat(vn,"-vertical"),!It),"".concat(vn,"-visible"),Hr)),style:(0,Fe.Z)((0,Fe.Z)({},pn),an),onMouseDown:fn,onMouseMove:qr},Ae.createElement("div",{ref:Qn,className:we()("".concat(vn,"-thumb"),(0,tt.Z)({},"".concat(vn,"-thumb-moving"),Pn)),style:(0,Fe.Z)((0,Fe.Z)({},Nn),cn),onMouseDown:br}))}),Wt=en,qe=20;function Ye(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ye/se*ye;return isNaN(oe)&&(oe=0),oe=Math.max(oe,qe),Math.floor(oe)}var Lt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],mn=[],Qt={overflowY:"auto",overflowAnchor:"none"};function dn(ye,se){var oe=ye.prefixCls,de=oe===void 0?"rc-virtual-list":oe,pe=ye.className,le=ye.height,Be=ye.itemHeight,lt=ye.fullHeight,Ot=lt===void 0?!0:lt,It=ye.style,Ht=ye.data,Yt=ye.children,an=ye.itemKey,cn=ye.virtual,Sn=ye.direction,wt=ye.scrollWidth,on=ye.component,Pn=on===void 0?"div":on,ot=ye.onScroll,St=ye.onVirtualScroll,$t=ye.onVisibleChange,Dn=ye.innerProps,Ln=ye.extraRender,In=ye.styles,qn=ye.showScrollBar,dr=qn===void 0?"optional":qn,ir=(0,De.Z)(ye,Lt),Er=Ae.useCallback(function(or){return typeof an=="function"?an(or):or==null?void 0:or[an]},[an]),kr=Ut(Er,null,null),Qn=(0,be.Z)(kr,4),Kr=Qn[0],jr=Qn[1],Hr=Qn[2],ni=Qn[3],Br=!!(cn!==!1&&le&&Be),qr=Ae.useMemo(function(){return Object.values(Hr.maps).reduce(function(or,nr){return or+nr},0)},[Hr.id,Hr.maps]),Cr=Br&&Ht&&(Math.max(Be*Ht.length,qr)>le||!!wt),yn=Sn==="rtl",wn=we()(de,(0,tt.Z)({},"".concat(de,"-rtl"),yn),pe),fn=Ht||mn,Rn=(0,Ae.useRef)(),br=(0,Ae.useRef)(),Kn=(0,Ae.useRef)(),ar=(0,Ae.useState)(0),vn=(0,be.Z)(ar,2),pn=vn[0],Nn=vn[1],st=(0,Ae.useState)(0),Ee=(0,be.Z)(st,2),Te=Ee[0],ke=Ee[1],Ie=(0,Ae.useState)(!1),Ge=(0,be.Z)(Ie,2),ut=Ge[0],nt=Ge[1],ze=function(){nt(!0)},ct=function(){nt(!1)},kt={getKey:Er};function Rt(or){Nn(function(nr){var Ir;typeof or=="function"?Ir=or(nr):Ir=or;var Lr=Yn(Ir);return Rn.current.scrollTop=Lr,Lr})}var Jt=(0,Ae.useRef)({start:0,end:fn.length}),pt=(0,Ae.useRef)(),Ct=Qe(fn,Er),bn=(0,be.Z)(Ct,1),ln=bn[0];pt.current=ln;var En=Ae.useMemo(function(){if(!Br)return{scrollHeight:void 0,start:0,end:fn.length-1,offset:void 0};if(!Cr){var or;return{scrollHeight:((or=br.current)===null||or===void 0?void 0:or.offsetHeight)||0,start:0,end:fn.length-1,offset:void 0}}for(var nr=0,Ir,Lr,ti,yi=fn.length,bi=0;bi<yi;bi+=1){var Gr=fn[bi],gi=Er(Gr),pi=Hr.get(gi),Zn=nr+(pi===void 0?Be:pi);Zn>=pn&&Ir===void 0&&(Ir=bi,Lr=nr),Zn>pn+le&&ti===void 0&&(ti=bi),nr=Zn}return Ir===void 0&&(Ir=0,Lr=0,ti=Math.ceil(le/Be)),ti===void 0&&(ti=fn.length-1),ti=Math.min(ti+1,fn.length-1),{scrollHeight:nr,start:Ir,end:ti,offset:Lr}},[Cr,Br,pn,fn,ni,le]),qt=En.scrollHeight,On=En.start,tn=En.end,An=En.offset;Jt.current.start=On,Jt.current.end=tn,Ae.useLayoutEffect(function(){var or=Hr.getRecord();if(or.size===1){var nr=Array.from(or.keys())[0],Ir=or.get(nr),Lr=fn[On];if(Lr&&Ir===void 0){var ti=Er(Lr);if(ti===nr){var yi=Hr.get(nr),bi=yi-Be;Rt(function(Gr){return Gr+bi})}}}Hr.resetRecord()},[qt]);var Ue=Ae.useState({width:0,height:le}),At=(0,be.Z)(Ue,2),Pt=At[0],Xt=At[1],Ft=function(nr){Xt({width:nr.offsetWidth,height:nr.offsetHeight})},Gt=(0,Ae.useRef)(),Kt=(0,Ae.useRef)(),un=Ae.useMemo(function(){return Ye(Pt.width,wt)},[Pt.width,wt]),xn=Ae.useMemo(function(){return Ye(Pt.height,qt)},[Pt.height,qt]),_n=qt-le,Hn=(0,Ae.useRef)(_n);Hn.current=_n;function Yn(or){var nr=or;return Number.isNaN(Hn.current)||(nr=Math.min(nr,Hn.current)),nr=Math.max(nr,0),nr}var yr=pn<=0,rr=pn>=_n,Wn=Te<=0,xr=Te>=wt,gr=Ke(yr,rr,Wn,xr),mr=function(){return{x:yn?-Te:Te,y:pn}},Gn=(0,Ae.useRef)(mr()),Jn=(0,Ne.useEvent)(function(or){if(St){var nr=(0,Fe.Z)((0,Fe.Z)({},mr()),or);(Gn.current.x!==nr.x||Gn.current.y!==nr.y)&&(St(nr),Gn.current=nr)}});function hr(or,nr){var Ir=or;nr?((0,He.flushSync)(function(){ke(Ir)}),Jn()):Rt(Ir)}function tr(or){var nr=or.currentTarget.scrollTop;nr!==pn&&Rt(nr),ot==null||ot(or),Jn()}var _r=function(nr){var Ir=nr,Lr=wt?wt-Pt.width:0;return Ir=Math.max(Ir,0),Ir=Math.min(Ir,Lr),Ir},Wr=(0,Ne.useEvent)(function(or,nr){nr?((0,He.flushSync)(function(){ke(function(Ir){var Lr=Ir+(yn?-or:or);return _r(Lr)})}),Jn()):Rt(function(Ir){var Lr=Ir+or;return Lr})}),fr=Ve(Br,yr,rr,Wn,xr,!!wt,Wr),kn=(0,be.Z)(fr,2),Cn=kn[0],Xn=kn[1];Dt(Br,Rn,function(or,nr,Ir,Lr){var ti=Lr;return gr(or,nr,Ir)?!1:!ti||!ti._virtualHandled?(ti&&(ti._virtualHandled=!0),Cn({preventDefault:function(){},deltaX:or?nr:0,deltaY:or?0:nr}),!0):!1}),$e(Cr,Rn,function(or){Rt(function(nr){return nr+or})}),(0,dt.Z)(function(){function or(Ir){var Lr=yr&&Ir.detail<0,ti=rr&&Ir.detail>0;Br&&!Lr&&!ti&&Ir.preventDefault()}var nr=Rn.current;return nr.addEventListener("wheel",Cn,{passive:!1}),nr.addEventListener("DOMMouseScroll",Xn,{passive:!0}),nr.addEventListener("MozMousePixelScroll",or,{passive:!1}),function(){nr.removeEventListener("wheel",Cn),nr.removeEventListener("DOMMouseScroll",Xn),nr.removeEventListener("MozMousePixelScroll",or)}},[Br,yr,rr]),(0,dt.Z)(function(){if(wt){var or=_r(Te);ke(or),Jn({x:or})}},[Pt.width,wt]);var Fn=function(){var nr,Ir;(nr=Gt.current)===null||nr===void 0||nr.delayHidden(),(Ir=Kt.current)===null||Ir===void 0||Ir.delayHidden()},Sr=gt(Rn,fn,Hr,Be,Er,function(){return jr(!0)},Rt,Fn);Ae.useImperativeHandle(se,function(){return{nativeElement:Kn.current,getScrollInfo:mr,scrollTo:function(nr){function Ir(Lr){return Lr&&(0,Ze.Z)(Lr)==="object"&&("left"in Lr||"top"in Lr)}Ir(nr)?(nr.left!==void 0&&ke(_r(nr.left)),Sr(nr.top)):Sr(nr)}}}),(0,dt.Z)(function(){if($t){var or=fn.slice(On,tn+1);$t(or,fn)}},[On,tn,fn]);var Ar=Mt(fn,Er,Hr,Be),lr=Ln==null?void 0:Ln({start:On,end:tn,virtual:Cr,offsetX:Te,offsetY:An,rtl:yn,getSize:Ar}),Vr=at(fn,On,tn,wt,Te,Kr,Yt,kt),Tr=null;le&&(Tr=(0,Fe.Z)((0,tt.Z)({},Ot?"height":"maxHeight",le),Qt),Br&&(Tr.overflowY="hidden",wt&&(Tr.overflowX="hidden"),ut&&(Tr.pointerEvents="none")));var si={};return yn&&(si.dir="rtl"),Ae.createElement("div",(0,fe.Z)({ref:Kn,style:(0,Fe.Z)((0,Fe.Z)({},It),{},{position:"relative"}),className:wn},si,ir),Ae.createElement(_e.Z,{onResize:Ft},Ae.createElement(Pn,{className:"".concat(de,"-holder"),style:Tr,ref:Rn,onScroll:tr,onMouseEnter:Fn},Ae.createElement(je,{prefixCls:de,height:qt,offsetX:Te,offsetY:An,scrollWidth:wt,onInnerResize:jr,ref:br,innerProps:Dn,rtl:yn,extra:lr},Vr))),Cr&&qt>le&&Ae.createElement(Wt,{ref:Gt,prefixCls:de,scrollOffset:pn,scrollRange:qt,rtl:yn,onScroll:hr,onStartMove:ze,onStopMove:ct,spinSize:xn,containerSize:Pt.height,style:In==null?void 0:In.verticalScrollBar,thumbStyle:In==null?void 0:In.verticalScrollBarThumb,showScrollBar:dr}),Cr&&wt>Pt.width&&Ae.createElement(Wt,{ref:Kt,prefixCls:de,scrollOffset:Te,scrollRange:wt,rtl:yn,onScroll:hr,onStartMove:ze,onStopMove:ct,spinSize:un,containerSize:Pt.width,horizontal:!0,style:In==null?void 0:In.horizontalScrollBar,thumbStyle:In==null?void 0:In.horizontalScrollBarThumb,showScrollBar:dr}))}var Zt=Ae.forwardRef(dn);Zt.displayName="List";var Vt=Zt,zt=Vt},48136:function(Mn,rn,ue){"use strict";var fe=Object.defineProperty,Ze=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,Pe=(a,y,b)=>y in a?fe(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,we=(a,y)=>{for(var b in y||(y={}))be.call(y,b)&&Pe(a,b,y[b]);if(tt)for(var b of tt(y))De.call(y,b)&&Pe(a,b,y[b]);return a},_e=(a,y)=>Ze(a,Fe(y)),Ne=a=>typeof a=="symbol"?a:a+"",dt=(a,y)=>{var b={};for(var E in a)be.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&tt)for(var E of tt(a))y.indexOf(E)<0&&De.call(a,E)&&(b[E]=a[E]);return b};function Ae(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 rt(){return"window"in globalThis&&"document"in globalThis}function je(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function it(){return typeof navigator.vibrate=="function"}function at(){var a,y;if(!rt())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 xt(){if(!rt())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 jt(){return HTMLElement.prototype.hasOwnProperty("popover")}var Qe={strings:He,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Qe._locale||(Qe._locale=rt()?navigator.language.slice(0,5):"en-US"),Qe._locale},set locale(a){Qe._locale=a,Qe._numberFormatter=void 0,Qe.dirty=!0},get numberFormatter(){return Qe._numberFormatter||(Qe._numberFormatter=new Intl.NumberFormat(Qe.locale)),Qe._numberFormatter},merge(a,y){if(typeof a=="string"&&y)Qe.strings[a]=we(we({},Qe.strings[a]),y),Qe.dirty=!0;else for(const b of Object.keys(a))Qe.merge(b,a[b])},get dirty(){return Qe._dirty},set dirty(a){Qe._dirty||Qe._dirty===a||(Qe._dirty=!0,setTimeout(()=>{Qe._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return Qe._subscribers.push(a),Qe._subscribers.length-1},unsubscribe(a){a<0||a>=Qe._subscribers.length||(Qe._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=mt(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=mt(E);ee&&b.setAttribute("aria-label",ee)}}}};function mt(a,...y){if(a===void 0)return;let b="";const E=Qe.locale;Qe.strings[E]&&(b=Qe.strings[E][a]);const ee=E.slice(0,2);if(!b&&Qe.strings[ee]&&(b=Qe.strings[ee][a]),b||(b=Qe.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),he=0;for(;ae;){if(y[he++]){const ve=ae[2]?parseInt(ae[2],10)-1:he-1;let Se=y[ve];typeof Se=="number"&&(Se=Qe.numberFormatter.format(Se)),b=b.replace(ae[1],Se)}ae=re.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"},Me={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ke={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"},Ve={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"},Mt={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"},Xe={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function Nt(a){var y,b,E,ee,re,ae;const he=a.split("!");let me,ve,Se,Re=255,Je=255,yt=255,_t=-1;const gn=he.length>0&&he[0].startsWith("-");gn&&(he[0]=he[0].slice(1));for(let sr=0;sr<he.length;sr++){me=Re,ve=Je,Se=yt;const hn=(y=he[sr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],$n=hn==null?void 0:hn.toLowerCase(),pr=hn&&(ae=(re=(ee=(E=(b=Ve[$n])!=null?b:Ve[Mt[hn]])!=null?E:Me[hn])!=null?ee:Xe[hn])!=null?re:We[hn])!=null?ae:he[sr].trim();let zn=pr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(zn!=null&&zn[1]&&zn[2]&&zn[3])Re=Math.max(0,Math.min(255,Number.parseInt(zn[1],16))),Je=Math.max(0,Math.min(255,Number.parseInt(zn[2],16))),yt=Math.max(0,Math.min(255,Number.parseInt(zn[3],16)));else if(zn=pr.match(/^#([\da-f]{3})$/i),zn!=null&&zn[1]){const Fr=Number.parseInt(zn[1][0],16),Xr=Number.parseInt(zn[1][1],16),Zr=Number.parseInt(zn[1][2],16);Re=Math.max(0,Math.min(255,Fr*16+Fr)),Je=Math.max(0,Math.min(255,Xr*16+Xr)),yt=Math.max(0,Math.min(255,Zr*16+Zr))}else if(zn=pr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),zn!=null&&zn[1]&&zn[2]&&zn[3])Re=Math.max(0,Math.min(255,Number.parseInt(zn[1]))),Je=Math.max(0,Math.min(255,Number.parseInt(zn[2]))),yt=Math.max(0,Math.min(255,Number.parseInt(zn[3])));else return;_t>=0&&(Re=(1-_t)*Re+_t*me,Je=(1-_t)*Je+_t*ve,yt=(1-_t)*yt+_t*Se,_t=-1),sr+1<he.length&&(_t=Math.max(0,Math.min(100,Number.parseInt(he[++sr])))/100)}return _t>=0&&(Re=_t*Re+(1-_t)*me,Je=_t*Je+(1-_t)*ve,yt=_t*yt+(1-_t)*Se),gn&&(Re=255-Re,Je=255-Je,yt=255-yt),"#"+("00"+Math.round(Re).toString(16)).slice(-2)+("00"+Math.round(Je).toString(16)).slice(-2)+("00"+Math.round(yt).toString(16)).slice(-2)}function ht(a){var y,b;return a=a.trim(),(b=(y=Ke[a.toLowerCase()])!=null?y:Ke[Mt[a]])!=null?b:Nt(a)}function Tt(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 et(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 Ut(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,re=E*2-ee;return{r:Math.round(255*et(re,ee,y+2)),g:Math.round(255*et(re,ee,y)),b:Math.round(255*et(re,ee,y-2))}}function ft(a){return a<0?0:a>255?255:Math.round(a)}function Dt(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(ft(y)<<16)+(ft(b)<<8)+ft(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 Bt(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),re=Math.max(y,b,E),ae=re-ee;let he,me;re===ee?he=0:y===re?he=(b-E)/ae:b===re?he=2+(E-y)/ae:E===re&&(he=4+(y-b)/ae),he=Math.min(he*60,360),he<0&&(he+=360);const ve=(ee+re)/2;return re===ee?me=0:ve<=.5?me=ae/(re+ee):me=ae/(2-re-ee),{h:he,s:me,l:ve}}function bt(a){let y=Tt(a);if(!y)return a;let{h:b,s:E,l:ee}=Bt(y);return E+=.1,ee-=.1,Dt(Ut({h:b,s:E,l:ee}))}var $e={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},gt=[{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 en(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 gt)if((!y||ee.variant===y)&&(!b||ee.style===b)&&E>=ee.offset&&E<ee.offset+ee.len){const re=ee.start+E-ee.offset;return String.fromCodePoint(xe[re]||re)}return a}function Wt(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 gt)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 qe(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 re=$e[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:he,style:me}=Wt(ee);switch(re=ae,he){case"double-struck":re=`\\mathbb{${re}}`;break;case"fraktur":re=`\\mathfrak{${re}}`;break;case"script":re=`\\mathscr{${re}}`;break;case"sans-serif":re=`\\mathsf{${re}}`;break;case"monospace":re=`\\mathtt{${re}}`;break;case"calligraphic":re=`\\mathcal{${re}}`;break}switch(me){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function Ye(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var Lt={},mn=we({},$e),Qt={},dn={},Zt={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}"},Vt={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}},zt={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}},ye={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:zt},"amsmath.sty":{package:Vt,primitive:!0},"texvc.sty":{package:Zt,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!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,de,pe;xt()?(de=new RegExp("\\p{Letter}","u"),pe=new RegExp("[0-9\\p{Letter}]","u")):(de=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,pe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function le(a,y,b="mord",E){y!==void 0&&(Lt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},mn[y]||(mn[y]=a))}function Be(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);le(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)le(E,ee,re!=null?re:y,ae!=null?ae:b)}function lt(a,y){for(let b=a;b<=y;b++)le(String.fromCodePoint(b),b)}function Ot(a){var y;return(y=dn[a])!=null?y:null}function It(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in Qt)ae.startsWith(y)&&!Qt[ae].infix&&ee.push({match:ae,frequency:(b=Qt[ae].frequency)!=null?b:0});for(const ae in Lt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Lt[ae].frequency)!=null?E:0});const re=y.substring(1);for(const ae of Object.keys(a.options.macros))ae.startsWith(re)&&ee.push({match:"\\"+ae,frequency:0});return ee.sort((ae,he)=>{var me,ve;return ae.frequency===he.frequency?ae.match.length===he.match.length?ae.match<he.match?-1:1:ae.match.length-he.match.length:((me=he.frequency)!=null?me:0)-((ve=ae.frequency)!=null?ve:0)}),ee.map(ae=>ae.match)}function Ht(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function Yt(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:Ht(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...Yt(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:Ht(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...Yt(b[E]))}return y}function an(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 cn(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)dn[E]=b}function Sn(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:Yt(y),createAtom:b};for(const re of a)dn[re]=ee}function wt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:Yt(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")Qt["\\"+a]=re;else for(const ae of a)Qt["\\"+ae]=re}var on;function Pn(a){return on||(on=St(ye)),a?St(we(we({},on),a)):on}function ot(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const he=a;return/(^|[^\\])#1/.test(he)&&(ae=1),/(^|[^\\])#2/.test(he)&&(ae=2),/(^|[^\\])#3/.test(he)&&(ae=3),/(^|[^\\])#4/.test(he)&&(ae=4),/(^|[^\\])#5/.test(he)&&(ae=5),/(^|[^\\])#6/.test(he)&&(ae=6),/(^|[^\\])#7/.test(he)&&(ae=7),/(^|[^\\])#8/.test(he)&&(ae=8),/(^|[^\\])#9/.test(he)&&(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:he}}return we({expand:(ee=y==null?void 0:y.expand)!=null?ee:!0,captureSelection:(re=y==null?void 0:y.captureSelection)!=null?re:!0,args:0},a)}function St(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]=ot(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=ot(E)}return y}function $t(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=Qt[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Lt[a]:se[a]&&(b={definitionType:"symbol",type:"mord",codepoint:se[a]})}else if(y==="math"){if(b=Lt[a],!b&&a.length===1){const E=Ln("math",a.codePointAt(0));return E.startsWith("\\")?_e(we({},$t(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 Dn(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Ln(a,y){if(y===void 0)return"";if(a==="math"&&mn[y])return mn[y];if(a==="text"){const b=Object.keys(se).find(E=>se[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var In=[0,.68889,0,0,.72222],qn=[0,.68889,0,0,.66667],dr=[0,.68889,0,0,.77778],ir=[0,.68889,0,0,.61111],Er=[.16667,.68889,0,0,.77778],kr=[0,.68889,0,0,.55556],Qn=[0,0,0,0,.25],Kr=[0,.825,0,0,2.33334],jr=[0,.9,0,0,2.33334],Hr=[0,.68889,0,0,.54028],ni=[-.03598,.46402,0,0,.5],Br=[-.13313,.36687,0,0,1],qr=[.01354,.52239,0,0,1],Cr=[.01354,.52239,0,0,1.11111],yn=[0,.54986,0,0,1],wn=[0,.69224,0,0,.5],fn=[0,.43056,0,0,1],Rn=[.08198,.58198,0,0,.77778],br=[.19444,.69224,0,0,.41667],Kn=[.1808,.675,0,0,1],ar=[.19444,.69224,0,0,.83334],vn=[.13667,.63667,0,0,1],pn=[-.064,.437,0,0,1.334],Nn=[.08167,.58167,0,0,.77778],st=[0,.69224,0,0,.72222],Ee=[0,.69224,0,0,.66667],Te=[-.13313,.36687,0,0,.77778],ke=[.06062,.54986,0,0,.77778],Ie=[0,.69224,0,0,.77778],Ge=[.25583,.75583,0,0,.77778],ut=[.25142,.75726,0,0,.77778],nt=[.20576,.70576,0,0,.77778],ze=[.30274,.79383,0,0,.77778],ct=[.22958,.72958,0,0,.77778],kt=[.1808,.675,0,0,.77778],Rt=[.13667,.63667,0,0,.77778],Jt=[.13597,.63597,0,0,.77778],pt=[.03517,.54986,0,0,.77778],Ct=[0,.675,0,0,.77778],bn=[.19444,.69224,0,0,.61111],ln=[0,.54986,0,0,.76042],En=[0,.54986,0,0,.66667],qt=[.0391,.5391,0,0,.77778],On=[.03517,.54986,0,0,1.33334],tn=[.38569,.88569,0,0,.77778],An=[.23222,.74111,0,0,.77778],Ue=[.19444,.69224,0,0,.77778],At=[0,.37788,0,0,.5],Pt=[0,.54986,0,0,.72222],Xt=[0,.69224,0,0,.83334],Ft=[.11111,.69224,0,0,.66667],Gt=[.26167,.75726,0,0,.77778],Kt=[.48256,.98256,0,0,.77778],un=[.28481,.79383,0,0,.77778],xn=[.08167,.58167,0,0,.22222],_n=[.08167,.58167,0,0,.38889],Hn=[0,.43056,.04028,0,.66667],Yn=[.41951,.91951,0,0,.77778],yr=[.24982,.74947,0,0,.38865],rr=[.08319,.58283,0,0,.75623],Wn=[0,.10803,0,0,.27764],xr=[0,.47534,0,0,.50181],gr=[.18906,.47534,0,0,.50181],mr=[0,.69141,0,0,.50181],Gn=[.24982,.74947,0,0,.27764],Jn=[0,.69141,0,0,.21471],hr=[.25,.75,0,0,.44722],tr=[0,.64444,0,0,.575],_r=[.08556,.58556,0,0,.89444],Wr=[0,.69444,0,0,.89444],fr=[0,.68611,0,0,.9],kn=[0,.68611,0,0,.86944],Cn=[.25,.75,0,0,.575],Xn=[.25,.75,0,0,.31944],Fn=[0,.69444,0,0,.63889],Sr=[0,.69444,0,0,.31944],Ar=[0,.44444,0,0,.63889],lr=[0,.44444,0,0,.51111],Vr=[0,.69444,0,0,.575],Tr=[.13333,.63333,0,0,.89444],si=[0,.44444,0,0,.31944],or=[0,.69444,0,0,.86944],nr=[0,.68611,0,0,.69166],Ir=[0,.68611,0,0,.83055],Lr=[0,.68611,0,0,.89444],ti=[0,.69444,0,0,.60278],yi=[.19444,.69444,0,0,.51111],bi=[0,.69444,0,0,.83055],Gr=[-.10889,.39111,0,0,1.14999],gi=[.19444,.69444,0,0,.575],pi=[.19444,.69444,0,0,1.14999],Zn=[.19444,.69444,0,0,.70277],Un=[.05556,.75,0,0,.575],jn=[0,.68611,0,0,.95833],ur=[.08556,.58556,0,0,.76666],Yr=[-.02639,.47361,0,0,.575],li=[0,.44444,0,0,.89444],fi=[0,.55556,0,0,.76666],di=[-.10889,.39111,0,0,.89444],ii=[.00222,.50222,0,0,.89444],Si=[.19667,.69667,0,0,.89444],Fi=[.08556,.58556,0,0,1.14999],Ii=[0,.69444,0,0,.70277],la=[-.02778,.47222,0,0,.575],ea=[.25,.75,0,0,.51111],Pi=[-.13889,.36111,0,0,1.14999],ki=[.19444,.69444,0,0,1.02222],Qr=[.12963,.69444,0,0,.89444],Vi=[.19444,.69444,0,0,.44722],$i=[0,.64444,.13167,0,.59111],ci=[.19444,.64444,.13167,0,.59111],Pr=[0,.68611,.17208,0,.8961],Ur=[.19444,.44444,.105,0,.53222],zr=[0,.44444,.085,0,.82666],Or=[0,.69444,.06709,0,.59111],ai=[0,.69444,.12945,0,.35555],ri=[0,.69444,0,0,.94888],Ai=[0,.69444,.11472,0,.59111],Ki=[0,.68611,.10778,0,.88555],Hi=[0,.69444,.07939,0,.62055],na=[0,.69444,.12417,0,.30667],vi=[0,.64444,.13556,0,.51111],mi=[.19444,.64444,.13556,0,.51111],Gi=[0,.68333,.16389,0,.74333],ca=[.19444,.43056,.08847,0,.46],oa=[0,.43056,.07514,0,.71555],ta=[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],fa=[0,.64444,0,0,.5],bo=[0,.69444,0,0,.77778],Eo=[0,.68333,0,0,.75],ko=[0,.68333,0,0,.77778],ns=[0,.68333,0,0,.68056],Ro=[0,.68333,0,0,.72222],Xa=[.25,.75,0,0,.5],Oa=[.25,.75,0,0,.27778],Bi=[0,.69444,0,0,.5],Lo=[0,.69444,0,0,.55556],rs=[0,.43056,0,0,.44445],Do=[0,.43056,0,0,.5],Ci=[.19444,.43056,0,0,.55556],hi=[0,.43056,0,0,.55556],zi=[.08333,.58333,0,0,.77778],La=[0,.43056,0,0,.27778],Ui=[0,.66786,0,0,.27778],Ra=[0,.69444,0,0,.75],Fa=[0,.66786,0,0,.5],to=[0,.68333,0,0,.625],$a=[.19444,.69444,0,0,.44445],so=[0,.69444,0,0,.72222],lo=[.19444,.69444,0,0,.5],Da=[.19444,.69444,0,0,1],bl=[.011,.511,0,0,1.126],jo=[.19444,.69444,0,0,.61111],Js=[.05556,.75,0,0,.5],Kl=[0,.68333,0,0,.83334],Hl=[.0391,.5391,0,0,.66667],Cs=[-.05555,.44445,0,0,.5],_c=[0,.43056,0,0,.77778],is=[0,.55556,0,0,.66667],xl=[-.03625,.46375,0,0,.77778],Vo=[-.01688,.48312,0,0,.77778],as=[.0391,.5391,0,0,1],Li=[0,.69444,0,0,.61111],Ti=[-.03472,.46528,0,0,.5],Wi=[.25,.75,0,0,.44445],Ya=[-.14236,.35764,0,0,1],Aa=[.244,.744,0,0,.412],xo=[.19444,.69444,0,0,.88889],po=[.12963,.69444,0,0,.77778],za=[.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],_u=[0,.68611,0,0,.80555],Eu=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],Ec=[.19444,.44444,0,0,.6118],Sl=[.19444,.43056,0,0,.5],ku=[0,.68333,.02778,.08334,.76278],kc=[0,.68333,.08125,.05556,.83125],qs=[0,.43056,0,.05556,.48472],jl=[.19444,.43056,0,.08334,.51702],Lu=[.25,.75,0,0,.42778],Ta=[0,.69444,0,0,.55],ss=[0,.69444,0,0,.73334],Ms=[0,.69444,0,0,.79445],Rd=[0,.69444,0,0,.51945],Vl=[0,.69444,0,0,.70278],Lc=[0,.69444,0,0,.76389],Qs=[.25,.75,0,0,.34306],el=[0,.69444,0,0,.56111],$d=[0,.69444,0,0,.25556],Gl=[.19444,.45833,0,0,.56111],Du=[0,.45833,0,0,.56111],_s=[0,.69444,0,0,.30556],Au=[0,.69444,0,0,.58056],Es=[0,.69444,0,0,.67223],tl=[0,.69444,0,0,.85556],ls=[0,.69444,0,0,.55834],mo=[0,.65556,.11156,0,.5],ks=[0,.69444,.08094,0,.70834],Dc=[.17014,0,0,0,.44445],Tu=[0,.69444,.0799,0,.5],Iu=[0,.69444,0,0,.73752],Nd=[0,.69444,.09205,0,.5],Ls=[0,.69444,.09031,0,.77778],cs=[0,.69444,.07816,0,.27778],Fd=[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],pa=[0,.65556,0,0,.5],Sa=[0,.69444,0,0,.47222],ua=[0,.69444,0,0,.66667],Ia=[0,.69444,0,0,.59722],nl=[0,.69444,0,0,.54167],Pu=[0,.69444,0,0,.70834],Ul=[.25,.75,0,0,.28889],Bu=[0,.69444,0,0,.51667],jd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],Ac=[0,.44444,0,0,.38333],Ou=[0,.44444,0,0,.51667],Tc=[0,.69444,0,0,.83334],Gd=[.35001,.85,0,0,.45834],Ic=[.35001,.85,0,0,.57778],Pc=[.35001,.85,0,0,.41667],Ru=[.35001,.85,0,0,.58334],Xl=[0,.72222,0,0,.55556],Bc=[1e-5,.6,0,0,.66667],$u=[1e-5,.6,0,0,.77778],Cl=[.25001,.75,0,0,.94445],Ud=[.306,.805,.19445,0,.47222],Yl=[.30612,.805,.19445,0,.47222],Ka=[.25001,.75,0,0,.83334],rl=[.35001,.85,0,0,.47222],Nu=[.25001,.75,0,0,1.11111],Fu=[.65002,1.15,0,0,.59722],go=[.65002,1.15,0,0,.81111],Ni=[.65002,1.15,0,0,.47222],Io=[.65002,1.15,0,0,.66667],$o=[0,.75,0,0,1],us=[.55001,1.05,0,0,1.27778],zu=[.862,1.36,.44445,0,.55556],Oc=[.86225,1.36,.44445,0,.55556],il=[.55001,1.05,0,0,1.11111],Rc=[.65002,1.15,0,0,.52778],$c=[.65002,1.15,0,0,.61111],al=[.55001,1.05,0,0,1.51112],Ku=[.95003,1.45,0,0,.73611],Nc=[.95003,1.45,0,0,1.04445],ds=[.95003,1.45,0,0,.52778],Jl=[.95003,1.45,0,0,.75],ql=[0,.75,0,0,1.44445],Fc=[.95003,1.45,0,0,.58334],Ql=[1.25003,1.75,0,0,.79167],zc=[1.25003,1.75,0,0,1.27778],Hu=[1.25003,1.75,0,0,.58334],Kc=[1.25003,1.75,0,0,.80556],ec=[0,.825,0,0,1.8889],Hc=[1.25003,1.75,0,0,.63889],Wc=[.64502,1.155,0,0,.875],tc=[1e-5,.6,0,0,.875],Zc=[-99e-5,.601,0,0,.66667],jc=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Wu=[.65002,1.15,0,0,.88889],ol=[.90001,0,0,0,.88889],Vc=[-.00499,.605,0,0,1.05556],sl=[0,.12,0,0,.45],Nr=[0,.61111,0,0,.525],So=[.08333,.69444,0,0,.525],Zu=[-.08056,.53055,0,0,.525],Yd=[-.05556,.55556,0,0,.525],no=[0,.43056,0,0,.525],Ca=[.22222,.43056,0,0,.525],nc=[0,0,0,0,.525],Jd={"AMS-Regular":{32:Qn,65:In,66:qn,67:In,68:In,69:qn,70:ir,71:dr,72:dr,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:dr,76:qn,77:[0,.68889,0,0,.94445],78:In,79:Er,80:ir,81:Er,82:In,83:kr,84:qn,85:In,86:In,87:[0,.68889,0,0,1],88:In,89:In,90:qn,107:kr,160:Qn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:kr,295:Hr,710:Kr,732:jr,770:Kr,771:jr,989:Nn,1008:Hn,8245:[0,.54986,0,0,.275],8463:Hr,8487:In,8498:kr,8502:qn,8503:[0,.68889,0,0,.44445],8504:qn,8513:[0,.68889,0,0,.63889],8592:ni,8594:ni,8602:Br,8603:Br,8606:qr,8608:qr,8610:Cr,8611:Cr,8619:yn,8620:yn,8621:[-.13313,.37788,0,0,1.38889],8622:Br,8624:wn,8625:wn,8630:fn,8631:fn,8634:Rn,8635:Rn,8638:br,8639:br,8642:br,8643:br,8644:Kn,8646:Kn,8647:Kn,8648:ar,8649:Kn,8650:ar,8651:qr,8652:qr,8653:Br,8654:Br,8655:Br,8666:vn,8667:vn,8669:[-.13313,.37788,0,0,1],8672:pn,8674:pn,8705:[0,.825,0,0,.5],8708:kr,8709:Nn,8717:[0,.43056,0,0,.42917],8722:ni,8724:[.08198,.69224,0,0,.77778],8726:Nn,8733:Ie,8736:st,8737:st,8738:[.03517,.52239,0,0,.72222],8739:xn,8740:[.25142,.74111,0,0,.27778],8741:_n,8742:[.25142,.74111,0,0,.5],8756:Ee,8757:Ee,8764:Te,8765:[-.13313,.37788,0,0,.77778],8769:Te,8770:xl,8774:ze,8776:Vo,8778:Nn,8782:ke,8783:ke,8785:Rn,8786:Rn,8787:Rn,8790:Ie,8791:ct,8796:[.08198,.91667,0,0,.77778],8806:Ge,8807:Ge,8808:ut,8809:ut,8812:[.25583,.75583,0,0,.5],8814:nt,8815:nt,8816:ze,8817:ze,8818:ct,8819:ct,8822:kt,8823:kt,8828:Rt,8829:Rt,8830:ct,8831:ct,8832:nt,8833:nt,8840:ze,8841:ze,8842:Jt,8843:Jt,8847:pt,8848:pt,8858:Rn,8859:Rn,8861:Rn,8862:Ct,8863:Ct,8864:Ct,8865:Ct,8872:[0,.69224,0,0,.61111],8873:st,8874:[0,.69224,0,0,.88889],8876:ir,8877:ir,8878:In,8879:In,8882:pt,8883:pt,8884:Rt,8885:Rt,8888:[0,.54986,0,0,1.11111],8890:Ci,8891:bn,8892:bn,8901:[0,.54986,0,0,.27778],8903:Nn,8905:Nn,8906:Nn,8907:Ie,8908:Ie,8909:[-.03598,.46402,0,0,.77778],8910:ln,8911:ln,8912:pt,8913:pt,8914:En,8915:En,8916:Ee,8918:qt,8919:qt,8920:On,8921:On,8922:tn,8923:tn,8926:Rt,8927:Rt,8928:ze,8929:ze,8934:An,8935:An,8936:An,8937:An,8938:nt,8939:nt,8940:ze,8941:ze,8994:Ue,8995:Ue,9416:[.15559,.69224,0,0,.90222],9484:wn,9488:wn,9492:At,9496:At,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Ct,9633:Ct,9650:Pt,9651:Pt,9654:pt,9660:Pt,9661:Pt,9664:pt,9674:Ft,9733:[.19444,.69224,0,0,.94445],10003:Xt,10016:Xt,10731:Ft,10846:[.19444,.75583,0,0,.61111],10877:Rt,10878:Rt,10885:Ge,10886:Ge,10887:Jt,10888:Jt,10889:Gt,10890:Gt,10891:Kt,10892:Kt,10901:Rt,10902:Rt,10933:ut,10934:ut,10935:Gt,10936:Gt,10937:Gt,10938:Gt,10949:Ge,10950:Ge,10955:un,10956:un,57350:xn,57351:_n,57352:Nn,57353:Hn,57356:ut,57357:ut,57358:Yn,57359:ze,57360:ze,57361:Yn,57366:ut,57367:ut,57368:ut,57369:ut,57370:Jt,57371:Jt},"Caligraphic-Regular":{32:Qn,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:Qn},"Fraktur-Regular":{32:Qn,33:[0,.69141,0,0,.29574],34:Jn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:yr,41:yr,42:[0,.62119,0,0,.27764],43:rr,44:Wn,45:rr,46:Wn,47:[.24982,.74947,0,0,.50181],48:xr,49:xr,50:xr,51:gr,52:gr,53:gr,54:mr,55:gr,56:mr,57:gr,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:Gn,93:Gn,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:Qn,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:Qn,33:[0,.69444,0,0,.35],34:ti,35:[.19444,.69444,0,0,.95833],36:Un,37:[.05556,.75,0,0,.95833],38:Wr,39:Sr,40:hr,41:hr,42:[0,.75,0,0,.575],43:Tr,44:[.19444,.15556,0,0,.31944],45:Ac,46:[0,.15556,0,0,.31944],47:Cn,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,58:si,59:[.19444,.44444,0,0,.31944],60:_r,61:di,62:_r,63:[0,.69444,0,0,.54305],64:Wr,65:kn,66:[0,.68611,0,0,.81805],67:Ir,68:[0,.68611,0,0,.88194],69:Wl,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:fr,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:nr,77:[0,.68611,0,0,1.09166],78:fr,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:kn,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Xn,92:Cn,93:Xn,94:Vr,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Fn,99:lr,100:Fn,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Fn,105:Sr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Sr,109:[0,.44444,0,0,.95833],110:Ar,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:Ar,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:lr,123:Cn,124:Xn,125:Cn,126:[.35,.34444,0,0,.575],160:Qn,163:[0,.69444,0,0,.86853],168:Vr,172:[0,.44444,0,0,.76666],176:or,177:Tr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Tr,216:[.04861,.73472,0,0,.89444],223:Ia,230:[0,.44444,0,0,.83055],247:Tr,248:[.09722,.54167,0,0,.575],305:si,338:[0,.68611,0,0,1.16944],339:li,567:[.19444,.44444,0,0,.35139],710:Vr,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Vr,715:Vr,728:Vr,729:Sr,730:or,732:Vr,733:Vr,915:nr,916:jn,920:Lr,923:_u,926:Zl,928:fr,931:Ir,933:Lr,934:Ir,936:Lr,937:Ir,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Sr,8217:Sr,8220:ti,8221:ti,8224:yi,8225:yi,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:wl,8465:bi,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:bi,8501:Ii,8592:Gr,8593:gi,8594:Gr,8595:gi,8596:Gr,8597:Cn,8598:pi,8599:pi,8600:pi,8601:pi,8636:Gr,8637:Gr,8640:Gr,8641:Gr,8656:Gr,8657:Zn,8658:Gr,8659:Zn,8660:Gr,8661:[.25,.75,0,0,.70277],8704:Fn,8706:[0,.69444,.06389,0,.62847],8707:Fn,8709:Un,8711:jn,8712:ur,8715:ur,8722:Tr,8723:Tr,8725:Cn,8726:Cn,8727:la,8728:Yr,8729:Yr,8730:[.18,.82,0,0,.95833],8733:li,8734:[0,.44444,0,0,1.14999],8736:st,8739:Xn,8741:Cn,8743:fi,8744:fi,8745:fi,8746:fi,8747:[.19444,.69444,.12778,0,.56875],8764:di,8768:[.19444,.69444,0,0,.31944],8771:ii,8776:[.02444,.52444,0,0,.89444],8781:ii,8801:ii,8804:Si,8805:Si,8810:Fi,8811:Fi,8826:_r,8827:_r,8834:_r,8835:_r,8838:Si,8839:Si,8846:fi,8849:Si,8850:Si,8851:fi,8852:fi,8853:Tr,8854:Tr,8855:Tr,8856:Tr,8857:Tr,8866:Ii,8867:Ii,8868:Wr,8869:Wr,8900:Yr,8901:[-.02639,.47361,0,0,.31944],8902:la,8968:ea,8969:ea,8970:ea,8971:ea,8994:Pi,8995:Pi,9651:ki,9657:la,9661:ki,9667:la,9711:pi,9824:Qr,9825:Qr,9826:Qr,9827:Qr,9837:[0,.75,0,0,.44722],9838:Vi,9839:Vi,10216:hr,10217:hr,10815:fr,10927:Si,10928:Si,57376:To},"Main-BoldItalic":{32:Qn,33:[0,.69444,.11417,0,.38611],34:Hi,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ai,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:$i,49:$i,50:$i,51:$i,52:ci,53:$i,54:$i,55:ci,56:$i,57:$i,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Ai,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:Pr,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:Pr,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:Or,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:Ur,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:Ur,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:Qn,168:[0,.69444,.11473,0,.59111],176:ri,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:zr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:zr,567:[.19444,.44444,.04611,0,.385],710:Or,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:ai,730:ri,732:Ai,733:Ai,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:Pr,931:[0,.68611,.11431,0,.82666],933:Ki,934:[0,.68611,.05632,0,.82666],936:Ki,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ai,8217:ai,8220:[0,.69444,.16772,0,.62055],8221:Hi},"Main-Italic":{32:Qn,33:na,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:na,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:vi,49:vi,50:vi,51:vi,52:mi,53:vi,54:vi,55:mi,56:vi,57:vi,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:Gi,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:Gi,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:Gi,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:ta,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:ca,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:ca,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:Qn,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:oa,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:oa,710:ta,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:Gi,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:na,8217:na,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Hr},"Main-Regular":{32:Qn,33:fo,34:Bi,35:zd,36:Js,37:Kd,38:bo,39:fo,40:ka,41:ka,42:Hd,43:zi,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Xa,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:La,59:[.19444,.43056,0,0,.27778],60:qt,61:Te,62:qt,63:Sa,64:bo,65:Eo,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:Eo,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:ko,76:to,77:[0,.68333,0,0,.91667],78:Eo,79:ko,80:ns,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Ro,85:Eo,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Eo,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Oa,92:Xa,93:Oa,94:Bi,95:[.31,.12056,.02778,0,.5],97:Do,98:Lo,99:rs,100:Lo,101:rs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Lo,105:Ui,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fo,109:[0,.43056,0,0,.83334],110:hi,111:Do,112:Ci,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:hi,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:rs,123:Xa,124:Oa,125:Xa,126:[.35,.31786,0,0,.5],160:Qn,163:[0,.69444,0,0,.76909],167:$a,168:Fa,172:[0,.43056,0,0,.66667],176:Ra,177:zi,182:jo,184:Dc,198:[0,.68333,0,0,.90278],215:zi,216:[.04861,.73194,0,0,.77778],223:Bi,230:[0,.43056,0,0,.72222],247:zi,248:[.09722,.52778,0,0,.5],305:La,338:[0,.68333,0,0,1.01389],339:_c,567:[.19444,.43056,0,0,.30556],710:Bi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Bi,715:Bi,728:Bi,729:Ui,730:Ra,732:Fa,733:Bi,915:to,916:Kl,920:ko,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Eo,931:Ro,933:ko,934:Ro,936:ko,937:Ro,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fo,8217:fo,8220:Bi,8221:Bi,8224:$a,8225:$a,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Hr,8465:so,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:so,8501:Li,8592:Br,8593:lo,8594:Br,8595:lo,8596:Br,8597:Xa,8598:Da,8599:Da,8600:Da,8601:Da,8614:[.011,.511,0,0,1],8617:bl,8618:bl,8636:Br,8637:Br,8640:Br,8641:Br,8652:[.011,.671,0,0,1],8656:Br,8657:jo,8658:Br,8659:jo,8660:Br,8661:[.25,.75,0,0,.61111],8704:Lo,8706:[0,.69444,.05556,.08334,.5309],8707:Lo,8709:Js,8711:Kl,8712:Hl,8715:Hl,8722:zi,8723:zi,8725:Xa,8726:Xa,8727:Ti,8728:Cs,8729:Cs,8730:[.2,.8,0,0,.83334],8733:_c,8734:fn,8736:st,8739:Oa,8741:Xa,8743:is,8744:is,8745:is,8746:is,8747:[.19444,.69444,.11111,0,.41667],8764:Te,8768:[.19444,.69444,0,0,.27778],8771:xl,8773:[-.022,.589,0,0,1],8776:Vo,8781:xl,8784:[-.133,.67,0,0,.778],8801:xl,8804:Jt,8805:Jt,8810:as,8811:as,8826:qt,8827:qt,8834:qt,8835:qt,8838:Jt,8839:Jt,8846:is,8849:Jt,8850:Jt,8851:is,8852:is,8853:zi,8854:zi,8855:zi,8856:zi,8857:zi,8866:Li,8867:Li,8868:bo,8869:bo,8872:[.249,.75,0,0,.867],8900:Cs,8901:[-.05555,.44445,0,0,.27778],8902:Ti,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:Wi,8969:Wi,8970:Wi,8971:Wi,8994:Ya,8995:Ya,9136:Aa,9137:Aa,9651:xo,9657:Ti,9661:xo,9667:Ti,9711:Da,9824:po,9825:po,9826:po,9827:po,9837:[0,.75,0,0,.38889],9838:za,9839:za,10216:ka,10217:ka,10222:Aa,10223:Aa,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:Eo,10927:Jt,10928:Jt,57376:To},"Math-BoldItalic":{32:Qn,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:tr,55:os,56:tr,57:os,65:kn,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:Eu,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:Qn,915:[0,.68611,.15972,0,.65694],916:jn,920:[0,.68611,.03194,0,.86722],923:_u,926:[0,.68611,.07458,0,.84125],928:Eu,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:Ec,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:Ec,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Qn,48:Do,49:Do,50:Do,51:Sl,52:Sl,53:Sl,54:fa,55:Sl,56:fa,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:kc,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:ku,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:qs,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:Qn,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:ku,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:kc,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:qs,960:[0,.43056,.03588,0,.57003],961:jl,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:jl,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:Qn,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:_s,40:Lu,41:Lu,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:Ta,49:Ta,50:Ta,51:Ta,52:Ta,53:Ta,54:Ta,55:Ta,56:Ta,57:Ta,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:Vl,68:Ms,69:[0,.69444,0,0,.64167],70:Li,71:ss,72:Ms,73:[0,.69444,0,0,.33056],74:Rd,75:Lc,76:Au,77:[0,.69444,0,0,.97778],78:Ms,79:Ms,80:Vl,81:[.10556,.69444,0,0,.79445],82:Vl,83:Li,84:ss,85:Lc,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:ss,89:[0,.69444,.0275,0,.73334],90:Es,91:Qs,93:Qs,94:Ta,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:$d,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:$d,109:[0,.45833,0,0,.86667],110:Du,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:Du,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:Qn,168:Ta,176:ss,180:Ta,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Ta,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Ta,729:_s,730:ss,732:Ta,733:Ta,915:Au,916:[0,.69444,0,0,.91667],920:tl,923:Es,926:ss,928:Ms,931:Ms,933:tl,934:Ms,936:tl,937:Ms,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:_s,8217:_s,8220:ls,8221:ls},"SansSerif-Italic":{32:Qn,33:[0,.69444,.05733,0,.31945],34:Fd,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:cs,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:ua,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:ks,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:nl,77:[0,.69444,.08094,0,.875],78:ks,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Tu,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:Qn,168:[0,.67937,.06385,0,.5],176:Iu,184:Dc,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Tu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Nd,715:Bi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Iu,732:[0,.67659,.08826,0,.5],733:Nd,915:[0,.69444,.13372,0,.54167],916:Tc,920:[0,.69444,.07555,0,.77778],923:Li,926:[0,.69444,.12816,0,.66667],928:ks,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:cs,8217:cs,8220:[0,.69444,.14205,0,.5],8221:Fd},"SansSerif-Regular":{32:Qn,33:[0,.69444,0,0,.31945],34:Bi,35:zd,36:Js,37:Kd,38:[0,.69444,0,0,.75834],39:fo,40:ka,41:ka,42:Hd,43:zi,44:Wd,45:[0,.44444,0,0,.33333],46:Zd,47:Xa,48:pa,49:pa,50:pa,51:pa,52:pa,53:pa,54:pa,55:pa,56:pa,57:pa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Sa,64:ua,65:ua,66:ua,67:Fn,68:[0,.69444,0,0,.72223],69:Ia,70:[0,.69444,0,0,.56945],71:ua,72:Pu,73:fo,74:Sa,75:[0,.69444,0,0,.69445],76:nl,77:[0,.69444,0,0,.875],78:Pu,79:[0,.69444,0,0,.73611],80:Fn,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:ua,89:[0,.69444,.025,0,.66667],90:Li,91:Ul,93:Ul,94:Bi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Bu,99:jd,100:Bu,101:jd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Bu,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:Ou,111:[0,.44444,0,0,.5],112:Vd,113:Vd,114:[0,.44444,.01389,0,.34167],115:Ac,116:[0,.57143,0,0,.36111],117:Ou,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:Qn,168:[0,.67937,0,0,.5],176:ua,184:Dc,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Bi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Bi,715:Bi,728:Bi,729:[0,.67937,0,0,.27778],730:ua,732:[0,.67659,0,0,.5],733:Bi,915:nl,916:Tc,920:bo,923:Li,926:ua,928:Pu,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:Bi,8221:Bi},"Script-Regular":{32:Qn,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:Qn},"Size1-Regular":{32:Qn,40:Gd,41:Gd,47:Ic,91:Pc,92:Ic,93:Pc,123:Ru,125:Ru,160:Qn,710:Xl,732:Xl,770:Xl,771:Xl,8214:[-99e-5,.601,0,0,.77778],8593:Bc,8595:Bc,8657:$u,8659:$u,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:Yl,8748:Ud,8749:Ud,8750:Yl,8896:Ka,8897:Ka,8898:Ka,8899:Ka,8968:rl,8969:rl,8970:rl,8971:rl,9168:Zc,10216:rl,10217:rl,10752:Nu,10753:Nu,10754:Nu,10756:Ka,10758:Ka},"Size2-Regular":{32:Qn,40:Fu,41:Fu,47:go,91:Ni,92:go,93:Ni,123:Io,125:Io,160:Qn,710:$o,732:$o,770:$o,771:$o,8719:us,8720:us,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Oc,8748:zu,8749:zu,8750:Oc,8896:il,8897:il,8898:il,8899:il,8968:Rc,8969:Rc,8970:Rc,8971:Rc,10216:$c,10217:$c,10752:al,10753:al,10754:al,10756:il,10758:il},"Size3-Regular":{32:Qn,40:Ku,41:Ku,47:Nc,91:ds,92:Nc,93:ds,123:Jl,125:Jl,160:Qn,710:ql,732:ql,770:ql,771:ql,8730:[.95003,1.45,0,0,1],8968:Fc,8969:Fc,8970:Fc,8971:Fc,10216:Jl,10217:Jl},"Size4-Regular":{32:Qn,40:Ql,41:Ql,47:zc,91:Hu,92:zc,93:Hu,123:Kc,125:Kc,160:Qn,710:ec,732:ec,770:ec,771:ec,8730:[1.25003,1.75,0,0,1],8968:Hc,8969:Hc,8970:Hc,8971:Hc,9115:Wc,9116:tc,9117:Wc,9118:Wc,9119:tc,9120:Wc,9121:jc,9122:Zc,9123:jc,9124:jc,9125:Zc,9126:jc,9127:Xd,9128:Wu,9129:ol,9130:[0,.3,0,0,.88889],9131:Xd,9132:Wu,9133:ol,9143:[.88502,.915,0,0,1.05556],10216:Kc,10217:Kc,57344:Vc,57345:Vc,57680:sl,57681:sl,57682:sl,57683:sl},"Typewriter-Regular":{32:nc,33:Nr,34:Nr,35:Nr,36:So,37:So,38:Nr,39:Nr,40:So,41:So,42:[0,.52083,0,0,.525],43:Zu,44:[.13889,.125,0,0,.525],45:Zu,46:[0,.125,0,0,.525],47:So,48:Nr,49:Nr,50:Nr,51:Nr,52:Nr,53:Nr,54:Nr,55:Nr,56:Nr,57:Nr,58:no,59:[.13889,.43056,0,0,.525],60:Yd,61:[-.19549,.41562,0,0,.525],62:Yd,63:Nr,64:Nr,65:Nr,66:Nr,67:Nr,68:Nr,69:Nr,70:Nr,71:Nr,72:Nr,73:Nr,74:Nr,75:Nr,76:Nr,77:Nr,78:Nr,79:Nr,80:Nr,81:[.13889,.61111,0,0,.525],82:Nr,83:Nr,84:Nr,85:Nr,86:Nr,87:Nr,88:Nr,89:Nr,90:Nr,91:So,92:So,93:So,94:Nr,95:[.09514,0,0,0,.525],96:Nr,97:no,98:Nr,99:no,100:Nr,101:no,102:Nr,103:Ca,104:Nr,105:Nr,106:[.22222,.61111,0,0,.525],107:Nr,108:Nr,109:no,110:no,111:no,112:Ca,113:Ca,114:no,115:no,116:[0,.55358,0,0,.525],117:no,118:no,119:no,120:no,121:Ca,122:no,123:So,124:So,125:So,126:Nr,127:Nr,160:nc,176:Nr,184:[.19445,0,0,0,.525],305:no,567:Ca,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Nr,715:Nr,728:Nr,730:Nr,770:Nr,771:Nr,776:Nr,915:Nr,916:Nr,920:Nr,923:Nr,926:Nr,928:Nr,931:Nr,933:Nr,934:Nr,936:Nr,937:Nr,8216:Nr,8217:Nr,8242:Nr,9251:[.11111,.21944,0,0,.525]}},qd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,ll=10,ro=.25,Gc=1.2,hs=.431,ju={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:[ro,ro,ro],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]},Uc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ds=5,Vu={"\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=Jd[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 Vu)a=Vu[E].codePointAt(0);else if(qd.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 Xc={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]},cl={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 Ml(a){if(cl[a]){const[ve,Se,Re]=cl[a],Je=`<span class="stretchy" style="height:${Re}em"><svg width="100%" height="${Re}em" viewBox="0 0 ${ve} ${Se}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Re/2)/100}em;min-width:0">${Je}</span>`}const[y,b,E,ee]=Xc[a];let re,ae;const he=E/1e3;y.length===3?(re=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],ae=["xMinYMin","xMidYMin","xMaxYMin"]):y.length===2?(re=["slice-1-of-2","slice-2-of-2"],ae=["xMinYMin","xMaxYMin"]):(re=["slice-1-of-1"],ae=[ee]);const me=y.map((ve,Se)=>`<span class="${re[Se]}" style=height:${he}em><svg width=400em height=${he}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[Se]} slice"><path fill="currentcolor" d="${Qd[ve]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${he}em;min-width:${b}em;">${me}</span>`}function eh(a){return Xc[a]?Xc[a][2]/1e3:cl[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 re=E-55296,ae=ee-56320;E=Ys(2,16)+re*Ys(2,10)+ae,b++}}y.push(E)}return y}var rc=8205,ic=[[rc,1],[65038,2],[127995,5],[129456,4],[917536,96]],As,_l=[127462,127487];function El(a){var y;if(As===void 0){As={};for(const b of ic)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>=_l[0]&&a<=_l[1]}function rh(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=th(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===rc){const ae=E-1;for(E+=2;b[E]===rc;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(El(re)){const ae=E-1;for(;El(b[E]);)E+=b[E]===rc?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 ih=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rh(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,re;const ae=[];let he=a.next();if(he&&he!=="\\relax"){if(he==="\\noexpand")he=a.next(),he&&ae.push(he);else if(he==="\\obeyspaces")a.obeyspaces=!0;else if(he==="\\bgroup")ae.push("<{>");else if(he==="\\egroup")ae.push("<}>");else if(he==="\\string"){if(he=a.next(),he)if(he.startsWith("\\"))for(const me of he)ae.push(me==="\\"?"\\backslash":me);else he==="<{>"?ae.push("\\{"):he==="<space>"?ae.push("~"):he==="<}>"&&ae.push("\\}")}else if(he==="\\csname"){for(;a.peek()==="<space>";)a.next();let me="",ve=!1,Se=[];do{if(Se.length===0)if(/^#[\d?@]$/.test(a.peek())){const Re=a.get().slice(1);Se=ps((E=(b=y==null?void 0:y(Re))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),he=Se[0]}else he=a.next(),Se=he?[he]:[];ve=Se.length===0,!ve&&he==="\\endcsname"&&(ve=!0,Se.shift()),ve||(ve=he==="<$>"||he==="<$$>"||he==="<{>"||he==="<}>"||typeof he=="string"&&he.length>1&&he.startsWith("\\")),ve||(me+=Se.shift())}while(!ve);me&&ae.push("\\"+me),ae.push(...Se)}else if(he!=="\\endcsname")if(he.length>1&&he.startsWith("#")){const me=he.slice(1);ae.push(...ps((re=(ee=y==null?void 0:y(me))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(he)}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 he=ae.match(/((?:\\%)|[^%])*/);he!==null&&b.push(he[0])}const ee=new ih(qe(b.join(""))),re=[];do re.push(...Ts(ee,y));while(!ee.end());return re}function xi(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 ra(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:xi([a,...y.map(b=>`{${b}}`)])}function Is(a){return xi(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var ah=class Bd{constructor(y){Bd._registry[y]=this}static createAtom(y,b,E){return Bd._registry[y].createAtom(b,$t(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 re of oh(y)){const ae=Bd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return xi(ee)}return xi(ef(y,b))}static getFont(y,b,E){return Bd._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 ya(a,y){const b=[];let E=[],ee;for(const re of a)if(re.type!=="first"&&re.style){let ae;y==="variant"?(ae=re.style.variant,re.style.variantStyle&&re.style.variantStyle!=="up"&&(ae+="-"+re.style.variantStyle)):ae=re.style[y],ae===ee?E.push(re):(E.length>0&&b.push(E),E=[re],ee=ae)}return E.length>0&&b.push(E),b}function Gu(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of oh(a)){const he=y.defaultMode;for(const me of ya(ae,"color")){const ve=me[0].computedStyle,Se=Co._registry[me[0].mode].serialize(me,_e(we({},y),{defaultMode:he==="text"?"text":"math"}));!y.skipStyles&&ve.color&&ve.color!=="none"&&(!E||ee!==ve.color)?re.push(ra("\\textcolor",(b=ve.verbatimColor)!=null?b:ve.color,xi(Se))):re.push(xi(Se))}}return re}function Qh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return ya(a,"backgroundColor").map(ee=>{var re;if(ee.length>0||ee[0].type!=="box"){const ae=ee[0].computedStyle;if(ae.backgroundColor&&ae.backgroundColor!=="none"&&(!b||E!==ae.backgroundColor))return ra("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,xi(Gu(ee,_e(we({},y),{defaultMode:"text"}))))}return xi(Gu(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 re of ya(a,"fontSize")){const ae=re[0].computedStyle.fontSize,he=Qh(re,y);he&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...he):ee.push(...he))}return ee}function Uu(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 kl(a){if(a.length===0)return"ord";const y=Uu(a[0].type),b=Uu(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 cr=class Mp{constructor(y,b){var E,ee,re,ae,he;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Ae(y)?this.children=y.filter(ve=>ve!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ve of this.children)ve.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=(re=b==null?void 0:b.isTight)!=null?re:!1,b!=null&&b.attributes&&(this.attributes=b.attributes);let me=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(me=(he=Co.getFont((ae=b.mode)!=null?ae:"math",this,_e(we({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?he:void 0),me||(me="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),ac(this,me)}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=bt(ee)),ee&&ee!==b.backgroundColor&&(this.setStyle("background-color",ee),this.setStyle("display","inline-block"));const re=y.scalingFactor;return this.scale=re,this.skew*=re,this.italic*=re,this}toMarkup(){var y,b,E,ee;let re=(y=this.value)!=null?y:"";if(this.children)for(const yt of this.children)re+=yt.toMarkup();let ae="";if(this.svgBody)ae=Ml(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+=re,ae+="</span>",ae+='<svg style="position:absolute;overflow:visible;',ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const yt=(b=this.cssProperties)==null?void 0:b.padding;yt?(ae+=`top:${yt};`,ae+=`left:${yt};`,ae+=`width:calc(100% - 2 * ${yt} );`):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 he="";const me=this.classes.split(" ");me.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&me.push("ML__latex-caret"),this.isSelected&&me.push("ML__selected");const ve=me.length===1?me[0]:me.filter((yt,_t,gn)=>yt.length>0&&gn.indexOf(yt)===_t).join(" ");if(ve.length>0&&(he+=` class="${ve}"`),this.id&&(he+=` data-atom-id=${this.id}`),this.cssId&&(he+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(he+=" "+Object.keys(this.attributes).map(yt=>`${yt}="${this.attributes[yt]}"`).join(" ")),this.htmlData){const yt=this.htmlData.split(",");for(const _t of yt){const gn=_t.match(/([^=]+)=(.+$)/);if(gn){const sr=gn[1].trim().replace(/ /g,"-");sr&&(he+=` data-${sr}="${gn[2]}" `)}else{const sr=_t.trim().replace(/ /g,"-");sr&&(he+=` data-${sr} `)}}}const Se=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&Se.width===void 0&&(Se.width=`${Math.ceil(this._width*100)/100}em`);const Re=Object.keys(Se).map(yt=>`${yt}:${Se[yt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&Re.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const yt=this.htmlStyle.split(";");let _t="";for(const gn of yt){const sr=gn.match(/([^=]+):(.+$)/);if(sr){const hn=sr[1].trim().replace(/ /g,"-");hn&&(_t+=`${hn}:${sr[2]};`)}}_t&&(he+=` style="${_t}"`)}Re.length>0&&(he+=` style="${Re.join(";")}"`);let Je="";return he.length>0||ae.length>0?Je=`<span${he}>${re}${ae}</span>`:Je=re,this.caret==="text"?Je+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Je+='<span class="ML__caret"></span>'),Je}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 me of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&me in y.cssProperties||this.cssProperties&&me in this.cssProperties)return!1}const ee=this.cssProperties?Object.keys(this.cssProperties).length:0,re=y.cssProperties?Object.keys(y.cssProperties).length:0;if(ee!==re)return!1;if(ee>0){for(const me of Object.keys(this.cssProperties))if(this.cssProperties[me]!==y.cssProperties[me])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),he=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==he.length)return!1;ae.sort(),he.sort();for(const[me,ve]of ae.entries())if(ve==="vertical-separator"||ve!==he[me])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 Xu(a){if(!a||a.length===0)return[];a[0].children=Xu(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=Xu(a[b].children),y.push(a[b]));return y}function Yc(a){return a.children&&(a.children=Xu(a.children)),a}function Jc(a,y){if(!a)return new cr(null,y);const b=new cr(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 cr(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 cr(E,_e(we({},y),{type:"lift"}))}function No(a){const y=eh(a)/2,b=new cr(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function ac(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,re=0;for(const ae of a.children)ae.height>E&&(E=ae.height),ae.depth>ee&&(ee=ae.depth),re=Math.max(re,(b=ae.maxFontSize)!=null?b:0);a.height=E,a.depth=ee,a._width=a.children.reduce((ae,he)=>ae+he.width,0),a.maxFontSize=re}}function qc(a){if("individualShift"in a){const y=a.individualShift;let b=y[0];const E=[b],ee=-b.shift-b.box.depth;let re=ee;for(let ae=1;ae<y.length;ae++){const he=y[ae],me=-he.shift-re-he.box.depth,ve=me-(b.box.height+b.box.depth);re=re+me,E.push(ve),E.push(he),b=he}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 oc(a){var y;const[b,E]=qc(a);if(!b)return[[],0,0];const ee=new cr(null,{classes:"pstrut"});let re=0;for(const _t of b)if(typeof _t!="number"){const gn=_t.box;re=Math.max(re,gn.maxFontSize,gn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let he=E,me=E,ve=E,Se=0;for(const _t of b){if(typeof _t=="number")ve+=_t;else{const gn=_t.box,sr=(y=_t.classes)!=null?y:[],hn=new cr([ee,gn],{classes:sr.join(" "),style:_t.style});gn.setStyle("height",gn.height+gn.depth,"em"),gn.setStyle("display","inline-block"),hn.setStyle("top",-re-ve-gn.depth,"em"),_t.marginLeft&&hn.setStyle("margin-left",_t.marginLeft,"em"),_t.marginRight&&hn.setStyle("margin-right",_t.marginRight,"em"),ae.push(hn),ve+=gn.height+gn.depth,Se=Math.max(Se,hn.width)}he=Math.min(he,ve),me=Math.max(me,ve)}ae.forEach(_t=>{_t.softWidth=Se});const Re=new cr(ae,{classes:"vlist"});if(Re.softWidth=Se,Re.height=me,Re.setStyle("height",me,"em"),he>=0)return[[new cr(Re,{classes:"vlist-r"})],me,-he];const Je=new cr(new cr(null),{classes:"vlist"});Je.height=-he,Je.setStyle("height",-he,"em");const yt=new cr(8203,{classes:"vlist-s",maxFontSize:0});return yt.softWidth=0,yt.height=0,yt.depth=0,[[new cr([Re,yt],{classes:"vlist-r"}),new cr(Je,{classes:"vlist-r"})],me,-he]}var Xi=class extends cr{constructor(a,y){var b;const[E,ee,re]=oc(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=re,this.softWidth=E.reduce((ae,he)=>Math.max(ae,he.width),0)}};function tf(a,y){var b,E,ee,re,ae;const he=a.metrics,me=new cr(y.base),ve=(b=y.baseShift)!=null?b:0,Se=(E=y.slant)!=null?E:0;let Re=0,Je=0;y.above&&(Re=(ee=y.aboveShift)!=null?ee:Math.max(he.bigOpSpacing1,he.bigOpSpacing3-y.above.depth)),y.below&&(Je=(re=y.belowShift)!=null?re:Math.max(he.bigOpSpacing2,he.bigOpSpacing4-y.below.height));let yt=null;if(y.below&&y.above){const _t=he.bigOpSpacing5+y.below.height+y.below.depth+Je+me.depth+ve;yt=new Xi({bottom:_t,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-Se,classes:["ML__center"]},Je,{box:me,classes:["ML__center"]},Re,{box:y.above,marginLeft:Se,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)yt=new Xi({top:me.height-ve,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-Se,classes:["ML__center"]},Je,{box:me,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const _t=me.depth+ve;yt=new Xi({bottom:_t,children:[{box:me,classes:["ML__center"]},Re,{box:y.above,marginLeft:Se,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else{const _t=me.depth+ve;yt=new Xi({bottom:_t,children:[{box:me},he.bigOpSpacing5]}).wrap(a)}return new cr(yt,{type:(ae=y.type)!=null?ae:"op"})}var Yu=7,ms=6,sc=5,Ps=4,ul=3,io=2,Po=1,Ha=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(ju).reduce((ee,re)=>_e(we({},ee),{[re]:ju[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Uo[[Ha,Po,Ha,Po,io,ul,io,ul][this.id]]}get sub(){return Uo[[Ha,Ha,Ha,Ha,io,io,io,io][this.id]]}get fracNum(){return Uo[[Ha,Po,Ha,Po,io,ul,Ps,sc][this.id]]}get fracDen(){return Uo[[Ha,Ha,Ha,Ha,io,io,Ps,Ps][this.id]]}get cramp(){return Uo[[Ha,Ha,io,io,Ps,Ps,ms,ms][this.id]]}get isTight(){return this.sizeDelta<0}},dl={7:new Go(Yu,0,!1),6:new Go(ms,0,!0),5:new Go(sc,0,!1),4:new Go(Ps,0,!0),3:new Go(ul,-3,!1),2:new Go(io,-3,!0),1:new Go(Po,-4,!1),0:new Go(Ha,-4,!0)},Uo=_e(we({},dl),{displaystyle:dl[Yu],textstyle:dl[sc],scriptstyle:dl[ul],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=Ys(10,y);return Math.round(a.dimension/ll*E*ee)/ee}return a.dimension*E}function Ju(a,y){if(a===null)return 0;const b=Dl(a)/ll;if(Number.isFinite(y)){const E=Ys(10,y);return Math.round(b*E)/E}return b}function qu(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function sh(a){let y=qu(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${qu(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${qu(a.shrink)}`),y}function Ma(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?_e(we({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?_e(we({},a),{factor:a.factor*y}):_e(we({},a),{factor:y}):"dimension"in a?_e(we({},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 we({},nf)}function Qc(){return{registers:Al(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Qe.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Nt,backgroundColorMap:ht,getMacro:a=>Dn(a,Pn())}}var _i=class _p{constructor(y,b){var E,ee,re,ae,he,me,ve,Se,Re,Je,yt,_t,gn,sr,hn;let $n;y!=null&&y.parent?(this.parent=y.parent,$n=y.parent,this.registers={}):($n=we(we({},Qc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=$n.registers),$n.atomIdsSettings&&(this.atomIdsSettings=we({},$n.atomIdsSettings)),this.renderPlaceholder=$n.renderPlaceholder,this.isPhantom=(ae=(re=y==null?void 0:y.isPhantom)!=null?re:(ee=this.parent)==null?void 0:ee.isPhantom)!=null?ae:!1,this.letterShapeStyle=$n.letterShapeStyle,this.minFontScale=$n.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(me=(he=this.parent)==null?void 0:he.color)!=null?me:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(Se=(ve=this.parent)==null?void 0:ve.backgroundColor)!=null?Se:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Re=this.parent)==null?void 0:Re.size)?this.size=b.fontSize:this.size=(yt=(Je=this.parent)==null?void 0:Je.size)!=null?yt:Ds;let pr=(gn=(_t=this.parent)==null?void 0:_t.mathstyle)!=null?gn:Uo.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if($n instanceof _p)switch(y.mathstyle){case"cramp":pr=pr.cramp;break;case"superscript":pr=pr.sup;break;case"subscript":pr=pr.sub;break;case"numerator":pr=pr.fracNum;break;case"denominator":pr=pr.fracDen;break}switch(y.mathstyle){case"textstyle":pr=Uo.textstyle;break;case"displaystyle":pr=Uo.displaystyle;break;case"scriptstyle":pr=Uo.scriptstyle;break;case"scriptscriptstyle":pr=Uo.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=pr,this.smartFence=$n.smartFence,this.placeholderSymbol=$n.placeholderSymbol,this.colorMap=(sr=$n.colorMap)!=null?sr:zn=>zn,this.backgroundColorMap=(hn=$n.backgroundColorMap)!=null?hn:zn=>zn,this.getMacro=$n.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===Yu||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(Uc[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 Ju(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 re=b.evaluate(ee);if(re!==void 0)return"string"in re?{string:Number(ee).toString()+re.string}:"number"in re?{number:E*re.number}:"dimension"in re?_e(we({},re),{dimension:E*re.dimension}):"glue"in re?_e(we({},re),{glue:_e(we({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?_e(we({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?_e(we({},re.grow),{dimension:E*re.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 lc(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Tn=class vl{constructor(y){var b,E,ee,re,ae,he;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=we({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(he=y.skipBoundary)!=null?he:!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 re=lh(b),ae=[];for(const me of re){const ve=me[0].style,Se=ch(y,me,{style:{color:ve.color,backgroundColor:ve.backgroundColor,fontSize:ve.fontSize}});Se&&ae.push(Se)}if(ae.length===0)return null;const he=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!he&&!(E!=null&&E.type)?ae[0].wrap(y):new cr(ae,{classes:he,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=we({},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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?xi([ra(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?xi([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Co.serialize(this.body,_e(we({},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=_e(we({},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 lc(this.parentBranch)?this.parentBranch[0]:-1}get col(){return lc(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",re=we(we({},(b=(y=this.parent)==null?void 0:y.computedStyle)!=null?b:{}),this.style);return delete re.variant,delete re.variantStyle,ee||delete re.verbatimBackgroundColor,E||delete re.verbatimColor,re}applyStyle(y){this.isDirty=!0,this.style=we(we({},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 re of y)re.parent=this,re.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=$t(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new _i({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,re=this.superscript,ae=this.subscript;if(!re&&!ae)return ee;let he=null,me=null;const ve=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let Se=0;if(re){const gn=new _i({parent:y,mathstyle:"superscript"});he=vl.createBox(gn,re),ve||(Se=ee.height-y.metrics.supDrop*gn.scalingFactor)}let Re=0;if(ae){const gn=new _i({parent:y,mathstyle:"subscript"});me=vl.createBox(gn,ae),ve||(Re=ee.depth+y.metrics.subDrop*gn.scalingFactor)}let Je;y.isDisplayStyle?Je=y.metrics.sup1:y.isCramped?Je=y.metrics.sup3:Je=y.metrics.sup2;const yt=.5/ll/y.scalingFactor;let _t=null;if(me&&he){Se=Math.max(Se,Je,he.depth+.25*y.metrics.xHeight),Re=Math.max(Re,y.metrics.sub2);const gn=y.metrics.defaultRuleThickness;if(Se-he.depth-(me.height-Re)<4*gn){Re=4*gn-(Se-he.depth)+me.height;const hn=.8*y.metrics.xHeight-(Se-he.depth);hn>0&&(Se+=hn,Re-=hn)}const sr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;_t=new Xi({individualShift:[{box:me,shift:Re,marginLeft:sr},{box:he,shift:-Se}]}).wrap(y)}else me&&!he?(Re=Math.max(Re,y.metrics.sub1,me.height-.8*hs),_t=new Xi({shift:Re,children:[{box:me,marginRight:yt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!me&&he&&(Se=Math.max(Se,Je,he.depth+.25*hs),_t=new Xi({shift:-Se,children:[{box:he,marginRight:yt}]}));return new cr([ee,new cr(_t,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?vl.createBox(new _i({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?vl.createBox(new _i({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):tf(y,_e(we({},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,re,ae;const he=(E=this.value)!=null?E:this.body,me=(ee=b==null?void 0:b.boxType)!=null?ee:Uu(this.type);let ve=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ve+=" ML__text");const Se=typeof he=="string"||he===void 0?new cr(he!=null?he:null,{type:me,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:_e(we({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ve}):(ae=vl.createBox(y,he,{type:me,classes:ve}))!=null?ae:new cr(null);return y.isTight&&(Se.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(Se.italic=0),Se.right=Se.italic,this.bind(y,Se),this.caret&&!this.superscript&&!this.subscript&&(Se.caret=this.caret),Se}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 re=ee.computedStyle;y&&re.color===y.color&&re.backgroundColor===y.backgroundColor&&re.fontSize===y.fontSize?E.push(ee):(E.length>0&&b.push(E),E=[ee],y=re)}return E.length>0&&b.push(E),b}function ch(a,y,b){var E,ee,re,ae,he;if(!y||y.length===0)return null;const me=new _i({parent:a},b.style),ve=!((E=me.atomIdsSettings)!=null&&E.groupNumbers);let Se=[];if(y.length===1){const Je=y[0],yt=Je.render(me);yt&&(ve&&Je.isSelected&&yt.selected(!0),Se=[yt])}else{let Je="",yt=!0;for(const _t of y){(ee=me.atomIdsSettings)!=null&&ee.groupNumbers&&Je&&(yt&&_t.isDigit()||!yt&&Qu(_t))&&(me.atomIdsSettings.overrideID=Je);const gn=_t.render(me);me.atomIdsSettings&&(me.atomIdsSettings.overrideID=void 0),gn&&((re=me.atomIdsSettings)!=null&&re.groupNumbers&&((_t.isDigit()||Qu(_t))&&(!Je||yt!==_t.isDigit())&&(yt=_t.isDigit(),Je=(ae=_t.id)!=null?ae:""),Je&&(!(_t.isDigit()||Qu(_t))||!_t.hasEmptyBranch("superscript")||!_t.hasEmptyBranch("subscript"))&&(Je="")),ve&&_t.isSelected&&gn.selected(!0),Se.push(gn))}}if(Se.length===0)return null;const Re=new cr(Se,_e(we({isTight:me.isTight},b),{type:(he=b.type)!=null?he:"lift"}));return Re.isSelected=Se.every(Je=>Je.isSelected),Re.wrap(me)}function Qu(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Tn?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class Ep extends Tn{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 Ep(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:Ln("text",this.value.codePointAt(0))}};function cc(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 Wa(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 Bs(a){return typeof a=="number"&&!Number.isNaN(a)}function eu(a){return Array.isArray(a)&&a.length===2}function tu(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 uh(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,re=!1,ae=!1,he=!1,me=!1,ve=!1,Se=!1,Re=!1,Je=!1,yt=!1,_t=!1,gn=!1,sr=!1,hn=a[0],$n=0;for(;hn!=null&&hn.type&&/^(subsup|placeholder)$/.test(hn.type);)$n+=1,hn=a[$n];return b=!hn||hn.type==="first",hn&&(gn=hn.mode==="text",E=!gn&&hn.type==="mord"&&de.test(hn.value),ee=!gn&&hn.type==="mord"&&/\d+$/.test(hn.value),re=!gn&&hn.isFunction,ae=hn.type==="genfrac",he=hn.type==="surd",me=hn.type==="mbin",ve=hn.type==="mrel",Se=hn.type==="mop"||hn.type==="operator"||hn.type==="extensible-symbol",Re=hn.type==="mpunct"||hn.type==="minner",Je=hn.type==="array",yt=hn.type==="mopen",_t=hn.type==="mclose"||hn.type==="leftright",sr=hn.type==="space"),y.after.includes("nothing")&&b||y.after.includes("letter")&&E||y.after.includes("digit")&&ee||y.after.includes("function")&&re||y.after.includes("frac")&&ae||y.after.includes("surd")&&he||y.after.includes("binop")&&me||y.after.includes("relop")&&ve||y.after.includes("operator")&&Se||y.after.includes("punct")&&Re||y.after.includes("array")&&Je||y.after.includes("openfence")&&yt||y.after.includes("closefence")&&_t||y.after.includes("text")&&gn||y.after.includes("space")&&sr?y.value:""}function td(a,y,b){return b?uh(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 uc(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",Ja(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function Ja(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const he=(b=y.inlineShortcuts)!=null?b:dh;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=Os(a.slice(1),{inlineShortcuts:he,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=Ja(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:he,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:he,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=Os(ae[1],{inlineShortcuts:he,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=Ja(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hh(ae[1],he),a+=Ja(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=Os(a.slice(1),{inlineShortcuts:he,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=Ja(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hh(ae[1],he),a+=Ja(ae[2],y),re=!0)),!re)if(ae=Os(a,{inlineShortcuts:he,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const me=Os(ae.rest.slice(1),{inlineShortcuts:he,noWrap:!0});me.match&&(a="\\frac{"+ae.match+"}{"+me.match+"}"+Ja(me.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+Ja(ae.rest,y):ae.match+Ja(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+Ja(ae[2],y),re=!0)),a}function Os(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,he=1;for(;he<a.length&&ae>0;)a[he]===ee&&ae++,a[he]===re&&ae--,he++;ae===0?(y.noWrap&&ee==="("?b=Ja(a.substring(1,he-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+Ja(a.substring(1,he-1),y)+"\\right"+re),E=a.slice(Math.max(0,he))):(b=a.substring(1,he),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let he=td(null,a,y.inlineShortcuts);if(he)return he=he.replace("_{#?}",""),he=he.replace("^{#?}",""),{match:he,rest:a.slice(he.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 nu="$$",of="$$",sf=(a,y,b)=>(nd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${nu} ${y} ${of}`),y),ph=class qh{constructor(y){qh._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 re=new ClipboardEvent("paste",{clipboardData:E,cancelable:!0});return(ee=b.host)!=null&&ee.dispatchEvent(re)?qh._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]:Wa(E.selection),re=E.getValue(ee,b);navigator.clipboard.writeText(re).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,re=ee.selectionIsCollapsed?[0,ee.lastOffset]:Wa(ee.selection);let ae=ee.getAtoms(re);if(ae.every(he=>he.mode==="text"||!he.mode))b.clipboardData.setData("text/plain",ae.filter(he=>he instanceof vs).map(he=>he.value).join(""));else if(ae.every(he=>he.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(he=>{var me;return(me=he.value)!=null?me:""}).join(""));else{let he;ae.length===1&&ae[0].verbatimLatex!==void 0?he=ae[0].verbatimLatex:he=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",he);try{b.clipboardData.setData("text/plain",y.options.onExport(y,he,re))}catch(me){}if(ae.length===1){const me=ae[0];(me.type==="root"||me.type==="group")&&(ae=me.body.filter(ve=>ve.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(me=>me.toJson())))}catch(me){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const me=window.MathfieldElement.computeEngine;if(me)try{const ve=me.jsonSerializationOptions;me.jsonSerializationOptions={metadata:["latex"]};const Se=me.parse(ee.getValue(re,"latex-unstyled"));me.jsonSerializationOptions=ve;const Re=JSON.stringify(Se.json);Re&&b.clipboardData.setData("application/json",Re)}catch(ve){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return qh._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};ph._modes={};var oi=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","^"]}],rd={"\\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 Fo(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 $s(a){const y=zo(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function id(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,re=y.bottom-y.top,ae=Math.ceil(y.left-E.left+a.field.scrollLeft*b),he=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:he,bottom:he+re}}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 re=od(ee);E.left=Math.min(E.left,re.left),E.right=Math.max(E.right,re.right),E.top=Math.min(E.top,re.top),E.bottom=Math.max(E.bottom,re.bottom)}return E}function Il(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 re=a.field.querySelector(`[data-atom-id="${y.id}"]`);return ee=re?od(re):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 re=a.field,ae=re.offsetWidth;let me=Math.floor(re.getBoundingClientRect().width)/ae;me=isNaN(me)?1:me;const ve=ad(a,Il(a,ee),me);if(ve){const Se=id(ee);if(E.has(Se)){const Re=E.get(Se);E.set(Se,{left:Math.min(Re.left,ve.left),right:Math.max(Re.right,ve.right),top:Math.min(Re.top,ve.top),bottom:Math.max(Re.bottom,ve.bottom)})}else E.set(Se,ve)}}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 ru(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;
}
`,Zi=`.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);
}
`,cf=`/* 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);*/
}
`,uf=`.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));
}
`,iu=`: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;
}
`,Yi;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=Zi;break;case"mathfield":y=gh;break;case"environment-popover":y=vh;break;case"suggestion-popover":y=cf;break;case"keystroke-caption":y=Pl;break;case"virtual-keyboard":y=uf;break;case"ui":y=iu;break;case"menu":y=df;break;default:debugger}return y}function Bl(a){return Yi||(Yi={}),Yi[a]||(Yi[a]=new CSSStyleSheet,Yi[a].replaceSync(hl(a))),Yi[a]}var ys;function Bo(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=Bl(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=Yi[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class kp extends Tn{constructor(y){var b;super(_e(we({},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 kp(y)}toJson(){return _e(we({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new _i({parent:y,mathstyle:"cramp"},this.style),ee=(b=Tn.createBox(E,this.body))!=null?b:new cr("\u25A2",{style:this.style});let re=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(re=ee.skew);let ae=Math.min(ee.height,hs),he;if(this.svgAccent)he=No(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ve=new cr(this.accent,{fontFamily:"Main-Regular"});ve.italic=0;const Se=this.accent===8407?" ML__accent-vec":"";he=new cr(new cr(ve),{classes:"ML__accent-body"+Se})}he=new Xi({shift:0,children:[{box:new cr(ee)},-ae,{box:he,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const me=new cr(he,{type:"lift"});return this.caret&&(me.caret=this.caret),this.bind(E,me.wrap(E)),this.attachSupsub(E,{base:me})}},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 ie(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 ce(a,y,b,E){var ee;const ae=new cr(ie(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)*ro),ae}function ge(a,y,b,E,ee){var re,ae;const he=new _i({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),me=new cr(ie(a),{fontFamily:`Size${y}-Regular`,isSelected:ee.isSelected,classes:((re=ee.classes)!=null?re:"")+` ML__delim-size${y}`,type:(ae=ee.type)!=null?ae:"ignore"}).wrap(he);return b&&me.setTop((1-he.scalingFactor)*ro),me}function Ce(a,y,b,E,ee){var re;let ae,he,me,ve;ae=me=ve=ie(a),he=null;let Se="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?me=ae=ve=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?me=ae=ve=8741:a==="\\uparrow"?me=ve=9168:a==="\\Uparrow"?me=ve=8214:a==="\\downarrow"?ae=me=9168:a==="\\Downarrow"?ae=me=8214:a==="\\updownarrow"?(ae=8593,me=9168,ve=8595):a==="\\Updownarrow"?(ae=8657,me=8214,ve=8659):a==="["||a==="\\lbrack"?(ae=9121,me=9122,ve=9123,Se="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,me=9125,ve=9126,Se="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(me=ae=9122,ve=9123,Se="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,me=ve=9122,Se="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(me=ae=9125,ve=9126,Se="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,me=ve=9125,Se="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,me=9116,ve=9117,Se="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,me=9119,ve=9120,Se="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,he=9128,ve=9129,me=9130,Se="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,he=9132,ve=9133,me=9130,Se="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ve=9129,me=9130,Se="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ve=9133,me=9130,Se="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ve=9133,me=9130,Se="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ve=9129,me=9130,Se="Size4-Regular"):a==="\\surd"?(ae=57345,ve=9143,me=57344,Se="Size4-Regular"):a==="\\ulcorner"?(ae=9484,me=ve=32):a==="\\urcorner"?(ae=9488,me=ve=32):a==="\\llcorner"?(ve=9492,me=ae=32):a==="\\lrcorner"&&(ae=9496,me=ae=32);const Re=fs(ae,Se),Je=Re.height+Re.depth,yt=fs(me,Se),_t=yt.height+yt.depth,gn=fs(ve,Se),sr=gn.height+gn.depth;let hn=0,$n=1;if(he!==null){const Ga=fs(he,Se);hn=Ga.height+Ga.depth,$n=2}const pr=Je+sr+hn,zn=Math.max(0,Math.ceil((y-pr)/($n*_t))),Fr=pr+zn*$n*_t;let Xr=ro;b&&(Xr=Xr*E.scalingFactor);const Zr=Fr/2-Xr,Ei=.008,ji=[];ji.push({box:new cr(ve,{fontFamily:Se})}),ji.push(-Ei);const wr=new cr(me,{fontFamily:Se});if(he===null)for(let Ga=0;Ga<zn;Ga++)ji.push({box:wr});else{for(let Ga=0;Ga<zn;Ga++)ji.push({box:wr});ji.push(-Ei),ji.push({box:new cr(he,{fontFamily:Se})}),ji.push(-Ei);for(let Ga=0;Ga<zn;Ga++)ji.push({box:wr})}ji.push(-Ei),ji.push({box:new cr(ae,{fontFamily:Se})});let Wo="";Se==="Size1-Regular"?Wo=" delim-size1":Se==="Size4-Regular"&&(Wo=" delim-size4");const js=new Xi({bottom:Zr,children:ji},{classes:Wo});return new cr(js,_e(we({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var Le=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Oe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),vt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Et=[0,1.2,1.8,2.4,3];function sn(a,y,b,E){return a===void 0||a==="."?$r(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),Le.has(a)||vt.has(a)?ge(a,y,!1,b,E):Oe.has(a)?Ce(a,Et[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var nn=[{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}],Bn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Vn=[{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 vr(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Dr(a,y,b,E){const ee={"-4":0,"-3":1,0:2}[E.mathstyle.sizeDelta];for(let re=ee;re<b.length&&b[re].type!=="stack";re++){const ae=fs(a,vr(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let he=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?he*=Math.max(Uc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(he*=Math.max(Uc[Math.max(1,E.size-1)],E.minFontScale))),he>y)return b[re]}return b[b.length-1]}function Rr(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return $r(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;vt.has(y)?ae=nn:Le.has(y)?ae=Vn:ae=Bn;const he=Dr(ie(y),b,ae,ee),me=new _i({parent:ee,mathstyle:he.mathstyle},re==null?void 0:re.style);return he.type==="small"?ce(y,me,E,_e(we({},re),{type:a})):he.type==="large"?ge(y,he.size,E,me,_e(we({},re),{type:a})):(console.assert(he.type==="stack"),Ce(y,b,E,me,_e(we({},re),{type:a})))}function Mr(a,y,b,E,ee,re){if(y===".")return $r(ee,re==null?void 0:re.classes);const ae=ro*ee.scalingFactor,he=901,me=5/ll,ve=Math.max(b-ae,E+ae),Se=Math.max(ve/500*he,2*ve-me);return Rr(a,y,Se,!0,ee,re)}function $r(a,y){const b=new cr(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new _i({parent:a,mathstyle:"textstyle"}))}var Jr=class Lp extends Tn{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{}"}},ei=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],wi=["cases","dcases","rcases"],Ji=["align","align*","aligned","gather","gathered","split"],Na=["array","subequations","eqnarray"];function da(a){return Na.concat(Ji).concat(wi).concat(ei).includes(a)}function co(a){return ei.includes(a)}function uo(a){return wi.includes(a)}function _a(a){return Ji.includes(a)}function ho(a,y,b){let E=0;for(const ve of b)"align"in ve&&(E+=1);let ee=0;const re=[];for(const ve of y){let Se=0;for(ee=Math.max(ee,Math.min(ve.length,E));Se<ve.length;){const Re=[],Je=Math.min(ve.length,Se+E);for(;Se<Je;){const yt=ve[Se];yt.length===0?Re.push([new Tn({type:"first",mode:a.mode})]):yt[0].type!=="first"?Re.push([new Tn({type:"first",mode:a.mode}),...yt]):(console.assert(!yt.slice(1).some(_t=>_t.type==="first")),Re.push(yt)),Se+=1}re.push(Re)}}re.length>0&&re[re.length-1].length===1&&re[re.length-1][0].length===1&&re[re.length-1][0][0].type==="first"&&re.pop();const ae=[];for(const ve of re){if(ve.length!==ee)for(let Se=ve.length;Se<ee;Se++)ve.push([new Tn({type:"first",mode:a.mode}),new Jr]);ae.push(ve)}let he=0,me=0;for(const ve of ae){me=0;for(const Se of ve){for(const Re of Se)Re.parent=a,Re.parentBranch=[he,me];me+=1}he+=1}return a.isDirty=!0,ae}var ui=class Dp extends Tn{constructor(y,b,E,ee={}){var re;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=(re=ee.minColumns)!=null?re:1}static fromJson(y){return new Dp(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=_e(we({},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(lc(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return lc(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,re,ae,he;const me=new _i({parent:y,mathstyle:this.mathstyleName},this.style),ve=me.getRegisterAsEm("arrayrulewidth"),Se=me.getRegisterAsEm("arraycolsep"),Re=me.getRegisterAsEm("doublerulesep"),Je=(E=(b=this.arraystretch)!=null?b:me.getRegisterAsNumber("arraystretch"))!=null?E:1;let yt=typeof this.arraycolsep=="number"?this.arraycolsep:Se;this.colSeparationType==="small"&&(yt=.2778*(new _i({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const _t=Je*Gc,gn=.7*_t,sr=.3*_t;let hn=0;const $n=[];let pr=0;const zn=this.array.length;for(let Qi=0;Qi<zn;++Qi){const wa=this.array[Qi];pr=Math.max(pr,wa.length);const Ua=new _i({parent:me,mathstyle:this.mathstyleName},this.style);let Vs=gn/Ua.scalingFactor,Gs=sr/Ua.scalingFactor;const Us={cells:[],height:0,depth:0,pos:0};for(const ws of wa){const e0=(ee=Tn.createBox(Ua,ws,{type:"ignore"}))!=null?ee:new cr(null,{type:"ignore"});Gs=Math.max(Gs,e0.depth),Vs=Math.max(Vs,e0.height),Us.cells.push(e0)}let Xs=(re=Ju(this.rowGaps[Qi]))!=null?re:0;Xs>0&&(Xs+=sr,Gs=Math.max(Gs,Xs),Xs=0),Qi<zn-1&&!co(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Gs+=me.getRegisterAsEm("jot")),Us.height=Vs,Us.depth=Gs,hn+=Vs,Us.pos=hn,hn+=Gs+Xs,$n.push(Us)}const Fr=hn/2+ro,Xr=[];for(let Qi=0;Qi<pr;Qi++){const wa=[];for(const Ua of $n){const Vs=Ua.cells[Qi];Vs.depth=Ua.depth,Vs.height=Ua.height,wa.push({box:Vs,shift:Ua.pos-Fr})}wa.length>0&&Xr.push(new Xi({individualShift:wa}))}const Zr=[];let Ei=!1,ji=!1,wr=0,Wo=!this.leftDelim;const{colFormat:js}=this;for(const Qi of js){if("align"in Qi&&wr>=Xr.length)break;if("align"in Qi)Ei?Zr.push(ha(2*yt)):(ji||Wo)&&Zr.push(ha(yt)),Zr.push(new cr(Xr[wr],{classes:"col-align-"+Qi.align})),wr++,Ei=!0,ji=!1,Wo=!1;else if("gap"in Qi){if(typeof Qi.gap=="number")Zr.push(ha(Qi.gap));else{const wa=ga(y,$n,Fr,Qi.gap);wa&&Zr.push(wa)}Ei=!1,ji=!1,Wo=!1}else if("separator"in Qi){const wa=new cr(null,{classes:"vertical-separator"});wa.height=hn,wa.setStyle("height",hn,"em"),wa.setStyle("border-right",`${ve}em ${Qi.separator} currentColor`),wa.setStyle("vertical-align",-(hn-Fr),"em");let Ua=0;ji?Ua=Re-ve:Ei&&(Ua=yt-ve),wa.left=Ua,Zr.push(wa),Ei=!1,ji=!0,Wo=!1}}Ei&&!this.rightDelim&&Zr.push(ha(yt));const Qo=new cr(Zr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Qo.caret=this.caret),this.bind(y,Qo);const Ga=Qo.height,Zo=Qo.depth,_o=this.bind(y,new cr([this.bind(y,Mr("open",(ae=this.leftDelim)!=null?ae:".",Ga,Zo,me,{isSelected:this.isSelected})),Qo,this.bind(y,Mr("close",(he=this.rightDelim)!=null?he:".",Ga,Zo,me,{isSelected:this.isSelected}))],{type:"ord"}));return _o?(_o.setStyle("display","inline-block"),this.caret&&(_o.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:_o}))):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 re=0;re<this.array[ee].length;re++)re>0&&E.push(" & "),E.push(Tn.serialize(this.array[ee][re],y));if(ee<this.array.length-1){const re=this.rowGaps[ee];re!=null&&re.dimension?E.push(`\\\\[${re.dimension} ${(b=re.unit)!=null?b:"pt"}] `):E.push("\\\\ ")}}return this.environmentName==="lines"?E.push("}"):E.push(`\\end{${this.environmentName}}`),xi(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 re of this.array[y][b])re.parent=void 0,re.parentBranch=void 0;let ee=E;(E.length===0||E[0].type!=="first")&&(ee=[new Tn({type:"first",mode:this.mode}),...E]),this.array[y][b]=ee;for(const re of ee)re.parent=this,re.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(ma(this));this.array.splice(y,0,b);for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)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(ma(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 re=this.array[E][ee];if(re)for(const ae of re)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 re of ee)re.parent=void 0,re.parentBranch=void 0;for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)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,ma(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 re of ee)re.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,ma(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 re of ee)re.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 re of ee)re.parent=void 0,re.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 re of ee)re.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 ma(a){const y=new Tn({type:"first",mode:a.mode});y.parent=a;const b=new Jr;return b.parent=a,[y,b]}function ha(a){const y=new cr(null,{classes:"arraycolsep"});return y.width=a,y}function ga(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=Tn.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Xi({individualShift:ee}).wrap(a)}var ba=class Ap extends Tn{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 _e(we({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(y){var b,E,ee,re;const ae=Tn.createBox(y,this.body,{type:"lift"});if(!ae)return null;const he=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=he,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 me=new _i({parent:y},this.style),ve=me.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),Se=new cr(null,{classes:"ML__box"});Se.height=ae.height+ve,Se.depth=ae.depth+ve,Se.setStyle("box-sizing","border-box"),Se.setStyle("position","absolute"),Se.setStyle("top",-ve+.3,"em"),Se.setStyle("left",0),Se.setStyle("height",Se.height+Se.depth,"em"),Se.setStyle("width","100%"),this.backgroundcolor&&Se.setStyle("background-color",(ee=me.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&Se.setStyle("border",`${me.getRegisterAsEm("fboxrule",2)}em solid ${(re=me.toColor(this.framecolor))!=null?re:"black"}`),this.border&&Se.setStyle("border",this.border);const Re=new cr([Se,ae],{type:"lift"});return Re.setStyle("display","inline-block"),Re.setStyle("position","relative"),Re.setStyle("line-height",0),Re.height=ae.height+ve+(he>0?he:0),Re.depth=ae.depth+ve+(he<0?-he:0),Re.setStyle("padding-left",ve,"em"),Re.setStyle("padding-right",ve,"em"),Re.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ve+Math.abs(he)))/100,"em"),Re.setStyle("margin-top",-ve,"em"),Re.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ve-he))/100,"em"),Re.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ve))/100,"em"),this.caret&&(Re.caret=this.caret),this.attachSupsub(y,{base:Re})}_serialize(y){return y.skipStyles?xi([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Tp extends Tn{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 cr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},vo=class Ip extends Tn{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Ip(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Za=class Pp extends Tn{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=Tn.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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Oi=class Bp extends Tn{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 Bp((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"?xi(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?xi(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):xi([!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 _i({parent:y},this.style);console.assert(this.body!==void 0);const re=new _i({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Tn.createBox(ee,this.body,{type:"inner"}))!=null?b:new cr(null,{type:"inner"}),he=ae.height/re.scalingFactor,me=ae.depth/re.scalingFactor,ve=[];if(this.leftDelim&&ve.push(this.bind(re,Mr("open",this.leftDelim,he,me,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Pa(ae.children,this,ee,he,me),ve.push(ae)),this.rightDelim){let yt=this.containsCaret?" ML__contains-caret":"",_t=this.rightDelim;_t==="?"&&(ee.smartFence?(_t=this.matchingRightDelim(),yt+=" ML__smart-fence__close"):_t="."),ve.push(this.bind(re,Mr("close",_t,he,me,re,{isSelected:this.isSelected,classes:yt+" ML__close",mode:this.mode,style:this.style})))}let Se=this.variant==="mleft...mright";const Re=this.leftSibling;Re&&(!Se&&Re.isFunction&&(Se=!0),!Se&&Re.type==="subsup"&&((E=Re.leftSibling)!=null&&E.isFunction)&&(Se=!0));const Je=new cr(ve,{type:Se?"close":"inner",classes:"left-right"});return Je.setStyle("margin-top",`${-ae.depth}em`),Je.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Je.caret=this.caret),this.bind(ee,Je.wrap(ee))}};function Pa(a,y,b,E,ee){if(a)for(let re=0;re<a.length;re++){const ae=a[re];ae.type==="middle"?(a[re]=y.bind(b,Mr("inner",ae.value,E,ee,b,{isSelected:y.isSelected})),a[re].caret=ae.caret,a[re].isSelected=ae.isSelected,a[re].cssId=ae.cssId,a[re].htmlData=ae.htmlData,a[re].htmlStyle=ae.htmlStyle,a[re].attributes=ae.attributes,a[re].cssProperties=ae.cssProperties):ae.children&&Pa(ae.children,y,b,E,ee)}}var au=class Op extends Tn{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=Tn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class Rp extends Tn{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Rp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},Ns=class $p extends Tn{constructor(y,b,E=!1,ee,re){var ae;super({type:"prompt",mode:(ae=re==null?void 0:re.mode)!=null?ae:"math",style:re==null?void 0:re.style,command:"\\placeholder"}),this.body=ee,this.correctness=b,this.placeholderId=y,this.locked=E,this.captureSelection=this.locked}static fromJson(y){return new $p(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 _i({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Tn.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 he=new cr(ae,{type:"ord"});he.setStyle("display","inline-block"),he.setStyle("height",ae.height+ae.depth,"em"),he.setStyle("vertical-align",-re,"em");let me="ML__prompt ";this.locked?me+=" ML__lockedPromptBox ":me+=" ML__editablePromptBox ",this.correctness==="correct"?me+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(me+=" ML__incorrectPromptBox "),this.containsCaret&&(me+=" ML__focusedPromptBox ");const ve=new cr(null,{classes:me,attributes:{part:"prompt"}});ve.height=he.height+re,ve.depth=he.depth+re,ve.width=he.width+2*ee,ve.setStyle("box-sizing","border-box"),ve.setStyle("position","absolute"),ve.setStyle("height",he.height+he.depth+2*re,"em"),ee===0&&ve.setStyle("width","100%"),ee!==0&&(ve.setStyle("width",`calc(100% + ${2*ee}em)`),ve.setStyle("top",E,"em"),ve.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ve.width=3*ee,ve.setStyle("width",`calc(100% + ${3*ee}em)`),ve.setStyle("left",-1.5*ee,"em"));let Se="";this.correctness==="incorrect"&&(Se+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),Se&&(ve.svgOverlay=Se);const Re=new cr([ve,he],{classes:"ML__prompt-atom"});return Re.setStyle("position","relative"),Re.setStyle("display","inline-block"),Re.setStyle("line-height",0),Re.height=he.height+re+.2,Re.depth=he.depth+re,Re.left=ee,Re.right=ee,Re.setStyle("height",he.height+re,"em"),Re.setStyle("top",he.depth-he.height,"em"),Re.setStyle("vertical-align",he.depth+re,"em"),Re.setStyle("margin-left",.5,"em"),Re.setStyle("margin-right",.5,"em"),this.caret&&(Re.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Re}))}_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]"),ra(ee,E)}},Yo=class Np extends Tn{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Np(y);for(const E of Tl)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new _i({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new cr(null),ae=new cr(null);return ae.height=re.height,ae.depth=re.depth,this.attachSupsub(y,{base:ae,isCharacterBox:ee.isCharacterBox(),type:"ignore"})}_serialize(y){return this.supsubToLatex(y)}};function Ea(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,re,ae;b!=null||(b={}),this.tokens=a,this.context=y instanceof _i&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new _i({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:(re=b.parseMode)!=null?re:"math",mathstyle:(ae=b.mathstyle)!=null?ae:"displaystyle",tabular:!1}}beginContext(a){var y,b,E;const ee=this.parsingContext,re={parent:ee,mathlist:[],style:we({},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=re}endContext(){this.parsingContext=this.parsingContext.parent}onError(a){this.errors.push(we({before:Is(this.tokens.slice(this.index,this.index+10)),after:Is(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 we({},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 Yo({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=$t(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?ja(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Jr({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 re=this.get();Ea(re)?(E+=re,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(Ea(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 re=10,ae=/\d/;if(this.match("'"))re=8,ae=/[0-7]/,a=!0;else if(this.match('"'))re=16,ae=/[\dA-F]/,a=!0;else if(this.match("x"))re=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 he="";for(;this.hasPattern(ae);)he+=this.get();if(!a&&(this.match(".")||this.match(",")))for(he+=".";this.hasPattern(ae);)he+=this.get();const me=a?Number.parseInt(he,re):Number.parseFloat(he);return Number.isNaN(me)?null:{number:E?-me:me,base:re===16?"hexadecimal":re===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 re=this.peek();if(re==="-")E=!E;else if(re!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const re=this.get();return re.startsWith("\\")?b?{register:re,global:!0,factor:(E?-1:1)*b.number}:E?{register:re,global:!0,factor:-1}:{register:re,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()||!Ea(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=Ot(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const he of y.params)if(he.isOptional)b.push(this.scanOptionalArgument(he.type));else{const me=this.scanArgument(he.type);me||this.onError({code:"missing-argument",arg:a}),b.push(me)}this.beginContext({tabular:y.tabular});const E=[],ee=[];let re=[],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())re.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){re.push(this.mathlist),this.mathlist=[];let he=null;this.skipWhitespace(),this.match("[")&&(he=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(he!=null?he:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(he=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(he)));while(!ae);return re.push(this.mathlist),re.length>0&&E.push(re),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=$t(y,"math"),b&&(E=this.scanArguments(b)[1]),ee=this.mathlist,this.mathlist=[]):this.parseExpression();let re;return y?(console.assert(!!b),E.unshift(this.mathlist),ee&&E.unshift(ee),re=[b.createAtom({command:y,args:E,style:this.style,mode:this.parseMode})]):re=this.mathlist,this.endContext(),re}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 Za(y,this.parseMode,this.style);return b.verbatimLatex=Is(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 Oi("",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(!Ea(a)&&!a.startsWith("\\"))return null;this.next();const y=$t(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 Oi(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 Tn({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Tn({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(Ye(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(re=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(re))):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(Ea(a)){const b=Co.createAtom(this.parseMode,a,we({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=$t(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=we({},this.style);b.variant&&(E.variant=b.variant),y=new Tn({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 re=ee.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(re)b.padding={dimension:parseInt(re[1]),unit:re[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 he=this.scanOptionalArgument("string"),me=this.scanOptionalArgument("math"),ve=Tn.serialize(me,{defaultMode:"math"});let Se=[],Re;!Re&&ve==="correct"?Re="correct":!Re&&ve==="incorrect"?Re="incorrect":ve!==""&&(Se=me);const Je=this.scanOptionalArgument("string")==="locked",yt=this.scanArgument("auto");let _t;return yt&&Array.isArray(yt)&&yt.length>0?_t=yt:yt&&typeof yt=="object"&&"group"in yt?_t=yt.group:_t=Se,he?[new Ns(he,Re,Je,_t!=null?_t:Se,{mode:this.parseMode,style:this.style})]:[new Jr({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const he=this.index,me=this.scanLiteralGroup()||this.next();if(!me)return null;if(this.context.registers[me.substring(1)]){const ve=this.scanArgument("string");ve!==null&&(this.context.registers[me.substring(1)]=ve);const Se=xi([a,Is(this.tokens.slice(he,this.index))]);return[new Tn({type:"text",value:"",verbatimLatex:Se})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=$t(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(he=>new Tn({type:"text",value:he,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new vo(a)]);const ae=this.index;if(re.definitionType==="symbol"){const he=we({},this.style);re.variant&&(he.variant=re.variant),ee=new Tn({type:re.type,command:a,style:he,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const he=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let me,ve=[];if(re.parse?ve=re.parse(this):[me,ve]=this.scanArguments(re),this.parseMode=he,re.applyMode&&!re.applyStyle&&!re.createAtom)return Ye(ve[0]);if(re.infix)return this.onError({code:"too-many-infix-commands",arg:a}),null;if(typeof re.createAtom=="function")ee=re.createAtom({command:a,args:ve,style:this.style,mode:this.parseMode}),me&&(ee.body=Ye(this.scanArgument(me)));else if(typeof re.applyStyle=="function"){const Se=we(we({},this.style),re.applyStyle(a,ve,this.context)),Re=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),me){const Je=this.style;this.style=Se;const yt=this.scanArgument(me);return this.style=Je,this.parseMode=Re,Ye(yt)}this.style=Se}else ee=new Tn({type:"mord",command:(b=re.command)!=null?b:a,style:we({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Tn&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const he=xi([a,Is(this.tokens.slice(ae,this.index))]);he&&(ee.verbatimLatex=he)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const he=this.scanSmartFence();if(he)return[ee,he]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(Ea(a)){const y=Co.createAtom(this.parseMode,a,we({},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,re={"?":(y=this.args)==null?void 0:y.call(this,"?")};for(let ae=1;ae<=ee;ae++){let he=this.scanLiteralGroup();if(!he){const me=this.index;this.scanExpression(),he=Is(this.tokens.slice(me,this.index))}re[ae]=he}return new au(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:Is(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:ja(b.def,{context:this.context,parseMode:this.parseMode,args:ae=>re[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 ja(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,he=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:(re=y==null?void 0:y.style)!=null?re:{}}),me=[];for(;!he.end();)me.push(...he.scan(()=>!1));return me}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 Fp extends Tn{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=sa.go(er.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=ja(E),this._verbatimLatex=y+"{"+b+"}",this.arg=b,this.captureSelection=!0}static fromJson(y){return new Fp(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return _e(we({},super.toJson()),{arg:this.arg})}render(y){const b=Tn.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}};wt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var er={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,re=10,ae=[];;){ee!==a?(re=10,ee=a):re--;var he=er.stateMachines[y],me=he.transitions[b]||he.transitions["*"];e:for(var ve=0;ve<me.length;ve++){var Se=er.patterns.match_(me[ve].pattern,a);if(Se){for(var Re=me[ve].task,Je=0;Je<Re.action_.length;Je++){var yt;if(he.actions[Re.action_[Je].type_])yt=he.actions[Re.action_[Je].type_](E,Se.match_,Re.action_[Je].option);else if(er.actions[Re.action_[Je].type_])yt=er.actions[Re.action_[Je].type_](E,Se.match_,Re.action_[Je].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Re.action_[Je].type_+")"];er.concatArray(ae,yt)}if(b=Re.nextState||b,a.length>0){if(Re.revisit||(a=Se.remainder),!Re.toContinue)break e}else return ae}}if(re<=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=er.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 er.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return er.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return er.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return er.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return er.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return er.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return er.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return er.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return er.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return er.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return er.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return er.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return er.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 er.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return er.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return er.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return er.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 er.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return er.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return er.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return er.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return er.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return er.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return er.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return er.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=er.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,re,ae,he,me,ve){var Se=function(hn,$n){if(typeof $n=="string")return hn.indexOf($n)!==0?null:$n;var pr=hn.match($n);return pr?pr[0]:null},Re=function(hn,$n,pr){for(var zn=0;$n<hn.length;){var Fr=hn.charAt($n),Xr=Se(hn.substr($n),pr);if(Xr!==null&&zn===0)return{endMatchBegin:$n,endMatchEnd:$n+Xr.length};if(Fr==="{")zn++;else if(Fr==="}"){if(zn===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];zn--}$n++}return zn>0,null},Je=Se(a,y);if(Je===null||(a=a.substr(Je.length),Je=Se(a,b),Je===null))return null;var yt=Re(a,Je.length,E||ee);if(yt===null)return null;var _t=a.substring(0,E?yt.endMatchEnd:yt.endMatchBegin);if(re||ae){var gn=this.findObserveGroups(a.substr(yt.endMatchEnd),re,ae,he,me);if(gn===null)return null;var sr=[_t,gn.match_];return{match_:ve?sr.join(""):sr,remainder:gn.remainder}}else return{match_:_t,remainder:a.substr(yt.endMatchEnd)}},match_:function(a,y){var b=er.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return er.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 er.go(y,"text")},"{text}":function(a,y){var b=["{"];return er.concatArray(b,er.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return er.go(y,"tex-math")},"tex-math tight":function(a,y){return er.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 er.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 er.go(y,"9,9")}},createTransitions:function(a){var y,b,E,ee,re={};for(y in a)for(b in a[y])for(E=b.split("|"),a[y][b].stateArray=E,ee=0;ee<E.length;ee++)re[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 he=0;he<ae.action_.length;he++)typeof ae.action_[he]=="string"&&(ae.action_[he]={type_:ae.action_[he]})}else ae.action_=[];for(var me=y.split("|"),ve=0;ve<me.length;ve++)if(E[ee]==="*")for(var Se in re)re[Se].push({pattern:me[ve],task:ae});else re[E[ee]].push({pattern:me[ve],task:ae})}return re},stateMachines:{}};er.stateMachines={ce:{transitions:er.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 er.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 er.concatArray(b,this.output(a)),er.concatArray(b,er.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=er.patterns.match_("orbital",a.o||""),ee=er.patterns.match_("one lowercase greek letter $",a.o||""),re=er.patterns.match_("one lowercase latin letter $",a.o||""),ae=er.patterns.match_("$one lowercase latin letter$ $",a.o||""),he=y==="-"&&(E&&E.remainder===""||ee||re||ae);he&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var me=[];return he?(er.concatArray(me,this.output(a)),me.push({type_:"hyphen"})):(E=er.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(er.concatArray(me,er.actions["d="](a,y)),er.concatArray(me,this.output(a))):(er.concatArray(me,this.output(a)),er.concatArray(me,er.actions.bond(a,y,"-")))),me},"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:er.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"&&er.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:er.go(a.a,"a"),b:er.go(a.b,"bd"),p:er.go(a.p,"pq"),o:er.go(a.o,"o"),q:er.go(a.q,"pq"),d:er.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=er.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=er.go(a.rd);var re;a.rqt==="M"?re=er.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=er.go(a.rq),E={type_:"arrow",r:a.r,rd:ee,rq:re}}for(var ae in a)ae!=="parenthesisLevel"&&ae!=="beginsWithBond"&&delete a[ae];return E},"oxidation-output":function(a,y){var b=["{"];return er.concatArray(b,er.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:er.go(y[0]),p2:er.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:er.go(y[0]),p2:er.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:er.go(y[0]),p2:er.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:er.go(y[0]),p2:er.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:er.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:er.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:er.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:er.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:er.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:er.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:er.go(y[1],"pq")}}}},bd:{transitions:er.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:er.go(y[1],"bd")}}}},oxidation:{transitions:er.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:er.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:er.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:er.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:er.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]&&(er.concatArray(b,er.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?er.concatArray(b,er.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]),er.concatArray(b,er.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=er.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=er.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:er.go(a.d,"pu"),q:er.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_:"/"}),er.concatArray(y,ee.q))}else y=er.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:er.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=er.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=er.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:er.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 sa={go:function(a,y){if(!a)return"";for(var b="",E=!1,ee=0;ee<a.length;ee++){var re=a[ee];typeof re=="string"?b+=re:(b+=sa._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&sa.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:sa._goInner(a.a),b:sa._goInner(a.b),p:sa._goInner(a.p),o:sa._goInner(a.o),q:sa._goInner(a.q),d:sa._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 "+sa._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+sa._goInner(a.p1);break;case"bond":if(y=sa._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{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+sa._goInner(a.p1)+"}_{"+sa._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+sa._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:sa._goInner(a.rd),rq:sa._goInner(a.rq)},ae=sa._getArrow(a.r);re.rd||re.rq?a.r==="<=>"||a.r==="<=>>"||a.r==="<<=>"||a.r==="<-->"?(ae="\\long"+ae,re.rd&&(ae="\\overset{"+re.rd+"}{"+ae+"}"),re.rq&&(a.r==="<-->"?ae="\\underset{\\lower2mu{"+re.rq+"}}{"+ae+"}":ae="\\underset{\\lower6mu{"+re.rq+"}}{"+ae+"}"),ae=" {}\\mathrel{"+ae+"}{} "):(re.rq&&(ae+="[{"+re.rq+"}]"),ae+="{"+re.rd+"}",ae=" {}\\mathrel{\\x"+ae+"}{} "):ae=" {}\\mathrel{\\long"+ae+"}{} ",y=ae;break;case"operator":y=sa._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 _1(a){}function E1(a){}var r0=class zp extends Tn{constructor(y){super(_e(we({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return _e(we({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new cr(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},i0=class Kp extends Tn{constructor(y){super(_e(we({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return _e(we({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=sn(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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},cd=class Hp extends Tn{constructor(y,b,E,ee){var re,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=(re=ee.shadow)!=null?re:"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 _e(we({},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=$t(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 re="",ae="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(re+=ae+'mathbackground="'+this.backgroundcolor+'"',ae=","),this.shadow&&this.shadow!=="auto"&&(re+=ae+'shadow="'+this.shadow+'"',ae=","),this.strokeWidth||this.strokeStyle!=="solid"?(re+=ae+this.borderStyle,ae=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(re+=ae+'mathcolor="'+this.strokeColor+'"',ae=","),re&&(ee+=`[${re}]`)}return ra(ee,this.bodyToLatex(y))}render(y){const b=new _i({parent:y},this.style),E=Tn.createBox(b,this.body);if(!E)return null;const ee=im(this.borderStyle),re=b.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});E.setStyle("position","relative"),E.setStyle("display","inline-block"),E.setStyle("top",re,"em"),E.setStyle("height",E.height+E.depth,"em"),E.setStyle("width",E.width,"em");const ae=new cr(null,{classes:"ML__notation"});let he=E.height+E.depth+2*re;const me=E.width+2*re;let ve="";if(this.notation.horizontalstrike&&(ve+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ve+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ve+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ve+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ve+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const _t=.03*Math.sqrt(me*me+he*he)*1,gn=E.width*_t,sr=(E.depth+E.height)*_t,hn=re+E.width;let $n=re;$n+sr-.4*gn<0&&($n=.4*gn-sr),ve+='<polygon points="',ve+=`${hn},${$n} ${hn-gn-.4*sr},${$n+sr-.4*gn} `,ve+=`${hn-.7*gn},${$n+.7*sr} ${hn-gn+.4*sr},${$n+sr+.4*gn} `,ve+=`${hn},${$n}`,ve+=`" stroke='none' fill="${this.strokeColor}"`,ve+="/>"}let Se=0;if(this.notation.phasorangle){const Je=a0(b),yt=(E.height+E.depth+2*Je+re).toString(),_t=(E.height+E.depth)/2;ve+=this.line(re.toString(),yt,(re+_t+E.width).toString(),yt),ve+=this.line(re.toString(),yt,(re+_t).toString(),(re-Je).toString()),he+=Je,Se=_t,E.left+=he/2-re}if(this.notation.longdiv){const Je=a0(b);he+=Je,ve+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const yt=.3;Se=yt+Je,E.left+=yt+Je,E.setTop(re+Je),ve+='<path d="',ve+=`M ${re} ${re} a${yt} ${(E.depth+E.height+2*Je)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Je} "`,ve+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ve+="/>"}if(ae.width=E.width+2*re+Se,ae.height=E.height+re,ae.depth=E.depth+re,ae.setStyle("box-sizing","border-box"),ae.setStyle("left",`calc(-${ee} / 2 )`),ae.setStyle("height",`${Math.floor(100*he)/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),ve){let Je="";this.shadow==="auto"&&(Je+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Je+=`filter: drop-shadow(${this.shadow})`),Je+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Je+=' stroke-linecap="round"',this.svgStrokeStyle&&(Je+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Je,ae.svgOverlay=ve}const Re=new cr([ae,E]);return Re.setStyle("position","relative"),Re.setStyle("vertical-align",re,"em"),Re.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),Re.setStyle("display","inline-block"),Re.height=ae.height,Re.depth=ae.depth,Re.width=ae.width-2*re,Re.left=re,Re.right=re,this.caret&&(Re.caret=this.caret),Re.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 im(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 ou=class Wp extends Tn{constructor(y,b,E){var ee,re;super(_e(we({},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=(re=E==null?void 0:E.continuousFraction)!=null?re:!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),we(we({},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 _i({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new _i({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),he=this.numerPrefix?new cr([new cr(this.numerPrefix),Tn.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Tn.createBox(ae,this.above,{type:"ignore"}))!=null?b:new cr(null,{type:"ignore"}),me=new _i({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ve=this.denomPrefix?new cr([new cr(this.denomPrefix),Tn.createBox(me,this.below,{type:"ignore"})]):(E=Tn.createBox(me,this.below,{type:"ignore"}))!=null?E:new cr(null,{type:"ignore"}),Se=this.hasBarLine?re.defaultRuleThickness:0;let Re,Je=0,yt;ee.isDisplayStyle?(Re=ae.metrics.num1,Je=Se>0?3*Se:7*Se,yt=me.metrics.denom1):(Se>0?(Re=ae.metrics.num2,Je=Se):(Re=ae.metrics.num3,Je=3*re.defaultRuleThickness),yt=me.metrics.denom2);const _t=[];this.isSelected&&_t.push("ML__selected");const gn=he.depth,sr=ve.height;let hn;if(Se<=0){const Zr=Re-gn-(sr-yt);Zr<Je&&(Re+=(Je-Zr)/2,yt+=(Je-Zr)/2),hn=new Xi({individualShift:[{box:he,shift:-Re,classes:[..._t,"ML__center"]},{box:ve,shift:yt,classes:[..._t,"ML__center"]}]}).wrap(ee)}else{const Zr=new cr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Zr.softWidth=Math.max(he.width,ve.width),Zr.height=Se/2,Zr.depth=Se/2;const Ei=ro+Se/2;Re<Je+gn+Ei&&(Re=Je+gn+Ei);const ji=ro-Se/2;yt<Je+sr-ji&&(yt=Je+sr-ji),hn=new Xi({individualShift:[{box:ve,shift:yt,classes:[..._t,"ML__center"]},{box:Zr,shift:-ji,classes:_t},{box:he,shift:-Re,classes:[..._t,"ML__center"]}]}).wrap(ee)}const $n=ee.isDisplayStyle?re.delim1:re.delim2,pr=this.leftDelim?this.bind(y,Rr("open",this.leftDelim,$n,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):$r(ee,"open");let zn=null;this.continuousFraction?zn=new cr(null,{type:"close"}):this.rightDelim?zn=this.bind(y,Rr("close",this.rightDelim,$n,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):zn=$r(ee,"close");const Fr=new cr([pr,hn,zn],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Xr=this.bind(y,Fr);return this.caret&&(Xr.caret=this.caret),this.attachSupsub(y,{base:Xr})}},qa=class Zp extends Tn{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),we({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new cr(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}},ud=class jp extends Tn{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new qa(b)),this.skipBoundary=!1}static fromJson(y){return new jp("")}toJson(){return super.toJson()}render(y){const b=Tn.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 Vp extends Tn{constructor(y,b){super(_e(we({},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 Vp(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 cr(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 re=(ee.height-ee.depth)/2-ro*y.scalingFactor,ae=ee.italic;ee.setTop(re);let he=ee;if(this.superscript||this.subscript){const me=(b=this.subsupPlacement)!=null?b:"auto";he=me==="over-under"||me==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new cr(this.bind(y,he),{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=$t(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)),xi(E)}},dc=class Gp extends Tn{constructor(y){const b=y.body;super(_e(we({},y),{type:"overlap",body:typeof b=="string"?[new Tn({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),we(we({},super.toJson()),y)}render(y){const b=Tn.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new cr([b,new cr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Jo=class Up extends Tn{constructor(y){var b,E,ee,re;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=(re=y.paddedLabels)!=null?re:!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?No(this.svgBody):Tn.createBox(y,this.body,{type:"ignore"});const E=new _i({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=No(this.svgAbove):this.above&&(ee=Tn.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=No(this.svgBelow):this.below&&(re=Tn.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new cr([$r(y,"open"),b,$r(y,"close")],{type:"ignore"}));let ae=om(y,{base:b,above:ee,below:re,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 he=new cr(y.base,{type:y.type});return he.setStyle("position","relative"),he}let b=0;y.above&&(b=a.metrics.bigOpSpacing5);let E=null;const ee=y.base,re=0,ae=["ML__center"];if(y.paddedAboveBelow&&ae.push("ML__label_padding"),y.below&&y.above){const he=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Xi({bottom:he,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 Xi({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Xi({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new cr(E,{type:y.type})}var dd=class Xp extends Tn{constructor(y){var b,E,ee,re;super(_e(we({},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=(re=y.smashWidth)!=null?re:!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),we(we({},super.toJson()),y)}render(y){const b=new _i({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Tn.createBox(b,this.body,{classes:"inner"});const E=Tn.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new cr(null,{classes:"fix"});return new cr([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 Xi({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},hd=class Yp extends Tn{constructor(y){var b;super(we({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 Yp(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 cr(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new cr(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 cr(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=$t(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}{${Ma(this.width)}}`:`${ee}${Ma(this.width)}`}},o0=class Jp extends Tn{constructor(y){var b;super(_e(we({},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 Jp(_e(we({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=$t(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")?ra(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:ra(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 _i({parent:y,mathstyle:"cramp"},this.style),ee=(b=Tn.createBox(E,this.body,{type:"inner"}))!=null?b:new cr(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,he=y.isDisplayStyle?hs:ae,me=new cr(null,{classes:"ML__sqrt-line",style:this.style});me.height=ae,me.softWidth=ee.width;let ve=re*(ae+he/4);const Re=Math.max(re*2*he,ee.height+ee.depth)+ve+ae,Je=new _i({parent:y},this.style),yt=this.bind(Je,new cr(Rr("inner","\\surd",Re,!1,Je,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!yt)return null;const _t=yt.height+yt.depth-ae;_t>ee.height+ee.depth+ve&&(ve=(ve+_t-(ee.height+ee.depth))/2),yt.setTop(yt.height-ee.height-ve);const gn=this.bind(y,new Xi({firstBaseline:[{box:new cr(ee)},ve-2*ae,{box:me},ae]})),sr=Tn.createBox(new _i({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!sr){const pr=new cr([yt,gn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return pr.setStyle("display","inline-block"),pr.setStyle("height",pr.height+pr.depth,"em"),this.caret&&(pr.caret=this.caret),this.bind(y,pr)}const hn=new Xi({shift:-.6*(Math.max(yt.height,gn.height)-Math.max(yt.depth,gn.depth)),children:[{box:sr}]}),$n=new cr([new cr(hn,{classes:"ML__sqrt-index",type:"ignore"}),yt,gn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return $n.height=yt.height,$n.depth=yt.depth,this.caret&&($n.caret=this.caret),this.bind(y,$n)}},sm=class extends cr{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}},cm={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function um(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;um(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),re=y.getRegisterAsEm("thickmuskip");return pd(b,(ae,he)=>{var me,ve,Se;if(!ae)return;const Re=ae.type,Je=he.isTight?(me=cm[Re])!=null?me:null:(ve=lm[Re])!=null?ve:null,yt=(Se=Je==null?void 0:Je[he.type])!=null?Se:null;yt===3&&bh(he,E),yt===4&&bh(he,ee),yt===5&&bh(he,re)}),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 qp extends Tn{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Tn({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new qp(_e(we({},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 _e(we({},super.toJson()),{tooltip:b})}render(y){const b=Tn.createBox(new _i,this.body);if(!b)return null;const E=new _i({parent:y,mathstyle:"displaystyle"},{fontSize:Ds}),ee=Yc(fd(new cr(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new cr([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},hc=class Qp extends Tn{constructor(y,b){super(_e(we({},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 cr(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 re=(b=this.subsupPlacement)!=null?b:"auto";ee=re==="over-under"||re==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:E}):this.attachSupsub(y,{base:E})}return new cr(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=$t(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)),xi(E)}};function Ol(a){if(Ae(a))return a.map(E=>Ol(E));if(typeof a=="string")return Tn.fromJson(a);a=we({},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=ui.fromJson(a)),y==="box"&&(b=ba.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=fl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=cd.fromJson(a)),y==="error"&&(b=vo.fromJson(a)),y==="extensible-symbol"&&(b=hf.fromJson(a)),y==="genfrac"&&(b=ou.fromJson(a)),y==="group"&&(b=Za.fromJson(a)),y==="latex"&&(b=qa.fromJson(a)),y==="latexgroup"&&(b=ud.fromJson(a)),y==="leftright"&&(b=Oi.fromJson(a)),y==="macro"&&(b=au.fromJson(a)),y==="macro-argument"&&(b=bs.fromJson(a)),y==="operator"&&(b=hc.fromJson(a)),y==="overlap"&&(b=dc.fromJson(a)),y==="overunder"&&(b=Jo.fromJson(a)),y==="placeholder"&&(b=Jr.fromJson(a)),y==="prompt"&&(b=Ns.fromJson(a)),y==="phantom"&&(b=dd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=hd.fromJson(a)),y==="subsup"&&(b=Yo.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=Tn.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,re,ae;if(y===null)return new Tn({type:"mord",mode:"math",command:a,value:a,style:b});const he=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ve=new Tn({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return he&&(ve.isFunction=!0),a.startsWith("\\")&&(ve.verbatimLatex=a),ve}const me=new Tn({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return he&&(me.isFunction=!0),a.startsWith("\\")&&(me.verbatimLatex=a),me}serialize(a,y){const b=gm(a,_e(we({},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((he,me)=>{var ve;he.test(a.value)&&pm[(ve=y.letterShapeStyle)!=null?ve:"tex"][me]==="it"&&(E="italic")}),E==="up"&&(E=void 0);const ee=E?b+"-"+E:b;console.assert(s0[ee]!==void 0);const[re,ae]=s0[ee];return pf[b]&&!pf[b].test(a.value)?(a.value=en(a.value,b,E),null):(l0.test(a.value)&&(a.classes+=" lcGreek"),ae&&(a.classes+=" "+ae),re)}};function gm(a,y){const{parent:b}=a[0],E=c0(b);return ya(a,"variant").map(ee=>{const re=c0(ee[0]);let ae="";re&&re!==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"}[re],console.assert(ae!==void 0));const he=xi(ee.map(me=>me._serialize(y)));return ae?ra(ae,he):he})}function c0(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 ya(a,"fontShape").map(b=>{const E=vm(b,y),{fontShape:ee}=b[0].style;let re="";return ee==="it"&&(re="\\textit"),ee==="sl"&&(re="\\textsl"),ee==="sc"&&(re="\\textsc"),ee==="n"&&(re="\\textup"),!re&&ee?`{${ra("\\fontshape",ee)}${xi(E)}}`:re?ra(re,xi(E)):xi(E)})}function bm(a,y){return ya(a,"fontSeries").map(b=>{const E=ym(b,y),{fontSeries:ee}=b[0].style;let re="";return ee==="b"&&(re="\\textbf"),ee==="l"&&(re="\\textlf"),ee==="m"&&(re="\\textmd"),ee&&!re?`{${ra("\\fontseries",ee)}${xi(E)}}`:re?ra(re,xi(E)):xi(E)})}function xm(a,y){return ya(a,"fontSize").map(b=>{var E,ee;const re=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} ${xi(re)}`:xi(re)})}function wm(a,y,b){return ya(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),he=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return he?`\\${he}{${xi(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${xi(ae)}}`:b?`\\text{${xi(ae)}}`:xi(ae)})}var u0={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,_e(we({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:he}=y;if(u0[he]?a.classes+=" "+u0[he]:he&&a.setStyle("font-family",he),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 me=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);me&&(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=me[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"}[(re=me[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Co{constructor(){super("latex")}createAtom(a){return new qa(a)}serialize(a,y){return a.filter(b=>b instanceof qa&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var Mm={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:[")",")",")",")"]}},_m={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:["=","=","=","="]}},Em={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:["<",">","",""]}},km={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"]}},Im={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 su(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 Bm={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(at()){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,re]of Object.entries(y.mapping)){if(re[0]===a)return E.key=`[${ee}]`,E;if(re[1]===a)return E.shift=!0,E.key=`[${ee}]`,E;if(re[2]===a)return E.alt=!0,E.key=`[${ee}]`,E;if(re[3]===a)return E.shift=!0,E.alt=!0,E.key=`[${ee}]`,E}return E.key=(b=Bm[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 re=0;re<4;re++){for(const[ae,he]of y)if(he[re]===a.key){ee=ae,re===3?(b=!0,E=!0):re===2?b=!0:re===1&&(E=!0);break}if(ee)break}return new KeyboardEvent(a.type,_e(we({},a),{altKey:b,shiftKey:E,code:ee}))}function $m(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,re)=>re.score-ee.score)}function Nm(a){gd=md.find(y=>a.startsWith(y.locale))}function vd(){return gd!=null?gd:md[0]}function Fm(){switch(gf()){case"apple":return mf;case"windows":return d0;case"linux":return h0}return mf}switch(gf()){case"apple":Ko(mf),Ko(_m),Ko(Tm),Ko(Lm);break;case"windows":Ko(d0),Ko(Em),Ko(Im),Ko(Dm);break;case"linux":Ko(h0),Ko(km),Ko(Pm),Ko(Am);break}Ko(Mm);function vf(a){var y;const b=/macos|ios/.test(at()),E=a.split("+");let ee="";for(const re of E)ee&&(ee+=b?"\u2009":'<span class="ML__shortcut-join">+</span>'),re.startsWith("[Key")?ee+=re.slice(4,5):re.startsWith("Key")?ee+=re.slice(3,4):re.startsWith("[Digit")?ee+=re.slice(6,7):re.startsWith("Digit")?ee+=re.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"}[re.toLowerCase()])!=null?y:re.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 fc(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 Fs=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 re=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${re+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:re}=this;re.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),re.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)),re.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,re=!1,ae=!1,he=!1;const me=new AbortController,ve=me.signal;return a.addEventListener("keydown",Se=>{if(re||Se.key==="Process"||Se.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(Se.code)){E=null;return}E=Se,ee=null,b.onKeystroke(Se)?a.textContent="":E=null},{capture:!0,signal:ve}),a.addEventListener("keypress",Se=>{re||(E&&ee&&b.onKeystroke(E),ee=Se)},{capture:!0,signal:ve}),a.addEventListener("compositionstart",Se=>{a.textContent="",re=!0,b.onCompositionStart(Se.data)},{capture:!0,signal:ve}),a.addEventListener("compositionupdate",Se=>{re&&b.onCompositionUpdate(Se.data)},{capture:!0,signal:ve}),a.addEventListener("compositionend",Se=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(Se.data))},{capture:!0,signal:ve}),a.addEventListener("beforeinput",Se=>Se.stopImmediatePropagation(),{signal:ve}),a.addEventListener("input",Se=>{var Re;if(!re&&(a.textContent="",Se.inputType!=="insertCompositionText")){if(Se.inputType==="insertFromPaste"){Se.preventDefault(),Se.stopPropagation();return}b.onInput((Re=Se.data)!=null?Re:""),Se.preventDefault(),Se.stopPropagation()}},{signal:ve}),a.addEventListener("paste",Se=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(Se)||Se.preventDefault(),Se.stopImmediatePropagation()},{signal:ve}),a.addEventListener("cut",Se=>b.onCut(Se),{capture:!0,signal:ve}),a.addEventListener("copy",Se=>b.onCopy(Se),{capture:!0,signal:ve}),a.addEventListener("blur",Se=>{var Re,Je;if(((Je=(Re=Se.relatedTarget)==null?void 0:Re._mathfield)==null?void 0:Je.element)===y){a.focus({preventScroll:!0}),Se.preventDefault(),Se.stopPropagation();return}const yt=Fs.state;if(yt==="open"||yt==="opening"){Se.preventDefault(),Se.stopPropagation();return}if(Se.relatedTarget===Se.target.getRootNode().host){Se.preventDefault(),Se.stopPropagation();return}he||ae||(he=!0,E=null,ee=null,b.onBlur(),he=!1)},{capture:!0,signal:ve}),a.addEventListener("focus",Se=>{he||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ve}),{dispose:()=>me.abort(),cancelComposition:()=>{re&&(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:Se=>a.setAttribute("aria-label",Se),setValue:Se=>{var Re;a.textContent=Se,a.style.left="-1000px",(Re=window.getSelection())==null||Re.selectAllChildren(a)},moveTo:(Se,Re)=>{a.style.top=`${Re}px`,a.style.left=`${Se}px`}}}function lu(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(rt()){const y=at(),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=su(f0(p0(b))),ee=su({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(at()),cmd:!1,win:!1});for(let re=a.length-1;re>=0;re--)if((a[re].key===E||a[re].key===ee)&&(!a[re].ifMode||a[re].ifMode===y))return a[re].command;return""}function m0(a){let y=a;return Ae(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function jm(a,y){let b=[];if(typeof y=="string"){const re=rd[y];Ae(re)?b=re.slice():re&&b.push(re)}const E=m0(y),ee=new RegExp("^"+E.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const re of a)ee.test(m0(re.command))&&b.push(re.key);return b.map(vf)}function Vm(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=at()==="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 _e(we({},a),{key:su(b)});const ee=Om(b.key,y);if(!ee)return _e(we({},a),{key:su(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 ${su(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,_e(we({},a),{key:su(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 re=Vm(ee,y);if(!re)continue;const ae=E.find(he=>he.key===re.key&&he.ifMode===re.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(re)}catch(re){re instanceof Error&&b.push(re.message)}return[E,b]}var Um=class extends oi{constructor(){super("latex")}createAtom(a){return new qa(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"}),va(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(Wa(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 re=[];for(const me of y)oe.test(me)&&re.push(new qa(me));let ae=a.at(a.position);if(ae instanceof ud&&(ae=ae.lastChild),!(ae.parent instanceof ud)){const me=new ud("");ae.parent.addChildAfter(me,ae),ae=me.firstChild}const he=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(he)):he&&(a.position=a.offsetOf(he))),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 re=Number.isFinite(y==null?void 0:y.before)?(b=y==null?void 0:y.before)!=null?b:0:a.lastOffset;for(;E<=re&&!ee;){const me=a.at(E);ee=me instanceof qa&&me.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,he=!1;for(;ae<=re&&!he;){const me=a.at(ae);he=!(me instanceof qa&&me.isSuggestion),he||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 Se of yd(E))Se.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){uu(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof qa&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof qa&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof qa&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(Se=>Se.value).join(""),he=It(a,ae);if(he.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const Se of ee)Se.isError=!0;uu(a);return}const me=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=me<0?he.length-1:me%he.length;const ve=he[a.suggestionIndex];if(ve!==ae){const Se=ee[ee.length-1];Se.parent.addChildrenAfter([...ve.slice(ae.length-ve.length)].map(Re=>new qa(Re,{isSuggestion:!0})),Se),pc(a,{interactive:!0})}Jm(a,he)}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 cu(a,y="accept",b){var E,ee;uu(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const ve=yd(a.model).filter(Se=>Se.isSuggestion);if(ve.length!==0){for(const Se of ve)Se.isSuggestion=!1;a.model.position=a.model.offsetOf(ve[ve.length-1])}if(y==="accept-suggestion")return ve.length!==0}const he=yd(a.model).filter(ve=>!ve.isSuggestion).map(ve=>ve.value).join(""),me=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(me),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(oi.insert(a.model,he,{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 Mh(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 Ym(a,y){const b=new _i({from:a.context}),E=new Tn({mode:"math",type:"root",body:ja(y,{context:b})}),ee=Yc(fd(new cr(E.render(b),{classes:"ML__base"}),b));return Jc(ee,{classes:"ML__latex"}).toMarkup()}function Jm(a,y){var b;if(y.length===0){uu(a);return}let E="";for(const[re,ae]of y.entries()){const he=ae,me=Ym(a,ae),ve=jm(a.keybindings,he).join("<br>");E+=`<li role="button" data-command="${he}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${he}</span><span class="ML__popover__command">${me}</span>`,ve&&(E+=`<span class="ML__popover__keybinding">${ve}</span>`),E+="</li>"}const ee=qm(a,`<ul>${E}</ul>`);xf()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xf()&&(ee.classList.add("is-visible"),_h(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xf(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function _h(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"){uu(a);return}if(y!=null&&y.deferred){setTimeout(()=>_h(a),32);return}const E=$s(a.field);if(!E)return;const ee=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,re=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ae=window.innerWidth-document.documentElement.clientWidth,he=window.innerHeight-document.documentElement.clientHeight,me=window.mathVirtualKeyboard.boundingRect.height,ve=document.getElementById("mathlive-suggestion-popover");E.x+ve.offsetWidth/2>re-ae?ve.style.left=`${re-ve.offsetWidth-ae}px`:E.x-ve.offsetWidth/2<0?ve.style.left="0":ve.style.left=`${E.x-ve.offsetWidth/2}px`;const Se=E.y-E.height;ee-he-me-E.y<Se?(ve.classList.add("ML__popover--reverse-direction"),ve.classList.remove("top-tip"),ve.classList.add("bottom-tip"),ve.style.top=`${E.y-E.height-ve.offsetHeight-15}px`):(ve.classList.remove("ML__popover--reverse-direction"),ve.classList.add("top-tip"),ve.classList.remove("bottom-tip"),ve.style.top=`${E.y+15}px`)}function uu(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function qm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=Mh("mathlive-suggestion-popover"),Bo("suggestion-popover"),Bo("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(cu(a,"reject"),oi.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 Eh=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(Eh===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(Eh=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,Eh!=null?Eh: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",kh()})}function kh(){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 re=[["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(re.map(he=>{try{return he.load()}catch(me){}}))).forEach(he=>document.fonts.add(he)),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 rg(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 va(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Fo(a)&&a.dirty&&(a.atomBoundsCache=new Map,pc(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new _i({from:_e(we({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Tn.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 Jc(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 re=ee.parent;for(;re;)re.containsCaret=!0,re=re.parent}else{const ee=b.getAtoms(b.selection,{includeChildren:!0});for(const re of ee)re.isSelected=!0}return ig(a,y).toMarkup()}function pc(a,y){if(!Fo(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(),re=E.classList.contains("ML__focused");re&&!ee?E.classList.remove("ML__focused"):!re&&ee&&E.classList.add("ML__focused");let ae=w0(a,y);const he=a.element.querySelector("[part=menu-toggle]");if(he&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?he.style.display="none":he.style.display=""),a.model.atoms.length<=1){const me=a.options.contentPlaceholder;me&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Va(me)}</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 he of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))he.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,re=b.getBoundingClientRect().width;let ae=Math.floor(re)/ee;if(ae=isNaN(ae)?1:ae,E.selectionIsCollapsed){_h(a,{deferred:!0});let he=E.at(E.position);for(;he&&he.type!=="prompt"&&!(he.containsCaret&&he.displayContainsHighlight);)he=he.parent;if(he!=null&&he.containsCaret&&he.displayContainsHighlight){const me=ad(a,Il(a,he),ae);if(me){me.left/=ae,me.right/=ae,me.top/=ae,me.bottom/=ae;const ve=document.createElement("div");ve.classList.add("ML__contains-highlight"),ve.style.position="absolute",ve.style.left=`${me.left+1}px`,ve.style.top=`${Math.ceil(me.top)}px`,ve.style.width=`${Math.ceil(me.right-me.left)}px`,ve.style.height=`${Math.ceil(me.bottom-me.top)}px`,b.insertBefore(ve,b.childNodes[0])}}return}for(const he of ag(sd(a,{excludeAtomsWithBackground:!0}))){he.left/=ae,he.right/=ae,he.top/=ae,he.bottom/=ae;const me=document.createElement("div");me.classList.add("ML__selection"),me.style.position="absolute",me.style.left=`${he.left}px`,me.style.top=`${he.top}px`,me.style.width=`${Math.ceil(he.right-he.left)}px`,me.style.height=`${Math.ceil(he.bottom-he.top-1)}px`,b.insertBefore(me,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=we({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]=_e(we({},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 du(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=[],re=!1,ae=!1;Ae(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ve=>ve[1].toUpperCase());const he=zs[E],me=he==null?void 0:he.target;if(me==="model"){if(!a.isSelectionEditable&&(he!=null&&he.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,re=!0}else if(me==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(zs[E]){if(!a.isSelectionEditable&&(he!=null&&he.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=zs[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return me!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||he!=null&&he.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),he!=null&&he.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&va(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&it()&&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 cg(a){return bd(a,{atIndex:a.suggestionIndex-1}),!1}Oo({complete:cu},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Oo({nextSuggestion:lg,previousSuggestion:cg},{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 ug=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;du(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(we({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 M0(a,y){var b,E,ee;const re=Rl.singleton;if(!re)return;const ae=hu(a),he=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof he=="string"&&!_0(he)||Array.isArray(he)&&he.length===0){y==null||y();return}const me={};let ve="";for(const gn of hg(he)){const sr=k0(gn),hn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);me[hn]=sr;const[$n,pr]=Th(sr);ve+=`<div id=${hn} class="item ${pr}">${$n}</div>`}const Se=document.createElement("div");Se.setAttribute("aria-hidden","true"),Se.className="MLK__variant-panel",Se.style.height="auto";const Re=Object.keys(me).length;let Je=5;Re===1?Je=1:Re===2||Re===4?Je=2:Re===3||Re===5||Re===6?Je=3:Re>=7&&Re<14&&(Je=4),Se.style.width=`calc(var(--variant-keycap-length) * ${Je} + 12px)`,Se.innerHTML=vp.createHTML(ve),Fs.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:Se}),xd=new AbortController;const{signal:yt}=xd,_t=a==null?void 0:a.getBoundingClientRect();if(_t){_t.top-Se.clientHeight<0&&(Se.style.width="auto",Re<=6?Se.style.height="56px":Re<=12?Se.style.height="108px":Re<=18?Se.style.height="205px":Se.classList.add("compact"));const gn=Math.max(0,Math.min(window.innerWidth-Se.offsetWidth,(_t.left+_t.right-Se.offsetWidth)/2)),sr=_t.top-Se.clientHeight+5;Se.style.transform=`translate(${gn}px, ${sr}px)`,Se.classList.add("is-visible"),requestAnimationFrame(()=>{Se.addEventListener("pointerup",hn=>{const $n=hu(hn.target);!($n!=null&&$n.id)||!me[$n.id]||(Mf(me[$n.id]),wd(),y==null||y(),hn.preventDefault())},{capture:!0,passive:!1,signal:yt}),Se.addEventListener("pointerenter",hn=>{const $n=hu(hn.target);!($n!=null&&$n.id)||!me[$n.id]||$n.classList.add("is-active")},{capture:!0,signal:yt}),Se.addEventListener("pointerleave",hn=>{const $n=hu(hn.target);!($n!=null&&$n.id)||!me[$n.id]||$n.classList.remove("is-active")},{capture:!0,signal:yt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:yt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:yt})})}}function wd(){xd==null||xd.abort(),xd=null,Fs.state==="open"&&Fs.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(Ve))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Ve[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Ke))y.push({class:"swatch-button",label:'<span style="background:'+Ke[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function _0(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 _i,b=new Tn({mode:"math",type:"root",body:ja(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=Yc(fd(new cr(b.render(y),{classes:"ML__base"}),y));return Jc(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=>k0(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 he=vd();he&&(E=he.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Qe.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~"]},re=(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 he of re){const me=[];for(const ve of he)/[a-z]/.test(ve)?me.push({label:ve,class:"hide-shift",shift:{label:ve.toUpperCase()},variants:_0(ve)?ve:void 0}):ve==="~"?E!=="dvorak"?me.push("[backspace]"):me.push({label:"[backspace]",width:1}):ve==="^"?me.push("[shift]"):ve===" "&&me.push("[separator-5]");ae.push(me)}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 E0(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}"`),E0(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:re}=ee,ae=dt(ee,["rows"]);y=_e(we({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=dt(ee,["markup"]);y=_e(we({},ae),{layers:Cd(a.markup)})}else y=we({},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 re of ee.rows.flat()){fu(re)&&(b=!0);const ae=re.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[re,ae]of a.normalizedLayouts.entries()){const he=ae,me=[re===y?"selected":"layer-switch"];he.tooltip&&me.push("MLK__tooltip"),he.labelClass&&me.push(...he.labelClass.split(" ")),ee+=`<div class="${me.join(" ")}"`,he.tooltip&&(ee+=" data-tooltip='"+((b=mt(he.tooltip))!=null?b:he.tooltip)+"' "),re!==y&&(ee+=`data-layer="${he.layers[0].id}"`),ee+=`>${(E=he.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 re={undo:`<div class='action ${y.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${mt("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${mt("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${mt("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${mt("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${mt("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return b+=ee.map(ae=>re[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(){Bo("virtual-keyboard"),Bo("core"),kh()}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,he)=>Mg(a,ae,he)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",Eg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",he=>{var me,ve;let Se=he.target,Re="";for(;Se&&!Re;)Re=(me=Se==null?void 0:Se.getAttribute("data-command"))!=null?me:"",Se=(ve=Se==null?void 0:Se.parentElement)!=null?ve:null;Re&&a.executeCommand(JSON.parse(Re))});yg(y.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const re=y.querySelectorAll(".MLK__layer");console.assert(re.length>0,"No virtual keyboards available");for(const ae of re)ae.addEventListener("pointerdown",he=>he.preventDefault());return a.currentLayer=a.latentLayer,y}function Mg(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(_g(a,ee)),E.push("</div>");return E.join("")}function _g(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 re=a.registerKeycap(ee),[ae,he]=Th(ee);/(^|\s)separator/.test(he)?b+=`<div class="${he}"`:b+=`<div tabindex="-1" id="${re}" class="${he}"`,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,re,ae,he,me;let ve="",Se=(b=a.class)!=null?b:"";if(y.shifted&&fu(a)&&(Se+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ve=Sd(a.shift):typeof a.shift=="object"&&(ve=a.shift.label?a.shift.label:(E=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(Se=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ve=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Re;typeof a.shift=="string"?Re=Sd(a.shift):a.shift.label?Re=a.shift.label:Re=(he=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?he:"",ve+=`<span class="MLK__shift">${Re}</span>`}a.aside&&(ve+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(Se)&&(Se+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(Se)||(Se+=" MLK__keycap"),!/\bw[0-9]+\b/.test(Se)&&a.width&&(Se+=(me={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?me:""),[ve,Se||"MLK__keycap"]}var mc={"[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 k0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!mc[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&mc[a.label]&&(b=_e(we(we({},mc[a.label]),a),{label:mc[a.label].label})),"key"in a&&a.key&&mc[a.key]&&(b=_e(we(we({},mc[a.key]),a),{key:mc[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=we(we({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=we(we({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=we(we({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=we(we({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Md;function Eg(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=hu(a.target);if(!(ee!=null&&ee.id))return;const re=b.getKeycap(ee.id);if(!re)return;console.assert(a.type==="pointerdown");const ae=new AbortController,he=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Ih(ae),{capture:!0,signal:he}),ee.addEventListener("pointerleave",Ih(ae),{capture:!0,signal:he}),ee.addEventListener("pointercancel",Ih(ae),{signal:he}),ee.addEventListener("pointerup",Ih(ae),{signal:he}),fu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Md&&clearTimeout(Md),Md=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),M0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Ih(a){return y=>{const b=hu(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"),fu(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"),fu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Md&&clearTimeout(Md),fu(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"}]):Mf(ee.shift):Mf(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mf(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 kg(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 hu(a){if(!a)return;let y=a;for(;y&&!kg(y);)y=y.parentElement;return y!=null?y:void 0}function fu(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 re=ee.target;re!=null&&re.isConnected&&setTimeout(()=>{const ae=L0();ae&&!ae.readOnly&&ae.mathVirtualKeyboardPolicy==="auto"&&je()&&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=>E0(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[re,ae]=Th(ee,{shifted:this.isShifted});E.innerHTML=window.MathfieldElement.createHTML(re),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 re=E.style.paddingBottom;this.originalContainerBottomPadding=re;const ae=ee.offsetHeight-1;E.style.paddingBottom=re?`calc(${re} + ${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)&&M0(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,re=du(ee);if(window.top!==void 0&&re!=="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:we({type:Dh,action:y},b)}));return}if(E)E.postMessage(we({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 re of ee)this.dispatchEvent(new KeyboardEvent("keydown",{key:re,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:re,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=du(y);return Ae(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=du(y)),E=y.slice(1)):b=y,b=b.replace(/-\w/g,re=>re[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(rt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ug.singleton,configurable:!0});function Ph(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Ae(E))y.scriptDepth=[E[0],E[1]];else if(typeof E=="number")y.scriptDepth=[E,E];else if(typeof E=="string"){const[re,ae]=E.split(",").map(he=>parseInt(he.trim()));y.scriptDepth=[re,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 re=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?Qe.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=St(a.macros);break;default:Ae(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=we({},a[b]):y[b]=a[b]}return y}function gc(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:Ae(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=we({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Bh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Nt,backgroundColorMap:ht,letterShapeStyle:Qe.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 $l(a,y){!a||!y||(Ae(a)?a.forEach(b=>$l(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),$l(a.body,y),$l(a.above,y),$l(a.below,y),$l(a.subscript,y),$l(a.superscript,y)))}function _f(a,y,b,E){function ee(ae,he){for(const me of re)if(me.style[ae]!==he)return!1;return!0}if(y=a.normalizeRange(y),y[0]===y[1])return!1;const re=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 re)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)}cn(["math","displaymath"],qo),cn("center",qo),wt("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 ui("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Sn("array","{columns:colspec}",(a,y,b,E)=>new ui(a,Ef(y),b,{columns:E[0],mathstyleName:"textstyle"})),Sn(["equation","equation*","subequations"],"",(a,y,b)=>new ui(a,Ef(y),b,{columns:[{align:"c"}]})),Sn(["multline","multline*"],"",qo),Sn(["align","align*","aligned","eqnarray"],"",qo),Sn("split","",qo),Sn(["gather","gathered"],"",qo),Sn(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",qo),Sn(["smallmatrix","smallmatrix*"],"[columns:colspec]",qo),Sn(["cases","dcases","rcases"],"",qo);function Ag(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function Ef(a,y=1){return Ag(a)?Array(y).fill([[new Tn({type:"first"}),new Jr]]):a.map(b=>b.length===0?[[new Tn({type:"first"})]]:b.map(E=>E.length===0?[new Tn({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Tn({type:"first"})),E)))}function qo(a,y=[[[]]],b=[],E=[]){switch(y=Ef(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new ui(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new ui(a,y,b,{mathstyleName:"textstyle"});case"center":return new ui(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new ui(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new ui(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new ui(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:vc(E[0])});case"bmatrix":case"bmatrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:vc(E[0])});case"Bmatrix":case"Bmatrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:vc(E[0])});case"vmatrix":case"vmatrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:vc(E[0])});case"Vmatrix":case"Vmatrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:vc(E[0])});case"matrix":case"matrix*":return new ui(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:vc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new ui(a,y,b,{mathstyleName:"scriptstyle",columns:vc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new ui(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 ui(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new ui(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const he of y)ee=Math.max(ee,he.length);const re=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let ae=2;for(;ae<ee;)re.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),ae+=2;return re.push({gap:0}),new ui(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new ui(a,y,b,{mathstyleName:"textstyle"})}function vc(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 ui);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof ui)){const E=a.at(a.position);if(b=E,!b.parent.parent){let ee=a.extractAtoms([a.position,a.lastOffset]),re=a.extractAtoms([0,a.position]);re.length===0&&(re=$h()),ee.length===0&&(ee=$h());let ae;return y.endsWith("column")?(ae=qo("split",[[re,ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,0,1)?bc(a,ae,0,1):a.position=a.offsetOf(E)):(ae=qo("lines",[[re],[ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,1,0)?bc(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Oi){const ee=b.parent;let re=a.extractAtoms([a.position,a.offsetOf(ee.lastChild)]),ae=a.extractAtoms([a.offsetOf(ee.firstChild),a.position]);ae.length===0&&(ae=$h()),re.length===0&&(re=$h());let he="pmatrix";const me=ee.leftDelim,ve=ee.rightDelim;me==="("&&(ve===")"||ve==="?")?he="pmatrix":(me==="["||me==="\\lbrack")&&(ve==="]"||ve==="\\rbrack"||ve==="?")?he="bmatrix":me==="\\vert"&&ve==="\\vert"?he="vmatrix":me==="\\Vert"&&ve==="\\Vert"?he="Vmatrix":(me==="{"||me==="\\lbrace")&&(ve==="."||ve==="?")&&(he="cases");const Se=qo(he,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(Se,ee),ee.parent.removeChild(ee),yc(Se,0,0)?bc(a,Se,0,0):y.endsWith("column")?yc(Se,0,1)?bc(a,Se,0,1):a.position=a.offsetOf(b):yc(Se,1,0)?bc(a,Se,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof ui?[b.parent,b.parentBranch]:[void 0,[0,0]]}function yc(a,y,b){const E=a.getCell(y,b);return!E||E.length!==2?!1:E[1].type==="placeholder"}function Ig(a,y,b,E){const ee=y.getCell(b,E);return ee?[a.offsetOf(ee[0]),a.offsetOf(ee[ee.length-1])]:-1}function bc(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Oh(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.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 Bg(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function I0(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),re=ee.type==="array"?ee:a.parentEnvironment;return re.environmentName=y,re.leftDelim=b,re.rightDelim=E,a.contentDidChange({}),!0}function P0(a,y){let b=a.at(a.position);for(;b&&!(Array.isArray(b.parentBranch)&&b.parent instanceof ui);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof ui){const E=b.parent,ee=b.parentBranch;let re;switch(y){case"row":if(E.rowCount>1){E.removeRow(ee[0]);const ae=E.getCell(Math.max(0,ee[0]-1),ee[1]);re=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));re=a.offsetOf(ae[ae.length-1])}break}re&&a.setPositionHandlingPlaceholder(re)}}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:Bg,removeRow:Og,removeColumn:Rg,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function $h(){return[new Jr]}var B0=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}};B0.maximumDepth=1e3;var $g=B0;function kf(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(pe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&pe.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}else if(/\s/.test(a.at(y).value)){let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&/\s/.test(a.at(re).value);)re+=E;if(!a.at(re))ee=re-E;else{let ae=!0;do ae=a.at(re).mode==="text"&&!/\s/.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}}else{let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&!/\s/.test(a.at(re).value);)re+=E;ee=a.at(re)?re:re-E;let ae=!0;for(;a.at(re)&&ae;)ae=a.at(re).mode==="text"&&/\s/.test(a.at(re).value),ae&&(ee=re),re+=E;ee=a.at(re)?re-2*E:re-E}return ee-(E>0?0:1)}function pu(a,y,b){var E,ee,re,ae,he,me,ve;const Se=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Re=a.at(a.position);if(y==="forward"&&(Re.type==="subsup"?(Re=Re.rightSibling,Re||(Re=a.at(a.position+1))):Re=a.at(a.position+1)),!Re)return a.announce("plonk"),!1;let Je=a.offsetOf(Re);if(Re instanceof vs)Je=kf(a,Je,y);else if(Re instanceof qa)if(Re.isSuggestion)for(console.assert(y==="forward");Re&&Re instanceof qa;)Re.isSuggestion=!1,Je=a.offsetOf(Re),Re=Re.rightSibling;else if(y==="forward"){if(Re=Re.rightSibling,!Re||!(Re instanceof qa))return a.announce("plonk"),!1;for(;Re&&Re instanceof qa&&/[a-zA-Z\*]/.test(Re.value);)Je=a.offsetOf(Re),Re=Re.rightSibling}else{if(Re=Re.leftSibling,!Re||!(Re instanceof qa))return a.announce("plonk"),!1;for(;Re&&Re instanceof qa&&/[a-zA-Z\*]/.test(Re.value);)Je=a.offsetOf(Re),Re=Re.leftSibling}else if(y==="forward"&&Re.type==="mopen"){let yt=0;do Re.type==="mopen"?yt+=1:Re.type==="mclose"&&(yt-=1),Re=Re.rightSibling;while(!Re.isLastSibling&&yt!==0);Je=a.offsetOf(Re.leftSibling)}else if(y==="backward"&&Re.type==="mclose"){let yt=0;do Re.type==="mopen"?yt+=1:Re.type==="mclose"&&(yt-=1),Re=Re.leftSibling;while(!Re.isFirstSibling&&yt!==0);Je=a.offsetOf(Re)}else if(y==="backward")if(Re.type==="first")for(;Je>0&&Re.type==="first";)Je-=1,Re=a.at(Je);else{const yt=Re.type;Re.type==="subsup"&&(Je=a.offsetOf(a.at(Je).leftSibling)),Je-=1;let _t=(ee=a.at(Je))==null?void 0:ee.type;for(;Je>=0&&_t===yt;)((re=a.at(Je))==null?void 0:re.type)==="subsup"?Je=a.offsetOf(a.at(Je).leftSibling):Je-=1,_t=a.at(Je).type}else{const{type:yt}=Re;let _t=(ae=a.at(Je))==null?void 0:ae.type;const{lastOffset:gn}=a;for(;Je<=gn&&(_t===yt||_t==="subsup");){for(;((he=a.at(Je).rightSibling)==null?void 0:he.type)==="subsup";)Je=a.offsetOf(a.at(Je).rightSibling);Je+=1,_t=(me=a.at(Je))==null?void 0:me.type}Je-=1}if((ve=b==null?void 0:b.extend)!=null&&ve){if(!a.setSelection(a.anchor,Je))return a.announce("plonk"),!1}else{if(Je===a.position)return a.announce("plonk"),!1;a.position=Je}return a.announce("move",Se),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[he,me]=g0(a);he!==void 0&&me!==void 0&&a.deleteAtoms([he,me])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let he=Nh(a,a.position,y);he<0&&(he=0),he>a.lastOffset&&(he=a.lastOffset);const me=a.setSelection(a.anchor,he);return a.mathfield.stopCoalescingUndo(),me}if(a.selectionIsPlaceholder){a.collapseSelection(y);const he=Ks(a,y);return a.mathfield.stopCoalescingUndo(),he}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,O0(a,re)||(re=Nh(a,re,y))):re=Nh(a,re,y),re<0||re>a.lastOffset){let he=!0;return a.silenceNotifications||(he=(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),he&&a.announce("plonk"),he}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function Nh(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:Nh(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 Ng(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=ru(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function Fh(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(ve=>ve.type==="prompt"&&!ve.captureSelection):b,he=ru(a.mathfield.getHTMLElement(y)).right,me=a.offsetOf(Ng(a.mathfield,ae,he))-(re?1:0);if(E){const[ve,Se]=a.selection.ranges[0];let Re;me<(ee==="up"?ve:Se)?Re={ranges:[[me,Se]],direction:"backward"}:Re={ranges:[[ve,me]],direction:"forward"},a.setSelection(Re)}else a.setPositionHandlingPlaceholder(me);a.announce(`move ${ee}`)}function Fg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const re=()=>{var me,ve;let Se=!0;return a.silenceNotifications||(Se=(ve=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(Se?"plonk":"line"),Se},ae=a.at(a.position);let he=ae;for(;he&&he.parentBranch!=="below"&&!(Array.isArray(he.parentBranch)&&he.parent instanceof ui);)he=he.parent;if(Array.isArray(he==null?void 0:he.parentBranch)&&he.parent instanceof ui){const me=he.parent;if(he.parentBranch[0]<1)return re();const ve=he.parentBranch[0]-1,Se=me.array[ve][he.parentBranch[1]];if(!Se.some(Je=>Je.type==="prompt"&&!Je.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,Se,ee,"up")}else if(he){const me=(E=he.parent.branch("above"))!=null?E:he.parent.createBranch("above");if(!me.some(Se=>Se.type==="prompt"&&Se.placeholderId)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,ee,"up")}else return re();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 re=()=>{var me,ve;let Se=!0;return a.silenceNotifications||(Se=(ve=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(Se?"plonk":"line"),Se},ae=a.at(a.position);let he=ae;for(;he&&he.parentBranch!=="above"&&!(Array.isArray(he.parentBranch)&&he.parent instanceof ui);)he=he.parent;if(Array.isArray(he==null?void 0:he.parentBranch)&&he.parent instanceof ui){const me=he.parent;if(he.parentBranch[0]+1>me.array.length-1)return re();const ve=he.parentBranch[0]+1,Se=me.array[ve][he.parentBranch[1]];if(!Se.some(Je=>Je.type==="prompt"&&!Je.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,Se,ee,"down")}else if(he){const me=(E=he.parent.branch("below"))!=null?E:he.parent.createBranch("below");if(!me.some(Se=>Se.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,ee,"down")}else return re();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 $0(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 Yo({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function N0(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 Yo({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(me){const ve=[],Se=[];return[...me.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Je,yt)=>{const _t=E(Je);_t===0?ve.push(Je):Se.push({documentOrder:yt,tabIndex:_t,node:Je})}),Se.sort((Je,yt)=>Je.tabIndex===yt.tabIndex?Je.documentOrder-yt.documentOrder:Je.tabIndex-yt.tabIndex).map(Je=>Je.node).concat(ve)}function y(me){return!(!b(me)||ee(me)||E(me)<0)}function b(me){return!(me.disabled||me.type==="hidden"&&me.tagName.toUpperCase()==="INPUT"||he(me))}function E(me){var ve;const Se=Number.parseInt((ve=me.getAttribute("tabindex"))!=null?ve:"NaN",10);return Number.isNaN(Se)?me.contentEditable==="true"||(me.nodeName==="AUDIO"||me.nodeName==="VIDEO")&&me.getAttribute("tabindex")===null?0:me.tabIndex:Se}function ee(me){return me.tagName.toUpperCase()==="INPUT"&&me.type==="radio"&&!ae(me)}function re(me,ve){for(const Se of me)if(Se.checked&&Se.form===ve)return Se;return null}function ae(me){var ve;if(!me.name)return!0;const Re=((ve=me.form)!=null?ve:me.ownerDocument).querySelectorAll('input[type="radio"][name="'+me.name+'"]'),Je=re(Re,me.form);return!Je||Je===me}function he(me){if(!rt()||me===document.activeElement||me.contains(document.activeElement))return!1;if(getComputedStyle(me).visibility==="hidden")return!0;const ve=me.getBoundingClientRect();if(ve.width===0||ve.height===0)return!0;for(;me;){if(getComputedStyle(me).display==="none")return!0;me=me.parentElement}return!1}return rt()?a(document.body):[]}function yo(a,y,b="forward"){const E=a.position;if(Array.isArray(y)){const ee=a.offsetOf(y[0]),re=a.offsetOf(y[y.length-1]);return b==="forward"?a.setSelection(ee,re):a.setSelection(re,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 re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Ks(a,y);let ae;const he=a.at(a.anchor).parentPrompt;he?y==="forward"?ae=a.offsetOf(he)+1:ae=a.offsetOf(he.leftSibling):ae=Math.max(a.position+re,0);const me=Lf(a,ae,y);if(!me||y==="forward"&&a.offsetOf(me)<ae||y==="backward"&&a.offsetOf(me)>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 Se=Wg();if(!document.activeElement||Se.length<=1)return a.announce("plonk"),!1;let Re=Se.indexOf(document.activeElement)+re;return Re<0&&(Re=Se.length-1),Re>=Se.length&&(Re=0),Se[Re].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,me),!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 re;if(typeof ee=="string"&&(re=y[ee]),!re){const he=b.subsupPlacement?N0(a):$0(a);return a.mathfield.stopCoalescingUndo(),he}E.branch(re)||E.createBranch(re);const ae=a.setSelection(a.getBranchRange(a.offsetOf(E),re));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=>pu(a,"forward"),moveToPreviousWord:a=>pu(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 re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let Je=re;for(;Je&&Je.mode==="text";)Je=Je.leftSibling;let yt=re;for(;((y=yt.rightSibling)==null?void 0:y.mode)==="text";)yt=yt.rightSibling;if(Je&&yt)return yo(a,[Je,yt])}if(re.rightSibling.mode==="text"){let Je=re;for(;Je&&Je.mode==="text";)Je=Je.rightSibling;return Je?(xs(a,(b=Je.leftSibling)!=null?b:Je),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const he=a.at(a.anchor).parentPrompt,me=he?a.offsetOf(he)+1:Math.max(a.position+1,0),ve=Lf(a,me,"forward");if(ve)return xs(a,ve);const Se=F0(a,re,Je=>Je.type==="leftright"||Je.type==="text","forward");if(Se){if(Se.mode==="text"){let Je=Se;for(;Je&&Je.mode==="text";)Je=Je.rightSibling;return yo(a,[(E=Se.leftSibling)!=null?E:Se,(ee=Je.leftSibling)!=null?ee:Je])}return yo(a,Se)}const Re=re.parent;if(Re){if(Re.type==="leftright"||Re.type==="surd")return yo(a,Re);if(re.parentBranch==="superscript"&&Re.subscript)return yo(a,Re.subscript);if(re.parentBranch==="above"&&Re.below)return yo(a,Re.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return xs(a,Re);if(re.parentBranch==="above"||re.parentBranch==="below")return yo(a,Re)}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 he=b;for(;he&&he.mode==="text";)he=he.leftSibling;let me=b;for(;((y=me.rightSibling)==null?void 0:y.mode)==="text";)me=me.rightSibling;if(he&&me)return yo(a,[he,me])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?xs(a,b):xs(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lf(a,re,"backward");if(ae)return xs(a,ae);if(E==="math"){const he=F0(a,b,ve=>ve.type==="leftright"||ve.type==="text","backward");if(he){if(he.mode==="text"){let ve=he;for(;ve&&ve.mode==="text";)ve=ve.leftSibling;return yo(a,[he,ve])}return yo(a,he)}const me=b.parent;if(me){if(me.type==="leftright"||me.type==="surd")return yo(a,me);if(b.parentBranch==="subscript"&&me.superscript)return yo(a,me.superscript);if(b.parentBranch==="below"&&me.above)return yo(a,me.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,me);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,me)}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:$0,moveToSubscript:N0},{target:"model",changeSelection:!0}),Oo({moveToNextPlaceholder:a=>zh(a,"forward"),moveToPreviousPlaceholder:a=>zh(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function F0(a,y,b,E){if(E==="forward"){let re=y.rightSibling;for(;re&&!b(re);)re=re.rightSibling;return re}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,re="";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,re+=ae.value),E-=1,y-=1}a.contentDidChange({data:re,inputType:"insertText"})}function xc(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1;const re=[];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||(re.push(Tn.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Df(a),a.contentDidChange({data:xi(re),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 jg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!wh(b))return!1;const ee=lu(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Zg(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&xc(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:he}=E.at(E.position);if(ae&&he instanceof Oi&&he.leftDelim===ae)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(re))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(ee))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(re))return xc(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){xc(E,1);const me=E.at(E.position);return me.value="\u22C5",me.style.variant="normal",me.command="\\cdot",me.verbatimLatex=void 0,E.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(re)||/\.\d$/.test(re)||/\([\d+\-.]$/.test(re))return xc(E,1),!0;if(/\([a-z][,;]$/.test(re))return xc(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(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Kh(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))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(re)&&!/(αβγ)$/.test(re))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(re))return!0}return!1}function Vg(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=Mh("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(Bo("keystroke-caption"),Bo("core"),Mh("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:re}=a,ae=p0(y);if(y.isTrusted){$m(y);const yt=vd();a.keyboardLayout!==yt.id&&(a.keyboardLayout=yt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let he,me="",ve;const Se=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")Se.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const yt=lu(y),_t=[...(E=(b=Se[Se.length-1])==null?void 0:b.keystrokes)!=null?E:[],yt];Se.push({state:re.getState(),keystrokes:_t,leftSiblings:Xg(a)});let gn=0,sr="";for(;!he&&gn<_t.length;)ve=Se.length-(_t.length-gn),sr=_t.slice(gn).join(""),he=td(Se[ve].leftSiblings,sr,a.options.inlineShortcuts),!he&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(sr)&&(he=a.options.onInlineShortcut(a,sr)),gn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(he?a.switchMode("math"):jg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),me=""))}if(!he){if(me||(me=Zm(a.keybindings,re.mode,y)),!me&&(ae==="[Enter]"||ae==="[Return]")){let yt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(yt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),yt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),yt}if((!me||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return oi.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),me="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const yt=re.at(re.position+1),_t=re.at(re.position-1);if((yt==null?void 0:yt.mode)==="text"||(_t==null?void 0:_t.mode)==="text")return oi.insert(re," ",{mode:"text"}),a.snapshot("insert-space"),a.dirty=!0,a.scrollIntoView(),!1}(ee=re.at(re.position))!=null&&ee.isDigit()&&window.MathfieldElement.decimalSeparator===","&&lu(y)===","&&(me="insertDecimalSeparator")}}if(!he&&!me){if(re.mathfield.smartFence){if(Tf(re,lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:yt}=re.at(re.position);if(yt instanceof Oi&&yt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),yt.isDirty=!0,yt.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:lu(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const _t=lu(y);if(_t==="("||_t==="{"||_t==="["){const gn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[_t],sr={"(":")","{":"\\rbrace","[":"\\rbrack"}[_t],[hn,$n]=Wa(re.selection);return a.snapshot(),re.position=$n,oi.insert(re,sr,{format:"latex"}),re.position=hn,oi.insert(re,gn,{format:"latex"}),re.setSelection(hn+1,$n+1),re.contentDidChange({data:_t,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Re=re.at(Math.max(re.position,re.anchor)),{parent:Je}=Re;if(me==="moveAfterParent"&&(Je==null?void 0:Je.type)==="leftright"&&Re.isLastSibling&&a.options.smartFence&&Tf(re,".",a.defaultStyle)&&(me="",va(a)),a.keyboardDelegate.cancelComposition(),me)a.executeCommand(me);else if(he){const yt=a.effectiveStyle;re.setState(Se[ve].state);const _t=Se[Se.length-1].keystrokes;for(const gn of _t)oi.insert(re,gn,{silenceNotifications:!0,style:yt});a.snapshot("insert-shortcut"),re.setState(Se[ve].state),re.deferNotifications({content:!0,selection:!0,data:he,type:"insertText"},()=>(oi.insert(re,he,{format:"latex",style:yt}),Df(a.model),he.endsWith(" ")&&(a.switchMode("text"),oi.insert(re," ",{style:yt,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.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=rh(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(me=>me.toUpperCase())),b.simulateKeystroke){let me=!0;for(const ve of ee)K0(a,new KeyboardEvent("keypress",{key:ve}))&&(me=!1);if(me)return}const ae=E.at(E.position),he=we(we({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(Wa(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Ch(a);for(const me of ee)oi.insert(E,me);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const me of ee)oi.insert(E,me,{style:he});a.snapshot("insert-text")}else if(E.mode==="math")for(const me of ee)Yg(a,me,he,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 Yg(a,y,b,E){const ee=a.model;let re={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[y];if(y===" "&&a.options.mathModeSpace&&(re=["insert",a.options.mathModeSpace]),re){a.executeCommand(re);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){Jg(ee),oi.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=we({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}oi.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Jg(a){a.selectionIsCollapsed||(a.deleteAtoms(Wa(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,re={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[y];if(!re)return!1;const ae=te[re],he=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[me,ve]=Wa(a.selection),Se=a.extractAtoms([me,ve]),Re=ee.addChildrenAfter([new Oi("left...right",Se,{leftDelim:re,rightDelim:he})],a.at(me));return a.setSelection(a.offsetOf(Re.firstChild),a.offsetOf(Re.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const me=ee instanceof Oi?ee.leftDelim+ee.rightDelim:"";if(me==="\\lbrace\\rbrace"||me==="\\{\\}"||me==="\\lbrace?")return a.mathfield.snapshot(),oi.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(he){if(ee instanceof Oi&&ee.firstChild===E&&(ee.leftDelim==="?"||ee.leftDelim==="."))return ee.leftDelim=re,ee.isDirty=!0,a.mathfield.snapshot(),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(!(ee instanceof Oi)){let Re=E;for(;Re&&!(Re.type==="mclose"&&Re.value===he);)Re=Re.rightSibling;if(Re){a.mathfield.snapshot();const Je=a.extractAtoms([a.offsetOf(E),a.offsetOf(Re)]);return Je.pop(),ee.addChildrenAfter([new Oi("left...right",Je,{leftDelim:re,rightDelim:he})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const me=a.offsetOf(E.lastSibling);let ve;for(ve=a.position;ve<=me;ve++){const Re=a.at(ve);if(Re instanceof Oi&&(Re.leftDelim==="?"||Re.leftDelim===".")&&H0(re,Re.rightDelim))break}const Se=a.at(ve);if(ve<=me&&Se instanceof Oi){Se.leftDelim=re,a.mathfield.snapshot();let Re=a.extractAtoms([a.position,ve-1]);return Re=Re.filter(Je=>Je.type!=="first"),Se.addChildren(Re,Se.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Oi&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const Re=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const Je of Re)ee.parent.addChildBefore(Je,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Oi&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),oi.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Re=a.offsetOf(E.lastSibling),Je=a.extractAtoms([a.position,Re]);a.at(a.position).body=Je,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let me=E;for(;me;){if(me.type==="mopen"&&me.value===ae){a.mathfield.snapshot();const yt=me.leftSibling,_t=a.extractAtoms([a.offsetOf(me.leftSibling),a.offsetOf(E)]);_t.shift();const gn=new Oi("left...right",_t,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([gn],yt),a.position=a.offsetOf(gn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}me=me.leftSibling}if(ee instanceof Oi&&E.isLastSibling&&If(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const ve=a.offsetOf(E.firstSibling);let Se;for(Se=a.position;Se>=ve;Se--){const yt=a.at(Se);if(yt instanceof Oi&&(yt.rightDelim==="?"||yt.rightDelim===".")&&If(yt.leftDelim,re))break}const Re=a.at(Se);if(Se>=ve&&Re instanceof Oi)return a.mathfield.snapshot(),Re.rightDelim=re,Re.addChildren(a.extractAtoms([Se,a.position]),Re.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Oi&&(ee.rightDelim==="?"||ee.rightDelim===".")&&If(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,ee.parent.addChildren(a.extractAtoms([a.position,a.offsetOf(E.lastSibling)]),ee.parentBranch),a.position=a.offsetOf(ee),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const Je=ee.parent;return Je instanceof Oi&&(Je.rightDelim==="?"||Je.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Je),Tf(a,re,b)):!1}return!1}function If(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),re=0;for(;E.includes(ee)&&re<100;){if(re===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),re++}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"}),va(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function qg(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=we(we({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>_f(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Oo({applyStyle:qg},{target:"mathfield",canUndo:!0,changeContent:!0});function Pf(a,y){var b,E,ee,re,ae,he,me,ve,Se,Re;const Je={};if(typeof y.color=="string"){const _t=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";_t!==y.color&&(Je.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Je.color=_t}if(typeof y.backgroundColor=="string"){const _t=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";_t!==y.backgroundColor&&(Je.verbatimBackgroundColor=(he=y.verbatimBackgroundColor)!=null?he:y.backgroundColor),Je.backgroundColor=_t}typeof y.fontFamily=="string"&&(Je.fontFamily=y.fontFamily),typeof y.series=="string"&&(Je.fontSeries=y.series),typeof y.fontSeries=="string"&&(Je.fontSeries=y.fontSeries.toLowerCase()),Je.fontSeries&&(Je.fontSeries=(me={bold:"b",medium:"m",normal:"m"}[Je.fontSeries])!=null?me:Je.fontSeries),typeof y.shape=="string"&&(Je.fontShape=y.shape),typeof y.fontShape=="string"&&(Je.fontShape=y.fontShape.toLowerCase()),Je.fontShape&&(Je.fontShape=(ve={italic:"it",up:"n",upright:"n",normal:"n"}[Je.fontShape])!=null?ve:Je.fontShape),y.variant&&(Je.variant=y.variant.toLowerCase()),y.variantStyle&&(Je.variantStyle=y.variantStyle.toLowerCase());const yt=(Se=y.size)!=null?Se:y.fontSize;return typeof yt=="number"?Je.fontSize=Math.max(1,Math.min(10,yt)):typeof yt=="string"&&(Je.fontSize=(Re={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[yt.toLowerCase()])!=null?Re:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[yt]),Je}function Bf(a){let[y,b]=Wa(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,re;let ae=a.at(y);if(!ae)return y;const he=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!pe.test(ae.value));)y+=he,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+=he,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=he,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=he,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=he,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+he))!=null&&E.isDigit();)y+=he;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let me=(ee=a.at(y))==null?void 0:ee.style;for(;me&&me.variant===ae.style.variant&&me.variantStyle===ae.style.variantStyle;)me=(re=a.at(y+he))==null?void 0:re.style,y+=he;return b==="backward"?y-1:y}return y}return y}Oo({selectGroup:a=>{const y=Bf(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=>pu(a,"forward",{extend:!0}),extendToPreviousWord:a=>pu(a,"backward",{extend:!0}),extendSelectionUpward:a=>Ks(a,"upward",{extend:!0}),extendSelectionDownward:a=>Ks(a,"downward",{extend:!0}),extendToNextBoundary:a=>pu(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>pu(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 wc=null,_d=0,Hh=class es{static start(y,b,E,ee){var re;es.element=y,(re=es.controller)==null||re.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,re=!1,ae=!1,he="none",me=!1,ve=!1;const Se=y.clientX,Re=y.clientY,Je=Date.now(),yt=E.field,_t=setInterval(()=>{me?yt.scroll({top:0,left:yt.scrollLeft-16}):ve&&yt.scroll({top:0,left:yt.scrollLeft+16})},32);function gn(){Hh.stop(),re=!1,clearInterval(_t),a.element.classList.remove("tracking"),y&&y.preventDefault()}function sr($n){if(!E.hasFocus()){gn();return}const pr=$n.clientX,zn=$n.clientY,Fr=Of($n)&&$n.pointerType==="touch"?20:5;if(Date.now()<Je+500&&Math.abs(Se-pr)<Fr&&Math.abs(Re-zn)<Fr){$n.preventDefault(),$n.stopPropagation();return}const Xr=yt.getBoundingClientRect();ve=pr>Xr.right,me=pr<Xr.left;let Zr=ee;Of($n)&&($n.isPrimary||(Zr=Ed(E,$n.clientX,$n.clientY,{bias:0})));const Ei=Ed(E,pr,zn,{bias:pr<=Se?pr===Se?0:-1:1});Zr>=0&&Ei>=0&&(E.model.extendSelectionTo(Zr,Ei),va(a)),ae&&Bf(E.model)}wc&&Math.abs(wc.x-Se)<5&&Math.abs(wc.y-Re)<5&&Date.now()<wc.time+500?(_d+=1,wc.time=Je):(wc={x:Se,y:Re,time:Je},_d=1);const hn=yt.getBoundingClientRect();if(Se>=hn.left&&Se<=hn.right&&Re>=hn.top&&Re<=hn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Ed(a,Se,Re,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const $n=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||$n?he="all":he="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),he="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),he="selection"):(a.model.position=ee,v0(a.model)?he="all":he="selection");a.defaultStyle={},y.detail===3||_d>2?(gn(),(y.detail===3||_d===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},he="all")):re||(re=!0,Hh.start(yt,y,sr,gn),(y.detail===2||_d===2)&&(ae=!0,Bf(a.model),he="all"))}a.hasFocus()||(he="none",a.focus({preventScroll:!0}))}else wc=null;a.stopCoalescingUndo(),he!=="none"&&(a.model.selectionIsCollapsed&&(he="all"),va(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 j0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=Il(a,b);if(!re)return[1/0,null];let ae=[1/0,null];if(b.hasChildren&&!b.captureSelection&&E>=re.left&&E<=re.right)for(const he of b.children){const me=j0(a,y,he,E,ee);me[0]<=ae[0]&&(ae=me)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=j0(a,new Map,a.model.root,y,b);return E}function Ed(a,y,b,E){var ee;const re=a.field.querySelector(".ML__latex").getBoundingClientRect();if(!re)return 0;if(y>re.right||b>re.bottom+8)return a.model.lastOffset;if(y<re.left||b<re.top-8)return 0;E=E!=null?E:{},E.bias=(ee=E.bias)!=null?ee:0;let ae=ev(a,y,b);const he=[];let me=ae;for(;me;)he.unshift(me),me=me.parent;for(const Se of he)if(Se.captureSelection){ae=Se;break}let ve=a.model.offsetOf(ae);if(ve<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const Se=Il(a,ae);Se&&y<(Se.left+Se.right)/2&&(ve=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ve=a.model.offsetOf(ae.leftSibling));return ve}var tv=class extends oi{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 re=JSON.parse(ee);if(re&&Array.isArray(re)){a.snapshot();const ae=Ol(re),{model:he}=a;he.selectionIsCollapsed||he.deleteAtoms(Wa(he.selection));const me=he.at(he.position);if(me.parent instanceof ui){console.assert(me.parentBranch!==void 0);const ve=[];let Se=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const _t of ae)_t.type==="first"&&Se.length>0?(ve.push(Se),Se=[_t]):Se.push(_t);Se.length>0&&ve.push(Se);let Re=Number(me.parentBranch[0]),Je=Number(me.parentBranch[1]);const yt=me.parent.maxColumns;for(;me.parent.colCount-Je<ve.length&&me.parent.colCount<yt;)me.parent.addColumn();me.parent.addChildrenAfter(ve[0],me);for(let _t=1;_t<ve.length;_t++)Je++,Je>=yt&&(Je=0,me.parent.addRowAfter(Re),Re++),me.parent.setCell(Re,Je,ve[_t])}else me.parent.addChildrenAfter(ae.filter(ve=>ve.type!=="first"),me);return he.position=he.offsetOf(ae[ae.length-1]),he.contentDidChange({inputType:"insertFromPaste"}),va(a),!0}}catch(re){}if(ee=typeof y!="string"?y.getData("application/json"):"",ee&&window.MathfieldElement.computeEngine)try{const re=JSON.parse(ee);if(typeof re=="object"&&"latex"in re&&re.latex&&(b=re.latex),!b){const ae=window.MathfieldElement.computeEngine.box(re);ae&&!ae.has("Error")&&(b=ae.latex)}b||(E="latex")}catch(re){}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 re;return[re,b]=Rs(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),va(a)),a.startRecording(),!0}return!1}insert(a,y,b){var E,ee;const re=typeof y=="string"?y:(ee=(E=window.MathfieldElement.computeEngine)==null?void 0:E.box(y).latex)!=null?ee:"";if(!b.silenceNotifications&&!a.contentWillChange({data:re,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 he=a.silenceNotifications;a.silenceNotifications=!0;const me={"?":"\\placeholder{}","@":"\\placeholder{}"};me[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Wa(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 ve=-1;me[0]?me["@"]=me[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ve=rv(a),ve>=0&&(me["@"]=a.getValue(ve,a.position,"latex"))),me[0]||(me[0]=me["?"]);let Se=!1;const Re=pr=>(Se=!0,me[pr]);let[Je,yt]=V0(a,y,Re,b);if(!yt)return!1;const _t=yt.length===1&&yt[0].type==="genfrac";_t&&ve>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(me["@"]=me["?"],Se=!1,[Je,yt]=V0(a,y,Re,b)):ve>=0&&a.deleteAtoms([ve,a.position]);const{parent:gn}=a.at(a.position),sr=gn.hasEmptyBranch("body");if(_t&&Je!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&gn instanceof Oi&&gn.leftDelim==="("&&sr){const pr=gn.parent,zn=gn.parentBranch;pr.removeChild(gn),pr.setChildren(yt,zn)}const hn=a.at(a.position);hn.parent.addChildrenAfter(yt,hn),Je==="latex"&&typeof y=="string"&&(gn==null?void 0:gn.type)==="root"&&sr&&!Se&&(gn.verbatimLatex=y),a.silenceNotifications=he;const $n=yt[yt.length-1];if(b.selectionMode==="placeholder"){const pr=yt.flatMap(zn=>[zn,...zn.children]).find(zn=>zn.type==="placeholder");if(pr){const zn=a.offsetOf(pr);a.setSelection(zn-1,zn),a.announce("move")}else $n&&(a.position=a.offsetOf($n))}else b.selectionMode==="before"||(b.selectionMode==="after"?$n&&(a.position=a.offsetOf($n)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf($n)));return a.contentDidChange({data:re,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function V0(a,y,b,E){var ee;let re,ae=[];if(typeof y!="string"||E.format==="math-json"){const he=window.MathfieldElement.computeEngine;if(!he)return["math-json",[]];[re,y]=["latex",he.box(y).latex],ae=ja(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=uc(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=ja(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=uc(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=Rs(y)),ae=ja(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae));return $l(ae,E.style),[re!=null?re:"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 Oi&&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 Oi&&b.leftDelim==="("){let E=0,ee=0,re=0;for(let ae=0;b.body[ae];ae++)b.body[ae].type==="genfrac"&&(E++,ee=ae),re++;re===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 ui)for(const b of y.cells)Wh(b)}}}function rv(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 iv=class extends oi{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"),va(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(Wa(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 re=av(y,a.mathfield.context);if($l(re,b.style),!re)return!1;const ae=a.at(a.position),he=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(he)):he&&(a.position=a.offsetOf(he))),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 "),ja(a,{context:y,parseMode:"text"})}new iv;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 ia=4,Mo=20,Ba=2*(Mo+ia),Zh=(a,y)=>`
<line x1="${a+Mo}" y1="${y+Mo}"
x2="${a>y?a+Mo:7*Mo+10*ia}"
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
<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+Mo}" y1="${y+Mo}"
x2="${a>y?a+Mo:7*Mo+10*ia}"
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
<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>`,jh=(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*Mo+10*ia+5} ${8*Mo+10*ia+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Ba+ia}"
height="${3*Ba}"
width="${Ba}"
rx="${Ba/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Ba+ia}"
y="0"
height="${Ba}"
width="${3*Ba}"
rx="${Ba/2}"/>
<g data-command='"moveDown"'>
${jh(2*(ia+Ba),2*ia+3*Ba,0)}
</g>
<g data-command='"moveUp"'>
${jh(2*(ia+Ba),2*ia+Ba,180)}
</g>
<g data-command='"moveToNextWord"'>
${jh(2*ia+3*Ba,2*(ia+Ba),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${jh(2*ia+Ba,2*(ia+Ba),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zh(2*ia+Ba,ia)}
</g>
<g data-command='"removeColumn"'>
${U0(2*ia+2*Ba,ia)}
</g>
<g data-command='"addColumnAfter"'>
${Zh(2*ia+3*Ba,ia)}
</g>
<g data-command='"addRowBefore"'>
${Zh(ia,2*ia+Ba)}
</g>
<g data-command='"removeRow"'>
${U0(ia,2*ia+2*Ba)}
</g>
<g data-command='"addRowAfter"'>
${Zh(ia,2*ia+3*Ba)}
</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>`,cv=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>`,uv=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:cv,Bmatrix:X0,vmatrix:uv,Vmatrix:dv},$f={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(_t=>{(!ee||_t.length>ee)&&(ee=_t.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Mh("mathlive-environment-popover"),Bo("environment-popover"),Bo("core"),re.setAttribute("aria-hidden","true"));let ae;const he=re.querySelector(".MLEP__environment-controls");he?ae=he:(ae=document.createElement("div"),re.innerHTML="",re.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 me=[],ve="";const Se=a.model.parentEnvironment.environmentName;if(co(Se)){const _t=gv(Se);ve=Rf[_t]("active");const gn=Rf,{[_t]:sr}=gn,hn=dt(gn,[Ne(_t)]);me=Object.values(hn).map($n=>$n("inactive"))}else if(uo(Se)){const _t=vv(Se);ve=$f[_t]("active");const gn=$f,{[_t]:sr}=gn,hn=dt(gn,[Ne(_t)]);me=Object.values(hn).map($n=>$n("inactive"))}else _a(Se)&&(ve=Rf.matrix("active"),me=Object.values($f).map(_t=>_t("inactive")));const Re=document.createElement("div");Re.className="MLEP__environment-delimiter-controls",Re.style.display="flex",Re.style.flexDirection="column",Re.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ve}
${me.join("")}
</div>`,ve&&ae.appendChild(Re),ae.querySelectorAll("[data-command]").forEach(_t=>{const gn=_t.dataset.command;let sr=gn;try{sr=JSON.parse(gn)}catch(hn){}_t.addEventListener("mousedown",hn=>hn.preventDefault()),sr&&_t.addEventListener("click",()=>a.executeCommand(sr))});const yt=(b=a.field)==null?void 0:b.getBoundingClientRect();yt&&(re.style.top=`${window.scrollY+(yt.top-re.clientHeight-15)}px`,re.style.left=`${yt.left+20}px`,re.classList.add("is-visible"))}function Nf(){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 Vh(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&da(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Nf()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function Y0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function J0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function Ff(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 re=(b=Y0(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(),he=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let me=Math.min(he,(E=y.height)!=null?E:ae.height),ve=Ff(y.location.y,me,y.verticalPos,re);ve+me>window.innerHeight-8&&(y.alternateLocation?(ve=Ff(y.alternateLocation.y,me,y.verticalPos,re),ve+me>window.innerHeight-8&&(ve=void 0)):ve=void 0),Number.isFinite(ve)||(ve=Math.max(8,window.innerHeight-8-me),8+me>window.innerHeight-8&&(a.style.bottom="8px")),me=Math.min(ve+me,window.innerHeight-8)-ve;const Se=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Re=Math.min(Se,(ee=y.width)!=null?ee:ae.width),Je=Ff(y.location.x,Re,y.horizontalPos,re);Je+Re>window.innerWidth-8&&(y.alternateLocation?(Je=yv(y.alternateLocation.x,Re,y.verticalPos,re),Je+Re>window.innerWidth-8&&(Je=void 0)):Je=void 0),Number.isFinite(Je)||(Je=Math.max(8,window.innerWidth-8-Re),8+Re>window.innerWidth-8&&(a.style.right="8px")),Re=Math.min(Je+Re,window.innerWidth-8)-Je,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Je-Re).toString()}px`:a.style.left=`${Math.ceil(Je).toString()}px`,a.style.top=`${Math.ceil(ve).toString()}px`,me!==ae.height&&(a.style.height=`${Math.ceil(me).toString()}px`),Re!==ae.width&&(a.style.width=`${Math.ceil(Re).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function mu(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 q0={};function Hf(a){let y=q0[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,q0[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,mu(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=gu(ee.checked,a))!=null?y:!1)),(Ws(ee)||mu(ee))&&(this.enabled=(b=gu(ee.enabled,a))!=null?b:!0,this.visible=(E=gu(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)||mu(ee))&&(this.label=gu(ee.label,a),this.tooltip=gu(ee.tooltip,a),this.ariaLabel=gu(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)||mu(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=Y0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:J0(b,"trailing",E),y:b.top-4},alternateLocation:{x:J0(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 re="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),he=this.element.getBoundingClientRect();ae.left<he.left+he.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function gu(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 Mu{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(ve=>ve.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ve=>ve.visible&&ve.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ve=>ve.updateState(y));let ae,he=0;for(const ve of this._menuItems)ve.type==="heading"?(ae&&he===0&&(ae.visible=!1),ae=ve,he=0):ve.type==="divider"&&ae?(ae.visible=he>0,ae=void 0,he=0):ae&&ve.visible&&(he+=1);ae&&(ae.visible=he>0);let me=!0;for(const ve of this._menuItems)ve.type==="divider"?(ve.visible=!me,me=!0):ve.visible&&(me=!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,re;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}):(re=this._element)==null||re.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),re=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(re===Math.abs(y))return this._menuItems[ee];re+=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 Mu._collator||(Mu._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Mu._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(he=>he.type!=="divider"&&he.visible&&he.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(he=>he.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(he=>Mu.collator.compare(y,he.label.substring(ae,y.length))===0))!=null?b:null,ae++;return re}show(y){return!this.visible||!y.container?!1:(this.updateElement(),y.container.appendChild(this.element),jt()&&(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,re;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),jt()&&((y=this._element)!=null&&y.popover)&&this.element.hidePopover(),(E=(b=this.parentMenu)==null?void 0:b.element)==null||E.focus(),(re=(ee=this._element)==null?void 0:ee.parentNode)==null||re.removeChild(this._element)}set openSubmenu(y){var b,E,ee,re;const ae=y!==null;((b=this.activeMenuItem)==null?void 0:b.type)==="submenu"&&((E=this.activeMenuItem.element)==null||E.setAttribute("aria-expanded",ae.toString())),(re=(ee=this.activeMenuItem)==null?void 0:ee.element)==null||re.classList.toggle("is-submenu-open",ae),this.isSubmenuOpen=ae}},np=class rm 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(rp),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=fc(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=fc(y));let re=!0;const ae=this.activeSubmenu,he=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":he==null||he.select(fc(y));break;case"ArrowRight":if((he==null?void 0:he.type)==="submenu")he.select(fc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!he)ae.activeMenuItem=ae.firstMenuItem;else{const me=(b=ae.getMenuItemColumn(he))!=null?b:-1;if(me>=0&&me<((E=ae.columnCount)!=null?E:1)-1){const ve=ae.nextMenuItem(1);ve&&(ae.activeMenuItem=ve)}}break;case"ArrowLeft":if(ae===this.rootMenu)he||(ae.activeMenuItem=ae.firstMenuItem);else if((he&&(ee=ae.getMenuItemColumn(he))!=null?ee:-1)<=0||!he){ae.hide();const ve=ae.parentMenu.activeMenuItem;if(ve){const{element:Se}=ve;Se==null||Se.focus(),Se==null||Se.classList.remove("is-submenu-open")}}else{const ve=ae.nextMenuItem(-1);ve&&(ae.activeMenuItem=ve)}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 me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else re=!1}re&&(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 Fs.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),Fs.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),Fs.state==="open"&&Fs.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(_e(we({},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,Fs.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(y){this.cancelDelayedOperation();const b=rm.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 rp(a){return zf(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(Ws(a)||mu(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||Ws(a)&&typeof a.checked=="function"?!0:mu(a)?a.submenu.some(rp):!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 re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Gh.MAX_DISTANCE)},Gh.DELAY),ae=new AbortController,he=ae.signal;for(const me of["pointermove","pointerup","pointercancel"])window.addEventListener(me,ve=>{if(ve.type==="pointerup"||ve.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ve.type==="pointermove"){const Se=xh(ve);Se&&(ee=Se)}},{passive:!0,signal:he})})}function ip(a,y,b){return zl(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:xh(E),modifiers:fc(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:fc(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};wt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(_e(we({},a),{body:Ye(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),wt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=an(Ye(a.args[0]));return new z(_e(we({},a),{body:Ye(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),wt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(_e(we({},a),{body:Ye(a.args[0]),svgAccent:"overarc"}))}),wt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:Ye(a.args[0]),svgBelow:"underarc"}))}),wt("utilde","{body:auto}",{createAtom:a=>{const y=Ye(a.args[0]),b=an(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Jo(_e(we({},a),{body:y,svgBelow:E,boxType:kl(y)}))}}),wt("^","{:string}",{createAtom:a=>{var y;return new Tn(_e(we({},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:"^"}))}}),wt("`","{:string}",{createAtom:a=>{var y;return new Tn(_e(we({},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:"`"}))}}),wt("'","{:string}",{createAtom:a=>{var y;return new Tn(_e(we({},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:"'"}))}}),wt('"',"{:string}",{createAtom:a=>{var y,b;return new Tn(_e(we({},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]:'"'}))}}),wt(".","{:string}",{createAtom:a=>{var y,b;return new Tn(_e(we({},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]:"."}))}}),wt("=","{:string}",{createAtom:a=>{var y,b;return new Tn(_e(we({},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]:"="}))}}),wt("~","{:string}",{createAtom:a=>{var y;return new Tn(_e(we({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"}))}}),wt("c","{:string}",{createAtom:a=>{var y;return new Tn(_e(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),wt("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 he of ae){const me=he.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(me)ee.strokeWidth=me[1],ee.strokeStyle=me[2],ee.strokeColor=me[3];else{const ve=he.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ve&&(ve[1]==="mathbackground"?ee.backgroundcolor=ve[2]:ve[1]==="mathcolor"?ee.strokeColor=ve[2]:ve[1]==="padding"?ee.padding=ve[2]:ve[1]==="shadow"&&(ee.shadow=ve[2]))}}ee.strokeStyle==="dashed"?ee.svgStrokeStyle="5,5":ee.strokeStyle==="dotted"&&(ee.svgStrokeStyle="1,5")}ee.borderStyle=`${ee.strokeWidth} ${ee.strokeStyle} ${ee.strokeColor}`;const re={};return((b=E[0])!=null?b:"").split(/[, ]/).filter(ae=>ae.length>0).forEach(ae=>{re[ae.toLowerCase()]=!0}),new cd(a.command,Ye(E[2]),re,ee)}}),wt("cancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),wt("bcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),wt("xcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),wt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Jo(_e(we({},a),{body:Ye((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),wt("overbrace","{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),wt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),wt(["underbrace"],"{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),wt(["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,re;return new Jo(_e(we({},a),{svgBody:a.command.slice(1),above:((b=Ye((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:Ye((E=a.args)==null?void 0:E[1]),below:(re=Ye((ee=a.args)==null?void 0:ee[0]))!=null?re: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)}`}),wt(["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 hc(a.command.slice(1),_e(we({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),wt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],_e(we({},a),{limits:"over-under",variant:"main"}))}),wt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hc(a.command.slice(1),_e(we({},a),{limits:"over-under",variant:"main"}))}),wt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hc(a.command.slice(1),_e(we({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),wt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Tn(_e(we({},a),{body:Ye(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 cr("\xB0",{style:_e(we({},a.style),{variant:"normal",variantStyle:"up"})});return new cr([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),wt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(_e(we({},a),{body:Ye(a.args[1]),index:a.args[0]?Ye(a.args[0]):void 0}))}),wt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=we({},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 ou(E[0]?Ye(E[0]):[new Jr],E[1]?Ye(E[1]):[new Jr],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}`:ra(a.command,b,E)}}),wt(["brace","brack"],"",{infix:!0,createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),_e(we({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>xi([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),wt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ou(Ye(E[0]),Ye(E[1]),_e(we({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>xi([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),wt(["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 ou(Ye(E[0]),Ye(E[1]),_e(we({},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)}`}),wt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),_e(we({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),wt(["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)],_e(we({},a),{limits:"auto",variant:"main"}))}),wt("smallint","",{ifMode:"math",createAtom:a=>new hc("\u222B",_e(we({},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"};wt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,_e(we({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),wt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],_e(we({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),wt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(_e(we({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),wt("the","{:value}",{createAtom:a=>new Tn(_e(we({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new _i({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new cr(((b=Ma(re))!=null?b:"").split("").map(ae=>new cr(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:we({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=Ma(a.args[0]))!=null?y:"\\relax"}`}}),wt("mathtip","{:auto}{:math}",{createAtom:a=>new ff(_e(we({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Tn.serialize([a.tooltip],_e(we({},y),{defaultMode:"math"}))}}`}),wt("texttip","{:auto}{:text}",{createAtom:a=>new ff(_e(we({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Tn.serialize([a.tooltip],_e(we({},y),{defaultMode:"text"}))}}`}),wt("error","{:math}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),wt("ensuremath","{:math}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(_e(we({},y),{defaultMode:"math"}))}}`}),wt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),wt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),wt("boxed","{content:math}",{createAtom:a=>new ba(_e(we({},a),{body:Ye(a.args[0]),framecolor:{string:"black"}}))}),wt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Ma(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),wt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ba(_e(we({},a),{body:Ye(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(_e(we({},y),{defaultMode:"text"})):ra(a.command,(b=Ma(a.framecolor))!=null?b:"",(E=Ma(a.backgroundcolor))!=null?E:"",a.bodyToLatex(_e(we({},y),{defaultMode:"text"})))}}),wt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=Ye(a.args[1]);return b?new ba(_e(we({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ba(_e(we({},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 re=[];a.padding&&re.push((b=Ma(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Ma(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return ra(ee,a.bodyToLatex(y))}}),wt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=new _i({parent:y,mathstyle:a.command.slice(1)},a.style),E=Tn.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):`{${xi([a.command,a.bodyToLatex(y)])}}`}),wt(["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]})}),wt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),wt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),wt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),wt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),wt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),wt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Tn(_e(we({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),wt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),wt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),wt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),wt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),wt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),wt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),wt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),wt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),wt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),wt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),wt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),wt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),wt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),wt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),wt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),wt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),wt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),wt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),wt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),wt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),wt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),wt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),wt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),wt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),wt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),wt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),wt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),wt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),wt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),wt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),wt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),wt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Tn(_e(we({},a),{type:"mord",body:Ye(a.args[0]),mode:"math"})),serialize:(a,y)=>ra("\\mbox",a.bodyToLatex(_e(we({},y),{defaultMode:"text"})))}),wt("text","{:text}",{ifMode:"math",applyMode:"text"}),wt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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:""})}}),wt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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}}),wt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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}}),wt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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}}),wt("em","{:rest}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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"})}),wt("emph","{:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(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}};wt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(_e(we({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),wt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(_e(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),wt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(_e(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),wt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Tn(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===sc||E===Ps)&&(b=1),(E===ul||E===io)&&(b=2),(E===Po||E===Ha)&&(b=3);const ee=Ye(a.args[b]);return Tn.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Tn.serialize(a.args[0],y)}}{${Tn.serialize(a.args[1],y)}}{${Tn.serialize(a.args[2],y)}}{${Tn.serialize(a.args[3],y)}}`}),wt("mathop","{:auto}",{createAtom:a=>new Tn(_e(we({},a),{type:"mop",body:Ye(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Tn.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 cr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(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)),xi(b)}}),wt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Tn(_e(we({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:Ye(a.args[0])}))}),wt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=Ye(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 Tn(_e(we({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Tn.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 cr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(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)),xi(b)}}),wt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Tn(_e(we({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Ma((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)}}),wt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Tn(a),render:(a,y)=>{var b,E,ee;const re=new _i({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),he=re.toEm((E=a.args[1])!=null?E:{dimension:10}),me=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ve=new cr(null,{classes:"rule",type:"ord"});return ve.width=he,ve.height=me+ae,ve.depth=-ae,ve.setStyle("border-right-width",he,"em"),ve.setStyle("border-top-width",me,"em"),ve.setStyle("border-color",a.style.color),ve.setStyle("vertical-align",ae,"em"),a.isSelected&&ve.setStyle("opacity","50%"),a.bind(re,ve),a.caret&&(ve.caret=a.caret),ve.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Ma(a.args[0])}]`:""}{${Ma(a.args[1])}}{${Ma(a.args[2])}}`}),wt(["overline","underline"],"{:auto}",{createAtom:a=>new Tn(_e(we({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new _i({parent:y,mathstyle:"cramp"},a.style),ee=Tn.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new cr(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let he;return b==="overline"?he=new Xi({shift:0,children:[{box:ee},3*re,{box:ae},re]}):he=new Xi({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(he.caret=a.caret),new cr(he,{classes:b,type:"ignore"})}}),wt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new Jo(_e(we({},a),{above:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),wt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new Jo(_e(we({},a),{below:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),wt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[2]);return new Jo(_e(we({},a),{above:Ye(a.args[0]),below:Ye(a.args[1]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),wt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:Ye(a.args[2]),above:Ye(a.args[1]),below:Ye(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),wt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(_e(we({},a),{body:Ye(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}))}}),wt(["vphantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:Ye(a.args[0]),isInvisible:!0,smashWidth:!0}))}),wt(["hphantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:Ye(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),wt(["phantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:Ye(a.args[0]),isInvisible:!0}))}),wt("not","{:math}",{createAtom:a=>{const y=Ye(a.args[0]);return y.length===0?new Tn(_e(we({},a),{type:"mrel",value:"\uE020"})):new Tn(_e(we({},a),{body:[new dc(_e(we({},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{${Tn.serialize(b.group,y)}}`:`\\not${Tn.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":kl(Ye(a.args[0])),ee=Tn.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),wt(["ne","neq"],"",{createAtom:a=>new Tn(_e(we({},a),{type:"mrel",body:[new dc(_e(we({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Tn(_e(we({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),wt("rlap","{:auto}",{createAtom:a=>new dc(_e(we({},a),{body:Ye(a.args[0]),align:"right"}))}),wt("llap","{:auto}",{createAtom:a=>new dc(_e(we({},a),{body:Ye(a.args[0]),align:"left"}))}),wt("mathrlap","{:math}",{createAtom:a=>new dc(_e(we({},a),{body:Ye(a.args[0]),align:"left"}))}),wt("mathllap","{:math}",{createAtom:a=>new dc(_e(we({},a),{body:Ye(a.args[0]),align:"left"}))}),wt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ba(_e(we({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raisebox",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),wt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ba(_e(we({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raise",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),wt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ba(_e(we({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=Xo(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return ra("\\lower",(E=Ma(Xo((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),Be("0123456789/@.?!"),lt(65,90),lt(97,122),Be([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Be([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Be([["\\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]]),Be([["\\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"),Be([["\\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"]]),Be([["\\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"]]),Be([["\\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"),Be([["+",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"),Be([["\\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"),Be([["\\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]]),Be([["=",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"),Be([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Be([["\\wp",8472],["\\aleph",8501]]),Be([["\\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"),Be([["\\ ",160],["~",160]],"space"),wt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),wt("space","",{createAtom:a=>new hd(a)}),Be([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Be([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Be([["\\/",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 qi(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,he,me,ve,Se,Re,Je,yt;let _t=!1;y=y!=null?y:a.atoms.length;let gn="",sr="",hn=a.atoms[a.index];const $n=(ee=(E=hn.style)==null?void 0:E.variant)!=null?ee:"",pr=(ae=(re=hn.style)==null?void 0:re.variantStyle)!=null?ae:"";let zn="";if($n||pr){const Xr=en(hn.value,(he=hn.style)==null?void 0:he.variant,(me=hn.style)==null?void 0:me.variantStyle);if(Xr!==hn.value)return a.index+=1,gn=`<mi${qi(hn.id,b)}>${Xr}</mi>`,ml(gn,a,b)||(a.mathML+=gn,a.lastType="mi"),!0;zn=(ve={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"}[pr+$n])!=null?ve:"",zn=` mathvariant="${zn}"`}const Fr={"\\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(hn.command==="!")return a.index+=1,gn="<mo>!</mo>",ml(gn,a,b)||(a.mathML+=gn,a.lastType="mo"),!0;if(Fr[hn.command]){a.index+=1;let Xr=`<mi${qi(hn.id,b)}${zn}>${Fr[hn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Xr=Uh+Xr),ml(Xr,a,b)||(a.mathML+=Xr,a.lastType="mi"),!0}if(hn.command==="\\operatorname")sr=vu(hn.body),a.index+=1;else if($n||pr)for(;a.index<y&&(hn.type==="mord"||hn.type==="macro")&&!hn.isDigit()&&$n===((Re=(Se=hn.style)==null?void 0:Se.variant)!=null?Re:"")&&pr===((yt=(Je=hn.style)==null?void 0:Je.variantStyle)!=null?yt:"");)sr+=vu([hn]),a.index+=1,hn=a.atoms[a.index];else(hn.type==="mord"||hn.type==="macro")&&!hn.isDigit()&&(sr+=vu([hn]),a.index+=1);if(sr.length>0){_t=!0,gn=`<mi${zn}>${sr}</mi>`;const Xr=a.lastType;gn.endsWith(">f</mi>")||gn.endsWith(">g</mi>")?(gn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(gn)?"mo":"mi",ml(gn,a,b)||((Xr==="mi"||Xr==="mn"||Xr==="mtext"||Xr==="fence")&&(gn=Uh+gn),a.mathML+=gn)}return _t}function _v(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function Ev(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.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 re=y.lastType;y.lastType="";const ae=Ri(ee.superscript,b);y.lastType="";const he=Ri(ee.subscript,b);if(y.lastType=re,!ae&&!he)return!1;let me="";return ae&&he?me=`<msubsup>${a}${he}${ae}</msubsup>`:ae?me=`<msup>${a}${ae}</msup>`:he&&(me=`<msub>${a}${he}</msub>`),y.mathML+=me,y.lastType="",!0}function kv(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 ${qi(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="",re=Ev(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+qi(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&_v(a)&&(re=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="",re="";if(a.index<y&&a.atoms[a.index].type==="mopen"){let ae=!1,he=0;const me=a.index;let ve=-1,Se=me+1;for(;Se<y&&!ae;)a.atoms[Se].type==="mopen"?he+=1:a.atoms[Se].type==="mclose"&&(he-=1),he===-1&&(ae=!0,ve=Se),Se+=1;ae&&(ee="<mrow>",ee+=Sc(a.atoms[me],b),ee+=Ri(a.atoms,b,me+1,ve),ee+=Sc(a.atoms[ve],b),ee+="</mrow>",a.index=ve+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=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Av(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",re="";const ae=a.atoms[a.index];if(!ae)return!1;const he={"\\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(he[ae.command]){a.index+=1;const me=`<mo${qi(ae.id,b)}>${he[ae.command]}</mo>`;return ml(me,a,b)||(a.mathML+=me,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wf(a.atoms[a.index],b),a.index+=1,re="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 me=Sc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+me,ee+=Ri(ae.subscript,b),ee+=Ri(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+me,ee+=Ri(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+me,ee+=Ri(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const me=a.atoms[a.index],ve=me.value==="\\operatorname",Se=ve?'<mi class="MathML-Unit"'+qi(me.id,b)+">"+vu(me.value)+"</mi>":Sc(me,b);ee+=Se,!ve&&!/^<mo>(.*)<\/mo>$/.test(Se)?(ee+=lp,re="applyfunction"):re=ve?"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=re)),E}function Ri(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 Tn)ee.mathML=Wf(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(kv(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Av(ee,E,y)||Dv(ee,E,y))re+=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)?re+=1:ae.length>0&&(ee.mathML+=ae,re+=1)}re>1&&(ee.mathML="<mrow>"+ee.mathML+"</mrow>")}return ee.mathML}function Sc(a,y){let b="";const E=vu(a.value);return E&&(b="<mo"+qi(a.id,y)+">"+E+"</mo>"),b}function vu(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,re,ae,he,me,ve,Se,Re,Je,yt,_t,gn,sr,hn,$n,pr,zn,Fr,Xr,Zr;if(a.mode==="text")return`<mi${qi(a.id,y)}>${a.value}</mi>`;const Ei={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"},ji={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let wr="",Wo="",js,Qo,Ga,Zo,_o,Qi;const{command:wa}=a;if(a.command==="\\error")return`<merror${qi(a.id,y)}>${Ri(a.body,y)}</merror>`;const Ua={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Vs={"\\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":wr=Ri(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(wr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(wr+="<mo>"+(Ua[a.leftDelim]||a.leftDelim)+"</mo>")),wr+="<mtable",a.colFormat){for(wr+=' columnalign="',Ga=0;Ga<a.colFormat.length;Ga++)a.colFormat[Ga].align&&(wr+={l:"left",c:"center",r:"right"}[a.colFormat[Ga].align]+" ");wr+='"'}for(wr+=">",Qo=0;Qo<a.array.length;Qo++){for(wr+="<mtr>",js=0;js<a.array[Qo].length;js++)wr+="<mtd>"+Ri(a.array[Qo][js],y)+"</mtd>";wr+="</mtr>"}wr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(wr+="<mo>"+(Ua[a.leftDelim]||a.rightDelim)+"</mo>"),wr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(wr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(wr+="<mo"+qi(a.id,y)+">"+(Ua[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(wr+="<mfrac>",wr+=Ri(a.above,y)||"<mi>&nbsp;</mi>",wr+=Ri(a.below,y)||"<mi>&nbsp;</mi>",wr+="</mfrac>"):(wr+="<mtable"+qi(a.id,y)+">",wr+="<mtr>"+Ri(a.above,y)+"</mtr>",wr+="<mtr>"+Ri(a.below,y)+"</mtr>",wr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(wr+="<mo"+qi(a.id,y)+">"+(Ua[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(wr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(wr+="<msqrt"+qi(a.id,y)+">",wr+=Ri(a.body,y),wr+="</msqrt>"):(wr+="<mroot"+qi(a.id,y)+">",wr+=Ri(a.body,y),wr+=Ri(a.above,y),wr+="</mroot>");break;case"leftright":const Gs=a,Us=Gs.leftDelim;wr="<mrow>",Us&&Us!=="."&&(wr+=`<mo${qi(a.id,y)}>${(b=Ua[Us])!=null?b:Us}</mo>`),a.body&&(wr+=Ri(a.body,y));const Xs=Gs.matchingRightDelim();Xs&&Xs!=="."&&(wr+=`<mo${qi(a.id,y)}>${(E=Ua[Xs])!=null?E:Xs}</mo>`),wr+="</mrow>";break;case"sizeddelim":case"delim":wr+=`<mo${qi(a.id,y)}>${Ua[a.value]||a.value}</mo>`;break;case"accent":wr+='<mover accent="true"'+qi(a.id,y)+">",wr+=Ri(a.body,y),wr+="<mo>"+(Vs[wa]||a.accent)+"</mo>",wr+="</mover>";break;case"line":case"overlap":break;case"overunder":_o=a.above,Zo=a.below,(a.svgAbove||_o)&&(a.svgBelow||Zo)?Qi=a.body:_o&&_o.length>0?(Qi=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(Zo=a.body[0].below,Qi=a.body[0].body):((he=(ae=a.body)==null?void 0:ae[0])==null?void 0:he.type)==="first"&&((ve=(me=a.body)==null?void 0:me[1])!=null&&ve.below)&&(Zo=a.body[1].below,Qi=a.body[1].body)):Zo&&Zo.length>0&&(Qi=a.body,(Re=(Se=a.body)==null?void 0:Se[0])!=null&&Re.above?(_o=a.body[0].above,Qi=a.body[0].body):((yt=(Je=a.body)==null?void 0:Je[0])==null?void 0:yt.type)==="first"&&((gn=(_t=a.body)==null?void 0:_t[1])!=null&&gn.above)&&(_o=a.body[1].overscript,Qi=a.body[1].body)),(a.svgAbove||_o)&&(a.svgBelow||Zo)?(wr+=`<munderover ${qi(a.id,y)}>`,wr+=(sr=Ei[a.svgBody])!=null?sr:Ri(Qi,y),wr+=(hn=Ei[a.svgBelow])!=null?hn:Ri(Zo,y),wr+=($n=Ei[a.svgAbove])!=null?$n:Ri(_o,y),wr+="</munderover>"):a.svgAbove||_o?(wr+=`<mover ${qi(a.id,y)}>`+((pr=Ei[a.svgBody])!=null?pr:Ri(Qi,y)),wr+=(zn=Ei[a.svgAbove])!=null?zn:Ri(_o,y),wr+="</mover>"):(a.svgBelow||Zo)&&(wr+=`<munder ${qi(a.id,y)}>`+((Fr=Ei[a.svgBody])!=null?Fr:Ri(Qi,y)),wr+=(Xr=Ei[a.svgBelow])!=null?Xr:Ri(Zo,y),wr+="</munder>");break;case"placeholder":wr+="?";break;case"mord":{wr=typeof a.value=="string"?a.value:wa,wa==="\\char"?wr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":wr.length>0&&wr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?wr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?wr=a.value.charAt(0):(console.error("Did not expect this"),wr=""));const ws=/\d/.test(wr)?"mn":"mi";wr=`<${ws}${qi(a.id,y)}>${Xh(wr)}</${ws}>`;break}case"mbin":case"mrel":case"minner":wr=Sc(a,y);break;case"mpunct":wr='<mo separator="true"'+qi(a.id,y)+">"+wa+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(wr="<mo"+qi(a.id,y)+">",wr+=wa==="\\operatorname"?a.body:wa||a.body,wr+="</mo>");break;case"box":wr='<menclose notation="box"',a.backgroundcolor&&(wr+=' mathbackground="'+a.backgroundcolor+'"'),wr+=qi(a.id,y)+">"+Ri(a.body,y)+"</menclose>";break;case"spacing":wr+='<mspace width="'+((Zr=ji[wa])!=null?Zr:0)+'em"/>';break;case"enclose":wr='<menclose notation="';for(const ws in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ws)&&a.notation[ws]&&(wr+=Wo+ws,Wo=" ");wr+=qi(a.id,y)+'">'+Ri(a.body,y)+"</menclose>";break;case"prompt":wr='<menclose notation="roundexbox""">'+Ri(a.body,y)+"</menclose>";break;case"space":wr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":wr+=Sc(a,y);break;case"mclose":wr+=Sc(a,y);break;case"macro":{const ws=a.command+vu(a.macroArgs);ws&&(wr+=`<mo ${qi(a.id,y)}>${ws}</mo>`)}break;case"latexgroup":wr+=Ri(a.body,y);break;case"latex":wr+="<mtext"+qi(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":wr+=Ri(a.body,y);break;case"text":wr+=`<mtext ${qi(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${qi(a.id,y)} displaystyle="true">${Ri(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${qi(a.id,y)} displaystyle="false">${Ri(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return wr}var yu={"\\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 kd(a){let y=0;if(Ae(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(Ae(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Ae(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 Mi(a,y){var b,E,ee,re,ae;function he(Se){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(Se)?` <say-as interpret-as="character">${Se}</say-as>`:/[A-Z]/.test(Se)?`capital <say-as interpret-as="character">${Se.toLowerCase()}</say-as>`:Se:/[a-z]/.test(Se)?" '"+Se.toUpperCase()+"'":/[A-Z]/.test(Se)?" 'capital "+Se.toUpperCase()+"'":Se}function me(Se){return"<emphasis>"+Se+"</emphasis>"}if(!y)return"";let ve="";if(Ae(y)){let Se=!1,Re=!1;for(let Je=0;Je<y.length;Je++)y[Je].type!=="first"&&(y[Je].mode!=="text"&&(Re=!1),Je<y.length-2&&y[Je].type==="mopen"&&y[Je+2].type==="mclose"&&y[Je+1].type==="mord"?(ve+=" of ",ve+=me(Mi(a,y[Je+1])),Je+=2):y[Je].mode==="text"?Re?ve+=(b=y[Je].value)!=null?b:" ":(Re=!0,ve+=Mi("text",y[Je])):y[Je].isDigit()?Se?ve+=y[Je].asDigit():(Se=!0,ve+=Mi(a,y[Je])):(Se=!1,ve+=Mi(a,y[Je])))}else if(y.mode==="text")y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>'),ve+=y.value;else{y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>');let Se="",Re="",Je="",yt=!1;const{command:_t}=y;switch(_t){case"\\vec":return"vector "+Mi(a,y.body);case"\\acute":return Mi(a,y.body)+" acute";case"\\grave":return Mi(a,y.body)+" grave";case"\\dot":return"dot over"+Mi(a,y.body);case"\\ddot":return"double dot over"+Mi(a,y.body);case"\\mathring":return"ring over"+Mi(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Mi(a,y.body);case"\\bar":return Mi(a,y.body)+" bar";case"\\breve":return Mi(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Mi(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Mi(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Mi(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Mi(a,y.body)}switch(y.type){case"prompt":const gn=y.body.length>1?'start input . <break time="500ms"/> '+Mi(a,y.body)+'. <break time="500ms"/> end input':"blank";ve+=' <break time="300ms"/> '+gn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const sr=y.array,hn=y.environmentName;if(Object.keys(Zf).includes(hn)){ve+=` begin ${Zf[hn]} `;for(let zn=0;zn<sr.length;zn++){zn>0&&(ve+=","),ve+=` row ${zn+1} `;for(let Fr=0;Fr<sr[zn].length;Fr++)Fr>0&&(ve+=","),ve+=` column ${Fr+1}: `,ve+=Mi("math",sr[zn][Fr])}ve+=` end ${Zf[hn]} `}break;case"group":_t==="\\ne"?ve+=" not equal ":(_t==="\\not"&&(ve+=" not "),ve+=Mi("math",y.body));break;case"root":ve+=Mi("math",y.body);break;case"genfrac":if(Se=Mi("math",y.above),Re=Mi("math",y.below),kd(y.above)&&kd(y.below)){const Fr={"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 "}[cp(y.above)+"/"+cp(y.below)];Fr?ve=Fr:ve+=Se+" over "+Re}else ve+=' the fraction <break time="150ms"/>'+Se+' over <break time="150ms"/>'+Re+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Je=Mi("math",y.body),y.hasEmptyBranch("above"))ve+=kd(y.body)?" the square root of "+Je+" , ":' the square root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End square root';else{let zn=Mi("math",y.above);zn=zn.trim();const Fr=zn.replace(/<mark([^/]*)\/>/g,"");Fr==="3"?ve+=' the cube root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End cube root':Fr==="n"?ve+=' the nth root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End root':ve+=' the root with index: <break time="200ms"/>'+zn+', of <break time="200ms"/>'+Je+'. <break time="200ms"/> End root'}break;case"leftright":{const zn=y;ve+=(ee=zn.leftDelim?yu[zn.leftDelim]:void 0)!=null?ee:zn.leftDelim,ve+=Mi("math",y.body),ve+=(re=zn.rightDelim?yu[zn.rightDelim]:void 0)!=null?re:zn.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const $n=_t.replace(/^\\/g,""),pr=Pn()[$n];pr&&(pr!=null&&pr.expand?ve+=Mi("math",y.body):ve+=`${$n} `);break;case"placeholder":ve+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(_t==="\\mathbin"||_t==="\\mathrel"||_t==="\\mathopen"||_t==="\\mathclose"||_t==="\\mathpunct"||_t==="\\mathord"||_t==="\\mathinner"){ve=Mi(a,y.body);break}let zn=y.isDigit()?y.asDigit():y.value,Fr=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(Fr=y.value,zn=Fr),a==="text")ve+=zn;else{if(y.type==="mbin"&&(ve+='<break time="150ms"/>'),zn){const Xr=yu[zn]||(Fr?yu[Fr.trim()]:"");if(Xr)ve+=" "+Xr;else{const Zr=Fr?Tv(Fr.trim()):"";ve+=Zr||he(zn)}}else ve+=Mi("math",y.body);y.type==="mbin"&&(ve+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const zn=y.command;if(zn==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Fr=Mi("math",y.superscript);Fr=Fr.trim();let Xr=Mi("math",y.subscript);Xr=Xr.trim(),ve+=' the summation from <break time="200ms"/>'+Xr+'<break time="200ms"/> to <break time="200ms"/>'+Fr+'<break time="200ms"/> of <break time="150ms"/>',yt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the summation of";else{let Fr=Mi("math",y.subscript);Fr=Fr.trim(),ve+=' the summation from <break time="200ms"/>'+Fr+'<break time="200ms"/> of <break time="150ms"/>',yt=!0}else if(zn==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Fr=Mi("math",y.superscript);Fr=Fr.trim();let Xr=Mi("math",y.subscript);Xr=Xr.trim(),ve+=' the product from <break time="200ms"/>'+Xr+'<break time="200ms"/> to <break time="200ms"/>'+Fr+'<break time="200ms"/> of <break time="150ms"/>',yt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the product of ";else{let Fr=Mi("math",y.subscript);Fr=Fr.trim(),ve+=' the product from <break time="200ms"/>'+Fr+'<break time="200ms"/> of <break time="150ms"/>',yt=!0}else if(zn==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Fr=Mi("math",y.superscript);Fr=Fr.trim();let Xr=Mi("math",y.subscript);Xr=Xr.trim(),ve+=' the integral from <break time="200ms"/>'+me(Xr)+'<break time="200ms"/> to <break time="200ms"/>'+me(Fr)+' <break time="200ms"/> of ',yt=!0}else ve+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const Fr=(ae=yu[y.value])!=null?ae:y.command?yu[y.command]:void 0;ve+=Fr||" "+y.value}else y.command&&(y.command==="\\mathop"?ve+=Mi("math",y.body):y.command==="\\operatorname"?ve+=Pv(y.body):ve+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Je=Mi("math",y.body),ve+=" crossed out "+Je+". End crossed out.";break;case"space":case"spacing":break}if(!yt&&!y.hasEmptyBranch("superscript")){let gn=Mi(a,y.superscript);gn=gn.trim();const sr=gn.replace(/<[^>]*>/g,"");if(kd(y.superscript)){if(a==="math"){const hn=Iv(y.superscript);hn&&(ve+='<mark name="'+hn+'"/>')}sr==="\u2032"?ve+=" prime ":sr==="2"?ve+=" squared ":sr==="3"?ve+=" cubed ":Number.isNaN(Number.parseInt(sr))?ve+=" to the "+gn+"; ":ve+=' to the <say-as interpret-as="ordinal">'+sr+"</say-as> power; "}else Number.isNaN(Number.parseInt(sr))?ve+=" raised to the "+gn+"; ":ve+=' raised to the <say-as interpret-as="ordinal">'+sr+"</say-as> power; "}if(!yt&&!y.hasEmptyBranch("subscript")){let gn=Mi("math",y.subscript);gn=gn.trim(),ve+=kd(y.subscript)?" sub "+gn:" subscript "+gn+". End subscript. "}}return ve}function bu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ri(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=_e(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=_e(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=_e(we({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const re=(b=window.SRE)!=null?b:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&re.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let ae="";try{ae=re.toSpeech(ee)}catch(he){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",he)}return ae}return""}let E=Mi("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"&&at()==="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 Bv(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 xa(a){var y,b,E,ee,re,ae,he,me,ve,Se,Re,Je,yt;if(!a)return"";if(Ae(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(xa).join("");if(a[0].mode==="text"){let pr=0,zn="";for(;((y=a[pr])==null?void 0:y.mode)==="text";)zn+=a[pr].body?xa(a[pr].body):a[pr].value,pr++;return`"${zn}" ${xa(a.slice(pr))}`}let hn=0;const $n=[];for(;a[hn]&&a[hn].mode==="math";){let pr="";for(;a[hn]&&a[hn].type==="mord"&&/\d/.test(a[hn].value);)pr+=a[hn++].value;pr?$n.push(pr):$n.push(xa(a[hn++]))}return $n.push(xa(a.slice(hn))),Bv($n)}if(a.mode==="text")return`"${a.value}"`;let _t="";const{command:gn}=a;let sr;if(gn==="\\placeholder")return`(${xa(a.body)})`;switch(a.type){case"accent":const hn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[gn];_t=`${hn!=null?hn:""} ${xa(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(Zr=>Zr.value).join("");case"group":case"root":_t=(b=Ld[gn])!=null?b:xa(a.body);break;case"genfrac":{const Zr=a;(Zr.leftDelim||Zr.rightDelim)&&(_t=Zr.leftDelim==="."||!Zr.leftDelim?"{:":Zr.leftDelim),Zr.hasBarLine?(_t+="(",_t+=xa(Zr.above),_t+=")/(",_t+=xa(Zr.below),_t+=")"):(_t+="("+xa(Zr.above)+"),",_t+="("+xa(Zr.below)+")"),(Zr.leftDelim||Zr.rightDelim)&&(_t+=Zr.rightDelim==="."||!Zr.rightDelim?"{:":Zr.rightDelim)}break;case"surd":_t+=a.hasEmptyBranch("above")?"sqrt("+xa(a.body)+")":"root("+xa(a.above)+")("+xa(a.body)+")";break;case"latex":_t=a.value;break;case"leftright":{const Zr=a,Ei=Zr.leftDelim;_t+=Ei==="."||!Ei?"{:":Ei,_t+=xa(Zr.body);const ji=Zr.matchingRightDelim();_t+=ji==="."||!ji?":}":ji}break;case"sizeddelim":case"delim":_t=a.value;break;case"overlap":break;case"overunder":break;case"mord":_t=(ee=(E=Ld[gn])!=null?E:gn)!=null?ee:typeof a.value=="string"?a.value:"",_t.startsWith("\\")&&(_t+=" "),sr=gn?gn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,sr?_t=String.fromCodePoint(Number.parseInt("0x"+sr[1])):_t.length>0&&_t.startsWith("\\")&&(_t=typeof a.value=="string"?a.value.charAt(0):a.command),_t=Ov(_t,a.style);break;case"mbin":case"mrel":case"minner":_t=(ae=(re=Ld[gn])!=null?re:Dd[gn])!=null?ae:a.value;break;case"mopen":case"mclose":_t=a.value;break;case"mpunct":_t=(he=Dd[gn])!=null?he:gn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Dd[gn]?_t=Dd[gn]:_t=gn==="\\operatorname"?xa(a.body):(me=a.value)!=null?me:gn,_t+=" ");break;case"array":const $n=a.array,pr=a.environmentName,zn=(ve={bmatrix:["[","]"],"bmatrix*":["[","]"]}[pr])!=null?ve:["(",")"],Fr=[];for(const Zr of $n){const Ei=[];for(const ji of Zr)Ei.push(zn[0]+xa(ji)+zn[1]);Fr.push(Ei.join(","))}const Xr=(Se={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[pr])!=null?Se:["(",")"];_t=Xr[0]+Fr.join(",")+Xr[1];break;case"box":break;case"spacing":_t=(Re=Ld[gn])!=null?Re:" ";break;case"enclose":_t="("+xa(a.body)+")";break;case"space":_t=" ";break;case"subsup":_t="";break;case"macro":_t=(yt=(Je=Ld[gn])!=null?Je:Dd[gn])!=null?yt:xa(a.body);break}if(!a.hasEmptyBranch("subscript")){_t+="_";const hn=xa(a.subscript);_t+=hn.length!==1?`(${hn})`:hn}if(!a.hasEmptyBranch("superscript")){_t+="^";const hn=xa(a.superscript);_t+=hn.length!==1?`(${hn})`:hn}return _t}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 _i({from:_e(we({},Qc()),{renderPlaceholder:()=>new cr(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Tn({mode:"math",type:"root",body:ja(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(Yc(fd(ae,ee)),Jc(ae,{classes:"ML__latex"}).toMarkup()):""}function k1(a){return t0(a,{context:Qc()})}function Rv(a,y={}){return Ri(ja(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function $v(a){const y=ja(a,{parseMode:"math",mathstyle:"displaystyle"});return bu(y)}var Yh;function Nv(a){var y,b;if(!Yh){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?Yh=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=Yh==null?void 0:Yh.box(a).latex)!=null?b:""}function L1(a,y="math"){return xa(new Tn({type:"root",body:ja(a,{parseMode:y})}))}function D1(a){return uc(a,{format:"ascii-math"})[1]}function jf(a){if(typeof a=="string"){const y=Fv(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?up(a):a}function xu(a){return a<0?0:a>255?255:Math.round(a)}function Fv(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 Vf(a){const[y,b,E]=[a.L,a.C,a.H],ee=E*Math.PI/180,re={L:y,a:b*Math.cos(ee),b:b*Math.sin(ee)};return a.alpha!==void 0&&(re.alpha=a.alpha),re}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,he={L:y,C:ee,H:ae};return a.alpha!==void 0&&(he.alpha=a.alpha),he}function Gf(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.pow(.9999999984505198*y+.39633779217376786*b+.2158037580607588*E,3),re=Math.pow(1.00000000888176*y-.10556134232365635*b-.0638541747717059*E,3),ae=Math.pow(y*1.000000054672411-.0894841820949657*b-1.2914855378640917*E,3),he=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,me=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ve=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,Se=Re=>{const Je=Math.abs(Re);return Je<=.0031308?Re*12.92:(Math.sign(Re)||1)*(1.055*Math.pow(Je,1/2.4)-.055)};return[Se(he),Se(me),Se(ve)]}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=xu(b*255),E=xu(E*255),ee=xu(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function up(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(Vf(ee)),!Uf([y,b,E]))return Xf([y,b,E],a.alpha);let re=0,ae=a.L,he=(re+ae)/2;ee.C=he;const me=.36/Math.pow(2,12);for(;ae-re>me;)he=(re+ae)/2,ee.C=he,[y,b,E]=Gf(Vf(ee)),Uf([y,b,E])?re=he:ae=he;return Xf([y,b,E],a.alpha)}function Kv(a){return up(Vf(a))}function dp(a,y){const b=jf(a),E=jf(y),ee=.56,re=.57,ae=.62,he=.65,me=.022,ve=1.414,Se=.1,Re=5e-4,Je=1.14,yt=.027,_t=1.14,gn=.027;function sr(Zr){return Zr>=me?Zr:Zr+Ys(me-Zr,ve)}function hn(Zr){return(Zr<0?-1:1)*Math.pow(Math.abs(Zr),2.4)}const $n=sr(hn(E.r/255)*.2126729+hn(E.g/255)*.7151522+hn(E.b/255)*.072175),pr=sr(hn(b.r/255)*.2126729+hn(b.g/255)*.7151522+hn(b.b/255)*.072175);let zn,Fr,Xr;return Math.abs(pr-$n)<Re?Fr=0:pr>$n?(zn=Ys(pr,ee)-Ys($n,re),Fr=zn*Je):(zn=Ys(pr,he)-Ys($n,ae),Fr=zn*_t),Math.abs(Fr)<Se?Xr=0:Fr>0?Xr=Fr-gn:Xr=Fr+yt,Xr*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=jf(a);let b=((1<<24)+(xu(y.r)<<16)+(xu(y.g)<<8)+xu(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 aa(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 aa(a).length>0}function jv(a){return[Yf(a,"double-struck","mathbb","tooltip.blackboard"),Yf(a,"fraktur","mathfrak","tooltip.fraktur"),Yf(a,"calligraphic","mathcal","tooltip.caligraphic"),Jf(a,"up","mathrm","tooltip.roman-upright"),Jf(a,"bold","mathbf","tooltip.bold"),Jf(a,"italic","mathit","tooltip.italic")]}function Vv(a){return[{label:()=>Va(`\\vec{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overrightarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overleftarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\dot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\ddot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bar{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overgroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overbrace{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\undergroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underbrace{${aa(a)}}`),visible:()=>aa(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(Ke))y.push({class:(Hv(hp(Ke[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ke[b]} "></span>`,ariaLabel:()=>{var E;return(E=mt(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(Ve))y.push({class:(hp(Ve[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ve[b]} "></span>`,ariaLabel:()=>{var E;return(E=mt(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 Yv=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 Jv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new Yv(ee,re,b,E),label:"\u2610",tooltip:()=>mt("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 qv(a){return[{label:()=>mt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Cc(a)},{label:()=>mt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Cc(a)},{label:()=>mt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>Cc(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>mt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Cc(a)},{type:"divider"},{label:()=>mt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Cc(a)},{label:()=>mt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Cc(a)},{type:"divider"},{label:()=>mt("menu.borders"),visible:()=>(Qv(a)||Cc(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:()=>mt("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Jv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>mt("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>mt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>mt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>mt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>mt("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>mt("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>mt("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Uv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>mt("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>mt("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&aa(a).length>0,submenu:Gv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>mt("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:()=>mt("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?mt("menu.solve-for",Va(b)):mt("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(re=>{var ae;return(ae=re.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:()=>mt("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>mt("menu.copy"),id:"copy",submenu:[{label:()=>mt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>oi.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>mt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>oi.copyToClipboard(a,"ascii-math")},{label:()=>mt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>oi.copyToClipboard(a,"math-ml")}]},{label:()=>mt("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>mt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function Cc(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(),I0(a.model,y),va(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 Yf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=mt(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 Jf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=mt(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 wu(a,y){return a+bu(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:re}=a;function ae(Se){let Re=null;switch(Se){case"all":Re=re.root;break;case"selection":Re=re.getAtoms(re.selection);break;case"left":{Re=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{Re=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":Re=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:Je}=re.at(re.position);Je!=null&&Je.parent?Re=Je:Re=re.root;break}default:Re=re.root}return Re}function he(Se){let Re="";switch(Se){case"all":console.log("Internal failure: speak all failed");break;case"selection":Re="no selection";break;case"left":Re="at start";break;case"right":Re="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Re="no parent";break;default:console.log('unknown speak_ param value: "'+Se+'"');break}return Re}const me=ae(y);if(me===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,he(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ve=bu(me);return rt()&&b.withHighlighting?(Fl().readAloudMathfield=a,pc(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ve)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ve),!1}function r1(a){var y,b;if(!rt()){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,(re,ae)=>{if(re)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);else if(ae!=null&&ae.AudioStream){const he=new Uint8Array(ae.AudioStream),me=new Blob([he.buffer],{type:"audio/mpeg"}),ve=URL.createObjectURL(me);new Audio(ve).play().catch(Re=>console.log(Re))}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 i1(a,y,b,E){let ee="";if(y==="plonk")window.MathfieldElement.playSound("plonk"),a.flushInlineShortcutBuffer();else if(y==="delete")ee=wu("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=wu("",a.model.at(a.model.position));else if(y==="line"){const re=wu("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?wu(y+" ",E):y;if(ee){const re=a.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";a.ariaLiveText.textContent=ee+re}}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 re=a.at(a.position).parent;for(;ee!==a.root&&ee!==re;)E+=`out of ${pp(ee)};`,ee=ee.parent;return E}function o1(a){if(!a.selectionIsCollapsed)return wu("",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+=wu("",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 re=this.silenceNotifications;this.silenceNotifications=!0,this.mode=a.mode,this.root=Ol(a.content),this.selection=a.selection,this.silenceNotifications=re,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 re=this.normalizeSelection(a,y);if(re===void 0)throw new TypeError("Invalid selection");if(re.ranges.length===1&&re.ranges[0][0]===re.ranges[0][1]){const Se=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(Se))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(Se-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(Se-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(Se+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(Se+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=Se,this._position=Se,this._selection=re;return}const ae=Wa(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const he=this.at(ae[0]+1),me=this.at(ae[1]),ve=Tn.commonAncestor(he,me);(ve==null?void 0:ve.type)==="array"&&he.parent===ve&&me.parent===ve?this._selection={ranges:[ae],direction:re.direction}:this._selection={ranges:[ae],direction:re.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 qa&&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(tu(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((ve,Se)=>[...ve,...this.getAtoms(Se,E)],[]);a=a.ranges[0]}let ee,re;if(Bs(a)){if(ee=a,!Bs(y))return[];re=y}else[ee,re]=a,E=y!=null?y:{};if(!Number.isFinite(ee))return[];E.includeChildren===void 0&&(E.includeChildren=!1),ee<0&&(ee=this.lastOffset-ee+1),re<0&&(re=this.lastOffset-re+1);const ae=Math.min(ee,re)+1,he=Math.max(ee,re);if(!E.includeChildren&&ae===1&&he===this.lastOffset)return[this.root];let me=[];for(let ve=ae;ve<=he;ve++){const Se=this.atoms[ve];mp(this,Se,ae,he)&&me.push(Se)}return E.includeChildren||(me=me.filter(ve=>{let Se=!1,{parent:Re}=ve;for(;Re&&!Se;)Se=mp(this,Re,ae,he),Re=Re.parent;return!Se})),me}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 re=y;re<=ee;re++)if(E=this.atoms[re],a(E))return E;for(let re=0;re<y;re++)if(E=this.atoms[re],a(E))return E;return}for(let re=y;re>=0;re--)if(E=this.atoms[re],a(E))return E;for(let re=ee;re>y;re--)if(E=this.atoms[re],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 Tn({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 Tn.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 Ri(a);if(b==="spoken")return bu(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=bu(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=bu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?xa(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(Bs(a)&&Bs(y)?(E=[this.normalizeRange([a,y])],ee=b):eu(a)?(E=[this.normalizeRange(a)],ee=y):tu(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 re=this.getValue({ranges:E},"latex-unstyled");try{const ae=window.MathfieldElement.computeEngine.parse(re);return JSON.stringify(ae.json)}catch(ae){return JSON.stringify(["Error",`'${ae.toString()}'`])}}if(ee.startsWith("latex")){const re={expandMacro:ee==="latex-expanded",skipStyles:ee==="latex-unstyled",skipPlaceholders:ee==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return xi(E.map(ae=>Tn.serialize(this.getAtoms(ae),re)))}return E.map(re=>this.getAtoms(re).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:re}=this.at(ee);if(re&&(re.type==="genfrac"||re.type==="subsup"))for(;re!==this.root&&qf(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&qf(this,re,[E,ee]);)E=this.offsetOf(re.leftSibling),re=re.parent;if(re=this.at(ee).parent,(re==null?void 0:re.type)==="genfrac")for(;re!==this.root&&qf(this,re,[E,ee]);)ee=this.offsetOf(re),console.assert(ee>=0),re=re.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)&&i1(this.mathfield,a,y,b)}deferNotifications(a,y){const b=this._selection,E=this._anchor,ee=this._position,re=this.silenceNotifications;this.silenceNotifications=!0;const ae=this.root.changeCounter;y();const he=this.root.changeCounter!==ae,me=E!==this._anchor||ee!==this._position||cc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&he&&this.contentDidChange({inputType:a.type}),a.selection&&me&&this.selectionDidChange(),he||me}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(Bs(a)){const ee=this.normalizeOffset(a);if(Bs(y)){const re=this.normalizeOffset(y);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else E={ranges:[[ee,ee]],direction:"none"}}else if(eu(a)){const ee=this.normalizeOffset(a[0]),re=this.normalizeOffset(a[1]);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else tu(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",_e(we({},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 re=a.offsetOf(y.firstChild);if(re>=b&&re<=E){const ae=a.offsetOf(y.lastChild);if(ae>=b&&ae<=E)return!0}return!1}function qf(a,y,b){if(!(y!=null&&y.hasChildren))return!1;const[E,ee]=b,re=a.offsetOf(y.firstChild),ae=a.offsetOf(y.lastChild);return re>=E&&re<=ee&&ae>=re&&ae<=ee}function Td(a,y,b,E){var ee,re,ae,he,me,ve;const Se=b.parent;if(Se&&b instanceof Oi){const Re=!E&&y==="forward"||E==="body"&&y==="backward";let Je=Re?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Re?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),Je--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),Je--),a.position=Je,!0}if(Se&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Re=b.leftSibling;b.hasChildren&&Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),a.position=a.offsetOf(Re)}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),Se.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(Se&&(b.type==="box"||b.type==="enclose")){const Re=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),a.position=a.offsetOf(Re),!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 Re=Id.fractionNavigationOrder==="numerator-denominator"?"above":"below",Je=Re==="above"?"below":"above";if(Se&&(y==="forward"&&E===Re||y==="backward"&&E===Je)){const yt=b.removeBranch(Re),_t=b.removeBranch(Je);return Se.addChildrenAfter([...yt,..._t],b),Se.removeChild(b),a.position=a.offsetOf(yt.length>0?yt[yt.length-1]:_t[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 Re=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(ve=(he=b.subscript)==null?void 0:he[0].lastSibling)!=null?ve:(me=b.superscript)==null?void 0:me[0].lastSibling;return Re&&(a.position=a.offsetOf(Re)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Re=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Re,!0}if(E==="superscript")if(y==="backward"){const Re=a.offsetOf(b.firstChild)-1;console.assert(Re>=0),a.position=Re}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 Re=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Re}return!0}if((Se==null?void 0:Se.type)==="genfrac"&&!E&&b.type!=="first"){let Re=a.offsetOf(b.leftSibling);return Se.removeChild(b),Se.hasEmptyBranch("above")&&Se.hasEmptyBranch("below")?(Re=a.offsetOf(Se.leftSibling),Se.parent.removeChild(Se),a.announce("delete",void 0,[Se]),a.position=Re,!0):(a.announce("delete",void 0,[b]),a.position=Re,!0)}if(y==="backward"&&((Se==null?void 0:Se.command)==="\\ln"||(Se==null?void 0:Se.command)==="\\log")&&b.parentBranch!=="body"){const Re=a.offsetOf(Se.leftSibling);return Se.parent.removeChild(Se),a.announce("delete",void 0,[Se]),a.position=Re,!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,Wa(a.selection),"deleteContentBackward")}function c1(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,Wa(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 re=E[E.length-1].parent.lastChild;let ae=E[0];ae.type==="first"&&(ae=ae.rightSibling);const he=E[E.length-1];if(ae===ee&&he===re){const me=E[0].parent;me.parent&&me.type!=="prompt"&&(y=[a.offsetOf(me.leftSibling),a.offsetOf(me)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const me=E[0].parent,ve=E[0].parentBranch==="below"?"above":"below",Se=a.offsetOf(me.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Re,Je;const yt=me.removeBranch(ve);if(yt.length===1&&yt[0].type==="placeholder")(Je=me.parent)==null||Je.removeChild(me),a.position=Math.max(0,Se);else{const _t=me.parent.addChildrenAfter(yt,me);(Re=me.parent)==null||Re.removeChild(me),a.position=a.offsetOf(_t)}})}}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=>c1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&Zs(a,[a.anchor,kf(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&Zs(a,[a.anchor,kf(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 u1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${mt("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="${mt("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=we(_e(we({},Bh()),{macros:Pn(),registers:Al()}),Ph(y)),this.eventController=new AbortController;const re=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 he=D0(this.options),me=new Tn({type:"root",mode:he,body:ja(ae,{context:this.context})});this.model=new s1(this,he,me),this.undoManager=new $g(this.model);const ve=[];if(ve.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>"),ve.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ve.push("<span part=content class=ML__content>"),ve.push(w0(this)),ve.push("</span>"),window.mathVirtualKeyboard&&(ve.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">`),ve.push(u1),ve.push("</div>")),ve.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ve.push(d1),ve.push("</div>"),ve.push("</span>"),ve.push("<span class=ML__sr-only>"),ve.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ve.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ve.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=Qe.subscribe(()=>Qe.update(this.element)),Qe.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Re=>Re.stopImmediatePropagation(),{capture:!1,signal:re}),this.field.addEventListener("wheel",this,{passive:!1,signal:re}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:re}):this.field.addEventListener("mousedown",this,{signal:re}),(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:re}),this._menu=new Sv(qv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const Se=this.element.querySelector("[part=menu-toggle]");Se==null||Se.addEventListener("pointerdown",Re=>{if(Re.currentTarget!==Se||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Je=Se.getBoundingClientRect();this._menu.modifiers=fc(Re),this._menu.show({target:Se,location:{x:Je.left,y:Je.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Re.preventDefault(),Re.stopPropagation()},{signal:re}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(Se.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:re}),document.addEventListener("scroll",this,{signal:re}),this.resizeObserver=new ResizeObserver(()=>va(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),gd&&!Qe.locale.startsWith(gd.locale)&&Nm(Qe.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)),Vh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Nf())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:$s(this.field))!=null?b:void 0,ee=a==null?void 0:a.modifiers,re=this.element.querySelector("[part=container]");return this._menu.show({target:re,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:Nt(a)}}get backgroundColorMap(){return a=>{var y,b,E,ee,re,ae;return(ae=(re=(b=(y=this.options).backgroundColorMap)==null?void 0:b.call(y,a))!=null?re:(ee=(E=this.options).colorMap)==null?void 0:ee.call(E,a))!=null?ae:ht(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=Tn.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=we({},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 me of Object.keys(y)){const ve=this.queryStyle({[me]:y[me]});if(ve==="none")return"none";if(ve==="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 re=this.model.getAtoms(this.model.selection,{includeChildren:!0});let ae=re.length;if(ae===0)return"none";let he=0;for(const me of re){if(me.type==="first"){ae-=1;continue}me.style[E]===ee&&(he+=1)}return he===0?"none":he===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:Fm());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=we(we({},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=Tn.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&oi.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)&&va(this)}getOptions(a){return gc(this.options,a)}getOption(a){return gc(this.options,a)}handleEvent(a){return zl(this,null,function*(){var y;if(Fo(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(du(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 ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Vh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Fo(this))return;Qe.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 du(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();oi.insert(this.model,a,y)&&(va(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&&pc(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=$s(this.field);else{const E=sd(this);if(E.length>0){let ee=-1/0,re=-1/0;for(const ae of E)ae.right>ee&&(ee=ae.right),ae.top<re&&(re=ae.top);b={x:ee+y.left-this.field.scrollLeft,y:re+y.top-this.field.scrollTop,height:0}}}if(this.host&&b){const E=this.host.getBoundingClientRect(),ee=b.y;let re=this.host.scrollTop;ee<E.top?re=ee-E.top+this.host.scrollTop:ee>E.bottom&&(re=ee-E.bottom+this.host.scrollTop+b.height),this.host.scroll({top:re,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&&it()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?A0(this.model):a==="&"?T0(this.model):this.model.selectionIsCollapsed?oi.insert(this.model,a,we({style:this.model.at(this.model.position).computedStyle},y)):oi.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),va(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 re=this.model.mode,{model:ae}=this;ae.deferNotifications({content:!!b||!!y,selection:!0,type:"insertText"},()=>{let he=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const me=ja(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(me,ve)),he=!0}if(this.model.mode=a,a==="latex"){let me=ae.selectionIsCollapsed;cu(this,"accept");let ve,Se=ae.at(ae.position);if(me)ve="\\";else{const Je=Wa(ae.selection);ve=this.model.getValue(Je,"latex");const yt=this.model.extractAtoms(Je);yt.length===1&&yt[0].type==="placeholder"&&(ve=y,me=!0),Se=ae.at(Je[0])}const Re=new ud(ve);Se.parent.addChildAfter(Re,Se),me?ae.position=ae.offsetOf(Re.lastChild):ae.setSelection(ae.offsetOf(Re.firstChild),ae.offsetOf(Re.lastChild))}else yd(ae).forEach(me=>{me.isError=!1});if(b){const me=ja(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(me,ve)),he=!0}return va(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),he}),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};eu(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=Pf(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=we(we({},this.defaultStyle),re);return}const he=we({},this.defaultStyle);for(const me of Object.keys(re))he[me]===re[me]?(me==="color"&&delete he.verbatimColor,me==="backgroundColor"&&delete he.verbatimBackgroundColor,delete he[me]):he[me]=re[me];this.defaultStyle=he;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const he of this.model.selection.ranges)_f(this.model,he,re,{operation:ae});else _f(this.model,ee.range,re,{operation:ae})}),va(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=$s(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=Ed(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),va(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,_e(we({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),va(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),va(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"?(cu(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)),Vh(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",_e(we({},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(),pc(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="",uu(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})),va(this),this.focusBlurInProgress=!1,Nf();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Fo(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(Wa(this.model.selection));const y=$s(this.field);y&&requestAnimationFrame(()=>{pc(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),va(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(),oi.onCopy(this,a),Zs(this.model,Wa(this.model.selection),"deleteByCut"),this.snapshot("cut"),va(this))}onCopy(a){oi.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=oi.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(),_h(this),Vh(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=>Dn(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(!rt())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"]};Fl().readAloudElement=a,E.synthesizeSpeech(ee,(re,ae)=>{if(re){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);return}if(!(ae!=null&&ae.AudioStream)){console.log("polly.synthesizeSpeech():",ae);return}const he=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));Fl().readAloudMarks=he.split(`
`).map(me=>me?JSON.parse(me):{}),Fl().readAloudTokens=[];for(const me of Fl().readAloudMarks)me.value&&Fl().readAloudTokens.push(me.value);Fl().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(me,ve)=>{if(me){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${me}`);return}if(!(ve!=null&&ve.AudioStream))return;const Se=new Uint8Array(ve.AudioStream),Re=new Blob([Se.buffer],{type:"audio/mpeg"}),Je=URL.createObjectURL(Re),yt=Fl();yt.readAloudAudio?yt.readAloudAudio.pause():(yt.readAloudAudio=new Audio,yt.readAloudAudio.addEventListener("ended",()=>{const _t=yt.readAloudMathfield;yt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),_t?(pc(_t),yt.readAloudElement=null,yt.readAloudMathfield=null,yt.readAloudTokens=[],yt.readAloudMarks=[],yt.readAloudCurrentMark=""):gp(yt.readAloudElement)}),yt.readAloudAudio.addEventListener("timeupdate",()=>{let _t="";const gn=yt.readAloudAudio.currentTime*1e3+100;for(const sr of yt.readAloudMarks)sr.time<gn&&(_t=sr.value);yt.readAloudCurrentMark!==_t&&(yt.readAloudCurrentToken=_t,_t&&_t===yt.readAloudFinalToken?yt.readAloudAudio.pause():(yt.readAloudCurrentMark=_t,Qf(yt.readAloudElement,yt.readAloudCurrentMark)))})),yt.readAloudAudio.src=Je,yt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),yt.readAloudAudio.play()})})}rt()||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 Di=new WeakMap,p1=.5,Nl={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 = ..."},Qa=class Mc extends HTMLElement{static get formAssociated(){return Su()}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 Qe.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),Qe.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 Qe.strings}static set strings(y){Qe.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 re=yield(yield fetch(yield x0(`${E}/${b}`))).arrayBuffer(),ae=yield this.audioContext.decodeAudioData(re);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(Nl[E])if(Nl[E].startsWith("mf."))if(Nl[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${Nl[E]}`);else{const ee=Nl[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 ${Nl[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(Su()&&(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=[Bl("core"),Bl("mathfield"),Bl("mathfield-element"),Bl("ui"),Bl("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=Mc.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?gc(this._mathfield.options,y):Di.has(this)?we({},gc(we(we({},Bh()),Ph(Di.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?gc(this._mathfield.options,y):Di.has(this)?gc(we(we({},Bh()),Ph(Di.get(this).options)),y):null}reflectAttributes(){const y=Bh(),b=this._getOptions();Object.keys(Mc.optionsAttributes).forEach(E=>{const ee=gl(E);Mc.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Mc.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(Di.has(this)){const b=we(we({},Di.get(this).options),y);Di.set(this,_e(we({},Di.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Di.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))Nl[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${Nl[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,re;if(this._mathfield)return this._mathfield.model.getValue(y,b,E);if(Di.has(this)){let ae,he,me;if(tu(y)?([ae,he]=y.ranges[0],me=b):eu(y)?([ae,he]=y,me=b):Bs(y)&&Bs(b)?(ae=y,he=b,me=E):(ae=0,he=-1,me=y),(me===void 0||me==="latex")&&ae===0&&he===-1)return(re=(ee=Di.get(this).value)!=null?ee:this.textContent)!=null?re:""}return""}setValue(y,b){if(this._mathfield&&y!==void 0){b!=null||(b={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(y,b);return}if(Di.has(this)){const ee=Di.get(this).options;Di.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Pd(this);Di.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?Ed(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=Il(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,re;Fs.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"&&((re=this._mathfield)==null||re.blur()))}connectedCallback(){var y,b,E,ee;const re=window.getComputedStyle(this),ae=this.shadowRoot,he=re.userSelect!=="none";if(he)ae.host.addEventListener("pointerdown",this,!0);else{const Se=ae.querySelector("span");Se.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Su()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),he&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const me=ae.querySelector("slot:not([name])");if(me)try{this._style=me.assignedElements().filter(Se=>Se.tagName.toLowerCase()==="style").map(Se=>Se.textContent).join("")}catch(Se){console.error(Se)}if(this._style){const Se=document.createElement("style");Se.textContent=this._style,ae.appendChild(Se)}let ve="";if(this.hasAttribute("value")?ve=this.getAttribute("value"):ve=(y=me==null?void 0:me.assignedNodes().map(Se=>Se.nodeType===3?Se.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),_e(we({},(E=(b=Di.get(this))==null?void 0:b.options)!=null?E:Pd(this)),{eventSink:this,value:ve})),!Di.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const Se of Object.keys(Mc.optionsAttributes))this.upgradeProperty(gl(Se))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Di.has(this)){const Se=this._mathfield,Re=Di.get(this),Je=Re.menuItems;Se.model.deferNotifications({content:!1,selection:!1},()=>{const yt=Re.value;yt!==void 0&&Se.setValue(yt),Se.model.selection=Re.selection,Di.delete(this)}),Je&&(this.menuItems=Je)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),kh()}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=gc(this._mathfield.options,Object.keys(Mc.optionsAttributes).map(ee=>gl(ee)));Di.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":va(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",""),Su()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Su()?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"),Su()?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:_e(we({},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=Di.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}Di.has(this)?Di.set(this,_e(we({},Di.get(this)),{menuItems:y})):Di.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:Di.has(this)?Di.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,va(this._mathfield);return}if(Di.has(this)){Di.set(this,_e(we({},Di.get(this)),{selection:y}));return}Di.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:Di.has(this)?Di.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,va(this._mathfield)),Di.has(this)){Di.set(this,_e(we({},Di.get(this)),{selection:{ranges:[[y,y]]}}));return}Di.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}};Qa.version="0.98.5",Qa._fontsDirectory="./fonts",Qa._soundsDirectory="./sounds",Qa.keypressVibration=!0,Qa._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Qa._plonkSound="plonk.wav",Qa.audioBuffers={},Qa.createHTML=a=>a,Qa._speechEngineRate="100%",Qa._speechEngineVoice="Joanna",Qa._textToSpeechMarkup="",Qa._textToSpeechRules="mathlive",Qa._textToSpeechRulesOptions={},Qa.speakHook=r1,Qa.readAloudHook=f1,Qa._decimalSeparator=".",Qa.fractionNavigationOrder="numerator-denominator",Qa._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 Id=Qa;function gl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Pd(a){const y={readOnly:!1},b=Id.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 Su(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Id,yp,bp,xp,wp;if(rt()&&!((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=Id,(wp=window.customElements)==null||wp.define("math-field",Id)}function m1(a,y,b){let E=b,ee=0;const re=a.length;for(;E<y.length;){const ae=y[E];if(ee<=0&&y.slice(E,E+re)===a)return E;ae==="\\"?E++:ae==="{"?ee++:ae==="}"&&ee--,E++}return-1}function Jh(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const he=ae.data;let me=!0,ve=0,Se;Se=he.indexOf(y),Se!==-1&&(ve=Se,ve>0&&re.push({type:"text",data:he.slice(0,ve)}),me=!1);let Re=!1;for(;!Re;){if(me){if(Se=he.indexOf(y,ve),Se===-1){Re=!0;break}ve!==Se&&re.push({type:"text",data:he.slice(ve,Se)}),ve=Se}else{if(Se=m1(b,he,ve+y.length),Se===-1){Re=!0;break}let Je=he.slice(ve+y.length,Se);ee==="ascii-math"&&([,Je]=uc(Je,{format:"ascii-math"})),re.push({type:"math",data:Je,rawData:he.slice(ve,Se+b.length),mathstyle:E}),ve=Se+b.length}me=!me}ve<he.length&&re.push({type:"text",data:he.slice(ve)})}else re.push(ae);return re}function Sp(a,y,b){let E=[{type:"text",data:a}];return y!=null&&y.inline&&y.inline.forEach(([ee,re])=>{E=Jh(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Jh(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Jh(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Jh(E,ee,re,"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"}),re=document.createElement("span");return re.dataset.latex=a,re.style.display=b==="displaystyle"?"flex":"inline-flex",re.setAttribute("aria-hidden","true"),re.setAttribute("translate","no"),re.innerHTML=window.MathfieldElement.createHTML(ee),re}catch(ee){if(console.error("Could not parse'"+a+"' with ",ee),E)return document.createTextNode(a)}return null}function Cu(a,y,b,E){var ee;const re=v1(a,b,y||"textstyle",E),ae=(ee=b.renderAccessibleContent)!=null?ee:"";if(re&&/\b(mathml|speakable-text)\b/i.test(ae)){const he=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&he.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const me=document.createElement("span");me.setAttribute("translate","no");const ve=b.renderToSpeakableText(a);me.innerHTML=window.MathfieldElement.createHTML(ve),me.className="ML__sr-only",he.append(me)}return he.append(re),he}return re}function y1(a,y){var b,E,ee;let re=null;if((b=y.TeX)!=null&&b.processEnvironments&&/^\s*\\begin/.test(a)){re=document.createDocumentFragment();const ae=Cu(a,"",y,!0);ae&&re.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;re=document.createDocumentFragment();for(const he of ae)if(he.type==="text")re.appendChild(document.createTextNode(he.data));else{const me=Cu(he.data,he.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);me&&re.appendChild(me)}}return re}function Cp(a,y){var b,E,ee,re,ae,he,me,ve,Se,Re,Je,yt,_t,gn,sr,hn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const $n=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test($n)){a.textContent="";const zn=Cu($n,"",y,!0);zn&&a.append(zn);return}const pr=Sp($n,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(pr.length===1&&pr[0].type==="math"){a.textContent="";const zn=Cu(pr[0].data,pr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);zn&&a.append(zn);return}if(pr.length===1&&pr[0].type==="text")return}for(let $n=a.childNodes.length-1;$n>=0;$n--){const pr=a.childNodes[$n];if(pr.nodeType===3){const zn=y1((ae=pr.textContent)!=null?ae:"",y);zn&&($n+=zn.childNodes.length-1,pr.replaceWith(zn))}else if(pr.nodeType===1){const zn=pr,Fr=pr.nodeName.toLowerCase();if(Fr==="script"){const Xr=pr;let Zr;if((he=y.processScriptTypePattern)!=null&&he.test(Xr.type))Zr=(me=Xr.textContent)!=null?me:"";else if((ve=y.processMathJSONScriptTypePattern)!=null&&ve.test(Xr.type))try{Zr=(Re=y.serializeToLatex)==null?void 0:Re.call(y,JSON.parse((Se=Xr.textContent)!=null?Se:""))}catch(Ei){console.error(Ei)}if(Zr){let Ei="textstyle";for(const wr of Xr.type.split(";")){const[Wo,js]=wr.toLowerCase().split("=");Wo.trim()==="mode"&&(Ei=js.trim()==="display"?"displaystyle":"textstyle")}const ji=Cu(Zr,Ei,y,!0);ji&&Xr.parentNode.replaceChild(ji,Xr)}}else if(((yt=(Je=y.processClassPattern)==null?void 0:Je.test(zn.className))!=null?yt:!1)||!((gn=(_t=y.skipTags)==null?void 0:_t.includes(Fr))!=null&&gn||(hn=(sr=y.ignoreClassPattern)==null?void 0:sr.test(zn.className))!=null&&hn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Zr=a.textContent;a.textContent="";const Ei=Cu(Zr!=null?Zr:"","displaystyle",y,!0);Ei&&a.append(Ei)}else Cp(zn,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,re;try{const ae=we(we({},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((re=ae.processMathJSONScriptType)!=null?re:""),kh(),Bo("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 Fl(){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){M1(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 M1(a,y){var b,E,ee,re;const ae=C1(a);if(!ae)return;const he=y!=null?y:{};(b=he.renderToMarkup)!=null||(he.renderToMarkup=Va),(E=he.renderToMathML)!=null||(he.renderToMathML=Rv),(ee=he.renderToSpeakableText)!=null||(he.renderToSpeakableText=$v),(re=he.serializeToLatex)!=null||(he.serializeToLatex=Nv),x1(ae,he)}var I1={mathlive:"0.98.5"}},16722:function(Mn,rn,ue){"use strict";ue.d(rn,{Z:function(){return we}});const fe=_e=>typeof _e=="object"&&_e!=null&&_e.nodeType===1,Ze=(_e,Ne)=>(!Ne||_e!=="hidden")&&_e!=="visible"&&_e!=="clip",Fe=(_e,Ne)=>{if(_e.clientHeight<_e.scrollHeight||_e.clientWidth<_e.scrollWidth){const dt=getComputedStyle(_e,null);return Ze(dt.overflowY,Ne)||Ze(dt.overflowX,Ne)||(Ae=>{const He=(rt=>{if(!rt.ownerDocument||!rt.ownerDocument.defaultView)return null;try{return rt.ownerDocument.defaultView.frameElement}catch(je){return null}})(Ae);return!!He&&(He.clientHeight<Ae.scrollHeight||He.clientWidth<Ae.scrollWidth)})(_e)}return!1},tt=(_e,Ne,dt,Ae,He,rt,je,it)=>rt<_e&&je>Ne||rt>_e&&je<Ne?0:rt<=_e&&it<=dt||je>=Ne&&it>=dt?rt-_e-Ae:je>Ne&&it<dt||rt<_e&&it>dt?je-Ne+He:0,be=_e=>{const Ne=_e.parentElement;return Ne==null?_e.getRootNode().host||null:Ne},De=(_e,Ne)=>{var dt,Ae,He,rt;if(typeof document=="undefined")return[];const{scrollMode:je,block:it,inline:at,boundary:xt,skipOverflowHiddenElements:jt}=Ne,Qe=typeof xt=="function"?xt:Wt=>Wt!==xt;if(!fe(_e))throw new TypeError("Invalid target");const mt=document.scrollingElement||document.documentElement,We=[];let Me=_e;for(;fe(Me)&&Qe(Me);){if(Me=be(Me),Me===mt){We.push(Me);break}Me!=null&&Me===document.body&&Fe(Me)&&!Fe(document.documentElement)||Me!=null&&Fe(Me,jt)&&We.push(Me)}const Ke=(Ae=(dt=window.visualViewport)==null?void 0:dt.width)!=null?Ae:innerWidth,Ve=(rt=(He=window.visualViewport)==null?void 0:He.height)!=null?rt:innerHeight,{scrollX:Mt,scrollY:Xe}=window,{height:Nt,width:ht,top:Tt,right:et,bottom:Ut,left:ft}=_e.getBoundingClientRect(),{top:Dt,right:Bt,bottom:bt,left:$e}=(Wt=>{const qe=window.getComputedStyle(Wt);return{top:parseFloat(qe.scrollMarginTop)||0,right:parseFloat(qe.scrollMarginRight)||0,bottom:parseFloat(qe.scrollMarginBottom)||0,left:parseFloat(qe.scrollMarginLeft)||0}})(_e);let xe=it==="start"||it==="nearest"?Tt-Dt:it==="end"?Ut+bt:Tt+Nt/2-Dt+bt,gt=at==="center"?ft+ht/2-$e+Bt:at==="end"?et+Bt:ft-$e;const en=[];for(let Wt=0;Wt<We.length;Wt++){const qe=We[Wt],{height:Ye,width:Lt,top:mn,right:Qt,bottom:dn,left:Zt}=qe.getBoundingClientRect();if(je==="if-needed"&&Tt>=0&&ft>=0&&Ut<=Ve&&et<=Ke&&(qe===mt&&!Fe(qe)||Tt>=mn&&Ut<=dn&&ft>=Zt&&et<=Qt))return en;const Vt=getComputedStyle(qe),zt=parseInt(Vt.borderLeftWidth,10),ye=parseInt(Vt.borderTopWidth,10),se=parseInt(Vt.borderRightWidth,10),oe=parseInt(Vt.borderBottomWidth,10);let de=0,pe=0;const le="offsetWidth"in qe?qe.offsetWidth-qe.clientWidth-zt-se:0,Be="offsetHeight"in qe?qe.offsetHeight-qe.clientHeight-ye-oe:0,lt="offsetWidth"in qe?qe.offsetWidth===0?0:Lt/qe.offsetWidth:0,Ot="offsetHeight"in qe?qe.offsetHeight===0?0:Ye/qe.offsetHeight:0;if(mt===qe)de=it==="start"?xe:it==="end"?xe-Ve:it==="nearest"?tt(Xe,Xe+Ve,Ve,ye,oe,Xe+xe,Xe+xe+Nt,Nt):xe-Ve/2,pe=at==="start"?gt:at==="center"?gt-Ke/2:at==="end"?gt-Ke:tt(Mt,Mt+Ke,Ke,zt,se,Mt+gt,Mt+gt+ht,ht),de=Math.max(0,de+Xe),pe=Math.max(0,pe+Mt);else{de=it==="start"?xe-mn-ye:it==="end"?xe-dn+oe+Be:it==="nearest"?tt(mn,dn,Ye,ye,oe+Be,xe,xe+Nt,Nt):xe-(mn+Ye/2)+Be/2,pe=at==="start"?gt-Zt-zt:at==="center"?gt-(Zt+Lt/2)+le/2:at==="end"?gt-Qt+se+le:tt(Zt,Qt,Lt,zt,se+le,gt,gt+ht,ht);const{scrollLeft:It,scrollTop:Ht}=qe;de=Ot===0?0:Math.max(0,Math.min(Ht+de/Ot,qe.scrollHeight-Ye/Ot+Be)),pe=lt===0?0:Math.max(0,Math.min(It+pe/lt,qe.scrollWidth-Lt/lt+le)),xe+=Ht-de,gt+=It-pe}en.push({el:qe,top:de,left:pe})}return en},Pe=_e=>_e===!1?{block:"end",inline:"nearest"}:(Ne=>Ne===Object(Ne)&&Object.keys(Ne).length!==0)(_e)?_e:{block:"start",inline:"nearest"};function we(_e,Ne){if(!_e.isConnected||!(He=>{let rt=He;for(;rt&&rt.parentNode;){if(rt.parentNode===document)return!0;rt=rt.parentNode instanceof ShadowRoot?rt.parentNode.host:rt.parentNode}return!1})(_e))return;const dt=(He=>{const rt=window.getComputedStyle(He);return{top:parseFloat(rt.scrollMarginTop)||0,right:parseFloat(rt.scrollMarginRight)||0,bottom:parseFloat(rt.scrollMarginBottom)||0,left:parseFloat(rt.scrollMarginLeft)||0}})(_e);if((He=>typeof He=="object"&&typeof He.behavior=="function")(Ne))return Ne.behavior(De(_e,Ne));const Ae=typeof Ne=="boolean"||Ne==null?void 0:Ne.behavior;for(const{el:He,top:rt,left:je}of De(_e,Pe(Ne))){const it=rt-dt.top+dt.bottom,at=je-dt.left+dt.right;He.scroll({top:it,left:at,behavior:Ae})}}}}]);
}());