|
|
!(function(){var Il=Math.pow;var gu=(Cn,Xt,se)=>new Promise((fe,et)=>{var $e=Se=>{try{be(se.next(Se))}catch(Me){et(Me)}},Ue=Se=>{try{be(se.throw(Se))}catch(Me){et(Me)}},be=Se=>Se.done?fe(Se.value):Promise.resolve(Se.value).then($e,Ue);be((se=se.apply(Cn,Xt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[76904],{18299:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},84249:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},42922:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},90674:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},25877:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},63237:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},99569:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},33859:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},38308:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},17663:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},72395:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},53978:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Me}});var fe=se(87462),et=se(67294),$e={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"},Ue=$e,be=se(84089),Se=function(pe,Te){return et.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ue}))},Me=et.forwardRef(Se)},71749:function(){"use strict"},30483:function(){"use strict"},71736:function(Cn,Xt){"use strict";Xt.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},26942:function(){"use strict"},61016: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 Cn={},Xt="5.0",se={},fe=null,et=!1,$e=!1,Ue=null,be=!1,Se=null,Me=null,xe=0;xe<arguments.length;xe++){var pe=arguments[xe];if(pe!==null)switch(typeof pe){case"number":Xt=pe.toFixed(1);break;case"string":pe.match(new RegExp("^[0-9]\\.[0-9]+$"))?Xt=pe:Ue=pe;break;case"object":typeof pe.is3D!="undefined"?fe=pe:se=pe;break;case"boolean":et=pe,$e=!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},se.material_id!==void 0&&!$e&&(et=!0)),Ue!==null&&se.id===void 0&&(se.id=Ue);var Te="",mt="",ze=!1,It=null,Ct=null,ht=null,Ye=!1,De=null,At=null,Jt=null,nt=null,lt=null;se.height!==void 0&&(se.height=Math.round(se.height)),se.width!==void 0&&(se.width=Math.round(se.width));var Ie=function(Je){return parseFloat(Je)>4?parseFloat(Je):5};Cn.setHTML5Codebase=function(Je,st){Me=Je,Nt(Je,st)},Cn.setJavaCodebase=Cn.setJavaCodebaseVersion=Cn.isCompiledInstalled=Cn.setPreCompiledScriptPath=Cn.setPreCompiledResourcePath=function(){},Cn.setHTML5CodebaseVersion=function(Je,st){var _t=parseFloat(Je);if(_t!==NaN&&_t<5){console.log("The GeoGebra HTML5 codebase version "+_t+" is deprecated. Using version latest instead.");return}Se=Je,Le(Je,st)},Cn.getHTML5CodebaseVersion=function(){return Ct},Cn.getParameters=function(){return se},Cn.setFontsCSSURL=function(Je){nt=Je},Cn.setGiacJSURL=function(Je){},Cn.setJNLPFile=function(Je){Te=Je},Cn.setJNLPBaseDir=function(Je){},Cn.inject=function(){function Je(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var st="auto",_t=se.id,en,Bt=!1,Ft=0;Ft<arguments.length;Ft++){var zt=arguments[Ft];typeof zt=="string"?(zt=zt.toLowerCase(),zt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?st=zt:_t=arguments[Ft]):typeof zt=="boolean"?Bt=zt:zt instanceof HTMLElement&&(en=zt)}Mn();function Mn(){if(!be){setTimeout(Mn,200);return}st=yr(st);var bn=en||document.getElementById(_t);if(!bn){console.log("possibly bug on ajax loading? ");return}if(Cn.removeExistingApplet(bn,!1),se.width===void 0&&bn.clientWidth&&(se.width=bn.clientWidth),se.height===void 0&&bn.clientHeight&&(se.height=bn.clientHeight),!(se.width&&se.height)&&st==="html5"&&(delete se.width,delete se.height),It=st,st==="screenshot")Dt(bn,se);else{var Ee=!1;se.hasOwnProperty("playButton")&&se.playButton||se.hasOwnProperty("clickToLoad")&&se.clickToLoad?Ee=!0:se.hasOwnProperty("playButtonAutoDecide")&&se.playButtonAutoDecide&&(Ee=(!ke()||Je())&&je()),Ee?(It="screenshot",un(bn,se,Bt,st)):Ht(bn,se,Bt)}}};function ke(){try{return window.self!==window.top}catch(Je){return!0}}function je(){return se.hasOwnProperty("screenshotGenerator")&&se.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Cn.getViews=function(){return fe},Cn.isJavaInstalled=function(){return!1};var Xe=function(Je){var st=function(Ft){var zt=JSON.parse(Ft),Mn=function(ce){return ce.type=="G"||ce.type=="E"},bn=zt.elements?zt.elements.filter(Mn)[0]:zt;if(!bn||!bn.url){_t();return}se.fileName=bn.url,Pt(bn.settings||{}),fe.is3D=!0;var Ee="https://www.geogebra.org/images/";Cn.setPreviewImage(De||bn.previewUrl,Ee+"GeoGebra_loading.png",Ee+"applet_play.png"),Je()},_t=function(){se.onError&&se.onError(),Nn("Error: Fetching material (id "+se.material_id+") failed.",se)},en=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Bt="/materials/"+se.material_id+"?scope=basic";kt("https://"+en+"/api/proxy.php?path="+encodeURIComponent(Bt),st,_t)};function Pt(Je){var st=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(_t){Je[_t]=!!Je[_t]}),st.forEach(function(_t){se[_t]===void 0&&Je[_t]!==void 0&&(se[_t]=Je[_t])}),se.showToolBarHelp===void 0&&(se.showToolBarHelp=se.showToolBar)}function kt(Je,st,_t){var en=new XMLHttpRequest;en.open("GET",Je),en.onload=function(){st(en.responseText)},en.onerror=_t,en.send()}Cn.isHTML5Installed=function(){return!0},Cn.getLoadedAppletType=function(){return It},Cn.setPreviewImage=function(Je,st,_t){De=Je,At=st,Jt=_t},Cn.removeExistingApplet=function(Je,st){var _t;typeof Je=="string"&&(Je=document.getElementById(Je)),It=null;var en=null;for(_t=0;_t<Je.childNodes.length;_t++){var Bt=Je.childNodes[_t],Ft=Bt.className;Ft==="applet_screenshot"?st?(Bt.style.display="block",It="screenshot"):Bt.style.display="none":Ft!=="applet_scaler prerender"&&(Je.removeChild(Bt),en=Ft&&Ft.indexOf("appletParameters")!=-1?Bt.id:null,_t--)}var zt=se.id!==void 0?se.id:en,Mn=window[zt];Mn&&typeof Mn.getBase64=="function"&&(Mn.remove(),window[zt]=null)},Cn.refreshHitPoints=function(){if(Ie(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Je=Cn.getAppletObject();return Je&&typeof Je.recalculateEnvironments=="function"?(Je.recalculateEnvironments(),!0):!1},Cn.startAnimation=function(){var Je=Cn.getAppletObject();return Je&&typeof Je.startAnimation=="function"?(Je.startAnimation(),!0):!1},Cn.stopAnimation=function(){var Je=Cn.getAppletObject();return Je&&typeof Je.stopAnimation=="function"?(Je.stopAnimation(),!0):!1},Cn.getAppletObject=function(){var Je=se.id!==void 0?se.id:"ggbApplet";return window[Je]},Cn.resize=function(){};var Lt=function(Je,st,_t){var en=document.createElement("param");en.setAttribute("name",st),en.setAttribute("value",_t),Je.appendChild(en)},Ge=function(Je){return Je&&Je!=="false"},Ht=function(Je,st,_t){Ie(Ct)<=4.2&&(_t=!0);var en=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Ct||ggbHTML5LoadedCodebaseIsWebSimple&&!Ye)&&(en=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Bt=document.createElement("div");Bt.classList.add("appletParameters","notranslate");var Ft=st.width,zt=st.height;if(st.disableAutoScale=st.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():st.disableAutoScale,st.width!==void 0)if(Ie(Ct)<=4.4)Ge(st.showToolBar)&&(st.height-=7),Ge(st.showAlgebraInput)&&(st.height-=37),st.width<605&&Ge(st.showToolBar)&&(st.width=605,Ft=605);else{var Mn=100;(Ge(st.showToolBar)||Ge(st.showMenuBar))&&(st.hasOwnProperty("customToolBar")&&(st.customToolbar=st.customToolBar),Mn=Ge(st.showMenuBar)?245:155),Ft<Mn&&(st.width=Mn,Ft=Mn)}Bt.style.border="none",Bt.style.display="inline-block";for(var bn in st)st.hasOwnProperty(bn)&&bn!=="appletOnLoad"&&Bt.setAttribute("data-param-"+bn,st[bn]);nt&&Bt.setAttribute("data-param-fontscssurl",nt),Cn.resize=function(){GGBAppletUtils.responsiveResize(Je,st)},window.addEventListener("resize",function(tn){Cn.resize()});var Ee=typeof st.appletOnLoad=="function"?st.appletOnLoad:function(){};if(!_t&&st.width!==void 0){st.hasOwnProperty("showSplash")||Bt.setAttribute("data-param-showSplash","false");var ce=Je.querySelector(".applet_scaler.prerender"),le=ce!==null;if(le)var ye=ce.querySelector(".ggb_preview");else{var ye=ir(Ft,zt,st.borderColor,!1);ce=document.createElement("div"),ce.className="applet_scaler",ce.style.position="relative",ce.style.display="block",ce.style.width=Ft+"px",ce.style.height=zt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ce,"66%"),Ie(Ct)>=5?(st.appletOnLoad=function(tn){var Nr=Je.querySelector(".ggb_preview");Nr&&Nr.parentNode.removeChild(Nr),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(ce),window.GGBT_wsf_view&&$(window).trigger("resize"),Ee(tn)},le||ce.appendChild(ye)):Bt.appendChild(ye),ce.appendChild(Bt),le||Je.appendChild(ce),setTimeout(function(){Cn.resize()},1)}else{var ve=document.createElement("div");ve.className="applet_scaler",ve.style.position="relative",ve.style.display="block",ve.appendChild(Bt),Je.appendChild(ve),st.appletOnLoad=function(tn){Cn.resize(),Ee(tn)}}function oe(tn,Nr){Nr&&typeof Nr.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(tn,Nr.appletOnLoad):renderGGBElement(tn),Nn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Nr)}function He(tn,Nr){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:tn,params:Nr}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Wr){oe(Wr.article,Wr.params)}),html5AppletsToProcess=null)},Ie(Ct)<5&&(tn.className+=" geogebraweb")):oe(tn,Nr)}if(en){scriptLoadStarted=!0;for(var xt=0;xt<Bt.childNodes.length;xt++){var Yt=Bt.childNodes[xt].tagName;Yt==="TABLE"&&(Bt.removeChild(Bt.childNodes[xt]),xt--)}if(ggbHTML5LoadedScript!==null){var pn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');pn!=null&&pn.parentNode.removeChild(pn)}var dn=document.createElement("script"),An=function(){He(Bt,st)};dn.src=mt+ht,ggbHTML5LoadedCodebaseIsWebSimple=Ye,ggbHTML5LoadedCodebaseVersion=Ct,ggbHTML5LoadedScript=dn.src,Nn("GeoGebra HTML5 codebase loaded: '"+mt+"'.",st),!Me&&(!Se||Se=="5.0")?(Ye?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),An()):mt.requirejs?__webpack_require__.e(12).then(function(){var tn=[__webpack_require__(12)];An.apply(null,tn)}.bind(this)).catch(__webpack_require__.oe):(dn.onload=An,Je.appendChild(dn))}else He(Bt,st);st.height=zt,st.width=Ft},Dt=function(Je,st,_t){var en=ir(st.width,st.height,st.borderColor,_t),Bt=document.createElement("div");Bt.style.position="relative",Bt.style.display="block",Bt.style.width=st.width+"px",Bt.style.height=st.height+"px",Bt.className="applet_screenshot applet_scaler"+(_t?" applet_screenshot_play":""),Bt.appendChild(en);var Ft=GGBAppletUtils.getScale(st,Je,_t);_t?(Je.appendChild(Rn()),window.GGBT_wsf_view||(Je.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Bt,"66%"),Je.appendChild(Bt),Ft!==1&&!isNaN(Ft)&&(GGBAppletUtils.scaleElement(Bt,Ft),Bt.style.width=st.width+"px",Bt.style.height=st.height+"px",Bt.parentNode.style.width=st.width*Ft+"px",Bt.parentNode.style.height=st.height*Ft+"px"),Cn.resize=function(){Ln(Je,en,Bt,_t)},window.addEventListener("resize",function(zt){Cn.resize()}),Cn.resize()};function Ln(Je,st,_t,en){if(Je.contains(st)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Je.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Je)}var Bt=GGBAppletUtils.getScale(se,Je,en);_t.parentNode!==null&&(!isNaN(Bt)&&Bt!==1?(GGBAppletUtils.scaleElement(_t,Bt),_t.parentNode.style.width=se.width*Bt+"px",_t.parentNode.style.height=se.height*Bt+"px"):(GGBAppletUtils.scaleElement(_t,1),_t.parentNode.style.width=se.width+"px",_t.parentNode.style.height=se.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Je),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Cn.onExitFullscreen=function(Je,st){st.appendChild(Je)};var un=function(Je,st,_t,en){Dt(Je,st,!0);for(var Bt=function(){var Mn=[];for(zt=0;zt<Je.childNodes.length;zt++)Mn.push(Je.childNodes[zt]);if(window.GGBT_wsf_view){var bn=window.GGBT_wsf_view.renderFullScreen(Je,st.id),Ee=document.getElementById("fullscreencontainer"),ce=jQuery(Je).find(".fullscreencontent");ce.length>0?(bn.remove(),ce.attr("id","fullscreencontent").show(),jQuery(Ee).append(ce),window.dispatchEvent(new Event("resize"))):Ht(bn,st,!1),window.GGBT_wsf_view.launchFullScreen(Ee)}else It=en,Ht(Je,st,!1);if(!window.GGBT_wsf_view)for(zt=0;zt<Mn.length;zt++)Je.removeChild(Mn[zt])},Ft=Je.getElementsByClassName("ggb_preview_play"),zt=0;zt<Ft.length;zt++)Ft[zt].addEventListener("click",Bt,!1),Ft[zt].addEventListener("ontouchstart",Bt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Je),je()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Rn=function(){var Je=document.createElement("div");if(Je.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var st='.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");}',_t=document.createElement("style");_t.styleSheet?_t.styleSheet.cssText=st:_t.appendChild(document.createTextNode(st)),document.getElementsByTagName("head")[0].appendChild(_t)}return Je},ir=function(Je,st,_t,en){var Bt=document.createElement("div");Bt.className="ggb_preview",Bt.style.position="absolute",Bt.style.zIndex="90",Bt.style.width=Je-2+"px",Bt.style.height=st-2+"px",Bt.style.top="0px",Bt.style.left="0px",Bt.style.overflow="hidden",Bt.style.backgroundColor="white";var Ft="lightgrey";_t!==void 0&&(_t==="none"?Ft="transparent":Ft=_t),Bt.style.border="1px solid "+Ft;var zt=document.createElement("img");if(zt.style.position="relative",zt.style.zIndex="1000",zt.style.top="-1px",zt.style.left="-1px",De!==null&&zt.setAttribute("src",De),zt.style.opacity=.7,At!==null){var Mn,bn,Ee;if(!en){Mn=document.createElement("img"),Mn.style.position="absolute",Mn.style.zIndex="1001",Mn.style.opacity=1,zt.style.opacity=.3,bn=360,bn>Je/4*3&&(bn=Je/4*3),Ee=bn/5.8,Mn.setAttribute("src",At),Mn.setAttribute("width",bn),Mn.setAttribute("height",Ee);var ce=(Je-bn)/2,le=(st-Ee)/2;Mn.style.left=ce+"px",Mn.style.top=le+"px",Bt.appendChild(Mn)}}return Bt.appendChild(zt),Bt},yr=function(Je){return Je=Je.toLowerCase(),Je==="html5"||Je==="screenshot"?Je:"html5"},Qe=["web","webSimple","web3d","tablet","tablet3d","phone"],Le=function(Je,st){if(Ct=Je,st){Nt(Ct,!0);return}var _t=!et;if(_t){var en=Ie(Ct);!isNaN(en)&&en<4.4&&(_t=!1)}var Bt,Ft;window.location.protocol.substr(0,4)==="http"?Bt=window.location.protocol:Bt="http:";var zt=Ct.indexOf("//");zt>0?Ft=Ct:zt===0?Ft=Bt+Ct:Ft="https://www.geogebra.org/apps/5.2.814.0/";for(var Mn in Qe)if(Ct.slice(Qe[Mn].length*-1)===Qe[Mn]||Ct.slice((Qe[Mn].length+1)*-1)===Qe[Mn]+"/"){Nt(Ft,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&_t&&!fe.is3D&&!fe.AV&&!fe.SV&&!fe.CV&&!fe.EV2&&!fe.CP&&!fe.PC&&!fe.DA&&!fe.FI&&!fe.PV&&!Ge(se.showToolBar)&&!Ge(se.showMenuBar)&&!Ge(se.showAlgebraInput)&&!Ge(se.enableRightClick)&&(!se.appName||se.appName=="classic")?Ft+="webSimple/":Ft+="web3d/",Nt(Ft,!1)},Nt=function(Je,st){if(Je.requirejs){mt=Je;return}Je.slice(-1)!=="/"&&(Je+="/"),mt=Je,st===null&&(st=Je.indexOf("http")===-1),ze=st,ht="web.nocache.js",Ye=!1;var _t=mt.split("/");_t.length>1&&(!st&&_t[_t.length-2]==="webSimple"?(ht="webSimple.nocache.js",Ye=!0):Qe.indexOf(_t[_t.length-2])>=0&&(ht=_t[_t.length-2]+".nocache.js")),_t=Je.split("/"),Ct=_t[_t.length-3],Ct.substr(0,4)==="test"?Ct=Ct.substr(4,1)+"."+Ct.substr(5,1):(Ct.substr(0,3)==="war"||Ct.substr(0,4)==="beta")&&(Ct="5.0");var en=parseFloat(Ct);en!==NaN&&en<5&&Je.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+en+" is deprecated. Using version latest instead."),Le("5.0",st))},Nn=function(Je,st){window.console&&window.console.log&&(!st||typeof st.showLogging=="undefined"||st.showLogging&&st.showLogging!=="false")&&console.log(Je)};se.material_id!==void 0?Xe(gn):gn();function gn(){var Je=Xt;Se!==null?Je=Se:parseFloat(Je)<5&&(Je="5.0"),Le(Je,!1),Me!==null&&Nt(Me,ze),be=!0}return Cn},GGBAppletUtils=function(){"use strict";function Cn(){return window.GGBT_wsf_edit!==void 0}function Xt(be,Se){Se!=1?(be.style.transformOrigin="0% 0% 0px",be.style.webkitTransformOrigin="0% 0% 0px",be.style.transform="scale("+Se+","+Se+")",be.style.webkitTransform="scale("+Se+","+Se+")",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 se(be,Se,Me,xe,pe,Te){var mt=null;if(Te!=null&&Te!="")for(var ze=be.parentNode;ze!=null;)if((" "+ze.className+" ").indexOf(" "+Te+" ")>-1){mt=ze;break}else ze=ze.parentNode;var It=0,Ct=0,ht=0,Ye=0,De=0,At=0,Jt=0;if(mt)It=mt.offsetWidth,Ct=Math.max(xe?mt.offsetWidth:0,mt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(It=Math.min(window.innerWidth,document.documentElement.clientWidth),Ct=Math.min(window.innerHeight,document.documentElement.clientHeight),ht=It):(It=window.innerWidth,Ct=window.innerHeight,ht=window.innerWidth),be){var nt=be.getBoundingClientRect();nt.left>0&&nt.left<=It&&(pe===void 0||!pe)&&(document.dir==="rtl"?(De=It-nt.width-nt.left,At=ht<=480?10:30):(At=nt.left,De=ht<=480?10:30),Ye=At+De)}if(be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var lt=be.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Ye=40,Jt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ye=0,Jt=40)}}return be&&((Me===void 0||!Me)&&Se>0&&Se+Ye<It?It=Se:It-=Ye,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Me===void 0||!Me)&&(Ct-=Jt)),{width:It,height:Ct}}function fe(be,Se,Me,xe,pe){if(be.isScreenshoGenerator)return 1;var Te=xe!==void 0&&xe,mt=be.noScaleMargin!=null&&be.noScaleMargin,ze=function(lt){return lt&<!=="false"},It=ze(be.autoHeight),Ct=se(Se,be.width,Me,It,Te&&window.GGBT_wsf_view||mt,pe),ht=parseInt(Ct.width),Ye=be.width,De=be.height;if(Ye===void 0){var At=Se.querySelector(".appletParameters");At&&(Ye=At.offsetWidth,De=At.offsetHeight)}var Jt=ht/Ye,nt=Te?1:Ct.height/De;return Me!==void 0&&!Me&&(Jt=Math.min(1,Jt),nt=Math.min(1,nt)),Math.min(Jt,nt)}function et(be,Se,Me){var xe=1,pe,Te=!1;if(be.hasOwnProperty("allowUpscale")&&(Te=be.allowUpscale),be.hasOwnProperty("scale")&&(xe=parseFloat(be.scale),(isNaN(xe)||xe===null||xe===0)&&(xe=1),xe>1&&(Te=!0)),Se&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Te=!0),!(be.hasOwnProperty("disableAutoScale")&&be.disableAutoScale))pe=fe(be,Se,Te,Me,be.scaleContainerClass);else return xe;return Te&&(!be.hasOwnProperty("scale")||xe===1)?pe:Math.min(xe,pe)}function $e(be){var Se=Math.min(window.innerWidth,document.documentElement.clientWidth),Me=Math.min(window.innerHeight,document.documentElement.clientHeight),xe=be.getBoundingClientRect(),pe=(Se-xe.width)/2,Te=(Me-xe.height)/2;Te<0&&(Te=0),be.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(pe<40?be.style.left="40px":be.style.left=pe+"px",be.style.top=Te+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Te<40?be.style.top="40px":be.style.top=Te+"px",be.style.left=pe+"px")}function Ue(be,Se){var Me=be.querySelector(".appletParameters");if(Me){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Se.id!==Me.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(be)}if(Me.parentElement&&/fullscreen/.test(Me.parentElement.className))return;var xe=et(Se,be);Cn()&&Me.setAttribute("data-param-scale",xe);for(var pe=null,Te=0;Te<be.childNodes.length;Te++)if(be.childNodes[Te].className!==void 0&&be.childNodes[Te].className.match(/^applet_scaler/)){pe=be.childNodes[Te];break}if(pe!==null&&pe.querySelector(".noscale")!==null)return;var mt=Se.id!==void 0?Se.id:"ggbApplet",ze=window[mt];(ze==null||!ze.recalculateEnvironments)&&pe!==null&&!pe.className.match(/fullscreen/)&&(pe.parentNode.style.transform="",!isNaN(xe)&&xe!==1?(pe.parentNode.style.width=Se.width*xe+"px",pe.parentNode.style.height=Se.height*xe+"px",Xt(pe,xe)):(Xt(pe,1),pe.parentNode.style.width=Se.width+"px",pe.parentNode.style.height=Se.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&$e(be),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Me).parents(".content-added-content"))}}return{responsiveResize:Ue,isFlexibleWorksheetEditor:Cn,positionCenter:$e,getScale:et,scaleElement:Xt}}();__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 Cn=n.location.search;return Cn.indexOf(J)!=-1||Cn.indexOf(K)!=-1}function q(Cn,Xt){}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(Cn){var Xt=s[L].bindings;s[L].bindings=function(){for(var se=Xt?Xt():{},fe=Cn[webModule.__softPermutationId],et=O;et<fe.length;et++){var $e=fe[et];se[$e[O]]=$e[P]}return se}};var t;function u(){return v(),t}function v(){if(!t){var Cn=o.createElement(Q);if(Cn.id=L,Cn.style.cssText=R+S,Cn.tabIndex=-1,o.body.appendChild(Cn),t=Cn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Xt=document.compatMode==U?V:W;t.write(Xt+X),t.close()}}}function w(Cn){function Xt(fe){function et(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var $e=et();if($e){fe();return}function Ue(){if(!$e){if(!et())return;$e=!0,fe(),o.removeEventListener&&o.removeEventListener(Z,Ue,!1),be&&clearInterval(be)}}o.addEventListener&&o.addEventListener(Z,Ue,!1);var be=setInterval(function(){Ue()},$)}function se(fe){var et=u(),$e=et.body,Ue=et.createElement(_);Ue.language=ab,Ue.crossOrigin=W,Ue.src=fe,webModule.__errFn&&(Ue.onerror=function(){webModule.__errFn(L,new Error(bb+fe))}),$e.appendChild(Ue)}Xt(function(){se(Cn)})}webModule.__startLoadingFragment=function(Cn){return C(Cn)},webModule.__installRunAsyncCode=function(Cn){var Xt=u(),se=Xt.body,fe=Xt.createElement(_);fe.language=ab,fe.text=Cn,se.appendChild(fe),se.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(Cn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Cn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Cn){var Xt=c[Cn];return Xt==null?null:Xt},r=d,webModule.__errFn=e}function B(){function Cn(be){var Se=be.lastIndexOf(rb);Se==-1&&(Se=be.length);var Me=be.indexOf(sb);Me==-1&&(Me=be.length);var xe=be.lastIndexOf(tb,Math.min(Me,Se));return xe>=O?be.substring(O,xe+P):W}function Xt(be){if(!be.match(/^\w+:\/\//)){var Se=o.createElement(ub);Se.src=be+vb,be=Cn(Se.src)}return be}function se(){var be=__gwt_getMetaProperty(wb);return be!=null?be:W}function fe(){for(var be=o.getElementsByTagName(_),Se=O;Se<be.length;++Se)if(be[Se].src.indexOf(xb)!=-1)return Cn(be[Se].src);return W}function et(){var be=o.getElementsByTagName(yb);return be.length>O?be[be.length-P].href:W}function $e(){var be=o.location;return be.href==be.protocol+zb+be.host+be.pathname+be.search+be.hash}var Ue=se();return Ue==W&&(Ue=fe()),Ue==W&&(Ue=et()),Ue==W&&$e()&&(Ue=Cn(o.location.href)),Ue=Xt(Ue),Ue}function C(Cn){return Cn.match(/^\//)||Cn.match(/^[a-zA-Z]+:\/\//)?Cn:webModule.__moduleBase+Cn}function D(){var Cn=[],Xt=O,se=[],fe=[];function et(be){var Se=fe[be](),Me=se[be];if(Se in Me)return Se;var xe=[];for(var pe in Me)xe[Me[pe]]=pe;throw r&&r(be,xe,Se),null}if(__gwt_isKnownPropertyValue=function(be,Se){return Se in se[be]},webModule.__getPropMap=function(){var be={};for(var Se in se)se.hasOwnProperty(Se)&&(be[Se]=et(Se));return be},webModule.__computePropValue=et,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var $e;try{$e=Cb;var Ue=$e.indexOf(Db);Ue!=-1&&(Xt=parseInt($e.substring(Ue+P),$),$e=$e.substring(O,Ue))}catch(be){}return webModule.__softPermutationId=Xt,C($e+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})()},15476:function(Cn,Xt,se){"use strict";se.d(Xt,{Ax:function(){return Ue},Ds:function(){return be},KI:function(){return Me},SI:function(){return $e},f1:function(){return et}});var fe=se(11320);function et(xe){let pe=!0;if(xe.length>0){for(let Te=0;Te<xe.length;Te++)if(xe[Te].compile_success==0||!xe[Te].compile_success){pe=!1;break}}else pe=!1;return pe}function $e(xe,pe=""){let Te=[];for(let mt=0;mt<xe.length;mt++){let ze=xe[mt],It=pe?`${pe}/${ze.name}`:`${ze.name}`;Te.push({title:ze.name,type:ze.type,isLeaf:ze.type!=="tree",key:It})}return Te}function Ue(xe,pe,Te){for(let mt=0;mt<xe.length;mt++){let ze=xe[mt];if(ze.key===pe){ze.children=Te;break}ze.children&&Ue(ze.children,pe,Te)}return xe}function be(xe,pe,Te){let mt;return function(){let ze=this,It=arguments,Ct=function(){mt=null,Te||xe.apply(ze,It)},ht=Te&&!mt;clearTimeout(mt),mt=setTimeout(Ct,pe),ht&&xe.apply(ze,It)}}const Se=!0,Me=fe.Z.API_SERVER},63205:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return mt}});var fe=se(67294),et={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},$e=se(94184),Ue=se.n($e),be=se(57953),Se=se(15979),Me=se(33170),xe=se(28706),pe=(ze,It,Ct)=>new Promise((ht,Ye)=>{var De=nt=>{try{Jt(Ct.next(nt))}catch(lt){Ye(lt)}},At=nt=>{try{Jt(Ct.throw(nt))}catch(lt){Ye(lt)}},Jt=nt=>nt.done?ht(nt.value):Promise.resolve(nt.value).then(De,At);Jt((Ct=Ct.apply(ze,It)).next())}),mt=({data:ze,className:It,fullWidth:Ct,style:ht={},onClose:Ye,onOk:De,showFullTools:At,noAssociationId:Jt})=>{const nt=(0,fe.useRef)(null),lt=(0,fe.useRef)(null),Ie=(0,fe.useRef)(null),ke=(0,fe.useRef)(null),[je,Xe]=(0,fe.useState)(!1),[Pt,kt]=(0,fe.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,fe.useEffect)(()=>{Ie.current||(Ie.current=document.createElement("style"),document.head.appendChild(Ie.current)),ze!=null&&ze.visible?(document.body.setAttribute("data-custom","y-hidden"),Ie.current.innerHTML=" html { overflow-y: hidden; }",ze!=null&&ze.src&&Lt()):(document.body.removeAttribute("data-custom"),Ie.current&&(document.head.removeChild(Ie.current),Ie.current=null))},[ze==null?void 0:ze.visible]);const Lt=()=>pe(void 0,null,function*(){Xe(!0),kt("\u6B63\u5728\u52A0\u8F7D\u4E2D");const un=yield(0,xe.ZJ)(ze==null?void 0:ze.src);nt.current.src="",nt.current.src=un,nt.current.onload=function(){Ln()},Xe(!1),kt("")}),Ge=()=>{document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Ye()},Ht=un=>pe(void 0,null,function*(){Xe(!0),kt("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Rn=yield(0,Me.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ze.title,file:un.dataUrl}});Rn!=null&&Rn.id&&!Jt?(yield(0,Me.ZP)(`/api/attachments/${ze.id}/add_subitem.json`,{method:"post",body:{subitem_id:Rn==null?void 0:Rn.id,settings:JSON.stringify(un.state)}})).status===0&&De():Rn!=null&&Rn.id&&De(Rn),document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Xe(!1),kt("")}),Dt=()=>{const un=document.querySelector('a[href="https://markerjs.com/"]');un&&un.parentNode&&(un.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(ir=>{const yr=document.querySelector(ir.name);yr&&yr.setAttribute("title",ir.title)})},Ln=()=>{lt.current=new Se.hP(nt.current),lt.current.targetRoot=ke.current,lt.current.addEventListener("render",Ht),lt.current.addEventListener("beforeclose",Ge),At&&(lt.current.availableMarkerTypes=lt.current.ALL_MARKER_TYPES,lt.current.uiStyleSettings.redoButtonVisible=!0,lt.current.uiStyleSettings.notesButtonVisible=!0,lt.current.uiStyleSettings.zoomButtonVisible=!0,lt.current.uiStyleSettings.zoomOutButtonVisible=!0,lt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=lt.current.uiStyleSettings,lt.current.show(),ze!=null&&ze.snapshotData&<.current.restoreState(ze.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Dt()},300)};return fe.createElement(fe.Fragment,null,(ze==null?void 0:ze.visible)&&fe.createElement(be.Z,{spinning:je,tip:Pt,style:{position:"absolute"}},fe.createElement("div",{ref:ke,className:Ue()(et.imageDimensions,It,Ct?et.fullWidth:""),style:ht},fe.createElement("img",{className:et.img,ref:nt}))))}},36527:function(Cn,Xt,se){"use strict";var fe=se(67294),et=se(71230),$e=se(15746),Ue=se(66368),be=se(71577),Se=se(35598),Me=se(71736),xe=se(84279),pe=se(67294);const Te=(0,fe.forwardRef)(({callback:mt,showSaveButton:ze,value:It=""},Ct)=>{const ht=(0,fe.useRef)(),Ye=[{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 "}]}]}],De=[{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}`}]}]}],At=lt=>{ht.current.setValue(ht.current.getValue()+" "+lt.value+" ")},Jt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:pe.createElement(et.Z,{className:Me.Z.lists,gutter:[10,10]},Ye.map((lt,Ie)=>pe.createElement($e.Z,{flex:"110px",className:Me.Z.item},pe.createElement("div",null,pe.createElement(Se.Z,{value:`$$${lt.value}$$`}),lt.name),pe.createElement("div",{className:Me.Z.children},lt.children.map((ke,je)=>pe.createElement("div",{key:je},pe.createElement("h1",null,ke.name),pe.createElement(et.Z,{gutter:[10,10]},ke.data.map((Xe,Pt)=>pe.createElement($e.Z,{key:Pt,onClick:()=>At(Xe),className:Me.Z.diamond},pe.createElement(Se.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:pe.createElement(et.Z,{className:Me.Z.lists,gutter:[10,10]},De.map((lt,Ie)=>pe.createElement($e.Z,{flex:"110px",className:Me.Z.item},pe.createElement("div",null,pe.createElement(Se.Z,{value:"`$$"+lt.value+"$$`"}),lt.name),pe.createElement("div",{className:Me.Z.children},lt.children.map((ke,je)=>pe.createElement("div",{key:je},ke.name&&pe.createElement("h1",null,ke.name),pe.createElement(et.Z,{gutter:[10,10]},ke.data.map((Xe,Pt)=>pe.createElement($e.Z,{key:Pt,onClick:()=>At(Xe),className:Me.Z.diamond},pe.createElement(Se.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))}],nt=()=>{var lt=document.createElement("div");lt.innerHTML=ht.current.getValue();var Ie=lt.innerText;return mt&&mt(Ie),Ie};return(0,fe.useImperativeHandle)(Ct,()=>({getData:nt})),pe.createElement("div",{className:Me.Z.mathWrap},pe.createElement(Ue.default,{defaultActiveKey:"1",items:Jt}),pe.createElement("math-field",{locale:"zh_cn",className:Me.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:ht,style:{width:800,marginTop:30,fontSize:18}},It||""),ze&&pe.createElement("div",{className:Me.Z.button},pe.createElement(be.ZP,{size:"large",onClick:nt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Xt.Z=Te},57444:function(Cn,Xt,se){"use strict";se.d(Xt,{h:function(){return lt}});var fe=se(67294),et=se(11713),$e=se(22150),Ue=se(71577),be=se(4631),Se=se.n(be),Me=se(71749),xe=se(30483),pe=Object.defineProperty,Te=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ht=(Ie,ke,je)=>ke in Ie?pe(Ie,ke,{enumerable:!0,configurable:!0,writable:!0,value:je}):Ie[ke]=je,Ye=(Ie,ke)=>{for(var je in ke||(ke={}))It.call(ke,je)&&ht(Ie,je,ke[je]);if(ze)for(var je of ze(ke))Ct.call(ke,je)&&ht(Ie,je,ke[je]);return Ie},De=(Ie,ke)=>Te(Ie,mt(ke));const At=et.default.Option,Jt={labelCol:{span:4},wrapperCol:{span:20}},nt={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"]};Xt.Z=({callback:Ie,onCancel:ke})=>{const[je,Xe]=(0,fe.useState)("python");function Pt(Lt){Xe(nt[Lt][1])}function kt(Lt){Ie(Lt)}return fe.createElement($e.default,De(Ye({},Jt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:kt,style:{width:500}}),fe.createElement($e.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},fe.createElement(et.default,{getPopupContainer:Lt=>Lt.parentNode,onChange:Pt},Object.keys(nt).map(Lt=>fe.createElement(At,{key:Lt,value:Lt},nt[Lt][0])))),fe.createElement($e.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},fe.createElement(lt,{mode:je})),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(Ue.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(Ue.ZP,{type:"ghost",onClick:ke},"\u53D6\u6D88")))};function lt({value:Ie,onChange:ke,mode:je,options:Xe={}}){const Pt=(0,fe.useRef)(),[kt,Lt]=(0,fe.useState)();return(0,fe.useEffect)(()=>{if(kt){let Ge=function(Ht){const Dt=Ht.getValue();ke&&ke(Dt)};return kt.on("change",Ge),()=>{kt.off("change",Ge)}}},[kt,ke]),(0,fe.useEffect)(()=>{kt&&kt.setOption("mode",je)},[kt,je]),(0,fe.useEffect)(()=>{kt&&(Ie!==kt.getValue()||Ie==="")&&setTimeout(()=>{kt.setValue(Ie||"")},300)},[kt,Ie]),(0,fe.useEffect)(()=>{if(Pt.current&&!kt){const Ge=Se().fromTextArea(Pt.current,Ye({mode:je,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Xe));Lt(Ge)}},[Pt.current,kt]),fe.createElement("div",{className:"my-codemirror-container"},fe.createElement("textarea",{ref:Pt}))}},91304:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return pr}});var fe=se(67294),et=se(4631),$e=se.n(et),Ue=se(91033),be=se(71749),Se=se(57341),Me=se(82801),xe=se(88386),pe=se(49047),Te=se(80785),mt=se(35598),ze=({value:Hn="",className:Ze,showTextOnly:at,showLines:Et,style:jt={}})=>{const Ke=(0,fe.useMemo)(()=>"",[Hn]);return fe.createElement(fe.Fragment,null,fe.createElement("div",{dangerouslySetInnerHTML:{__html:Ke}}))},It=se(67294),Ct=Object.defineProperty,ht=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,nt=(Hn,Ze,at)=>Ze in Hn?Ct(Hn,Ze,{enumerable:!0,configurable:!0,writable:!0,value:at}):Hn[Ze]=at,lt=(Hn,Ze)=>{for(var at in Ze||(Ze={}))At.call(Ze,at)&&nt(Hn,at,Ze[at]);if(De)for(var at of De(Ze))Jt.call(Ze,at)&&nt(Hn,at,Ze[at]);return Hn},Ie=(Hn,Ze)=>ht(Hn,Ye(Ze));let ke=[{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 je({onActionCallback:Hn,title:Ze,icon:at,actionName:Et,className:jt="",children:Ke}){function dt(){Hn(Et)}return It.createElement("a",{title:Ze,className:jt,onClick:dt},It.createElement("i",{className:`${at}`}),Ke)}var Xe=({watch:Hn,showNullButton:Ze,showNullProgramButton:at,onActionCallback:Et,fullScreen:jt,insertTemp:Ke,hidetoolBar:dt,extraUse:Rt})=>{const Tt=[...ke,{title:`${Hn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Hn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return It.createElement("ul",{className:"markdown-toolbar-container"},!dt&&Tt.map((Wt,Zt)=>It.createElement("li",{key:Zt},Wt.actionName?It.createElement(je,Ie(lt({},Wt),{onActionCallback:Et})):It.createElement("span",{className:"v-line"}))),Ze?It.createElement("li",null,It.createElement(je,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Et},It.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,at?It.createElement(It.Fragment,null,It.createElement("li",null,It.createElement(je,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Et},It.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),It.createElement("li",null,It.createElement(je,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Et},It.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Ke&&It.createElement("li",null,It.createElement(je,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Ke}`,onActionCallback:Et},It.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Rt&&It.createElement("li",null,Rt),It.createElement("li",{className:"btn-full-screen"},It.createElement(je,{icon:`${jt?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:jt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Et})))},Pt=se(76621),kt=se(22150),Lt=se(69677),Ge=se(71577),Ht=Object.defineProperty,Dt=Object.defineProperties,Ln=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,yr=(Hn,Ze,at)=>Ze in Hn?Ht(Hn,Ze,{enumerable:!0,configurable:!0,writable:!0,value:at}):Hn[Ze]=at,Qe=(Hn,Ze)=>{for(var at in Ze||(Ze={}))Rn.call(Ze,at)&&yr(Hn,at,Ze[at]);if(un)for(var at of un(Ze))ir.call(Ze,at)&&yr(Hn,at,Ze[at]);return Hn},Le=(Hn,Ze)=>Dt(Hn,Ln(Ze));const Nt={labelCol:{span:4},wrapperCol:{span:20}};var Nn=({callback:Hn,onCancel:Ze})=>{function at(Et){Hn(Et)}return fe.createElement(kt.default,Le(Qe({},Nt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:at,style:{width:500}}),fe.createElement(kt.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},fe.createElement(Lt.default,null)),fe.createElement(kt.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},fe.createElement(Lt.default,null)),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(Ge.ZP,{type:"ghost",onClick:Ze},"\u53D6\u6D88")))},gn=se(57444),Je=se(70859),st=se(14446),_t=se(71230),en=se(63205),Bt=se(67294),Ft=({callback:Hn,onCancel:Ze})=>{const at=document.createElement("canvas"),Et=at.getContext("2d");at.width=1e3,at.height=800,Et.fillStyle="#ffffff",Et.fillRect(0,0,at.width,at.height);const jt=at.toDataURL("image/png");return Bt.createElement(st.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Bt.createElement(_t.Z,{style:{height:"100vh"}},Bt.createElement(en.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:jt,visible:!0,title:String(Date.now())},onOk:Ke=>{Hn({src:Ke.url})},onClose:Ze})))},zt=se(72565),Mn=se(15746),bn=se(2453),Ee={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ce=se(67294),ye=(0,fe.forwardRef)(({onCancel:Hn,editImgId:Ze,callback:at},Et)=>{let jt=(0,fe.useRef)(),Ke=(0,fe.useRef)(),dt=(0,fe.useRef)(),Rt=(0,fe.useRef)(!1);const Tt=(0,fe.useRef)(!1);console.log("ref:",Et);const[Wt,Zt]=(0,fe.useState)(0),[zn,Sr]=(0,fe.useState)("100vh");return(0,fe.useEffect)(()=>{Zt(1);try{indexedDB.databases().then(Yn=>{Yn.forEach(qn=>indexedDB.deleteDatabase(qn.name))})}catch(Yn){}},[]),(0,fe.useImperativeHandle)(Et,()=>({setHeight:Sr})),ce.createElement("div",{ref:Tt,className:"body-overflow-initial"},ce.createElement(zt.Z,{width:"100vw",height:zn,footer:null,closable:!0,placement:"bottom",open:!!Wt,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${Ee.drawerWrap}`,onClose:()=>{window.saveDrawData(Yn=>{at({src:`/api/attachments/${Yn}`,id:Yn})})},title:ce.createElement(_t.Z,{align:"middle"},ce.createElement(Mn.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ce.createElement(Mn.Z,{onClick:()=>{Sr(zn==="60px"?"100vh":"60px")}},ce.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),ce.createElement(Mn.Z,{onClick:()=>{window.saveDrawData(Yn=>{if(Yn===null){bn.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}bn.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),at({src:`/api/attachments/${Yn}`,id:Yn,disabledClose:!0})})}},ce.createElement(Ge.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},ce.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${Ze||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Ke})))}),ve=se(11320),oe=se(78045),He=se(31795);const xt=oe.ZP.Group,Yt={margin:"0 8px"};var pn=({callback:Hn,onCancel:Ze})=>{function at(Et){Hn(Et)}return fe.createElement(kt.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:at},fe.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},fe.createElement("span",{style:Yt},"\u5355\u5143\u683C\u6570\uFF1A"),fe.createElement("span",{style:Yt},"\u884C\u6570"),fe.createElement(kt.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},fe.createElement(He.Z,null)),fe.createElement("span",{style:Yt},"\u5217\u6570"),fe.createElement(kt.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},fe.createElement(He.Z,null))),fe.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},fe.createElement("span",{style:Yt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),fe.createElement(kt.default.Item,{name:"align"},fe.createElement(xt,null,fe.createElement(oe.ZP,{value:"default"},fe.createElement("i",{className:"fa fa-align-justify"})),fe.createElement(oe.ZP,{value:"left"},fe.createElement("i",{className:"fa fa-align-left"})),fe.createElement(oe.ZP,{value:"center"},fe.createElement("i",{className:"fa fa-align-center"})),fe.createElement(oe.ZP,{value:"right"},fe.createElement("i",{className:"fa fa-align-right"}))))),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(Ge.ZP,{type:"ghost",onClick:Ze},"\u53D6\u6D88")))},dn=se(47897),An=se(61016),tn=se.n(An),Wr=(0,fe.forwardRef)(({use3d:Hn,width:Ze,height:at,callback:Et,showSaveButton:jt},Ke)=>{const dt=(0,fe.useRef)(),Rt=(0,fe.useRef)(),[Tt,Wt]=(0,fe.useState)(!1),Zt=(0,fe.useRef)({id:dt,appName:"graphing",width:Ze||1e3,height:at||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)(()=>{Rt.current=new(tn())(Zt.current,!0),window.onload=function(){Rt.current.inject("applet_container")}},[]);const zn=()=>{var Sr=window.ggbApplet.getPNGBase64(1,!0,72);return Et&&Et(Sr),Sr};return(0,fe.useEffect)(()=>{Zt.current.appName=Tt?"3D":"graphing",Rt.current.inject("applet_container")},[Tt]),(0,fe.useEffect)(()=>{Wt(Hn)},[Hn]),(0,fe.useImperativeHandle)(Ke,()=>({getImgData:zn})),fe.createElement(fe.Fragment,null,fe.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:dt}),fe.createElement(_t.Z,{align:"middle"},fe.createElement(Mn.Z,{flex:1},fe.createElement(dn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Tt,onChange:Sr=>Wt(Sr)})),fe.createElement(Mn.Z,null,fe.createElement(Ge.ZP,{size:"large",onClick:zn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Kt=se(36527),$n=se(25934);const ei="link",hi="upload-image",ut="add-flowchart",Vt="draw-image",Vn="add-flowchart",rr="code-block",gr="add-table",Ir="------------",Ur={default:Ir,left:`:${Ir}`,center:`:${Ir}:`,right:`${Ir}:`};var Gr=se(99914),Xr=(Hn,Ze,at)=>new Promise((Et,jt)=>{var Ke=Tt=>{try{Rt(at.next(Tt))}catch(Wt){jt(Wt)}},dt=Tt=>{try{Rt(at.throw(Tt))}catch(Wt){jt(Wt)}},Rt=Tt=>Tt.done?Et(Tt.value):Promise.resolve(Tt.value).then(Ke,dt);Rt((at=at.apply(Hn,Ze)).next())});function ui(){}let br=0;const Ei=1e4,sa="\u2581",Ji="@\u2581\u2581@",Qi="@\u2581@",Ci=`
|
|
|
**\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`,gt=["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 En(Hn){return/^\d+$/.test(Hn)?`${Hn}px`:Hn}const Tn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",sr={[Tn+"-B"]:"bold",[Tn+"-I"]:"italic"},tr={[ei]:"\u6DFB\u52A0\u94FE\u63A5",[rr]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[hi]:"\u6DFB\u52A0\u56FE\u7247",[Vt]:"\u6DFB\u52A0\u753B\u56FE",[ut]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[gr]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var pr=({defaultValue:Hn="",onChange:Ze,width:at="100%",height:Et=400,miniToolbar:jt=!1,isFocus:Ke=!1,watch:dt,insertTemp:Rt,mode:Tt="markdown",id:Wt="markdown-editor-id",showResizeBar:Zt=!1,noStorage:zn=!1,showNullButton:Sr=!1,showNullProgramButton:Yn=!1,hidetoolBar:qn=!1,fullScreen:nr=!1,onBlur:ar,onCMBeforeChange:ot,onFullScreen:tt,className:vt="",disablePaste:rn=!1,disabled:Dn=!1,disabledFill:an=!1,placeholder:cn="",values:fn="",extraUse:In,onAddBlank:or})=>{const[Ut,qr]=(0,fe.useState)(null),[Fr,Ri]=(0,fe.useState)(Hn),[Li,pi]=(0,fe.useState)(dt),[Gi,yi]=(0,fe.useState)(nr),[ii,Bi]=(0,fe.useState)(""),[Zi,Vr]=(0,fe.useState)(0),[mi,Wi]=(0,fe.useState)(Et),[la,ea]=(0,fe.useState)(!1),ti=(0,fe.useRef)((0,$n.Z)()),yt=(0,fe.useRef)(!1),pt=(0,fe.useRef)(),[$t,sn]=(0,fe.useState)(0),[_n,cr]=(0,fe.useState)(0),Mr=(0,fe.useRef)(),Br=(0,fe.useRef)(),Kr=(0,fe.useRef)(),Rr=(0,fe.useRef)(),Qr=(0,fe.useRef)(),gi=(0,fe.useRef)(),Cr=()=>Xr(void 0,null,function*(){var vn;const hn=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ti.current}});(vn=hn==null?void 0:hn.attachments)!=null&&vn.length&&(console.log("cm:",Ut,Mr),hn.attachments.map(Sn=>{Sn.content_type.indexOf("image")>-1?Ut.replaceSelection(``):Sn.content_type.indexOf("video")>-1?Ut.replaceSelection(`<video width="100%" controls src="${ve.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Sn.content_type.indexOf("pdf")>-1?Ut.replaceSelection(`<a href="${ve.Z.API_SERVER}/api/attachments/${Sn.id}?type=${Sn.content_type}&disposition=inline" target="_blank">${Sn.name}</a>`):Ut.replaceSelection(`[${Sn.name}](${ve.Z.API_SERVER}/api/attachments/${Sn.id}?type=${Sn.content_type})`)}))});(0,fe.useEffect)(()=>{const vn=window.scrollY||window.pageYOffset;Ri(fn),Ut==null||Ut.setValue(fn),window.scrollTo(0,vn)},[fn]),(0,fe.useEffect)(()=>{tt==null||tt(Gi)},[Gi]),(0,fe.useEffect)(()=>{if(Mr.current){let vn=function(Sn,Pn){var ur;if(rn){Pn.preventDefault();return}const jn=Pn.clipboardData;if(jn){const Zn=jn.types.toString(),Jn=jn.items;if(Zn==="Files"||jn.types.indexOf("Files")>-1){if(Pn.preventDefault(),Tt=="stex")return;try{let Qn=Jn[1];((ur=Jn[0])==null?void 0:ur.kind)==="file"&&(Qn=Jn[0]);const hr=Qn.getAsFile(),Pe=hr.name.split(".").pop();(0,Je.I)(hr,Fe=>{var wt,it,Ot;Fe.id?((wt=hr==null?void 0:hr.type)==null?void 0:wt.indexOf("image"))>-1?hn.replaceSelection(`<img width="100%" src="/api/attachments/${Fe.id}?type=${Fe.content_type})" alt="" />`):((it=hr==null?void 0:hr.type)==null?void 0:it.indexOf("video"))>-1?hn.replaceSelection(`<video width="100%" controls src="/api/attachments/${Fe.id}"></video>`):((Ot=hr==null?void 0:hr.type)==null?void 0:Ot.indexOf("pdf"))>-1?hn.replaceSelection(`<a href="/api/attachments/${Fe.id}?type=${hr.type}&disposition=inline" target="_blank">${hr.name}</a>`):gt.includes(Pe)?hn.replaceSelection(`<a href="/api/attachments/${Fe.id}?type=office&disposition=inline" target="_blank">${hr.name}</a>`):hn.replaceSelection(`[${hr.name}](/api/attachments/${Fe.id}?type=${Fe.content_type})`):(Fe==null?void 0:Fe.status)===401&&(bn.ZP.warning((Fe==null?void 0:Fe.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(Qn){bn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const hn=$e().fromTextArea(Mr.current,{mode:Tt,lineNumbers:!jt,lineWrapping:!0,value:Hn,autoCloseTags:!Yn,autoCloseBrackets:!0});return hn.on("keyup",function(Sn,Pn){Pn.keyCode===8&&(Sn.getValue()==""?hn.setOption("placeholder",cn):hn.setOption("placeholder",null))}),hn.on("keydown",function(Sn,Pn){if(Pn.keyCode===8){var ur=Ai(Sn);ur&&Pn.preventDefault()}}),Ke&&hn.focus(),hn.on("paste",vn),hn.on("dragleave",function(Sn,Pn){Br.current.classList.remove("mouse-hover-md")}),Dn&&hn.on("beforeChange",function(Sn,Pn){(Pn.origin==="paste"||Pn.origin==="+input")&&Pn.cancel()}),qr(hn),()=>{hn.off("paste",vn)}}},[]);const di=(0,fe.useCallback)(()=>{if(Br.current)try{}catch(vn){console.log(vn,"---- to set md editor body height")}},[mi,Br,Gi]);(0,fe.useEffect)(()=>{function vn(){let hn=new Ue.Z(Sn=>{for(let Pn of Sn)(Pn.target.offsetHeight>0||Pn.target.offsetWidth>0)&&(di(),Ut.setSize("100%","100%"),Ut.refresh())});return hn.observe(Mr.current.parentElement),hn}if(Ut){const hn=vn();return()=>{var Sn,Pn;(Sn=Mr.current)!=null&&Sn.parentElement&&hn.unobserve((Pn=Mr.current)==null?void 0:Pn.parentElement)}}},[Ut,di]),(0,fe.useEffect)(()=>{if(Ut){let vn=[];for(const[hn,Sn]of Object.entries(sr)){let Pn={[hn]:()=>{Si(Sn)}};vn.push(Pn),Ut.addKeyMap(Pn)}return pt.current=setInterval(()=>{yt.current&&Cr()},4e3),()=>{clearInterval(pt.current);for(let hn of vn)Ut.removeKeyMap(hn)}}},[Ut]),(0,fe.useEffect)(()=>{nr!==Gi&&yi(nr)},[nr]),(0,Gr.Z)(()=>{if(!zn&&Zi>0){let vn=new Date().getTime(),hn=window.sessionStorage.getItem(Wt);vn>=Zi+Ei&&(!hn||hn!==Fr)&&(window.sessionStorage.setItem(Wt,Fr),ea(!0))}},Ei),(0,fe.useEffect)(()=>{pi(dt)},[Ut,dt]),(0,fe.useEffect)(()=>{Ut&&Ke&&Ut.focus()},[Ut,Ke]),(0,fe.useEffect)(()=>{if(Li&&Ut){let vn=function(Sn){let Pn=Sn.target;if(Rr.current){let ur=Pn.scrollTop/Pn.scrollHeight;Rr.current.scrollTop=Rr.current.scrollHeight*ur}};const hn=Ut.getScrollerElement();return hn.addEventListener("scroll",vn),()=>{hn.removeEventListener("scroll",vn)}}},[Ut,Li]),(0,fe.useEffect)(()=>{if(Ut&&ot){let vn=function(hn,Sn){ot(hn,Sn)};return Ut.on("beforeChange",vn),()=>{Ut.off("beforeChange",vn)}}},[Ut,ot]),(0,fe.useEffect)(()=>{if(Ut&&ar){let vn=function(){ar(Ut.getValue())};return Ut.on("blur",vn),()=>{Ut.off("blur",vn)}}},[Ut,ar]);function Ai(vn,hn){var Sn=vn.getDoc(),Pn=Sn.getCursor(),ur=Sn.getLine(Pn.line),jn=ur.charAt(Pn.ch-1),Zn=ur.lastIndexOf("@\u2581@",Pn.ch),Jn=ur.lastIndexOf("@\u2581\u2581@",Pn.ch),Qn=Zn>Jn?Zn:Jn,hr=Zn>Jn?3:4;if(Ji.indexOf(jn)===-1)return null;if(console.log("change1:",hn,vn,ur,Pn,Qn,Zn,Jn,jn),Qn>=0&&Pn.ch-Qn<5){var Pe=Qn+hr;return Sn.replaceRange("",{line:Pn.line,ch:Qn},{line:Pn.line,ch:Pe}),{line:Pn.line,ch:Pe}}return null}(0,fe.useEffect)(()=>{if(Ut){let vn=function(hn,Sn){const Pn=hn.getValue();Ri(Pn),Vr(new Date().getTime()),hn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&(Yn?Ze(Pn,Gt(Pn)):Ze(Pn))};return Ut.on("change",vn),()=>{Ut.off("change",vn)}}},[Ut,Ze]),(0,fe.useEffect)(()=>{if(Ut)if(Hn==null)Ut.setValue(""),Ri("");else{const vn=window.scrollY||window.pageYOffset;Hn!==Ut.getValue()&&(Ut.setValue(Hn),Ri(Hn),Ut.setCursor(Dn?1:Ut.lineCount(),0),window.scrollTo(0,vn))}},[Ut,Hn]);const Si=(0,fe.useCallback)(vn=>{const hn=Ut.getCursor(),Sn=Ut.getSelection();let Pn=Sn.split(`
|
|
|
`);switch(vn){case"bold":return Ut.replaceSelection("**"+Sn+"**"),Sn===""&&Ut.setCursor(hn.line,hn.ch+2),Ut.focus();case"italic":return Ut.replaceSelection("*"+Sn+"*"),Sn===""&&Ut.setCursor(hn.line,hn.ch+1),Ut.focus();case"code":return Ut.replaceSelection("`"+Sn+"`"),Sn===""&&Ut.setCursor(hn.line,hn.ch+1),Ut.focus();case"inline-latex":return Bi("inline-latex"),Ut.focus();case"latex":return Ut.replaceSelection("```latex\n"+Sn+"\n```"),Ut.setCursor(hn.line+1,Sn.length+1),Ut.focus();case"line-break":return Ut.replaceSelection(`<br/>
|
|
|
`),Ut.focus();case"list-ul":return Sn===""?Ut.replaceSelection("- "+Sn):Ut.replaceSelection(Pn.map(ur=>ur===""?"":`- ${ur}`).join(`
|
|
|
`)),Ut.focus();case"list-ol":return Sn===""?Ut.replaceSelection("1. "+Sn):Ut.replaceSelection(Pn.map((ur,jn)=>ur===""?"":`${jn+1}. ${ur}`).join(`
|
|
|
`)),Ut.focus();case"add-null-ch":or==null||or();return;case"add-signal":return Sn===""&&Ut.setCursor(hn.line,hn.ch),Ut.replaceSelection(Qi),Ut.focus();case"add-multiple":return Sn===""&&Ut.setCursor(hn.line,hn.ch),Ut.replaceSelection(Ji),Ut.focus();case"inster-template-1":return Sn===""&&Ut.setCursor(hn.line,hn.ch),Ut.replaceSelection(Ci),Ut.focus();case"eraser":return Ut.setValue(""),Ut.focus();case"trigger-watch":return pi(!Li),Ut.focus();case"trigger-full-screen":return yi(!Gi),Ut.focus();case ei:Bi(ei);return;case rr:Bi(rr);return;case hi:Bi(hi);return;case Vt:Bi(Vt);return;case"maths-latex":Bi("maths-latex");return;case ut:Qr.current="",sessionStorage.removeItem("file_id"),Bi(ut);return;case gr:Bi(gr);return;default:throw new Error}},[Ut,Li,Gi]),_e=(0,fe.useCallback)((vn,hn)=>{var Sn,Pn,ur,jn,Zn,Jn;Bi("");const{src:Qn,alt:hr,id:Pe}=vn||{};switch(ii){case ei:const{title:on,link:mn}=vn;return Ut.replaceSelection(`[${on}](${mn})`),Ut.focus();case rr:const{language:On,content:xn}=vn;return Ut.replaceSelection(["```"+On,xn,"```"].join(`
|
|
|
`)),Ut.focus();case"maths-latex":for(var Fe=atob(vn),wt=new Uint8Array(Fe.length),it=0;it<Fe.length;it++)wt[it]=Fe.charCodeAt(it);var Ot=new Blob([wt],{type:"image/png"});(0,Je.I)(Ot,Zr=>{Zr.id?Ut.replaceSelection(``):(Zr==null?void 0:Zr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Ut.replaceSelection("`$$"+vn+"$$`");break;case Vn:if(!Pe)return;Ut.focus(),Ut.getValue().indexOf(Qn)===-1?Ut.replaceSelection(`<center><img id="${Pe}" width="80%" src="${Qn}" class="draw-flowchart" alt="${hr||""}" /></center>`):document.getElementById(Pe).src=ve.Z.API_SERVER+Qn+"?t="+Date.now();try{setTimeout(()=>{ar(Ut.getValue())},100)}catch(Zr){}break;case hi:case Vt:const Qt=hn,Bn=(ur=(Pn=(Sn=Qt==null?void 0:Qt.name)==null?void 0:Sn.split("."))==null?void 0:Pn.pop)==null?void 0:ur.call(Pn);return((jn=Qt==null?void 0:Qt.type)==null?void 0:jn.indexOf("image"))>-1||!(Qt!=null&&Qt.type)?Qt!=null&&Qt.align||Qt!=null&&Qt.width?Ut.replaceSelection(`<p style="text-align:${Qt.align||"initial"}"><img width="${Qt.width?Qt.width+"%":"initial"}" src="${Qn}" alt="${hr||""}" /></p>`):Ut.replaceSelection(`<img width="100%" src="${Qn}" alt="${hr||""}" />`):((Zn=Qt==null?void 0:Qt.type)==null?void 0:Zn.indexOf("video"))>-1?Ut.replaceSelection(`<video width="100%" controls src="${Qn}"></video>`):((Jn=Qt==null?void 0:Qt.type)==null?void 0:Jn.indexOf("pdf"))>-1?Ut.replaceSelection(`<a href="${Qn}?type=${Qt.type}&disposition=inline" target="_blank">${Qt.name}</a>`):gt.includes(Bn)?Ut.replaceSelection(`<a href="${Qn}?type=office&disposition=inline" target="_blank">${Qt.name}</a>`):Ut.replaceSelection(`[${Qt.name}](${Qn})`),Ut.focus();case gr:const{row:Kn,col:mr,align:Fn}=vn;let _r=`
|
|
|
`;for(let Zr=0;Zr<Kn;Zr++){let Tr=[],$r=[];for(let xr=0;xr<mr;xr++)Zr===1&&$r.push(Ur[Fn]),Tr.push(" ");Zr===1&&(_r+=`| ${$r.join(" | ")} |
|
|
|
`),_r+=`| ${Tr.join(mr===1?"":" | ")} |
|
|
|
`}return Ut.replaceSelection(_r+`
|
|
|
`),Ut.focus();default:throw new Error}},[Ut,ii]),Be=(0,fe.useMemo)(()=>{switch(ii){case ei:return fe.createElement(Nn,{callback:_e,onCancel:Ne});case rr:return fe.createElement(gn.Z,{callback:_e,onCancel:Ne});case hi:return fe.createElement(Je.Z,{callback:_e,onCancel:Ne});case ut:return fe.createElement(ye,{editImgId:Qr.current,callback:_e,onCancel:Ne});case gr:return fe.createElement(pn,{callback:_e,onCancel:Ne});case"maths-latex":return fe.createElement(Wr,{showSaveButton:!0,callback:_e});case"inline-latex":return fe.createElement(Kt.Z,{showSaveButton:!0,callback:_e});default:return null}},[ii]);function Ne(){Bi("")}(0,fe.useEffect)(()=>{if(Kr.current){let vn=function(Zn){ur=!0,jn=Zn.pageY},hn=function(){ur=!1},Sn=function(Zn){if(ur){let Jn=Zn.pageY-jn;Jn<0&&(Jn=0),Jn>300&&(Jn=300);let Qn=Et+Jn+"px";Wi(Qn)}},Pn=Kr.current,ur=!1,jn=0;return Pn.addEventListener("mousedown",vn),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",hn),()=>{Pn.removeEventListener("mousedown",vn),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",hn)}}},[Ut,Kr]),(0,fe.useEffect)(()=>{Wi(Et)},[Et]);const We=En(at),qe=En(mi),rt={width:We,height:qe},bt=(0,fe.useMemo)(()=>{if(Zi){let vn=new Date(Zi),hn=vn.getHours(),Sn=vn.getMinutes(),Pn=vn.getSeconds();return hn=hn<10?"0"+hn:hn,Sn=Sn<10?"0"+Sn:Sn,Pn=Pn<10?"0"+Pn:Pn,`${hn}:${Sn}:${Pn}`}return 0},[Zi]),Gt=vn=>{const hn=[];if(Yn){let Sn=-1;vn=vn.replace(/(@▁▁@|@▁@)/g,function(Pn,ur,jn){hn.push({multiLine:Pn!==Qi})})}return hn};function nn(){window.sessionStorage.removeItem(Wt),ea(!1),Vr(0)}function Gn(){ea(!1),Vr(0),Ut.setValue(window.sessionStorage.getItem(Wt))}(0,fe.useEffect)(()=>{tr[ii]&&ii!==Vt&&ii!==ut&&setTimeout(()=>{const vn=document.getElementsByClassName("markdown-popup-form")[0],hn=window.innerWidth/2-vn.offsetWidth/2,Sn=window.innerHeight/2-vn.offsetHeight/2;sn(hn),cr(Sn)},0)},[ii]);const fr=vn=>{vn.preventDefault();const hn=vn.clientX-$t,Sn=vn.clientY-_n;document.body.onmousemove=Pn=>{let ur=Pn.clientX-hn,jn=Pn.clientY-Sn;const Zn=document.getElementsByClassName("markdown-popup-form")[0],Jn=window.innerWidth-Zn.offsetWidth,Qn=window.innerHeight-Zn.offsetHeight;ur=Math.max(0,Math.min(ur,Jn)),jn=Math.max(0,Math.min(jn,Qn)),Wn(Pn.clientX,Pn.clientY,hn,Sn)&&(sn(ur),cr(jn))},document.body.onmouseup=function(){document.body.onmousemove=null}},Wn=(vn,hn,Sn,Pn)=>{const ur=document.body.clientHeight,jn=document.body.clientWidth;return vn<20&&Sn>vn||vn>jn-20&&Sn<vn||hn<20&&Pn>hn||hn>ur-20&&Pn<hn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:"markdown-editor-wrapper",ref:Br},fe.createElement("div",{className:`markdown-editor-container ${vt} ${Li?"on-preview":""} ${jt?"mini":""} ${Gi?"full-screen":""}`,style:rt},fe.createElement(Xe,{insertTemp:Rt,watch:Li,fullScreen:Gi,showNullButton:Sr,showNullProgramButton:Yn,onActionCallback:Si,hidetoolBar:qn,extraUse:In}),fe.createElement("div",{className:"markdown-editor-body"},fe.createElement("div",{className:"codemirror-container"},fe.createElement("textarea",{ref:Mr,placeholder:cn})),Li?fe.createElement("div",{ref:Rr,className:"preview-container"},Tt==="stex"&&fe.createElement(ze,{value:Fr}),Tt!=="stex"&&fe.createElement(mt.Z,{edit:!0,disabledFill:an,showProgramFill:Yn,value:Fr,openEditor:vn=>{var hn;Qr.current=vn,(hn=gi.current)==null||hn.setHeight("100vh"),setTimeout(()=>{Bi("add-flowchart")},150)}})):null))),Zt?fe.createElement("a",{ref:Kr,className:"editor-resize"}):null,ii===Vt&&fe.createElement(Ft,{callback:_e,onCancel:Ne}),ii===ut&&fe.createElement(ye,{ref:gi,editImgId:Qr.current,callback:_e,onCancel:Ne}),fe.createElement(Pt.Z,null,tr[ii]&&ii!==Vt&&ii!==ut?fe.createElement(st.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:$t,top:_n},title:fe.createElement("div",{style:{cursor:"move"},onMouseDown:fr},tr[ii]),open:!0,onCancel:Ne,footer:null,destroyOnClose:!0,width:ii===ut?"1200px":null,height:ii===ut?"80vh":null,className:"markdown-popup-form"},Be):null))}},70859:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return je},I:function(){return Pt}});var fe=se(22150),et=se(2453),$e=se(69677),Ue=se(93421),be=se(31795),Se=se(78045),Me=se(71577),xe=se(15476),pe=se(67294),Te=se(52262),mt=se(67294),ze=Object.defineProperty,It=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,At=(kt,Lt,Ge)=>Lt in kt?ze(kt,Lt,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):kt[Lt]=Ge,Jt=(kt,Lt)=>{for(var Ge in Lt||(Lt={}))Ye.call(Lt,Ge)&&At(kt,Ge,Lt[Ge]);if(ht)for(var Ge of ht(Lt))De.call(Lt,Ge)&&At(kt,Ge,Lt[Ge]);return kt},nt=(kt,Lt)=>It(kt,Ct(Lt));const{useForm:lt}=fe.default,Ie={width:280,marginRight:10},ke={labelCol:{span:5},wrapperCol:{span:19}};var je=({callback:kt,onCancel:Lt})=>{const[Ge]=lt();let Ht=(0,pe.useRef)();function Dt(Rn){Ht.current.width=Ge.getFieldValue("width"),Ht.current.align=Ge.getFieldValue("align"),kt(Rn,Ht.current)}function Ln(Rn,ir){if(Rn.status===-1){et.ZP.error(Rn.message);return}Ge.setFieldsValue({src:`/api/attachments/${Rn.id}`,type:ir.type})}function un(Rn){let ir=Rn.target.files[0];Ht.current=ir,Pt(ir,Ln)}return mt.createElement(fe.default,nt(Jt({form:Ge},ke),{className:"upload-image-panel",onFinish:Dt,style:{width:470,overflow:"hidden"}}),mt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},mt.createElement("div",{className:"flex-container"},mt.createElement(fe.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},mt.createElement($e.default,{style:Ie})),mt.createElement(Xe,{onFileChange:un}))),mt.createElement(fe.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},mt.createElement($e.default,{style:{width:264}})),mt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},mt.createElement(Ue.Z,null,mt.createElement(fe.default.Item,{name:"width",style:{margin:0}},mt.createElement(be.Z,{style:{width:264}})),mt.createElement("span",{className:"ml8"},"%"))),mt.createElement(fe.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},mt.createElement(Se.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"}]})),mt.createElement("aside",null,mt.createElement(fe.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},mt.createElement(Me.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),mt.createElement(Me.ZP,{type:"default",onClick:Lt},"\u53D6\u6D88"))))};function Xe({onFileChange:kt}){return mt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",mt.createElement("input",{type:"file",onChange:kt}))}function Pt(kt,Lt){if(!kt)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Te.bg)())throw et.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let Ge=new FormData;Ge.append("editormd-image-file",kt),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var Ht=new window.XMLHttpRequest;Ht.withCredentials=!0,Ht.addEventListener("load",function(Dt){Lt(JSON.parse(Dt.target.responseText),kt)},!1),Ht.addEventListener("error",function(Dt){console.error(Dt)},!1),Ht.open("POST",`${xe.KI}/api/attachments.json`),Ht.send(Ge)}},76621:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return $e}});var fe=se(67294),et=se(73935);class $e extends fe.Component{constructor(be){super(be);const Se=window.document;this.node=Se.createElement("div"),Se.body.appendChild(this.node)}render(){const{children:be}=this.props;return(0,et.createPortal)(be,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},99914:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});var fe=se(67294);function et($e,Ue){const be=(0,fe.useRef)();(0,fe.useEffect)(()=>{be.current=$e}),(0,fe.useEffect)(()=>{function Se(){be.current()}if(Ue!==null){let Me=setInterval(Se,Ue);return()=>clearInterval(Me)}},[Ue])}},69363:function(Cn,Xt,se){"use strict";se.r(Xt),se.d(Xt,{default:function(){return st}});var fe=se(67294),et=se(57953),$e=se(26942),Ue=se(35973),be=se(84567),Se=se(59810),Me=se(22150),xe=se(2453),pe=se(14446),Te=se(69677),mt=se(71577),ze=se(33859),It=se(11320),Ct=se(91304),ht=Object.defineProperty,Ye=Object.defineProperties,De=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,lt=(_t,en,Bt)=>en in _t?ht(_t,en,{enumerable:!0,configurable:!0,writable:!0,value:Bt}):_t[en]=Bt,Ie=(_t,en)=>{for(var Bt in en||(en={}))Jt.call(en,Bt)&<(_t,Bt,en[Bt]);if(At)for(var Bt of At(en))nt.call(en,Bt)&<(_t,Bt,en[Bt]);return _t},ke=(_t,en)=>Ye(_t,De(en)),je=(_t,en)=>{var Bt={};for(var Ft in _t)Jt.call(_t,Ft)&&en.indexOf(Ft)<0&&(Bt[Ft]=_t[Ft]);if(_t!=null&&At)for(var Ft of At(_t))en.indexOf(Ft)<0&&nt.call(_t,Ft)&&(Bt[Ft]=_t[Ft]);return Bt};const Xe=be.default.Group,{Dragger:Pt}=Se.default;function kt(_t,en){const Bt=new FileReader;Bt.addEventListener("load",()=>en(Bt.result)),Bt.readAsDataURL(_t)}var Lt=({callback:_t,tags:en=[],initialValues:Bt={},removeAttachment:Ft})=>{const[zt,Mn]=(0,fe.useState)(""),[bn]=Me.default.useForm();function Ee(oe){const He=oe,{cover_id:xt,attachment_ids:Yt}=He,pn=je(He,["cover_id","attachment_ids"]);_t(ke(Ie({},pn),{cover_id:xt==null?void 0:xt.map(dn=>dn.response?dn.response.id:dn.uid)[(xt==null?void 0:xt.length)-1],attachment_ids:Yt?Yt==null?void 0:Yt.map(dn=>dn.response?dn.response.id:dn.uid):[]}))}function ce(oe){return Array.isArray(oe)?oe:oe&&oe.fileList}const le={multiple:!0,beforeUpload:oe=>{const He=oe.size/1024/1024<100;if(!He)return xe.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(100MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"),He},action:`${It.Z.API_SERVER}/api/attachments.json`,onRemove:oe=>{pe.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:()=>Ft(oe.response?oe.response.id:oe.uid),onCancel:()=>!1})}};function ye(oe){oe.file.status==="done"&&kt(oe.file.originFileObj,He=>Mn(He))}const ve={showUploadList:!1,withCredentials:!0,action:`${It.Z.API_SERVER}/api/attachments.json`,onChange:ye};return(0,fe.useEffect)(()=>{Bt.title&&(bn.setFieldsValue(Bt),Bt.cover_id.length>0&&Mn(It.Z.IMG_SERVER+Bt.cover_id[0].url))},[Bt]),fe.createElement(Me.default,{form:bn,initialValues:Bt,className:"moop-panel",style:{marginBottom:20},onFinish:Ee},fe.createElement(Me.default.Item,{label:"\u6807\u9898",name:"title",extra:fe.createElement("div",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},fe.createElement(Te.default,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),fe.createElement("div",{className:"flex-container"},fe.createElement(Me.default.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},fe.createElement(Te.default,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),fe.createElement(Me.default.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},fe.createElement(Te.default,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),fe.createElement(Me.default.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},fe.createElement(Xe,null,en.map(oe=>fe.createElement(be.default,{key:oe.id,value:oe.id}," ",oe.name," ")))),fe.createElement(Me.default.Item,{name:"publish",valuePropName:"checked"},fe.createElement(be.default,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),fe.createElement(Me.default.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},fe.createElement(Ct.Z,{id:"moop_cases_content",height:400})),fe.createElement(Me.default.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:ce},fe.createElement(Pt,Ie({},le),fe.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),fe.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),fe.createElement(Me.default.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:ce,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},fe.createElement(Se.default,Ie({},ve),zt?fe.createElement("img",{src:zt,width:120}):fe.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",fe.createElement(ze.Z,null)," "))),fe.createElement("div",{className:"desc"},fe.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),fe.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),fe.createElement("div",{className:"desc"},fe.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),fe.createElement("ul",{style:{padding:0}},fe.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),fe.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",fe.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",fe.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),fe.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),fe.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),fe.createElement(Me.default.Item,{style:{marginTop:10}},fe.createElement(mt.ZP,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},Ge=se(4440),Ht=Object.defineProperty,Dt=Object.defineProperties,Ln=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,yr=(_t,en,Bt)=>en in _t?Ht(_t,en,{enumerable:!0,configurable:!0,writable:!0,value:Bt}):_t[en]=Bt,Qe=(_t,en)=>{for(var Bt in en||(en={}))Rn.call(en,Bt)&&yr(_t,Bt,en[Bt]);if(un)for(var Bt of un(en))ir.call(en,Bt)&&yr(_t,Bt,en[Bt]);return _t},Le=(_t,en)=>Dt(_t,Ln(en)),Nt=(_t,en,Bt)=>new Promise((Ft,zt)=>{var Mn=ce=>{try{Ee(Bt.next(ce))}catch(le){zt(le)}},bn=ce=>{try{Ee(Bt.throw(ce))}catch(le){zt(le)}},Ee=ce=>ce.done?Ft(ce.value):Promise.resolve(ce.value).then(Mn,bn);Ee((Bt=Bt.apply(_t,en)).next())});const Nn={loading:!1,data:{},tags:[]};var gn=(_t=>(_t[_t.GET_DATA=0]="GET_DATA",_t[_t.SET_LOADING=1]="SET_LOADING",_t[_t.GET_TAGS=2]="GET_TAGS",_t))(gn||{});function Je(_t,en){switch(en.type){case 0:return Qe(Qe({},_t),en.payload);case 2:return Le(Qe({},_t),{tags:en.payload});case 1:return Le(Qe({},_t),{loading:en.payload});default:throw new Error}}var st=()=>{const{caseId:_t}=(0,Ue.useParams)(),[en,Bt]=(0,fe.useReducer)(Je,Nn),{loading:Ft,tags:zt,data:Mn}=en;(0,fe.useEffect)(()=>{function ce(){return Nt(this,null,function*(){const le=yield(0,Ge.rO)({tab_module_type:"moop_cases"});le.un_purchased&&Bt({type:"globalSetting/setActionTabs",payload:{key:"\u91C7\u8D2D\u63D0\u793A"}}),Bt({type:2,payload:le.library_tags})})}ce()},[]),(0,fe.useEffect)(()=>{let ce=!1;function le(){return Nt(this,null,function*(){Bt({type:1,payload:!1});let ye=yield(0,Ge.$J)(_t);const{author_name:ve,author_school_name:oe,content:He,cover:xt,attachments:Yt,status:pn,title:dn,tags:An}=ye;ce||(ye.status===404?Ue.history.push("/moop_cases"):Bt({type:0,payload:{data:{title:dn,author_name:ve,author_school_name:oe,content:He,tag_ids:An.map(tn=>tn.id),publish:pn==="published",attachment_ids:Yt.map(tn=>({uid:tn.id,id:tn.id,name:tn.title,url:tn.url,filesize:tn.filesize,status:"done"})),cover_id:xt!=null&&xt.id?[{uid:xt==null?void 0:xt.id,id:xt==null?void 0:xt.id,name:xt==null?void 0:xt.title,url:xt==null?void 0:xt.url,filesize:xt==null?void 0:xt.filesize,status:"done"}]:[]},loading:!1}}))})}return!ce&&_t&&le(),()=>{ce=!0}},[_t]);function bn(ce){return Nt(this,null,function*(){if(_t)yield(0,Ge.bN)(_t,ce),Ue.history.push(`/moop_cases/${_t}/publish-success`);else{const{id:le}=yield(0,Ge.jP)(ce);le&&Ue.history.push(`/moop_cases/${le}/publish-success`)}})}const Ee={initialValues:Mn,tags:zt,removeAttachment:Ge.JZ,callback:bn};return fe.createElement(et.Z,{spinning:Ft,delay:500},fe.createElement("div",{className:"moop-info"},fe.createElement("div",{className:"crumb"},fe.createElement(Ue.Link,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),fe.createElement("span",null,"\u65B0\u5EFA")),fe.createElement("div",{className:"title"},fe.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),fe.createElement(Ue.Link,{to:"/moop_cases"},"\u8FD4\u56DE")),fe.createElement(Lt,Qe({},Ee))))}},4440:function(Cn,Xt,se){"use strict";se.d(Xt,{$J:function(){return $e},JZ:function(){return be},bN:function(){return Me},jP:function(){return Se},rO:function(){return Ue}});var fe=se(33170),et=(xe,pe,Te)=>new Promise((mt,ze)=>{var It=Ye=>{try{ht(Te.next(Ye))}catch(De){ze(De)}},Ct=Ye=>{try{ht(Te.throw(Ye))}catch(De){ze(De)}},ht=Ye=>Ye.done?mt(Ye.value):Promise.resolve(Ye.value).then(It,Ct);ht((Te=Te.apply(xe,pe)).next())});function $e(xe){return(0,fe.U2)(`libraries/${xe}.json`)}function Ue(xe){return(0,fe.U2)("library_tags.json",xe)}function be(xe){return et(this,null,function*(){return(yield(0,fe.IV)(`attachments/${xe}.json`)).status===0})}function Se(xe){return(0,fe.v_)("libraries.json",xe)}function Me(xe,pe){return(0,fe.gz)(`libraries/${xe}.json`,pe)}},57838:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});var fe=se(67294);function et(){const[,$e]=fe.useReducer(Ue=>Ue+1,0);return $e}},9708:function(Cn,Xt,se){"use strict";se.d(Xt,{F:function(){return be},Z:function(){return Ue}});var fe=se(94184),et=se.n(fe);const $e=null;function Ue(Se,Me,xe){return et()({[`${Se}-status-success`]:Me==="success",[`${Se}-status-warning`]:Me==="warning",[`${Se}-status-error`]:Me==="error",[`${Se}-status-validating`]:Me==="validating",[`${Se}-has-feedback`]:xe})}const be=(Se,Me)=>Me||Se},84567:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return je}});var fe=se(94184),et=se.n(fe),$e=se(95860),Ue=se(67294),be=se(53124),Se=se(98866),Me=se(65223),pe=Ue.createContext(null),Te=se(63185),mt=se(45353),ze=se(92429),It=function(Xe,Pt){var kt={};for(var Lt in Xe)Object.prototype.hasOwnProperty.call(Xe,Lt)&&Pt.indexOf(Lt)<0&&(kt[Lt]=Xe[Lt]);if(Xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Lt=Object.getOwnPropertySymbols(Xe);Ge<Lt.length;Ge++)Pt.indexOf(Lt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Xe,Lt[Ge])&&(kt[Lt[Ge]]=Xe[Lt[Ge]]);return kt};const Ct=(Xe,Pt)=>{var kt;const{prefixCls:Lt,className:Ge,rootClassName:Ht,children:Dt,indeterminate:Ln=!1,style:un,onMouseEnter:Rn,onMouseLeave:ir,skipGroup:yr=!1,disabled:Qe}=Xe,Le=It(Xe,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:Nt,direction:Nn,checkbox:gn}=Ue.useContext(be.E_),Je=Ue.useContext(pe),{isFormItemInput:st}=Ue.useContext(Me.aM),_t=Ue.useContext(Se.Z),en=(kt=(Je==null?void 0:Je.disabled)||Qe)!==null&&kt!==void 0?kt:_t,Bt=Ue.useRef(Le.value);Ue.useEffect(()=>{Je==null||Je.registerValue(Le.value)},[]),Ue.useEffect(()=>{if(!yr)return Le.value!==Bt.current&&(Je==null||Je.cancelValue(Bt.current),Je==null||Je.registerValue(Le.value),Bt.current=Le.value),()=>Je==null?void 0:Je.cancelValue(Le.value)},[Le.value]);const Ft=Nt("checkbox",Lt),[zt,Mn]=(0,Te.ZP)(Ft),bn=Object.assign({},Le);Je&&!yr&&(bn.onChange=function(){Le.onChange&&Le.onChange.apply(Le,arguments),Je.toggleOption&&Je.toggleOption({label:Dt,value:Le.value})},bn.name=Je.name,bn.checked=Je.value.includes(Le.value));const Ee=et()(`${Ft}-wrapper`,{[`${Ft}-rtl`]:Nn==="rtl",[`${Ft}-wrapper-checked`]:bn.checked,[`${Ft}-wrapper-disabled`]:en,[`${Ft}-wrapper-in-form-item`]:st},gn==null?void 0:gn.className,Ge,Ht,Mn),ce=et()({[`${Ft}-indeterminate`]:Ln},ze.A,Mn),le=Ln?"mixed":void 0;return zt(Ue.createElement(mt.Z,{component:"Checkbox",disabled:en},Ue.createElement("label",{className:Ee,style:Object.assign(Object.assign({},gn==null?void 0:gn.style),un),onMouseEnter:Rn,onMouseLeave:ir},Ue.createElement($e.Z,Object.assign({"aria-checked":le},bn,{prefixCls:Ft,className:ce,disabled:en,ref:Pt})),Dt!==void 0&&Ue.createElement("span",null,Dt))))};var Ye=Ue.forwardRef(Ct),De=se(74902),At=se(10366),Jt=function(Xe,Pt){var kt={};for(var Lt in Xe)Object.prototype.hasOwnProperty.call(Xe,Lt)&&Pt.indexOf(Lt)<0&&(kt[Lt]=Xe[Lt]);if(Xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Lt=Object.getOwnPropertySymbols(Xe);Ge<Lt.length;Ge++)Pt.indexOf(Lt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Xe,Lt[Ge])&&(kt[Lt[Ge]]=Xe[Lt[Ge]]);return kt};const nt=(Xe,Pt)=>{const{defaultValue:kt,children:Lt,options:Ge=[],prefixCls:Ht,className:Dt,rootClassName:Ln,style:un,onChange:Rn}=Xe,ir=Jt(Xe,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:yr,direction:Qe}=Ue.useContext(be.E_),[Le,Nt]=Ue.useState(ir.value||kt||[]),[Nn,gn]=Ue.useState([]);Ue.useEffect(()=>{"value"in ir&&Nt(ir.value||[])},[ir.value]);const Je=Ue.useMemo(()=>Ge.map(ye=>typeof ye=="string"||typeof ye=="number"?{label:ye,value:ye}:ye),[Ge]),st=ye=>{gn(ve=>ve.filter(oe=>oe!==ye))},_t=ye=>{gn(ve=>[].concat((0,De.Z)(ve),[ye]))},en=ye=>{const ve=Le.indexOf(ye.value),oe=(0,De.Z)(Le);ve===-1?oe.push(ye.value):oe.splice(ve,1),"value"in ir||Nt(oe),Rn==null||Rn(oe.filter(He=>Nn.includes(He)).sort((He,xt)=>{const Yt=Je.findIndex(dn=>dn.value===He),pn=Je.findIndex(dn=>dn.value===xt);return Yt-pn}))},Bt=yr("checkbox",Ht),Ft=`${Bt}-group`,[zt,Mn]=(0,Te.ZP)(Bt),bn=(0,At.Z)(ir,["value","disabled"]),Ee=Ge.length?Je.map(ye=>Ue.createElement(Ye,{prefixCls:Bt,key:ye.value.toString(),disabled:"disabled"in ye?ye.disabled:ir.disabled,value:ye.value,checked:Le.includes(ye.value),onChange:ye.onChange,className:`${Ft}-item`,style:ye.style,title:ye.title},ye.label)):Lt,ce={toggleOption:en,value:Le,disabled:ir.disabled,name:ir.name,registerValue:_t,cancelValue:st},le=et()(Ft,{[`${Ft}-rtl`]:Qe==="rtl"},Dt,Ln,Mn);return zt(Ue.createElement("div",Object.assign({className:le,style:un},bn,{ref:Pt}),Ue.createElement(pe.Provider,{value:ce},Ee)))},lt=Ue.forwardRef(nt);var Ie=Ue.memo(lt);const ke=Ye;ke.Group=Ie,ke.__ANT_CHECKBOX=!0;var je=ke},63185:function(Cn,Xt,se){"use strict";se.d(Xt,{C2:function(){return be}});var fe=se(14747),et=se(45503),$e=se(67968);const Ue=Se=>{const{checkboxCls:Me}=Se,xe=`${Me}-wrapper`;return[{[`${Me}-group`]:Object.assign(Object.assign({},(0,fe.Wf)(Se)),{display:"inline-flex",flexWrap:"wrap",columnGap:Se.marginXS,[`> ${Se.antCls}-row`]:{flex:1}}),[xe]:Object.assign(Object.assign({},(0,fe.Wf)(Se)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${xe}`]:{marginInlineStart:0},[`&${xe}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[Me]:Object.assign(Object.assign({},(0,fe.Wf)(Se)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:Se.borderRadiusSM,alignSelf:"center",[`${Me}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${Me}-inner`]:Object.assign({},(0,fe.oN)(Se))},[`${Me}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:Se.checkboxSize,height:Se.checkboxSize,direction:"ltr",backgroundColor:Se.colorBgContainer,border:`${Se.lineWidth}px ${Se.lineType} ${Se.colorBorder}`,borderRadius:Se.borderRadiusSM,borderCollapse:"separate",transition:`all ${Se.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:Se.checkboxSize/14*5,height:Se.checkboxSize/14*8,border:`${Se.lineWidthBold}px solid ${Se.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${Se.motionDurationFast} ${Se.motionEaseInBack}, opacity ${Se.motionDurationFast}`}},"& + span":{paddingInlineStart:Se.paddingXS,paddingInlineEnd:Se.paddingXS}})},{[`
|
|
|
${xe}:not(${xe}-disabled),
|
|
|
${Me}:not(${Me}-disabled)
|
|
|
`]:{[`&:hover ${Me}-inner`]:{borderColor:Se.colorPrimary}},[`${xe}:not(${xe}-disabled)`]:{[`&:hover ${Me}-checked:not(${Me}-disabled) ${Me}-inner`]:{backgroundColor:Se.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${Me}-checked:not(${Me}-disabled):after`]:{borderColor:Se.colorPrimaryHover}}},{[`${Me}-checked`]:{[`${Me}-inner`]:{backgroundColor:Se.colorPrimary,borderColor:Se.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${Se.motionDurationMid} ${Se.motionEaseOutBack} ${Se.motionDurationFast}`}}},[`
|
|
|
${xe}-checked:not(${xe}-disabled),
|
|
|
${Me}-checked:not(${Me}-disabled)
|
|
|
`]:{[`&:hover ${Me}-inner`]:{backgroundColor:Se.colorPrimaryHover,borderColor:"transparent"}}},{[Me]:{"&-indeterminate":{[`${Me}-inner`]:{backgroundColor:Se.colorBgContainer,borderColor:Se.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:Se.fontSizeLG/2,height:Se.fontSizeLG/2,backgroundColor:Se.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${xe}-disabled`]:{cursor:"not-allowed"},[`${Me}-disabled`]:{[`&, ${Me}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${Me}-inner`]:{background:Se.colorBgContainerDisabled,borderColor:Se.colorBorder,"&:after":{borderColor:Se.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:Se.colorTextDisabled},[`&${Me}-indeterminate ${Me}-inner::after`]:{background:Se.colorTextDisabled}}}]};function be(Se,Me){const xe=(0,et.TS)(Me,{checkboxCls:`.${Se}`,checkboxSize:Me.controlInteractiveSize});return[Ue(xe)]}Xt.ZP=(0,$e.Z)("Checkbox",(Se,Me)=>{let{prefixCls:xe}=Me;return[be(xe,Se)]})},88258:function(Cn,Xt,se){"use strict";var fe=se(67294),et=se(53124),$e=se(32983);const Ue=be=>{const{componentName:Se}=be,{getPrefixCls:Me}=(0,fe.useContext)(et.E_),xe=Me("empty");switch(Se){case"Table":case"List":return fe.createElement($e.Z,{image:$e.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return fe.createElement($e.Z,{image:$e.Z.PRESENTED_IMAGE_SIMPLE,className:`${xe}-small`});default:return fe.createElement($e.Z,null)}};Xt.Z=Ue},72565:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return ti}});var fe=se(94184),et=se.n(fe),$e=se(1413),Ue=se(97685),be=se(67294),Se=se(73935);function Me(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var xe={};function pe(yt,pt){}function Te(yt,pt){}function mt(){xe={}}function ze(yt,pt,$t){!pt&&!xe[$t]&&(yt(!1,$t),xe[$t]=!0)}function It(yt,pt){ze(pe,yt,pt)}function Ct(yt,pt){ze(Te,yt,pt)}var ht=null,Ye=se(71002),De=se(18459);function At(yt,pt,$t){var sn=be.useRef({});return(!("value"in sn.current)||$t(sn.current.condition,pt))&&(sn.current.value=yt(),sn.current.condition=pt),sn.current.value}function Jt(yt,pt){typeof yt=="function"?yt(pt):(0,Ye.Z)(yt)==="object"&&yt&&"current"in yt&&(yt.current=pt)}function nt(){for(var yt=arguments.length,pt=new Array(yt),$t=0;$t<yt;$t++)pt[$t]=arguments[$t];var sn=pt.filter(function(_n){return _n});return sn.length<=1?sn[0]:function(_n){pt.forEach(function(cr){Jt(cr,_n)})}}function lt(){for(var yt=arguments.length,pt=new Array(yt),$t=0;$t<yt;$t++)pt[$t]=arguments[$t];return At(function(){return nt.apply(void 0,pt)},pt,function(sn,_n){return sn.length===_n.length&&sn.every(function(cr,Mr){return cr===_n[Mr]})})}function Ie(yt){var pt,$t,sn=(0,De.isMemo)(yt)?yt.type.type:yt.type;return!(typeof sn=="function"&&!((pt=sn.prototype)!==null&&pt!==void 0&&pt.render)||typeof yt=="function"&&!(($t=yt.prototype)!==null&&$t!==void 0&&$t.render))}var ke=be.createContext(null),je=ke,Xe=se(74902),Pt=Me()?be.useLayoutEffect:be.useEffect,kt=Pt,Lt=function(pt,$t){var sn=React.useRef(!0);Pt(function(){if(!sn.current)return pt()},$t),Pt(function(){return sn.current=!1,function(){sn.current=!0}},[])},Ge=[];function Ht(yt,pt){var $t=be.useState(function(){if(!Me())return null;var Ai=document.createElement("div");return Ai}),sn=(0,Ue.Z)($t,1),_n=sn[0],cr=be.useRef(!1),Mr=be.useContext(je),Br=be.useState(Ge),Kr=(0,Ue.Z)(Br,2),Rr=Kr[0],Qr=Kr[1],gi=Mr||(cr.current?void 0:function(Ai){Qr(function(Si){var _e=[Ai].concat((0,Xe.Z)(Si));return _e})});function Cr(){_n.parentElement||document.body.appendChild(_n),cr.current=!0}function di(){var Ai;(Ai=_n.parentElement)===null||Ai===void 0||Ai.removeChild(_n),cr.current=!1}return kt(function(){return yt?Mr?Mr(Cr):Cr():di(),di},[yt]),kt(function(){Rr.length&&(Rr.forEach(function(Ai){return Ai()}),Qr(Ge))},[Rr]),[_n,gi]}function Dt(yt,pt){if(!yt)return!1;if(yt.contains)return yt.contains(pt);for(var $t=pt;$t;){if($t===yt)return!0;$t=$t.parentNode}return!1}var Ln="data-rc-order",un="rc-util-key",Rn=new Map;function ir(){var yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pt=yt.mark;return pt?pt.startsWith("data-")?pt:"data-".concat(pt):un}function yr(yt){if(yt.attachTo)return yt.attachTo;var pt=document.querySelector("head");return pt||document.body}function Qe(yt){return yt==="queue"?"prependQueue":yt?"prepend":"append"}function Le(yt){return Array.from((Rn.get(yt)||yt).children).filter(function(pt){return pt.tagName==="STYLE"})}function Nt(yt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Me())return null;var $t=pt.csp,sn=pt.prepend,_n=document.createElement("style");_n.setAttribute(Ln,Qe(sn)),$t!=null&&$t.nonce&&(_n.nonce=$t==null?void 0:$t.nonce),_n.innerHTML=yt;var cr=yr(pt),Mr=cr.firstChild;if(sn){if(sn==="queue"){var Br=Le(cr).filter(function(Kr){return["prepend","prependQueue"].includes(Kr.getAttribute(Ln))});if(Br.length)return cr.insertBefore(_n,Br[Br.length-1].nextSibling),_n}cr.insertBefore(_n,Mr)}else cr.appendChild(_n);return _n}function Nn(yt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$t=yr(pt);return Le($t).find(function(sn){return sn.getAttribute(ir(pt))===yt})}function gn(yt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$t=Nn(yt,pt);if($t){var sn=yr(pt);sn.removeChild($t)}}function Je(yt,pt){var $t=Rn.get(yt);if(!$t||!Dt(document,$t)){var sn=Nt("",pt),_n=sn.parentNode;Rn.set(yt,_n),yt.removeChild(sn)}}function st(){Rn.clear()}function _t(yt,pt){var $t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},sn=yr($t);Je(sn,$t);var _n=Nn(pt,$t);if(_n){var cr,Mr;if((cr=$t.csp)!==null&&cr!==void 0&&cr.nonce&&_n.nonce!==((Mr=$t.csp)===null||Mr===void 0?void 0:Mr.nonce)){var Br;_n.nonce=(Br=$t.csp)===null||Br===void 0?void 0:Br.nonce}return _n.innerHTML!==yt&&(_n.innerHTML=yt),_n}var Kr=Nt(yt,$t);return Kr.setAttribute(ir($t),pt),Kr}var en;function Bt(yt){if(typeof document=="undefined")return 0;if(yt||en===void 0){var pt=document.createElement("div");pt.style.width="100%",pt.style.height="200px";var $t=document.createElement("div"),sn=$t.style;sn.position="absolute",sn.top="0",sn.left="0",sn.pointerEvents="none",sn.visibility="hidden",sn.width="200px",sn.height="150px",sn.overflow="hidden",$t.appendChild(pt),document.body.appendChild($t);var _n=pt.offsetWidth;$t.style.overflow="scroll";var cr=pt.offsetWidth;_n===cr&&(cr=$t.clientWidth),document.body.removeChild($t),en=_n-cr}return en}function Ft(yt){var pt=yt.match(/^(.*)px$/),$t=Number(pt==null?void 0:pt[1]);return Number.isNaN($t)?Bt():$t}function zt(yt){if(typeof document=="undefined"||!yt||!(yt instanceof Element))return{width:0,height:0};var pt=getComputedStyle(yt,"::-webkit-scrollbar"),$t=pt.width,sn=pt.height;return{width:Ft($t),height:Ft(sn)}}function Mn(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var bn="rc-util-locker-".concat(Date.now()),Ee=0;function ce(yt){var pt=!!yt,$t=be.useState(function(){return Ee+=1,"".concat(bn,"_").concat(Ee)}),sn=(0,Ue.Z)($t,1),_n=sn[0];kt(function(){if(pt){var cr=zt(document.body).width,Mr=Mn();_t(`
|
|
|
html body {
|
|
|
overflow-y: hidden;
|
|
|
`.concat(Mr?"width: calc(100% - ".concat(cr,"px);"):"",`
|
|
|
}`),_n)}else gn(_n);return function(){gn(_n)}},[pt,_n])}var le=!1;function ye(yt){return typeof yt=="boolean"&&(le=yt),le}var ve=function(pt){return pt===!1?!1:!Me()||!pt?null:typeof pt=="string"?document.querySelector(pt):typeof pt=="function"?pt():pt},oe=be.forwardRef(function(yt,pt){var $t=yt.open,sn=yt.autoLock,_n=yt.getContainer,cr=yt.debug,Mr=yt.autoDestroy,Br=Mr===void 0?!0:Mr,Kr=yt.children,Rr=be.useState($t),Qr=(0,Ue.Z)(Rr,2),gi=Qr[0],Cr=Qr[1],di=gi||$t;be.useEffect(function(){(Br||$t)&&Cr($t)},[$t,Br]);var Ai=be.useState(function(){return ve(_n)}),Si=(0,Ue.Z)(Ai,2),_e=Si[0],Be=Si[1];be.useEffect(function(){var vn=ve(_n);Be(vn!=null?vn:null)});var Ne=Ht(di&&!_e,cr),We=(0,Ue.Z)(Ne,2),qe=We[0],rt=We[1],bt=_e!=null?_e:qe;ce(sn&&$t&&Me()&&(bt===qe||bt===document.body));var Gt=null;if(Kr&&Ie(Kr)&&pt){var nn=Kr;Gt=nn.ref}var Gn=lt(Gt,pt);if(!di||!Me()||_e===void 0)return null;var fr=bt===!1||ye(),Wn=Kr;return pt&&(Wn=be.cloneElement(Kr,{ref:Gn})),be.createElement(je.Provider,{value:rt},fr?Wn:(0,Se.createPortal)(Wn,bt))}),He=oe,xt=He;function Yt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var pn=Yt()?be.useLayoutEffect:be.useEffect,dn=function(pt,$t){var sn=be.useRef(!0);pn(function(){return pt(sn.current)},$t),pn(function(){return sn.current=!1,function(){sn.current=!0}},[])},An=function(pt,$t){dn(function(sn){if(!sn)return pt()},$t)},tn=dn,Nr=be.createContext(null),Wr=be.createContext({}),Kt=Nr,$n=se(4942),ei=se(87462),hi=se(62874),ut={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(pt){var $t=pt.keyCode;if(pt.altKey&&!pt.ctrlKey||pt.metaKey||$t>=ut.F1&&$t<=ut.F12)return!1;switch($t){case ut.ALT:case ut.CAPS_LOCK:case ut.CONTEXT_MENU:case ut.CTRL:case ut.DOWN:case ut.END:case ut.ESC:case ut.HOME:case ut.INSERT:case ut.LEFT:case ut.MAC_FF_META:case ut.META:case ut.NUMLOCK:case ut.NUM_CENTER:case ut.PAGE_DOWN:case ut.PAGE_UP:case ut.PAUSE:case ut.PRINT_SCREEN:case ut.RIGHT:case ut.SHIFT:case ut.UP:case ut.WIN_KEY:case ut.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(pt){if(pt>=ut.ZERO&&pt<=ut.NINE||pt>=ut.NUM_ZERO&&pt<=ut.NUM_MULTIPLY||pt>=ut.A&&pt<=ut.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&pt===0)return!0;switch(pt){case ut.SPACE:case ut.QUESTION_MARK:case ut.NUM_PLUS:case ut.NUM_MINUS:case ut.NUM_PERIOD:case ut.NUM_DIVISION:case ut.SEMICOLON:case ut.DASH:case ut.EQUALS:case ut.COMMA:case ut.PERIOD:case ut.SLASH:case ut.APOSTROPHE:case ut.SINGLE_QUOTE:case ut.OPEN_SQUARE_BRACKET:case ut.BACKSLASH:case ut.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Vt=ut,Vn=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,rr=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,gr="".concat(Vn," ").concat(rr).split(/[\s\n]+/),Ir="aria-",Ur="data-";function Gr(yt,pt){return yt.indexOf(pt)===0}function Xr(yt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$t;pt===!1?$t={aria:!0,data:!0,attr:!0}:pt===!0?$t={aria:!0}:$t=(0,$e.Z)({},pt);var sn={};return Object.keys(yt).forEach(function(_n){($t.aria&&(_n==="role"||Gr(_n,Ir))||$t.data&&Gr(_n,Ur)||$t.attr&&gr.includes(_n))&&(sn[_n]=yt[_n])}),sn}function ui(yt){var pt=React.useRef();pt.current=yt;var $t=React.useCallback(function(){for(var sn,_n=arguments.length,cr=new Array(_n),Mr=0;Mr<_n;Mr++)cr[Mr]=arguments[Mr];return(sn=pt.current)===null||sn===void 0?void 0:sn.call.apply(sn,[pt].concat(cr))},[]);return $t}function br(yt){var pt=React.useRef(!1),$t=React.useState(yt),sn=_slicedToArray($t,2),_n=sn[0],cr=sn[1];React.useEffect(function(){return pt.current=!1,function(){pt.current=!0}},[]);function Mr(Br,Kr){Kr&&pt.current||cr(Br)}return[_n,Mr]}function Ei(yt){return yt!==void 0}function sa(yt,pt){var $t=pt||{},sn=$t.defaultValue,_n=$t.value,cr=$t.onChange,Mr=$t.postState,Br=useState(function(){return Ei(_n)?_n:Ei(sn)?typeof sn=="function"?sn():sn:typeof yt=="function"?yt():yt}),Kr=_slicedToArray(Br,2),Rr=Kr[0],Qr=Kr[1],gi=_n!==void 0?_n:Rr,Cr=Mr?Mr(gi):gi,di=useEvent(cr),Ai=useState([gi]),Si=_slicedToArray(Ai,2),_e=Si[0],Be=Si[1];useLayoutUpdateEffect(function(){var We=_e[0];Rr!==We&&di(Rr,We)},[_e]),useLayoutUpdateEffect(function(){Ei(_n)||Qr(_n)},[_n]);var Ne=useEvent(function(We,qe){Qr(We,qe),Be([gi],qe)});return[Cr,Ne]}var Ji=se(33993);function Qi(yt,pt,$t){var sn=be.useRef({});return(!("value"in sn.current)||$t(sn.current.condition,pt))&&(sn.current.value=yt(),sn.current.condition=pt),sn.current.value}function Ci(yt,pt){typeof yt=="function"?yt(pt):(0,Ye.Z)(yt)==="object"&&yt&&"current"in yt&&(yt.current=pt)}function gt(){for(var yt=arguments.length,pt=new Array(yt),$t=0;$t<yt;$t++)pt[$t]=arguments[$t];var sn=pt.filter(function(_n){return _n});return sn.length<=1?sn[0]:function(_n){pt.forEach(function(cr){Ci(cr,_n)})}}function En(){for(var yt=arguments.length,pt=new Array(yt),$t=0;$t<yt;$t++)pt[$t]=arguments[$t];return Qi(function(){return gt.apply(void 0,pt)},pt,function(sn,_n){return sn.length!==_n.length||sn.every(function(cr,Mr){return cr!==_n[Mr]})})}function kn(yt){var pt,$t,sn=isMemo(yt)?yt.type.type:yt.type;return!(typeof sn=="function"&&!((pt=sn.prototype)!==null&&pt!==void 0&&pt.render)||typeof yt=="function"&&!(($t=yt.prototype)!==null&&$t!==void 0&&$t.render))}function Tn(yt){return!isValidElement(yt)||isFragment(yt)?!1:kn(yt)}function sr(yt,pt,$t,sn){if(!pt.length)return $t;var _n=_toArray(pt),cr=_n[0],Mr=_n.slice(1),Br;return!yt&&typeof cr=="number"?Br=[]:Array.isArray(yt)?Br=_toConsumableArray(yt):Br=_objectSpread({},yt),sn&&$t===void 0&&Mr.length===1?delete Br[cr][Mr[0]]:Br[cr]=sr(Br[cr],Mr,$t,sn),Br}function tr(yt,pt,$t){var sn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return pt.length&&sn&&$t===void 0&&!get(yt,pt.slice(0,-1))?yt:sr(yt,pt,$t,sn)}function pr(yt){return _typeof(yt)==="object"&&yt!==null&&Object.getPrototypeOf(yt)===Object.prototype}function Hn(yt){return Array.isArray(yt)?[]:{}}var Ze=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function at(){for(var yt=arguments.length,pt=new Array(yt),$t=0;$t<yt;$t++)pt[$t]=arguments[$t];var sn=Hn(pt[0]);return pt.forEach(function(_n){function cr(Mr,Br){var Kr=new Set(Br),Rr=get(_n,Mr),Qr=Array.isArray(Rr);if(Qr||pr(Rr)){if(!Kr.has(Rr)){Kr.add(Rr);var gi=get(sn,Mr);Qr?sn=tr(sn,Mr,[]):(!gi||_typeof(gi)!=="object")&&(sn=tr(sn,Mr,Hn(Rr))),Ze(Rr).forEach(function(Cr){cr([].concat(_toConsumableArray(Mr),[Cr]),Kr)})}}else sn=tr(sn,Mr,Rr)}cr([])}),sn}var Et={},jt=[],Ke=function(pt){jt.push(pt)};function dt(yt,pt){if(0)var $t}function Rt(yt,pt){if(0)var $t}function Tt(){Et={}}function Wt(yt,pt,$t){!pt&&!Et[$t]&&(yt(!1,$t),Et[$t]=!0)}function Zt(yt,pt){Wt(dt,yt,pt)}function zn(yt,pt){Wt(Rt,yt,pt)}Zt.preMessage=Ke,Zt.resetWarned=Tt,Zt.noteOnce=zn;var Sr=Zt,Yn=function(pt){var $t=pt.prefixCls,sn=pt.className,_n=pt.style,cr=pt.children,Mr=pt.containerRef,Br=pt.id,Kr=pt.onMouseEnter,Rr=pt.onMouseOver,Qr=pt.onMouseLeave,gi=pt.onClick,Cr=pt.onKeyDown,di=pt.onKeyUp,Ai={onMouseEnter:Kr,onMouseOver:Rr,onMouseLeave:Qr,onClick:gi,onKeyDown:Cr,onKeyUp:di},Si=be.useContext(Wr),_e=Si.panel,Be=En(_e,Mr);return be.createElement(be.Fragment,null,be.createElement("div",(0,ei.Z)({id:Br,className:et()("".concat($t,"-content"),sn),style:(0,$e.Z)({},_n),"aria-modal":"true",role:"dialog",ref:Be},Ai),cr))},qn=Yn;function nr(yt){return typeof yt=="string"&&String(Number(yt))===yt?(Sr(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(yt)):yt}function ar(yt){warning(!("wrapperClassName"in yt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!yt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var ot={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function tt(yt,pt){var $t,sn,_n,cr,Mr=yt.prefixCls,Br=yt.open,Kr=yt.placement,Rr=yt.inline,Qr=yt.push,gi=yt.forceRender,Cr=yt.autoFocus,di=yt.keyboard,Ai=yt.rootClassName,Si=yt.rootStyle,_e=yt.zIndex,Be=yt.className,Ne=yt.id,We=yt.style,qe=yt.motion,rt=yt.width,bt=yt.height,Gt=yt.children,nn=yt.contentWrapperStyle,Gn=yt.mask,fr=yt.maskClosable,Wn=yt.maskMotion,vn=yt.maskClassName,hn=yt.maskStyle,Sn=yt.afterOpenChange,Pn=yt.onClose,ur=yt.onMouseEnter,jn=yt.onMouseOver,Zn=yt.onMouseLeave,Jn=yt.onClick,Qn=yt.onKeyDown,hr=yt.onKeyUp,Pe=be.useRef(),Fe=be.useRef(),wt=be.useRef();be.useImperativeHandle(pt,function(){return Pe.current});var it=function(Pr){var Yr=Pr.keyCode,ai=Pr.shiftKey;switch(Yr){case Vt.TAB:{if(Yr===Vt.TAB){if(!ai&&document.activeElement===wt.current){var Dr;(Dr=Fe.current)===null||Dr===void 0||Dr.focus({preventScroll:!0})}else if(ai&&document.activeElement===Fe.current){var li;(li=wt.current)===null||li===void 0||li.focus({preventScroll:!0})}}break}case Vt.ESC:{Pn&&di&&(Pr.stopPropagation(),Pn(Pr));break}}};be.useEffect(function(){if(Br&&Cr){var xr;(xr=Pe.current)===null||xr===void 0||xr.focus({preventScroll:!0})}},[Br]);var Ot=be.useState(!1),on=(0,Ue.Z)(Ot,2),mn=on[0],On=on[1],xn=be.useContext(Kt),Qt;Qr===!1?Qt={distance:0}:Qr===!0?Qt={}:Qt=Qr||{};var Bn=($t=(sn=(_n=Qt)===null||_n===void 0?void 0:_n.distance)!==null&&sn!==void 0?sn:xn==null?void 0:xn.pushDistance)!==null&&$t!==void 0?$t:180,Kn=be.useMemo(function(){return{pushDistance:Bn,push:function(){On(!0)},pull:function(){On(!1)}}},[Bn]);be.useEffect(function(){if(Br){var xr;xn==null||(xr=xn.push)===null||xr===void 0||xr.call(xn)}else{var Pr;xn==null||(Pr=xn.pull)===null||Pr===void 0||Pr.call(xn)}},[Br]),be.useEffect(function(){return function(){var xr;xn==null||(xr=xn.pull)===null||xr===void 0||xr.call(xn)}},[]);var mr=Gn&&be.createElement(hi.Z,(0,ei.Z)({key:"mask"},Wn,{visible:Br}),function(xr,Pr){var Yr=xr.className,ai=xr.style;return be.createElement("div",{className:et()("".concat(Mr,"-mask"),Yr,vn),style:(0,$e.Z)((0,$e.Z)({},ai),hn),onClick:fr&&Br?Pn:void 0,ref:Pr})}),Fn=typeof qe=="function"?qe(Kr):qe,_r={};if(mn&&Bn)switch(Kr){case"top":_r.transform="translateY(".concat(Bn,"px)");break;case"bottom":_r.transform="translateY(".concat(-Bn,"px)");break;case"left":_r.transform="translateX(".concat(Bn,"px)");break;default:_r.transform="translateX(".concat(-Bn,"px)");break}Kr==="left"||Kr==="right"?_r.width=nr(rt):_r.height=nr(bt);var Zr={onMouseEnter:ur,onMouseOver:jn,onMouseLeave:Zn,onClick:Jn,onKeyDown:Qn,onKeyUp:hr},Tr=be.createElement(hi.Z,(0,ei.Z)({key:"panel"},Fn,{visible:Br,forceRender:gi,onVisibleChanged:function(Pr){Sn==null||Sn(Pr)},removeOnLeave:!1,leavedClassName:"".concat(Mr,"-content-wrapper-hidden")}),function(xr,Pr){var Yr=xr.className,ai=xr.style;return be.createElement("div",(0,ei.Z)({className:et()("".concat(Mr,"-content-wrapper"),Yr),style:(0,$e.Z)((0,$e.Z)((0,$e.Z)({},_r),ai),nn)},Xr(yt,{data:!0})),be.createElement(qn,(0,ei.Z)({id:Ne,containerRef:Pr,prefixCls:Mr,className:Be,style:We},Zr),Gt))}),$r=(0,$e.Z)({},Si);return _e&&($r.zIndex=_e),be.createElement(Kt.Provider,{value:Kn},be.createElement("div",{className:et()(Mr,"".concat(Mr,"-").concat(Kr),Ai,(cr={},(0,$n.Z)(cr,"".concat(Mr,"-open"),Br),(0,$n.Z)(cr,"".concat(Mr,"-inline"),Rr),cr)),style:$r,tabIndex:-1,ref:Pe,onKeyDown:it},mr,be.createElement("div",{tabIndex:0,ref:Fe,style:ot,"aria-hidden":"true","data-sentinel":"start"}),Tr,be.createElement("div",{tabIndex:0,ref:wt,style:ot,"aria-hidden":"true","data-sentinel":"end"})))}var vt=be.forwardRef(tt),rn=vt,Dn=function(pt){var $t=pt.open,sn=$t===void 0?!1:$t,_n=pt.prefixCls,cr=_n===void 0?"rc-drawer":_n,Mr=pt.placement,Br=Mr===void 0?"right":Mr,Kr=pt.autoFocus,Rr=Kr===void 0?!0:Kr,Qr=pt.keyboard,gi=Qr===void 0?!0:Qr,Cr=pt.width,di=Cr===void 0?378:Cr,Ai=pt.mask,Si=Ai===void 0?!0:Ai,_e=pt.maskClosable,Be=_e===void 0?!0:_e,Ne=pt.getContainer,We=pt.forceRender,qe=pt.afterOpenChange,rt=pt.destroyOnClose,bt=pt.onMouseEnter,Gt=pt.onMouseOver,nn=pt.onMouseLeave,Gn=pt.onClick,fr=pt.onKeyDown,Wn=pt.onKeyUp,vn=pt.panelRef,hn=be.useState(!1),Sn=(0,Ue.Z)(hn,2),Pn=Sn[0],ur=Sn[1],jn=be.useState(!1),Zn=(0,Ue.Z)(jn,2),Jn=Zn[0],Qn=Zn[1];tn(function(){Qn(!0)},[]);var hr=Jn?sn:!1,Pe=be.useRef(),Fe=be.useRef();tn(function(){hr&&(Fe.current=document.activeElement)},[hr]);var wt=function(On){var xn;if(ur(On),qe==null||qe(On),!On&&Fe.current&&!((xn=Pe.current)!==null&&xn!==void 0&&xn.contains(Fe.current))){var Qt;(Qt=Fe.current)===null||Qt===void 0||Qt.focus({preventScroll:!0})}},it=be.useMemo(function(){return{panel:vn}},[vn]);if(!We&&!Pn&&!hr&&rt)return null;var Ot={onMouseEnter:bt,onMouseOver:Gt,onMouseLeave:nn,onClick:Gn,onKeyDown:fr,onKeyUp:Wn},on=(0,$e.Z)((0,$e.Z)({},pt),{},{open:hr,prefixCls:cr,placement:Br,autoFocus:Rr,keyboard:gi,width:di,mask:Si,maskClosable:Be,inline:Ne===!1,afterOpenChange:wt,ref:Pe},Ot);return be.createElement(Wr.Provider,{value:it},be.createElement(xt,{open:hr||We||Pn,autoDestroy:!1,getContainer:Ne,autoLock:Si&&(hr||Pn)},be.createElement(rn,on)))},an=Dn,cn=an,fn=se(33603),In=se(53124),or=se(65223),Ut=se(69760),Fr=yt=>{const{prefixCls:pt,title:$t,footer:sn,extra:_n,closeIcon:cr,closable:Mr,onClose:Br,headerStyle:Kr,drawerStyle:Rr,bodyStyle:Qr,footerStyle:gi,children:Cr}=yt,di=be.useCallback(Ne=>be.createElement("button",{type:"button",onClick:Br,"aria-label":"Close",className:`${pt}-close`},Ne),[Br]),[Ai,Si]=(0,Ut.Z)(Mr,cr,di,void 0,!0),_e=be.useMemo(()=>!$t&&!Ai?null:be.createElement("div",{style:Kr,className:et()(`${pt}-header`,{[`${pt}-header-close-only`]:Ai&&!$t&&!_n})},be.createElement("div",{className:`${pt}-header-title`},Si,$t&&be.createElement("div",{className:`${pt}-title`},$t)),_n&&be.createElement("div",{className:`${pt}-extra`},_n)),[Ai,Si,_n,Kr,pt,$t]),Be=be.useMemo(()=>{if(!sn)return null;const Ne=`${pt}-footer`;return be.createElement("div",{className:Ne,style:gi},sn)},[sn,gi,pt]);return be.createElement("div",{className:`${pt}-wrapper-body`,style:Rr},_e,be.createElement("div",{className:`${pt}-body`,style:Qr},Cr),Be)},Ri=se(4173),Li=se(67968),pi=se(45503),yi=yt=>{const{componentCls:pt,motionDurationSlow:$t}=yt,sn={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${$t}`}}};return{[pt]:{[`${pt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${$t}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${pt}-panel-motion`]:{"&-left":[sn,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[sn,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[sn,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[sn,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const ii=yt=>{const{componentCls:pt,zIndexPopup:$t,colorBgMask:sn,colorBgElevated:_n,motionDurationSlow:cr,motionDurationMid:Mr,padding:Br,paddingLG:Kr,fontSizeLG:Rr,lineHeightLG:Qr,lineWidth:gi,lineType:Cr,colorSplit:di,marginSM:Ai,colorIcon:Si,colorIconHover:_e,colorText:Be,fontWeightStrong:Ne,footerPaddingBlock:We,footerPaddingInline:qe}=yt,rt=`${pt}-content-wrapper`;return{[pt]:{position:"fixed",inset:0,zIndex:$t,pointerEvents:"none","&-pure":{position:"relative",background:_n,[`&${pt}-left`]:{boxShadow:yt.boxShadowDrawerLeft},[`&${pt}-right`]:{boxShadow:yt.boxShadowDrawerRight},[`&${pt}-top`]:{boxShadow:yt.boxShadowDrawerUp},[`&${pt}-bottom`]:{boxShadow:yt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${pt}-mask`]:{position:"absolute",inset:0,zIndex:$t,background:sn,pointerEvents:"auto"},[rt]:{position:"absolute",zIndex:$t,maxWidth:"100vw",transition:`all ${cr}`,"&-hidden":{display:"none"}},[`&-left > ${rt}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:yt.boxShadowDrawerLeft},[`&-right > ${rt}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:yt.boxShadowDrawerRight},[`&-top > ${rt}`]:{top:0,insetInline:0,boxShadow:yt.boxShadowDrawerUp},[`&-bottom > ${rt}`]:{bottom:0,insetInline:0,boxShadow:yt.boxShadowDrawerDown},[`${pt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:_n,pointerEvents:"auto"},[`${pt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${pt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Br}px ${Kr}px`,fontSize:Rr,lineHeight:Qr,borderBottom:`${gi}px ${Cr} ${di}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${pt}-extra`]:{flex:"none"},[`${pt}-close`]:{display:"inline-block",marginInlineEnd:Ai,color:Si,fontWeight:Ne,fontSize:Rr,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${Mr}`,textRendering:"auto","&:focus, &:hover":{color:_e,textDecoration:"none"}},[`${pt}-title`]:{flex:1,margin:0,color:Be,fontWeight:yt.fontWeightStrong,fontSize:Rr,lineHeight:Qr},[`${pt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Kr,overflow:"auto"},[`${pt}-footer`]:{flexShrink:0,padding:`${We}px ${qe}px`,borderTop:`${gi}px ${Cr} ${di}`},"&-rtl":{direction:"rtl"}}}};var Bi=(0,Li.Z)("Drawer",yt=>{const pt=(0,pi.TS)(yt,{});return[ii(pt),yi(pt)]},yt=>({zIndexPopup:yt.zIndexPopupBase,footerPaddingBlock:yt.paddingXS,footerPaddingInline:yt.padding})),Zi=se(16569),Vr=function(yt,pt){var $t={};for(var sn in yt)Object.prototype.hasOwnProperty.call(yt,sn)&&pt.indexOf(sn)<0&&($t[sn]=yt[sn]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _n=0,sn=Object.getOwnPropertySymbols(yt);_n<sn.length;_n++)pt.indexOf(sn[_n])<0&&Object.prototype.propertyIsEnumerable.call(yt,sn[_n])&&($t[sn[_n]]=yt[sn[_n]]);return $t};const mi=null,Wi={distance:180},la=yt=>{var pt;const{rootClassName:$t,width:sn,height:_n,size:cr="default",mask:Mr=!0,push:Br=Wi,open:Kr,afterOpenChange:Rr,onClose:Qr,prefixCls:gi,getContainer:Cr,style:di,className:Ai,visible:Si,afterVisibleChange:_e}=yt,Be=Vr(yt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:Ne,getPrefixCls:We,direction:qe,drawer:rt}=be.useContext(In.E_),bt=We("drawer",gi),[Gt,nn]=Bi(bt),Gn=Cr===void 0&&Ne?()=>Ne(document.body):Cr,fr=et()({"no-mask":!Mr,[`${bt}-rtl`]:qe==="rtl"},$t,nn),Wn=be.useMemo(()=>sn!=null?sn:cr==="large"?736:378,[sn,cr]),vn=be.useMemo(()=>_n!=null?_n:cr==="large"?736:378,[_n,cr]),hn={motionName:(0,fn.m)(bt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},Sn=ur=>({motionName:(0,fn.m)(bt,`panel-motion-${ur}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Pn=(0,Zi.H)();return Gt(be.createElement(Ri.BR,null,be.createElement(or.Ux,{status:!0,override:!0},be.createElement(cn,Object.assign({prefixCls:bt,onClose:Qr,maskMotion:hn,motion:Sn},Be,{open:Kr!=null?Kr:Si,mask:Mr,push:Br,width:Wn,height:vn,style:Object.assign(Object.assign({},rt==null?void 0:rt.style),di),className:et()(rt==null?void 0:rt.className,Ai),rootClassName:fr,getContainer:Gn,afterOpenChange:Rr!=null?Rr:_e,panelRef:Pn}),be.createElement(Fr,Object.assign({prefixCls:bt},Be,{onClose:Qr}))))))},ea=yt=>{const{prefixCls:pt,style:$t,className:sn,placement:_n="right"}=yt,cr=Vr(yt,["prefixCls","style","className","placement"]),{getPrefixCls:Mr}=be.useContext(In.E_),Br=Mr("drawer",pt),[Kr,Rr]=Bi(Br),Qr=et()(Br,`${Br}-pure`,`${Br}-${_n}`,Rr,sn);return Kr(be.createElement("div",{className:Qr,style:$t},be.createElement(Fr,Object.assign({prefixCls:Br},cr))))};la._InternalPanelDoNotUseOrYouWillBeFired=ea;var ti=la},32983:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return nt}});var fe=se(94184),et=se.n(fe),$e=se(67294),Ue=se(53124),be=se(10110),Se=se(84780),Me=se(29691),pe=()=>{const[,lt]=(0,Me.Z)(),ke=new Se.C(lt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return $e.createElement("svg",{style:ke,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},$e.createElement("g",{fill:"none",fillRule:"evenodd"},$e.createElement("g",{transform:"translate(24 31.67)"},$e.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),$e.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"}),$e.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)"}),$e.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"}),$e.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"})),$e.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"}),$e.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},$e.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),$e.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},mt=()=>{const[,lt]=(0,Me.Z)(),{colorFill:Ie,colorFillTertiary:ke,colorFillQuaternary:je,colorBgContainer:Xe}=lt,{borderColor:Pt,shadowColor:kt,contentColor:Lt}=(0,$e.useMemo)(()=>({borderColor:new Se.C(Ie).onBackground(Xe).toHexShortString(),shadowColor:new Se.C(ke).onBackground(Xe).toHexShortString(),contentColor:new Se.C(je).onBackground(Xe).toHexShortString()}),[Ie,ke,je,Xe]);return $e.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},$e.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},$e.createElement("ellipse",{fill:kt,cx:"32",cy:"33",rx:"32",ry:"7"}),$e.createElement("g",{fillRule:"nonzero",stroke:Pt},$e.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"}),$e.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:Lt}))))},ze=se(67968),It=se(45503);const Ct=lt=>{const{componentCls:Ie,margin:ke,marginXS:je,marginXL:Xe,fontSize:Pt,lineHeight:kt}=lt;return{[Ie]:{marginInline:je,fontSize:Pt,lineHeight:kt,textAlign:"center",[`${Ie}-image`]:{height:lt.emptyImgHeight,marginBottom:je,opacity:lt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ie}-description`]:{color:lt.colorText},[`${Ie}-footer`]:{marginTop:ke},"&-normal":{marginBlock:Xe,color:lt.colorTextDisabled,[`${Ie}-description`]:{color:lt.colorTextDisabled},[`${Ie}-image`]:{height:lt.emptyImgHeightMD}},"&-small":{marginBlock:je,color:lt.colorTextDisabled,[`${Ie}-image`]:{height:lt.emptyImgHeightSM}}}}};var ht=(0,ze.Z)("Empty",lt=>{const{componentCls:Ie,controlHeightLG:ke}=lt,je=(0,It.TS)(lt,{emptyImgCls:`${Ie}-img`,emptyImgHeight:ke*2.5,emptyImgHeightMD:ke,emptyImgHeightSM:ke*.875});return[Ct(je)]}),Ye=function(lt,Ie){var ke={};for(var je in lt)Object.prototype.hasOwnProperty.call(lt,je)&&Ie.indexOf(je)<0&&(ke[je]=lt[je]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,je=Object.getOwnPropertySymbols(lt);Xe<je.length;Xe++)Ie.indexOf(je[Xe])<0&&Object.prototype.propertyIsEnumerable.call(lt,je[Xe])&&(ke[je[Xe]]=lt[je[Xe]]);return ke};const De=$e.createElement(pe,null),At=$e.createElement(mt,null),Jt=lt=>{var{className:Ie,rootClassName:ke,prefixCls:je,image:Xe=De,description:Pt,children:kt,imageStyle:Lt,style:Ge}=lt,Ht=Ye(lt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:Dt,direction:Ln,empty:un}=$e.useContext(Ue.E_),Rn=Dt("empty",je),[ir,yr]=ht(Rn),[Qe]=(0,be.Z)("Empty"),Le=typeof Pt!="undefined"?Pt:Qe==null?void 0:Qe.description,Nt=typeof Le=="string"?Le:"empty";let Nn=null;return typeof Xe=="string"?Nn=$e.createElement("img",{alt:Nt,src:Xe}):Nn=Xe,ir($e.createElement("div",Object.assign({className:et()(yr,Rn,un==null?void 0:un.className,{[`${Rn}-normal`]:Xe===At,[`${Rn}-rtl`]:Ln==="rtl"},Ie,ke),style:Object.assign(Object.assign({},un==null?void 0:un.style),Ge)},Ht),$e.createElement("div",{className:`${Rn}-image`,style:Lt},Nn),Le&&$e.createElement("div",{className:`${Rn}-description`},Le),kt&&$e.createElement("div",{className:`${Rn}-footer`},kt)))};Jt.PRESENTED_IMAGE_DEFAULT=De,Jt.PRESENTED_IMAGE_SIMPLE=At;var nt=Jt},22150:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return jt}});var fe=se(74902),et=se(94184),$e=se.n(et),Ue=se(38379),be=se(67294),Se=se(33603),Me=se(65223);function xe(Ke){const[dt,Rt]=be.useState(Ke);return be.useEffect(()=>{const Tt=setTimeout(()=>{Rt(Ke)},Ke.length?0:10);return()=>{clearTimeout(Tt)}},[Ke]),dt}var pe=se(14747),Te=se(50438),mt=se(33507),ze=se(45503),It=se(67968),ht=Ke=>{const{componentCls:dt}=Ke,Rt=`${dt}-show-help`,Tt=`${dt}-show-help-item`;return{[Rt]:{transition:`opacity ${Ke.motionDurationSlow} ${Ke.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Tt]:{overflow:"hidden",transition:`height ${Ke.motionDurationSlow} ${Ke.motionEaseInOut},
|
|
|
opacity ${Ke.motionDurationSlow} ${Ke.motionEaseInOut},
|
|
|
transform ${Ke.motionDurationSlow} ${Ke.motionEaseInOut} !important`,[`&${Tt}-appear, &${Tt}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Tt}-leave-active`]:{transform:"translateY(-5px)"}}}}};const Ye=Ke=>({legend:{display:"block",width:"100%",marginBottom:Ke.marginLG,padding:0,color:Ke.colorTextDescription,fontSize:Ke.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Ke.lineWidth}px ${Ke.lineType} ${Ke.colorBorder}`},label:{fontSize:Ke.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 ${Ke.controlOutlineWidth}px ${Ke.controlOutline}`},output:{display:"block",paddingTop:15,color:Ke.colorText,fontSize:Ke.fontSize,lineHeight:Ke.lineHeight}}),De=(Ke,dt)=>{const{formItemCls:Rt}=Ke;return{[Rt]:{[`${Rt}-label > label`]:{height:dt},[`${Rt}-control-input`]:{minHeight:dt}}}},At=Ke=>{const{componentCls:dt}=Ke;return{[Ke.componentCls]:Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(Ke)),Ye(Ke)),{[`${dt}-text`]:{display:"inline-block",paddingInlineEnd:Ke.paddingSM},"&-small":Object.assign({},De(Ke,Ke.controlHeightSM)),"&-large":Object.assign({},De(Ke,Ke.controlHeightLG))})}},Jt=Ke=>{const{formItemCls:dt,iconCls:Rt,componentCls:Tt,rootPrefixCls:Wt,labelRequiredMarkColor:Zt,labelColor:zn,labelFontSize:Sr,labelHeight:Yn,labelColonMarginInlineStart:qn,labelColonMarginInlineEnd:nr,itemMarginBottom:ar}=Ke;return{[dt]:Object.assign(Object.assign({},(0,pe.Wf)(Ke)),{marginBottom:ar,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
|
|
|
&-hidden.${Wt}-row`]:{display:"none"},"&-has-warning":{[`${dt}-split`]:{color:Ke.colorError}},"&-has-error":{[`${dt}-split`]:{color:Ke.colorWarning}},[`${dt}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${Ke.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Yn,color:zn,fontSize:Sr,[`> ${Rt}`]:{fontSize:Ke.fontSize,verticalAlign:"top"},[`&${dt}-required:not(${dt}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:Ke.marginXXS,color:Zt,fontSize:Ke.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Tt}-hide-required-mark &`]:{display:"none"}},[`${dt}-optional`]:{display:"inline-block",marginInlineStart:Ke.marginXXS,color:Ke.colorTextDescription,[`${Tt}-hide-required-mark &`]:{display:"none"}},[`${dt}-tooltip`]:{color:Ke.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:Ke.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:qn,marginInlineEnd:nr},[`&${dt}-no-colon::after`]:{content:'"\\a0"'}}},[`${dt}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Wt}-col-'"]):not([class*="' ${Wt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:Ke.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[dt]:{"&-explain, &-extra":{clear:"both",color:Ke.colorTextDescription,fontSize:Ke.fontSize,lineHeight:Ke.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:Ke.controlHeightSM,transition:`color ${Ke.motionDurationMid} ${Ke.motionEaseOut}`},"&-explain":{"&-error":{color:Ke.colorError},"&-warning":{color:Ke.colorWarning}}},[`&-with-help ${dt}-explain`]:{height:"auto",opacity:1},[`${dt}-feedback-icon`]:{fontSize:Ke.fontSize,textAlign:"center",visibility:"visible",animationName:Te.kr,animationDuration:Ke.motionDurationMid,animationTimingFunction:Ke.motionEaseOutBack,pointerEvents:"none","&-success":{color:Ke.colorSuccess},"&-error":{color:Ke.colorError},"&-warning":{color:Ke.colorWarning},"&-validating":{color:Ke.colorPrimary}}})}},nt=Ke=>{const{componentCls:dt,formItemCls:Rt}=Ke;return{[`${dt}-horizontal`]:{[`${Rt}-label`]:{flexGrow:0},[`${Rt}-control`]:{flex:"1 1 0",minWidth:0},[`${Rt}-label[class$='-24'], ${Rt}-label[class*='-24 ']`]:{[`& + ${Rt}-control`]:{minWidth:"unset"}}}}},lt=Ke=>{const{componentCls:dt,formItemCls:Rt}=Ke;return{[`${dt}-inline`]:{display:"flex",flexWrap:"wrap",[Rt]:{flex:"none",marginInlineEnd:Ke.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Rt}-label,
|
|
|
> ${Rt}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Rt}-label`]:{flex:"none"},[`${dt}-text`]:{display:"inline-block"},[`${Rt}-has-feedback`]:{display:"inline-block"}}}}},Ie=Ke=>({padding:Ke.verticalLabelPadding,margin:Ke.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),ke=Ke=>{const{componentCls:dt,formItemCls:Rt,rootPrefixCls:Tt}=Ke;return{[`${Rt} ${Rt}-label`]:Ie(Ke),[dt]:{[Rt]:{flexWrap:"wrap",[`${Rt}-label, ${Rt}-control`]:{[`&:not([class*=" ${Tt}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},je=Ke=>{const{componentCls:dt,formItemCls:Rt,rootPrefixCls:Tt}=Ke;return{[`${dt}-vertical`]:{[Rt]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${dt}-item-control`]:{width:"100%"}}},[`${dt}-vertical ${Rt}-label,
|
|
|
.${Tt}-col-24${Rt}-label,
|
|
|
.${Tt}-col-xl-24${Rt}-label`]:Ie(Ke),[`@media (max-width: ${Ke.screenXSMax}px)`]:[ke(Ke),{[dt]:{[`.${Tt}-col-xs-24${Rt}-label`]:Ie(Ke)}}],[`@media (max-width: ${Ke.screenSMMax}px)`]:{[dt]:{[`.${Tt}-col-sm-24${Rt}-label`]:Ie(Ke)}},[`@media (max-width: ${Ke.screenMDMax}px)`]:{[dt]:{[`.${Tt}-col-md-24${Rt}-label`]:Ie(Ke)}},[`@media (max-width: ${Ke.screenLGMax}px)`]:{[dt]:{[`.${Tt}-col-lg-24${Rt}-label`]:Ie(Ke)}}}},Xe=(Ke,dt)=>(0,ze.TS)(Ke,{formItemCls:`${Ke.componentCls}-item`,rootPrefixCls:dt});var Pt=(0,It.Z)("Form",(Ke,dt)=>{let{rootPrefixCls:Rt}=dt;const Tt=Xe(Ke,Rt);return[At(Tt),Jt(Tt),ht(Tt),nt(Tt),lt(Tt),je(Tt),(0,mt.Z)(Tt),Te.kr]},Ke=>({labelRequiredMarkColor:Ke.colorError,labelColor:Ke.colorTextHeading,labelFontSize:Ke.fontSize,labelHeight:Ke.controlHeight,labelColonMarginInlineStart:Ke.marginXXS/2,labelColonMarginInlineEnd:Ke.marginXS,itemMarginBottom:Ke.marginLG,verticalLabelPadding:`0 0 ${Ke.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const kt=[];function Lt(Ke,dt,Rt){let Tt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof Ke=="string"?Ke:`${dt}-${Tt}`,error:Ke,errorStatus:Rt}}var Ht=Ke=>{let{help:dt,helpStatus:Rt,errors:Tt=kt,warnings:Wt=kt,className:Zt,fieldId:zn,onVisibleChanged:Sr}=Ke;const{prefixCls:Yn}=be.useContext(Me.Rk),qn=`${Yn}-item-explain`,[,nr]=Pt(Yn),ar=(0,be.useMemo)(()=>(0,Se.Z)(Yn),[Yn]),ot=xe(Tt),tt=xe(Wt),vt=be.useMemo(()=>dt!=null?[Lt(dt,"help",Rt)]:[].concat((0,fe.Z)(ot.map((Dn,an)=>Lt(Dn,"error","error",an))),(0,fe.Z)(tt.map((Dn,an)=>Lt(Dn,"warning","warning",an)))),[dt,Rt,ot,tt]),rn={};return zn&&(rn.id=`${zn}_help`),be.createElement(Ue.default,{motionDeadline:ar.motionDeadline,motionName:`${Yn}-show-help`,visible:!!vt.length,onVisibleChanged:Sr},Dn=>{const{className:an,style:cn}=Dn;return be.createElement("div",Object.assign({},rn,{className:$e()(qn,an,Zt,nr),style:cn,role:"alert"}),be.createElement(Ue.CSSMotionList,Object.assign({keys:vt},(0,Se.Z)(Yn),{motionName:`${Yn}-show-help-item`,component:!1}),fn=>{const{key:In,error:or,errorStatus:Ut,className:qr,style:Fr}=fn;return be.createElement("div",{key:In,className:$e()(qr,{[`${qn}-${Ut}`]:Ut}),style:Fr},or)}))})},Dt=se(46660),Ln=se(53124),un=se(98866),Rn=se(97647),ir=se(98675),yr=se(17423);const Qe=["parentNode"],Le="form_item";function Nt(Ke){return Ke===void 0||Ke===!1?[]:Array.isArray(Ke)?Ke:[Ke]}function Nn(Ke,dt){if(!Ke.length)return;const Rt=Ke.join("_");return dt?`${dt}_${Rt}`:Qe.includes(Rt)?`${Le}_${Rt}`:Rt}function gn(Ke,dt,Rt,Tt,Wt,Zt){let zn=Tt;return Zt!==void 0?zn=Zt:Rt.validating?zn="validating":Ke.length?zn="error":dt.length?zn="warning":(Rt.touched||Wt&&Rt.validated)&&(zn="success"),zn}function Je(Ke){return Nt(Ke).join("_")}function st(Ke){const[dt]=(0,Dt.useForm)(),Rt=be.useRef({}),Tt=be.useMemo(()=>Ke!=null?Ke:Object.assign(Object.assign({},dt),{__INTERNAL__:{itemRef:Wt=>Zt=>{const zn=Je(Wt);Zt?Rt.current[zn]=Zt:delete Rt.current[zn]}},scrollToField:function(Wt){let Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const zn=Nt(Wt),Sr=Nn(zn,Tt.__INTERNAL__.name),Yn=Sr?document.getElementById(Sr):null;Yn&&(0,yr.Z)(Yn,Object.assign({scrollMode:"if-needed",block:"nearest"},Zt))},getFieldInstance:Wt=>{const Zt=Je(Wt);return Rt.current[Zt]}}),[Ke,dt]);return[Tt]}var _t=se(37920),en=function(Ke,dt){var Rt={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&dt.indexOf(Tt)<0&&(Rt[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Wt=0,Tt=Object.getOwnPropertySymbols(Ke);Wt<Tt.length;Wt++)dt.indexOf(Tt[Wt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[Wt])&&(Rt[Tt[Wt]]=Ke[Tt[Wt]]);return Rt};const Bt=(Ke,dt)=>{const Rt=be.useContext(un.Z),{getPrefixCls:Tt,direction:Wt,form:Zt}=be.useContext(Ln.E_),{prefixCls:zn,className:Sr,rootClassName:Yn,size:qn,disabled:nr=Rt,form:ar,colon:ot,labelAlign:tt,labelWrap:vt,labelCol:rn,wrapperCol:Dn,hideRequiredMark:an,layout:cn="horizontal",scrollToFirstError:fn,requiredMark:In,onFinishFailed:or,name:Ut,style:qr,feedbackIcons:Fr}=Ke,Ri=en(Ke,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Li=(0,ir.Z)(qn),pi=be.useContext(_t.Z),Gi=(0,be.useMemo)(()=>In!==void 0?In:Zt&&Zt.requiredMark!==void 0?Zt.requiredMark:!an,[an,In,Zt]),yi=ot!=null?ot:Zt==null?void 0:Zt.colon,ii=Tt("form",zn),[Bi,Zi]=Pt(ii),Vr=$e()(ii,`${ii}-${cn}`,{[`${ii}-hide-required-mark`]:Gi===!1,[`${ii}-rtl`]:Wt==="rtl",[`${ii}-${Li}`]:Li},Zi,Zt==null?void 0:Zt.className,Sr,Yn),[mi]=st(ar),{__INTERNAL__:Wi}=mi;Wi.name=Ut;const la=(0,be.useMemo)(()=>({name:Ut,labelAlign:tt,labelCol:rn,labelWrap:vt,wrapperCol:Dn,vertical:cn==="vertical",colon:yi,requiredMark:Gi,itemRef:Wi.itemRef,form:mi,feedbackIcons:Fr}),[Ut,tt,rn,Dn,cn,yi,Gi,mi,Fr]);be.useImperativeHandle(dt,()=>mi);const ea=(yt,pt)=>{if(yt){let $t={block:"nearest"};typeof yt=="object"&&($t=yt),mi.scrollToField(pt,$t)}},ti=yt=>{if(or==null||or(yt),yt.errorFields.length){const pt=yt.errorFields[0].name;if(fn!==void 0){ea(fn,pt);return}Zt&&Zt.scrollToFirstError!==void 0&&ea(Zt.scrollToFirstError,pt)}};return Bi(be.createElement(un.n,{disabled:nr},be.createElement(Rn.q,{size:Li},be.createElement(Me.RV,Object.assign({},{validateMessages:pi}),be.createElement(Me.q3.Provider,{value:la},be.createElement(Dt.default,Object.assign({id:Ut},Ri,{name:Ut,onFinishFailed:ti,form:mi,style:Object.assign(Object.assign({},Zt==null?void 0:Zt.style),qr),className:Vr})))))))};var zt=be.forwardRef(Bt),Mn=se(9475),bn=se(17799),Ee=se(96159),ce=se(37419);function le(Ke){if(typeof Ke=="function")return Ke;const dt=(0,ce.Z)(Ke);return dt.length<=1?dt[0]:dt}const ye=()=>{const{status:Ke,errors:dt=[],warnings:Rt=[]}=(0,be.useContext)(Me.aM);return{status:Ke,errors:dt,warnings:Rt}};ye.Context=Me.aM;var ve=ye,oe=se(96523);function He(Ke){const[dt,Rt]=be.useState(Ke),Tt=(0,be.useRef)(null),Wt=(0,be.useRef)([]),Zt=(0,be.useRef)(!1);be.useEffect(()=>(Zt.current=!1,()=>{Zt.current=!0,oe.Z.cancel(Tt.current),Tt.current=null}),[]);function zn(Sr){Zt.current||(Tt.current===null&&(Wt.current=[],Tt.current=(0,oe.Z)(()=>{Tt.current=null,Rt(Yn=>{let qn=Yn;return Wt.current.forEach(nr=>{qn=nr(qn)}),qn})})),Wt.current.push(Sr))}return[dt,zn]}function xt(){const{itemRef:Ke}=be.useContext(Me.q3),dt=be.useRef({});function Rt(Tt,Wt){const Zt=Wt&&typeof Wt=="object"&&Wt.ref,zn=Tt.join("_");return(dt.current.name!==zn||dt.current.originRef!==Zt)&&(dt.current.name=zn,dt.current.originRef=Zt,dt.current.ref=(0,bn.sQ)(Ke(Tt),Zt)),dt.current.ref}return Rt}var Yt=se(48130),pn=se(14075),dn=se(10366),An=se(92820),tn=se(21584);const Nr=Ke=>{const{formItemCls:dt}=Ke;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${dt}-control`]:{display:"flex"}}}};var Wr=(0,It.b)(["Form","item-item"],(Ke,dt)=>{let{rootPrefixCls:Rt}=dt;const Tt=Xe(Ke,Rt);return[Nr(Tt)]}),$n=Ke=>{const{prefixCls:dt,status:Rt,wrapperCol:Tt,children:Wt,errors:Zt,warnings:zn,_internalItemRender:Sr,extra:Yn,help:qn,fieldId:nr,marginBottom:ar,onErrorVisibleChanged:ot}=Ke,tt=`${dt}-item`,vt=be.useContext(Me.q3),rn=Tt||vt.wrapperCol||{},Dn=$e()(`${tt}-control`,rn.className),an=be.useMemo(()=>Object.assign({},vt),[vt]);delete an.labelCol,delete an.wrapperCol;const cn=be.createElement("div",{className:`${tt}-control-input`},be.createElement("div",{className:`${tt}-control-input-content`},Wt)),fn=be.useMemo(()=>({prefixCls:dt,status:Rt}),[dt,Rt]),In=ar!==null||Zt.length||zn.length?be.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},be.createElement(Me.Rk.Provider,{value:fn},be.createElement(Ht,{fieldId:nr,errors:Zt,warnings:zn,help:qn,helpStatus:Rt,className:`${tt}-explain-connected`,onVisibleChanged:ot})),!!ar&&be.createElement("div",{style:{width:0,height:ar}})):null,or={};nr&&(or.id=`${nr}_extra`);const Ut=Yn?be.createElement("div",Object.assign({},or,{className:`${tt}-extra`}),Yn):null,qr=Sr&&Sr.mark==="pro_table_render"&&Sr.render?Sr.render(Ke,{input:cn,errorList:In,extra:Ut}):be.createElement(be.Fragment,null,cn,In,Ut);return be.createElement(Me.q3.Provider,{value:an},be.createElement(tn.Z,Object.assign({},rn,{className:Dn}),qr),be.createElement(Wr,{prefixCls:dt}))},ei=se(17663),hi=se(24457),ut=se(10110),Vt=se(83062),Vn=function(Ke,dt){var Rt={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&dt.indexOf(Tt)<0&&(Rt[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Wt=0,Tt=Object.getOwnPropertySymbols(Ke);Wt<Tt.length;Wt++)dt.indexOf(Tt[Wt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[Wt])&&(Rt[Tt[Wt]]=Ke[Tt[Wt]]);return Rt};function rr(Ke){return Ke?typeof Ke=="object"&&!be.isValidElement(Ke)?Ke:{title:Ke}:null}var Ir=Ke=>{let{prefixCls:dt,label:Rt,htmlFor:Tt,labelCol:Wt,labelAlign:Zt,colon:zn,required:Sr,requiredMark:Yn,tooltip:qn}=Ke;var nr;const[ar]=(0,ut.Z)("Form"),{vertical:ot,labelAlign:tt,labelCol:vt,labelWrap:rn,colon:Dn}=be.useContext(Me.q3);if(!Rt)return null;const an=Wt||vt||{},cn=Zt||tt,fn=`${dt}-item-label`,In=$e()(fn,cn==="left"&&`${fn}-left`,an.className,{[`${fn}-wrap`]:!!rn});let or=Rt;const Ut=zn===!0||Dn!==!1&&zn!==!1;Ut&&!ot&&typeof Rt=="string"&&Rt.trim()!==""&&(or=Rt.replace(/[:|:]\s*$/,""));const Fr=rr(qn);if(Fr){const{icon:Gi=be.createElement(ei.Z,null)}=Fr,yi=Vn(Fr,["icon"]),ii=be.createElement(Vt.Z,Object.assign({},yi),be.cloneElement(Gi,{className:`${dt}-item-tooltip`,title:""}));or=be.createElement(be.Fragment,null,or,ii)}const Ri=Yn==="optional",Li=typeof Yn=="function";Li?or=Yn(or,{required:!!Sr}):Ri&&!Sr&&(or=be.createElement(be.Fragment,null,or,be.createElement("span",{className:`${dt}-item-optional`,title:""},(ar==null?void 0:ar.optional)||((nr=hi.Z.Form)===null||nr===void 0?void 0:nr.optional))));const pi=$e()({[`${dt}-item-required`]:Sr,[`${dt}-item-required-mark-optional`]:Ri||Li,[`${dt}-item-no-colon`]:!Ut});return be.createElement(tn.Z,Object.assign({},an,{className:In}),be.createElement("label",{htmlFor:Tt,className:pi,title:typeof Rt=="string"?Rt:""},or))},Ur=se(87725),Gr=se(16646),Xr=se(87995),ui=se(3407);const br={success:Ur.Z,warning:Xr.Z,error:Gr.Z,validating:ui.Z};function Ei(Ke){let{children:dt,errors:Rt,warnings:Tt,hasFeedback:Wt,validateStatus:Zt,prefixCls:zn,meta:Sr,noStyle:Yn}=Ke;const qn=`${zn}-item`,{feedbackIcons:nr}=be.useContext(Me.q3),ar=gn(Rt,Tt,Sr,null,!!Wt,Zt),{isFormItemInput:ot,status:tt}=be.useContext(Me.aM),vt=be.useMemo(()=>{var rn;let Dn;if(Wt){const fn=Wt!==!0&&Wt.icons||nr,In=ar&&((rn=fn==null?void 0:fn({status:ar,errors:Rt,warnings:Tt}))===null||rn===void 0?void 0:rn[ar]),or=ar&&br[ar];Dn=In!==!1&&or?be.createElement("span",{className:$e()(`${qn}-feedback-icon`,`${qn}-feedback-icon-${ar}`)},In||be.createElement(or,null)):null}let an=!0,cn=ar||"";return Yn&&(an=ot,cn=(ar!=null?ar:tt)||""),{status:cn,errors:Rt,warnings:Tt,hasFeedback:!!Wt,feedbackIcon:Dn,isFormItemInput:an}},[ar,Wt,Yn,ot,tt]);return be.createElement(Me.aM.Provider,{value:vt},dt)}var sa=function(Ke,dt){var Rt={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&dt.indexOf(Tt)<0&&(Rt[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Wt=0,Tt=Object.getOwnPropertySymbols(Ke);Wt<Tt.length;Wt++)dt.indexOf(Tt[Wt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[Wt])&&(Rt[Tt[Wt]]=Ke[Tt[Wt]]);return Rt};function Ji(Ke){const{prefixCls:dt,className:Rt,rootClassName:Tt,style:Wt,help:Zt,errors:zn,warnings:Sr,validateStatus:Yn,meta:qn,hasFeedback:nr,hidden:ar,children:ot,fieldId:tt,required:vt,isRequired:rn,onSubItemMetaChange:Dn}=Ke,an=sa(Ke,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),cn=`${dt}-item`,{requiredMark:fn}=be.useContext(Me.q3),In=be.useRef(null),or=xe(zn),Ut=xe(Sr),qr=Zt!=null,Fr=!!(qr||zn.length||Sr.length),Ri=!!In.current&&(0,Yt.Z)(In.current),[Li,pi]=be.useState(null);(0,pn.Z)(()=>{if(Fr&&In.current){const Zi=getComputedStyle(In.current);pi(parseInt(Zi.marginBottom,10))}},[Fr,Ri]);const Gi=Zi=>{Zi||pi(null)},ii=function(){let Zi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Vr=Zi?or:qn.errors,mi=Zi?Ut:qn.warnings;return gn(Vr,mi,qn,"",!!nr,Yn)}(),Bi=$e()(cn,Rt,Tt,{[`${cn}-with-help`]:qr||or.length||Ut.length,[`${cn}-has-feedback`]:ii&&nr,[`${cn}-has-success`]:ii==="success",[`${cn}-has-warning`]:ii==="warning",[`${cn}-has-error`]:ii==="error",[`${cn}-is-validating`]:ii==="validating",[`${cn}-hidden`]:ar});return be.createElement("div",{className:Bi,style:Wt,ref:In},be.createElement(An.Z,Object.assign({className:`${cn}-row`},(0,dn.Z)(an,["_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(Ir,Object.assign({htmlFor:tt},Ke,{requiredMark:fn,required:vt!=null?vt:rn,prefixCls:dt})),be.createElement($n,Object.assign({},Ke,qn,{errors:or,warnings:Ut,prefixCls:dt,status:ii,help:Zt,marginBottom:Li,onErrorVisibleChanged:Gi}),be.createElement(Me.qI.Provider,{value:Dn},be.createElement(Ei,{prefixCls:dt,meta:qn,errors:qn.errors,warnings:qn.warnings,hasFeedback:nr,validateStatus:ii},ot)))),!!Li&&be.createElement("div",{className:`${cn}-margin-offset`,style:{marginBottom:-Li}}))}const Qi="__SPLIT__",Ci=null,gt=be.memo(Ke=>{let{children:dt}=Ke;return dt},(Ke,dt)=>Ke.value===dt.value&&Ke.update===dt.update&&Ke.childProps.length===dt.childProps.length&&Ke.childProps.every((Rt,Tt)=>Rt===dt.childProps[Tt]));function En(Ke){return Ke!=null}function kn(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Tn(Ke){const{name:dt,noStyle:Rt,className:Tt,dependencies:Wt,prefixCls:Zt,shouldUpdate:zn,rules:Sr,children:Yn,required:qn,label:nr,messageVariables:ar,trigger:ot="onChange",validateTrigger:tt,hidden:vt,help:rn}=Ke,{getPrefixCls:Dn}=be.useContext(Ln.E_),{name:an}=be.useContext(Me.q3),cn=le(Yn),fn=typeof cn=="function",In=be.useContext(Me.qI),{validateTrigger:or}=be.useContext(Dt.FieldContext),Ut=tt!==void 0?tt:or,qr=En(dt),Fr=Dn("form",Zt),[Ri,Li]=Pt(Fr),pi=be.useContext(Dt.ListContext),Gi=be.useRef(),[yi,ii]=He({}),[Bi,Zi]=(0,Mn.Z)(()=>kn()),Vr=pt=>{const $t=pi==null?void 0:pi.getKey(pt.name);if(Zi(pt.destroy?kn():pt,!0),Rt&&rn!==!1&&In){let sn=pt.name;if(pt.destroy)sn=Gi.current||sn;else if($t!==void 0){const[_n,cr]=$t;sn=[_n].concat((0,fe.Z)(cr)),Gi.current=sn}In(pt,sn)}},mi=(pt,$t)=>{ii(sn=>{const _n=Object.assign({},sn),Mr=[].concat((0,fe.Z)(pt.name.slice(0,-1)),(0,fe.Z)($t)).join(Qi);return pt.destroy?delete _n[Mr]:_n[Mr]=pt,_n})},[Wi,la]=be.useMemo(()=>{const pt=(0,fe.Z)(Bi.errors),$t=(0,fe.Z)(Bi.warnings);return Object.values(yi).forEach(sn=>{pt.push.apply(pt,(0,fe.Z)(sn.errors||[])),$t.push.apply($t,(0,fe.Z)(sn.warnings||[]))}),[pt,$t]},[yi,Bi.errors,Bi.warnings]),ea=xt();function ti(pt,$t,sn){return Rt&&!vt?be.createElement(Ei,{prefixCls:Fr,hasFeedback:Ke.hasFeedback,validateStatus:Ke.validateStatus,meta:Bi,errors:Wi,warnings:la,noStyle:!0},pt):be.createElement(Ji,Object.assign({key:"row"},Ke,{className:$e()(Tt,Li),prefixCls:Fr,fieldId:$t,isRequired:sn,errors:Wi,warnings:la,meta:Bi,onSubItemMetaChange:mi}),pt)}if(!qr&&!fn&&!Wt)return Ri(ti(cn));let yt={};return typeof nr=="string"?yt.label=nr:dt&&(yt.label=String(dt)),ar&&(yt=Object.assign(Object.assign({},yt),ar)),Ri(be.createElement(Dt.Field,Object.assign({},Ke,{messageVariables:yt,trigger:ot,validateTrigger:Ut,onMetaChange:Vr}),(pt,$t,sn)=>{const _n=Nt(dt).length&&$t?$t.name:[],cr=Nn(_n,an),Mr=qn!==void 0?qn:!!(Sr&&Sr.some(Rr=>{if(Rr&&typeof Rr=="object"&&Rr.required&&!Rr.warningOnly)return!0;if(typeof Rr=="function"){const Qr=Rr(sn);return Qr&&Qr.required&&!Qr.warningOnly}return!1})),Br=Object.assign({},pt);let Kr=null;if(Array.isArray(cn)&&qr)Kr=cn;else if(!(fn&&(!(zn||Wt)||qr))){if(!(Wt&&!fn&&!qr))if((0,Ee.l$)(cn)){const Rr=Object.assign(Object.assign({},cn.props),Br);if(Rr.id||(Rr.id=cr),rn||Wi.length>0||la.length>0||Ke.extra){const Cr=[];(rn||Wi.length>0)&&Cr.push(`${cr}_help`),Ke.extra&&Cr.push(`${cr}_extra`),Rr["aria-describedby"]=Cr.join(" ")}Wi.length>0&&(Rr["aria-invalid"]="true"),Mr&&(Rr["aria-required"]="true"),(0,bn.Yr)(cn)&&(Rr.ref=ea(_n,cn)),new Set([].concat((0,fe.Z)(Nt(ot)),(0,fe.Z)(Nt(Ut)))).forEach(Cr=>{Rr[Cr]=function(){for(var di,Ai,Si,_e,Be,Ne=arguments.length,We=new Array(Ne),qe=0;qe<Ne;qe++)We[qe]=arguments[qe];(Si=Br[Cr])===null||Si===void 0||(di=Si).call.apply(di,[Br].concat(We)),(Be=(_e=cn.props)[Cr])===null||Be===void 0||(Ai=Be).call.apply(Ai,[_e].concat(We))}});const gi=[Rr["aria-required"],Rr["aria-invalid"],Rr["aria-describedby"]];Kr=be.createElement(gt,{value:Br[Ke.valuePropName||"value"],update:cn,childProps:gi},(0,Ee.Tm)(cn,Rr))}else fn&&(zn||Wt)&&!qr?Kr=cn(sn):Kr=cn}return ti(Kr,cr,Mr)}))}const sr=Tn;sr.useStatus=ve;var tr=sr,pr=function(Ke,dt){var Rt={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&dt.indexOf(Tt)<0&&(Rt[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Wt=0,Tt=Object.getOwnPropertySymbols(Ke);Wt<Tt.length;Wt++)dt.indexOf(Tt[Wt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[Wt])&&(Rt[Tt[Wt]]=Ke[Tt[Wt]]);return Rt},Ze=Ke=>{var{prefixCls:dt,children:Rt}=Ke,Tt=pr(Ke,["prefixCls","children"]);const{getPrefixCls:Wt}=be.useContext(Ln.E_),Zt=Wt("form",dt),zn=be.useMemo(()=>({prefixCls:Zt,status:"error"}),[Zt]);return be.createElement(Dt.List,Object.assign({},Tt),(Sr,Yn,qn)=>be.createElement(Me.Rk.Provider,{value:zn},Rt(Sr.map(nr=>Object.assign(Object.assign({},nr),{fieldKey:nr.key})),Yn,{errors:qn.errors,warnings:qn.warnings})))};function at(){const{form:Ke}=(0,be.useContext)(Me.q3);return Ke}const Et=zt;Et.Item=tr,Et.List=Ze,Et.ErrorList=Ht,Et.useForm=st,Et.useFormInstance=at,Et.useWatch=Dt.useWatch,Et.Provider=Me.RV,Et.create=()=>{};var jt=Et},31795:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Hn}});var fe=se(42922),et=se(53978),$e=se(94184),Ue=se.n($e),be=se(87462),Se=se(4942),Me=se(71002),xe=se(97685),pe=se(45987),Te=se(15671),mt=se(43144);function ze(){return typeof BigInt=="function"}function It(Ze){return!Ze&&Ze!==0&&!Number.isNaN(Ze)||!String(Ze).trim()}function Ct(Ze){var at=Ze.trim(),Et=at.startsWith("-");Et&&(at=at.slice(1)),at=at.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),at.startsWith(".")&&(at="0".concat(at));var jt=at||"0",Ke=jt.split("."),dt=Ke[0]||"0",Rt=Ke[1]||"0";dt==="0"&&Rt==="0"&&(Et=!1);var Tt=Et?"-":"";return{negative:Et,negativeStr:Tt,trimStr:jt,integerStr:dt,decimalStr:Rt,fullStr:"".concat(Tt).concat(jt)}}function ht(Ze){var at=String(Ze);return!Number.isNaN(Number(at))&&at.includes("e")}function Ye(Ze){var at=String(Ze);if(ht(Ze)){var Et=Number(at.slice(at.indexOf("e-")+2)),jt=at.match(/\.(\d+)/);return jt!=null&&jt[1]&&(Et+=jt[1].length),Et}return at.includes(".")&&At(at)?at.length-at.indexOf(".")-1:0}function De(Ze){var at=String(Ze);if(ht(Ze)){if(Ze>Number.MAX_SAFE_INTEGER)return String(ze()?BigInt(Ze).toString():Number.MAX_SAFE_INTEGER);if(Ze<Number.MIN_SAFE_INTEGER)return String(ze()?BigInt(Ze).toString():Number.MIN_SAFE_INTEGER);at=Ze.toFixed(Ye(at))}return Ct(at).fullStr}function At(Ze){return typeof Ze=="number"?!Number.isNaN(Ze):Ze?/^\s*-?\d+(\.\d+)?\s*$/.test(Ze)||/^\s*-?\d+\.\s*$/.test(Ze)||/^\s*-?\.\d+\s*$/.test(Ze):!1}var Jt=function(){function Ze(at){if((0,Te.Z)(this,Ze),(0,Se.Z)(this,"origin",""),(0,Se.Z)(this,"negative",void 0),(0,Se.Z)(this,"integer",void 0),(0,Se.Z)(this,"decimal",void 0),(0,Se.Z)(this,"decimalLen",void 0),(0,Se.Z)(this,"empty",void 0),(0,Se.Z)(this,"nan",void 0),It(at)){this.empty=!0;return}if(this.origin=String(at),at==="-"||Number.isNaN(at)){this.nan=!0;return}var Et=at;if(ht(Et)&&(Et=Number(Et)),Et=typeof Et=="string"?Et:De(Et),At(Et)){var jt=Ct(Et);this.negative=jt.negative;var Ke=jt.trimStr.split(".");this.integer=BigInt(Ke[0]);var dt=Ke[1]||"0";this.decimal=BigInt(dt),this.decimalLen=dt.length}else this.nan=!0}return(0,mt.Z)(Ze,[{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(Et){var jt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Et,"0"));return BigInt(jt)}},{key:"negate",value:function(){var Et=new Ze(this.toString());return Et.negative=!Et.negative,Et}},{key:"cal",value:function(Et,jt,Ke){var dt=Math.max(this.getDecimalStr().length,Et.getDecimalStr().length),Rt=this.alignDecimal(dt),Tt=Et.alignDecimal(dt),Wt=jt(Rt,Tt).toString(),Zt=Ke(dt),zn=Ct(Wt),Sr=zn.negativeStr,Yn=zn.trimStr,qn="".concat(Sr).concat(Yn.padStart(Zt+1,"0"));return new Ze("".concat(qn.slice(0,-Zt),".").concat(qn.slice(-Zt)))}},{key:"add",value:function(Et){if(this.isInvalidate())return new Ze(Et);var jt=new Ze(Et);return jt.isInvalidate()?this:this.cal(jt,function(Ke,dt){return Ke+dt},function(Ke){return Ke})}},{key:"multi",value:function(Et){var jt=new Ze(Et);return this.isInvalidate()||jt.isInvalidate()?new Ze(NaN):this.cal(jt,function(Ke,dt){return Ke*dt},function(Ke){return Ke*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(Et){return this.toString()===(Et==null?void 0:Et.toString())}},{key:"lessEquals",value:function(Et){return this.add(Et.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Et?this.isInvalidate()?"":Ct("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Ze}(),nt=function(){function Ze(at){if((0,Te.Z)(this,Ze),(0,Se.Z)(this,"origin",""),(0,Se.Z)(this,"number",void 0),(0,Se.Z)(this,"empty",void 0),It(at)){this.empty=!0;return}this.origin=String(at),this.number=Number(at)}return(0,mt.Z)(Ze,[{key:"negate",value:function(){return new Ze(-this.toNumber())}},{key:"add",value:function(Et){if(this.isInvalidate())return new Ze(Et);var jt=Number(Et);if(Number.isNaN(jt))return this;var Ke=this.number+jt;if(Ke>Number.MAX_SAFE_INTEGER)return new Ze(Number.MAX_SAFE_INTEGER);if(Ke<Number.MIN_SAFE_INTEGER)return new Ze(Number.MIN_SAFE_INTEGER);var dt=Math.max(Ye(this.number),Ye(jt));return new Ze(Ke.toFixed(dt))}},{key:"multi",value:function(Et){var jt=Number(Et);if(this.isInvalidate()||Number.isNaN(jt))return new Ze(NaN);var Ke=this.number*jt;if(Ke>Number.MAX_SAFE_INTEGER)return new Ze(Number.MAX_SAFE_INTEGER);if(Ke<Number.MIN_SAFE_INTEGER)return new Ze(Number.MIN_SAFE_INTEGER);var dt=Math.max(Ye(this.number),Ye(jt));return new Ze(Ke.toFixed(dt))}},{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(Et){return this.toNumber()===(Et==null?void 0:Et.toNumber())}},{key:"lessEquals",value:function(Et){return this.add(Et.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Et?this.isInvalidate()?"":De(this.number):this.origin}}]),Ze}();function lt(Ze){return ze()?new Jt(Ze):new nt(Ze)}function Ie(Ze,at,Et){var jt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Ze==="")return"";var Ke=Ct(Ze),dt=Ke.negativeStr,Rt=Ke.integerStr,Tt=Ke.decimalStr,Wt="".concat(at).concat(Tt),Zt="".concat(dt).concat(Rt);if(Et>=0){var zn=Number(Tt[Et]);if(zn>=5&&!jt){var Sr=lt(Ze).add("".concat(dt,"0.").concat("0".repeat(Et)).concat(10-zn));return Ie(Sr.toString(),at,Et,jt)}return Et===0?Zt:"".concat(Zt).concat(at).concat(Tt.padEnd(Et,"0").slice(0,Et))}return Wt===".0"?Zt:"".concat(Zt).concat(Wt)}var ke=lt,je=se(67656),Xe=se(67294);function Pt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var kt=Pt()?Xe.useLayoutEffect:Xe.useEffect,Lt=function(at,Et){var jt=Xe.useRef(!0);kt(function(){return at(jt.current)},Et),kt(function(){return jt.current=!1,function(){jt.current=!0}},[])},Ge=function(at,Et){Lt(function(jt){if(!jt)return at()},Et)},Ht=Lt,Dt=se(27183);function Ln(Ze,at,Et){var jt=React.useRef({});return(!("value"in jt.current)||Et(jt.current.condition,at))&&(jt.current.value=Ze(),jt.current.condition=at),jt.current.value}function un(Ze,at){typeof Ze=="function"?Ze(at):(0,Me.Z)(Ze)==="object"&&Ze&&"current"in Ze&&(Ze.current=at)}function Rn(){for(var Ze=arguments.length,at=new Array(Ze),Et=0;Et<Ze;Et++)at[Et]=arguments[Et];var jt=at.filter(function(Ke){return Ke});return jt.length<=1?jt[0]:function(Ke){at.forEach(function(dt){un(dt,Ke)})}}function ir(){for(var Ze=arguments.length,at=new Array(Ze),Et=0;Et<Ze;Et++)at[Et]=arguments[Et];return useMemo(function(){return Rn.apply(void 0,at)},at,function(jt,Ke){return jt.length!==Ke.length||jt.every(function(dt,Rt){return dt!==Ke[Rt]})})}function yr(Ze){var at,Et,jt=isMemo(Ze)?Ze.type.type:Ze.type;return!(typeof jt=="function"&&!((at=jt.prototype)!==null&&at!==void 0&&at.render)||typeof Ze=="function"&&!((Et=Ze.prototype)!==null&&Et!==void 0&&Et.render))}function Qe(Ze){return!isValidElement(Ze)||isFragment(Ze)?!1:yr(Ze)}var Le={},Nt=[],Nn=function(at){Nt.push(at)};function gn(Ze,at){if(0)var Et}function Je(Ze,at){if(0)var Et}function st(){Le={}}function _t(Ze,at,Et){!at&&!Le[Et]&&(Ze(!1,Et),Le[Et]=!0)}function en(Ze,at){_t(gn,Ze,at)}function Bt(Ze,at){_t(Je,Ze,at)}en.preMessage=Nn,en.resetWarned=st,en.noteOnce=Bt;var Ft=en;function zt(Ze,at){var Et=(0,Xe.useRef)(null);function jt(){try{var dt=Ze.selectionStart,Rt=Ze.selectionEnd,Tt=Ze.value,Wt=Tt.substring(0,dt),Zt=Tt.substring(Rt);Et.current={start:dt,end:Rt,value:Tt,beforeTxt:Wt,afterTxt:Zt}}catch(zn){}}function Ke(){if(Ze&&Et.current&&at)try{var dt=Ze.value,Rt=Et.current,Tt=Rt.beforeTxt,Wt=Rt.afterTxt,Zt=Rt.start,zn=dt.length;if(dt.endsWith(Wt))zn=dt.length-Et.current.afterTxt.length;else if(dt.startsWith(Tt))zn=Tt.length;else{var Sr=Tt[Zt-1],Yn=dt.indexOf(Sr,Zt-1);Yn!==-1&&(zn=Yn+1)}Ze.setSelectionRange(zn,zn)}catch(qn){Ft(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(qn.message))}}return[jt,Ke]}var Mn=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ze=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ze)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ze==null?void 0:Ze.substr(0,4))},bn=function(){var at=(0,Xe.useState)(!1),Et=(0,xe.Z)(at,2),jt=Et[0],Ke=Et[1];return Ht(function(){Ke(Mn())},[]),jt},Ee=bn,ce=function(at){return+setTimeout(at,16)},le=function(at){return clearTimeout(at)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ce=function(at){return window.requestAnimationFrame(at)},le=function(at){return window.cancelAnimationFrame(at)});var ye=0,ve=new Map;function oe(Ze){ve.delete(Ze)}var He=function(at){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ye+=1;var jt=ye;function Ke(dt){if(dt===0)oe(jt),at();else{var Rt=ce(function(){Ke(dt-1)});ve.set(jt,Rt)}}return Ke(Et),jt};He.cancel=function(Ze){var at=ve.get(Ze);return oe(at),le(at)};var xt=He,Yt=200,pn=600;function dn(Ze){var at=Ze.prefixCls,Et=Ze.upNode,jt=Ze.downNode,Ke=Ze.upDisabled,dt=Ze.downDisabled,Rt=Ze.onStep,Tt=Xe.useRef(),Wt=Xe.useRef([]),Zt=Xe.useRef();Zt.current=Rt;var zn=function(){clearTimeout(Tt.current)},Sr=function(rn,Dn){rn.preventDefault(),zn(),Zt.current(Dn);function an(){Zt.current(Dn),Tt.current=setTimeout(an,Yt)}Tt.current=setTimeout(an,pn)};Xe.useEffect(function(){return function(){zn(),Wt.current.forEach(function(vt){return xt.cancel(vt)})}},[]);var Yn=Ee();if(Yn)return null;var qn="".concat(at,"-handler"),nr=Ue()(qn,"".concat(qn,"-up"),(0,Se.Z)({},"".concat(qn,"-up-disabled"),Ke)),ar=Ue()(qn,"".concat(qn,"-down"),(0,Se.Z)({},"".concat(qn,"-down-disabled"),dt)),ot=function(){return Wt.current.push(xt(zn))},tt={unselectable:"on",role:"button",onMouseUp:ot,onMouseLeave:ot};return Xe.createElement("div",{className:"".concat(qn,"-wrap")},Xe.createElement("span",(0,be.Z)({},tt,{onMouseDown:function(rn){Sr(rn,!0)},"aria-label":"Increase Value","aria-disabled":Ke,className:nr}),Et||Xe.createElement("span",{unselectable:"on",className:"".concat(at,"-handler-up-inner")})),Xe.createElement("span",(0,be.Z)({},tt,{onMouseDown:function(rn){Sr(rn,!1)},"aria-label":"Decrease Value","aria-disabled":dt,className:ar}),jt||Xe.createElement("span",{unselectable:"on",className:"".concat(at,"-handler-down-inner")})))}function An(Ze){var at=typeof Ze=="number"?De(Ze):Ct(Ze).fullStr,Et=at.includes(".");return Et?Ct(at.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Ze+"0"}var tn=se(87887),Nr=function(){var Ze=(0,Xe.useRef)(0),at=function(){xt.cancel(Ze.current)};return(0,Xe.useEffect)(function(){return at},[]),function(Et){at(),Ze.current=xt(function(){Et()})}},Wr=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Kt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],$n=function(at,Et){return at||Et.isEmpty()?Et.toString():Et.toNumber()},ei=function(at){var Et=ke(at);return Et.isInvalidate()?null:Et},hi=Xe.forwardRef(function(Ze,at){var Et,jt=Ze.prefixCls,Ke=jt===void 0?"rc-input-number":jt,dt=Ze.className,Rt=Ze.style,Tt=Ze.min,Wt=Ze.max,Zt=Ze.step,zn=Zt===void 0?1:Zt,Sr=Ze.defaultValue,Yn=Ze.value,qn=Ze.disabled,nr=Ze.readOnly,ar=Ze.upHandler,ot=Ze.downHandler,tt=Ze.keyboard,vt=Ze.controls,rn=vt===void 0?!0:vt,Dn=Ze.classNames,an=Ze.stringMode,cn=Ze.parser,fn=Ze.formatter,In=Ze.precision,or=Ze.decimalSeparator,Ut=Ze.onChange,qr=Ze.onInput,Fr=Ze.onPressEnter,Ri=Ze.onStep,Li=(0,pe.Z)(Ze,Wr),pi="".concat(Ke,"-input"),Gi=Xe.useRef(null),yi=Xe.useState(!1),ii=(0,xe.Z)(yi,2),Bi=ii[0],Zi=ii[1],Vr=Xe.useRef(!1),mi=Xe.useRef(!1),Wi=Xe.useRef(!1),la=Xe.useState(function(){return ke(Yn!=null?Yn:Sr)}),ea=(0,xe.Z)(la,2),ti=ea[0],yt=ea[1];function pt(jn){Yn===void 0&&yt(jn)}var $t=Xe.useCallback(function(jn,Zn){if(!Zn)return In>=0?In:Math.max(Ye(jn),Ye(zn))},[In,zn]),sn=Xe.useCallback(function(jn){var Zn=String(jn);if(cn)return cn(Zn);var Jn=Zn;return or&&(Jn=Jn.replace(or,".")),Jn.replace(/[^\w.-]+/g,"")},[cn,or]),_n=Xe.useRef(""),cr=Xe.useCallback(function(jn,Zn){if(fn)return fn(jn,{userTyping:Zn,input:String(_n.current)});var Jn=typeof jn=="number"?De(jn):jn;if(!Zn){var Qn=$t(Jn,Zn);if(At(Jn)&&(or||Qn>=0)){var hr=or||".";Jn=Ie(Jn,hr,Qn)}}return Jn},[fn,$t,or]),Mr=Xe.useState(function(){var jn=Sr!=null?Sr:Yn;return ti.isInvalidate()&&["string","number"].includes((0,Me.Z)(jn))?Number.isNaN(jn)?"":jn:cr(ti.toString(),!1)}),Br=(0,xe.Z)(Mr,2),Kr=Br[0],Rr=Br[1];_n.current=Kr;function Qr(jn,Zn){Rr(cr(jn.isInvalidate()?jn.toString(!1):jn.toString(!Zn),Zn))}var gi=Xe.useMemo(function(){return ei(Wt)},[Wt,In]),Cr=Xe.useMemo(function(){return ei(Tt)},[Tt,In]),di=Xe.useMemo(function(){return!gi||!ti||ti.isInvalidate()?!1:gi.lessEquals(ti)},[gi,ti]),Ai=Xe.useMemo(function(){return!Cr||!ti||ti.isInvalidate()?!1:ti.lessEquals(Cr)},[Cr,ti]),Si=zt(Gi.current,Bi),_e=(0,xe.Z)(Si,2),Be=_e[0],Ne=_e[1],We=function(Zn){return gi&&!Zn.lessEquals(gi)?gi:Cr&&!Cr.lessEquals(Zn)?Cr:null},qe=function(Zn){return!We(Zn)},rt=function(Zn,Jn){var Qn=Zn,hr=qe(Qn)||Qn.isEmpty();if(!Qn.isEmpty()&&!Jn&&(Qn=We(Qn)||Qn,hr=!0),!nr&&!qn&&hr){var Pe=Qn.toString(),Fe=$t(Pe,Jn);return Fe>=0&&(Qn=ke(Ie(Pe,".",Fe)),qe(Qn)||(Qn=ke(Ie(Pe,".",Fe,!0)))),Qn.equals(ti)||(pt(Qn),Ut==null||Ut(Qn.isEmpty()?null:$n(an,Qn)),Yn===void 0&&Qr(Qn,Jn)),Qn}return ti},bt=Nr(),Gt=function jn(Zn){if(Be(),_n.current=Zn,Rr(Zn),!mi.current){var Jn=sn(Zn),Qn=ke(Jn);Qn.isNaN()||rt(Qn,!0)}qr==null||qr(Zn),bt(function(){var hr=Zn;cn||(hr=Zn.replace(/。/g,".")),hr!==Zn&&jn(hr)})},nn=function(){mi.current=!0},Gn=function(){mi.current=!1,Gt(Gi.current.value)},fr=function(Zn){Gt(Zn.target.value)},Wn=function(Zn){var Jn;if(!(Zn&&di||!Zn&&Ai)){Vr.current=!1;var Qn=ke(Wi.current?An(zn):zn);Zn||(Qn=Qn.negate());var hr=(ti||ke(0)).add(Qn.toString()),Pe=rt(hr,!1);Ri==null||Ri($n(an,Pe),{offset:Wi.current?An(zn):zn,type:Zn?"up":"down"}),(Jn=Gi.current)===null||Jn===void 0||Jn.focus()}},vn=function(Zn){var Jn=ke(sn(Kr)),Qn=Jn;Jn.isNaN()?Qn=rt(ti,Zn):Qn=rt(Jn,Zn),Yn!==void 0?Qr(ti,!1):Qn.isNaN()||Qr(Qn,!1)},hn=function(){Vr.current=!0},Sn=function(Zn){var Jn=Zn.key,Qn=Zn.shiftKey;Vr.current=!0,Wi.current=Qn,Jn==="Enter"&&(mi.current||(Vr.current=!1),vn(!1),Fr==null||Fr(Zn)),tt!==!1&&!mi.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Jn)&&(Wn(Jn==="Up"||Jn==="ArrowUp"),Zn.preventDefault())},Pn=function(){Vr.current=!1,Wi.current=!1},ur=function(){vn(!1),Zi(!1),Vr.current=!1};return Ge(function(){ti.isInvalidate()||Qr(ti,!1)},[In]),Ge(function(){var jn=ke(Yn);yt(jn);var Zn=ke(sn(Kr));(!jn.equals(Zn)||!Vr.current||fn)&&Qr(jn,Vr.current)},[Yn]),Ge(function(){fn&&Ne()},[Kr]),Xe.createElement("div",{className:Ue()(Ke,Dn==null?void 0:Dn.input,dt,(Et={},(0,Se.Z)(Et,"".concat(Ke,"-focused"),Bi),(0,Se.Z)(Et,"".concat(Ke,"-disabled"),qn),(0,Se.Z)(Et,"".concat(Ke,"-readonly"),nr),(0,Se.Z)(Et,"".concat(Ke,"-not-a-number"),ti.isNaN()),(0,Se.Z)(Et,"".concat(Ke,"-out-of-range"),!ti.isInvalidate()&&!qe(ti)),Et)),style:Rt,onFocus:function(){Zi(!0)},onBlur:ur,onKeyDown:Sn,onKeyUp:Pn,onCompositionStart:nn,onCompositionEnd:Gn,onBeforeInput:hn},rn&&Xe.createElement(dn,{prefixCls:Ke,upNode:ar,downNode:ot,upDisabled:di,downDisabled:Ai,onStep:Wn}),Xe.createElement("div",{className:"".concat(pi,"-wrap")},Xe.createElement("input",(0,be.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Tt,"aria-valuemax":Wt,"aria-valuenow":ti.isInvalidate()?null:ti.toString(),step:zn},Li,{ref:Rn(Gi,at),className:pi,value:Kr,onChange:fr,disabled:qn,readOnly:nr}))))}),ut=Xe.forwardRef(function(Ze,at){var Et=Ze.disabled,jt=Ze.style,Ke=Ze.prefixCls,dt=Ze.value,Rt=Ze.prefix,Tt=Ze.suffix,Wt=Ze.addonBefore,Zt=Ze.addonAfter,zn=Ze.classes,Sr=Ze.className,Yn=Ze.classNames,qn=(0,pe.Z)(Ze,Kt),nr=Xe.useRef(null),ar=function(tt){nr.current&&(0,tn.nH)(nr.current,tt)};return Xe.createElement(je.BaseInput,{inputElement:Xe.createElement(hi,(0,be.Z)({prefixCls:Ke,disabled:Et,classNames:Yn,ref:Rn(nr,at)},qn)),className:Sr,triggerFocus:ar,prefixCls:Ke,value:dt,disabled:Et,style:jt,prefix:Rt,suffix:Tt,addonAfter:Zt,addonBefore:Wt,classes:zn,classNames:Yn,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});ut.displayName="InputNumber";var Vt=ut,Vn=Vt,rr=se(9708),gr=se(53124),Ir=se(46735),Ur=se(98866),Gr=se(98675),Xr=se(65223),ui=se(4173),br=se(47673),Ei=se(14747),sa=se(80110),Ji=se(67968),Qi=se(45503);const Ci=(Ze,at)=>{let{componentCls:Et,borderRadiusSM:jt,borderRadiusLG:Ke}=Ze;const dt=at==="lg"?Ke:jt;return{[`&-${at}`]:{[`${Et}-handler-wrap`]:{borderStartEndRadius:dt,borderEndEndRadius:dt},[`${Et}-handler-up`]:{borderStartEndRadius:dt},[`${Et}-handler-down`]:{borderEndEndRadius:dt}}}},gt=Ze=>{const{componentCls:at,lineWidth:Et,lineType:jt,colorBorder:Ke,borderRadius:dt,fontSizeLG:Rt,controlHeightLG:Tt,controlHeightSM:Wt,colorError:Zt,paddingInlineSM:zn,colorTextDescription:Sr,motionDurationMid:Yn,handleHoverColor:qn,paddingInline:nr,paddingBlock:ar,handleBg:ot,handleActiveBg:tt,colorTextDisabled:vt,borderRadiusSM:rn,borderRadiusLG:Dn,controlWidth:an,handleVisible:cn,handleBorderColor:fn}=Ze;return[{[at]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ze)),(0,br.ik)(Ze)),(0,br.bi)(Ze,at)),{display:"inline-block",width:an,margin:0,padding:0,border:`${Et}px ${jt} ${Ke}`,borderRadius:dt,"&-rtl":{direction:"rtl",[`${at}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Rt,borderRadius:Dn,[`input${at}-input`]:{height:Tt-2*Et}},"&-sm":{padding:0,borderRadius:rn,[`input${at}-input`]:{height:Wt-2*Et,padding:`0 ${zn}px`}},"&:hover":Object.assign({},(0,br.pU)(Ze)),"&-focused":Object.assign({},(0,br.M1)(Ze)),"&-out-of-range":{[`${at}-input-wrap`]:{input:{color:Zt}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ze)),(0,br.s7)(Ze)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${at}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${at}-group-addon`]:{borderRadius:Dn,fontSize:Ze.fontSizeLG}},"&-sm":{[`${at}-group-addon`]:{borderRadius:rn}},[`${at}-wrapper-disabled > ${at}-group-addon`]:Object.assign({},(0,br.Xy)(Ze))}}),[`&-disabled ${at}-input`]:{cursor:"not-allowed"},[at]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ze)),{width:"100%",padding:`${ar}px ${nr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:dt,outline:0,transition:`all ${Yn} linear`,appearance:"textfield",fontSize:"inherit"}),(0,br.nz)(Ze.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[at]:Object.assign(Object.assign(Object.assign({[`&:hover ${at}-handler-wrap, &-focused ${at}-handler-wrap`]:{opacity:1},[`${at}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Ze.handleWidth,height:"100%",background:ot,borderStartStartRadius:0,borderStartEndRadius:dt,borderEndEndRadius:dt,borderEndStartRadius:0,opacity:cn===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Yn} linear ${Yn}`,[`${at}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
|
${at}-handler-up-inner,
|
|
|
${at}-handler-down-inner
|
|
|
`]:{marginInlineEnd:0,fontSize:Ze.handleFontSize}}},[`${at}-handler`]:{height:"50%",overflow:"hidden",color:Sr,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Et}px ${jt} ${fn}`,transition:`all ${Yn} linear`,"&:active":{background:tt},"&:hover":{height:"60%",[`
|
|
|
${at}-handler-up-inner,
|
|
|
${at}-handler-down-inner
|
|
|
`]:{color:qn}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,Ei.Ro)()),{color:Sr,transition:`all ${Yn} linear`,userSelect:"none"})},[`${at}-handler-up`]:{borderStartEndRadius:dt},[`${at}-handler-down`]:{borderBlockStart:`${Et}px ${jt} ${fn}`,borderEndEndRadius:dt}},Ci(Ze,"lg")),Ci(Ze,"sm")),{"&-disabled, &-readonly":{[`${at}-handler-wrap`]:{display:"none"},[`${at}-input`]:{color:"inherit"}},[`
|
|
|
${at}-handler-up-disabled,
|
|
|
${at}-handler-down-disabled
|
|
|
`]:{cursor:"not-allowed"},[`
|
|
|
${at}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
${at}-handler-down-disabled:hover &-handler-down-inner
|
|
|
`]:{color:vt}})},{[`${at}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${at}-handler-down`]:{borderBlockStartWidth:0}}}]},En=Ze=>{const{componentCls:at,paddingBlock:Et,paddingInline:jt,inputAffixPadding:Ke,controlWidth:dt,borderRadiusLG:Rt,borderRadiusSM:Tt}=Ze;return{[`${at}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,br.ik)(Ze)),(0,br.bi)(Ze,`${at}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:dt,padding:0,paddingInlineStart:jt,"&-lg":{borderRadius:Rt},"&-sm":{borderRadius:Tt},[`&:not(${at}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,br.pU)(Ze)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${at}-disabled`]:{background:"transparent"},[`> div${at}`]:{width:"100%",border:"none",outline:"none",[`&${at}-focused`]:{boxShadow:"none !important"}},[`input${at}-input`]:{padding:`${Et}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${at}-handler-wrap`]:{zIndex:2},[at]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Ke},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:jt,marginInlineStart:Ke}}})}};var kn=(0,Ji.Z)("InputNumber",Ze=>{const at=(0,Qi.TS)(Ze,(0,br.e5)(Ze));return[gt(at),En(at),(0,sa.c)(at)]},Ze=>Object.assign(Object.assign({},(0,br.TM)(Ze)),{controlWidth:90,handleWidth:Ze.controlHeightSM-Ze.lineWidth*2,handleFontSize:Ze.fontSize/2,handleVisible:"auto",handleActiveBg:Ze.colorFillAlter,handleBg:Ze.colorBgContainer,handleHoverColor:Ze.colorPrimary,handleBorderColor:Ze.colorBorder})),Tn=function(Ze,at){var Et={};for(var jt in Ze)Object.prototype.hasOwnProperty.call(Ze,jt)&&at.indexOf(jt)<0&&(Et[jt]=Ze[jt]);if(Ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ke=0,jt=Object.getOwnPropertySymbols(Ze);Ke<jt.length;Ke++)at.indexOf(jt[Ke])<0&&Object.prototype.propertyIsEnumerable.call(Ze,jt[Ke])&&(Et[jt[Ke]]=Ze[jt[Ke]]);return Et};const sr=Xe.forwardRef((Ze,at)=>{const{getPrefixCls:Et,direction:jt}=Xe.useContext(gr.E_),Ke=Xe.useRef(null);Xe.useImperativeHandle(at,()=>Ke.current);const{className:dt,rootClassName:Rt,size:Tt,disabled:Wt,prefixCls:Zt,addonBefore:zn,addonAfter:Sr,prefix:Yn,bordered:qn=!0,readOnly:nr,status:ar,controls:ot}=Ze,tt=Tn(Ze,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),vt=Et("input-number",Zt),[rn,Dn]=kn(vt),{compactSize:an,compactItemClassnames:cn}=(0,ui.ri)(vt,jt);let fn=Xe.createElement(et.Z,{className:`${vt}-handler-up-inner`}),In=Xe.createElement(fe.Z,{className:`${vt}-handler-down-inner`});const or=typeof ot=="boolean"?ot:void 0;typeof ot=="object"&&(fn=typeof ot.upIcon=="undefined"?fn:Xe.createElement("span",{className:`${vt}-handler-up-inner`},ot.upIcon),In=typeof ot.downIcon=="undefined"?In:Xe.createElement("span",{className:`${vt}-handler-down-inner`},ot.downIcon));const{hasFeedback:Ut,status:qr,isFormItemInput:Fr,feedbackIcon:Ri}=Xe.useContext(Xr.aM),Li=(0,rr.F)(qr,ar),pi=(0,Gr.Z)(Vr=>{var mi;return(mi=Tt!=null?Tt:an)!==null&&mi!==void 0?mi:Vr}),Gi=Xe.useContext(Ur.Z),yi=Wt!=null?Wt:Gi,ii=Ue()({[`${vt}-lg`]:pi==="large",[`${vt}-sm`]:pi==="small",[`${vt}-rtl`]:jt==="rtl",[`${vt}-borderless`]:!qn,[`${vt}-in-form-item`]:Fr},(0,rr.Z)(vt,Li),cn,Dn),Bi=`${vt}-group`,Zi=Xe.createElement(Vn,Object.assign({ref:Ke,disabled:yi,className:Ue()(dt,Rt),upHandler:fn,downHandler:In,prefixCls:vt,readOnly:nr,controls:or,prefix:Yn,suffix:Ut&&Ri,addonAfter:Sr&&Xe.createElement(ui.BR,null,Xe.createElement(Xr.Ux,{override:!0,status:!0},Sr)),addonBefore:zn&&Xe.createElement(ui.BR,null,Xe.createElement(Xr.Ux,{override:!0,status:!0},zn)),classNames:{input:ii},classes:{affixWrapper:Ue()((0,rr.Z)(`${vt}-affix-wrapper`,Li,Ut),{[`${vt}-affix-wrapper-sm`]:pi==="small",[`${vt}-affix-wrapper-lg`]:pi==="large",[`${vt}-affix-wrapper-rtl`]:jt==="rtl",[`${vt}-affix-wrapper-borderless`]:!qn},Dn),wrapper:Ue()({[`${Bi}-rtl`]:jt==="rtl",[`${vt}-wrapper-disabled`]:yi},Dn),group:Ue()({[`${vt}-group-wrapper-sm`]:pi==="small",[`${vt}-group-wrapper-lg`]:pi==="large",[`${vt}-group-wrapper-rtl`]:jt==="rtl"},(0,rr.Z)(`${vt}-group-wrapper`,Li,Ut),Dn)}},tt));return rn(Zi)}),tr=sr,pr=Ze=>Xe.createElement(Ir.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Xe.createElement(sr,Object.assign({},Ze)));tr._InternalPanelDoNotUseOrYouWillBeFired=pr;var Hn=tr},82586:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Jt},n:function(){return De}});var fe=se(16646),et=se(94184),$e=se.n(et),Ue=se(67656),be=se(17799),Se=se(67294),Me=se(9708),xe=se(53124),pe=se(98866),Te=se(98675),mt=se(65223),ze=se(4173),It=se(72922),Ct=se(47673);function ht(nt){return!!(nt.prefix||nt.suffix||nt.allowClear)}var Ye=function(nt,lt){var Ie={};for(var ke in nt)Object.prototype.hasOwnProperty.call(nt,ke)&<.indexOf(ke)<0&&(Ie[ke]=nt[ke]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var je=0,ke=Object.getOwnPropertySymbols(nt);je<ke.length;je++)lt.indexOf(ke[je])<0&&Object.prototype.propertyIsEnumerable.call(nt,ke[je])&&(Ie[ke[je]]=nt[ke[je]]);return Ie};function De(nt,lt){if(!nt)return;nt.focus(lt);const{cursor:Ie}=lt||{};if(Ie){const ke=nt.value.length;switch(Ie){case"start":nt.setSelectionRange(0,0);break;case"end":nt.setSelectionRange(ke,ke);break;default:nt.setSelectionRange(0,ke);break}}}var Jt=(0,Se.forwardRef)((nt,lt)=>{var Ie;const{prefixCls:ke,bordered:je=!0,status:Xe,size:Pt,disabled:kt,onBlur:Lt,onFocus:Ge,suffix:Ht,allowClear:Dt,addonAfter:Ln,addonBefore:un,className:Rn,style:ir,styles:yr,rootClassName:Qe,onChange:Le,classNames:Nt}=nt,Nn=Ye(nt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:gn,direction:Je,input:st}=Se.useContext(xe.E_),_t=gn("input",ke),en=(0,Se.useRef)(null),[Bt,Ft]=(0,Ct.ZP)(_t),{compactSize:zt,compactItemClassnames:Mn}=(0,ze.ri)(_t,Je),bn=(0,Te.Z)(Wr=>{var Kt;return(Kt=Pt!=null?Pt:zt)!==null&&Kt!==void 0?Kt:Wr}),Ee=Se.useContext(pe.Z),ce=kt!=null?kt:Ee,{status:le,hasFeedback:ye,feedbackIcon:ve}=(0,Se.useContext)(mt.aM),oe=(0,Me.F)(le,Xe),He=ht(nt)||!!ye,xt=(0,Se.useRef)(He);(0,Se.useEffect)(()=>{var Wr;He&&xt.current,xt.current=He},[He]);const Yt=(0,It.Z)(en,!0),pn=Wr=>{Yt(),Lt==null||Lt(Wr)},dn=Wr=>{Yt(),Ge==null||Ge(Wr)},An=Wr=>{Yt(),Le==null||Le(Wr)},tn=(ye||Ht)&&Se.createElement(Se.Fragment,null,Ht,ye&&ve);let Nr;return typeof Dt=="object"&&(Dt!=null&&Dt.clearIcon)?Nr=Dt:Dt&&(Nr={clearIcon:Se.createElement(fe.Z,null)}),Bt(Se.createElement(Ue.default,Object.assign({ref:(0,be.sQ)(lt,en),prefixCls:_t,autoComplete:st==null?void 0:st.autoComplete},Nn,{disabled:ce,onBlur:pn,onFocus:dn,style:Object.assign(Object.assign({},st==null?void 0:st.style),ir),styles:Object.assign(Object.assign({},st==null?void 0:st.styles),yr),suffix:tn,allowClear:Nr,className:$e()(Rn,Qe,Mn,st==null?void 0:st.className),onChange:An,addonAfter:Ln&&Se.createElement(ze.BR,null,Se.createElement(mt.Ux,{override:!0,status:!0},Ln)),addonBefore:un&&Se.createElement(ze.BR,null,Se.createElement(mt.Ux,{override:!0,status:!0},un)),classNames:Object.assign(Object.assign(Object.assign({},Nt),st==null?void 0:st.classNames),{input:$e()({[`${_t}-sm`]:bn==="small",[`${_t}-lg`]:bn==="large",[`${_t}-rtl`]:Je==="rtl",[`${_t}-borderless`]:!je},!He&&(0,Me.Z)(_t,oe),Nt==null?void 0:Nt.input,(Ie=st==null?void 0:st.classNames)===null||Ie===void 0?void 0:Ie.input,Ft)}),classes:{affixWrapper:$e()({[`${_t}-affix-wrapper-sm`]:bn==="small",[`${_t}-affix-wrapper-lg`]:bn==="large",[`${_t}-affix-wrapper-rtl`]:Je==="rtl",[`${_t}-affix-wrapper-borderless`]:!je},(0,Me.Z)(`${_t}-affix-wrapper`,oe,ye),Ft),wrapper:$e()({[`${_t}-group-rtl`]:Je==="rtl"},Ft),group:$e()({[`${_t}-group-wrapper-sm`]:bn==="small",[`${_t}-group-wrapper-lg`]:bn==="large",[`${_t}-group-wrapper-rtl`]:Je==="rtl",[`${_t}-group-wrapper-disabled`]:ce},(0,Me.Z)(`${_t}-group-wrapper`,oe,ye),Ft)}})))})},96330:function(Cn,Xt,se){"use strict";var fe=se(16646),et=se(94184),$e=se.n(et),Ue=se(64701),be=se(67294),Se=se(9708),Me=se(53124),xe=se(98866),pe=se(98675),Te=se(65223),mt=se(82586),ze=se(47673),It=function(ht,Ye){var De={};for(var At in ht)Object.prototype.hasOwnProperty.call(ht,At)&&Ye.indexOf(At)<0&&(De[At]=ht[At]);if(ht!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Jt=0,At=Object.getOwnPropertySymbols(ht);Jt<At.length;Jt++)Ye.indexOf(At[Jt])<0&&Object.prototype.propertyIsEnumerable.call(ht,At[Jt])&&(De[At[Jt]]=ht[At[Jt]]);return De};const Ct=(0,be.forwardRef)((ht,Ye)=>{const{prefixCls:De,bordered:At=!0,size:Jt,disabled:nt,status:lt,allowClear:Ie,showCount:ke,classNames:je,rootClassName:Xe,className:Pt}=ht,kt=It(ht,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Lt,direction:Ge}=be.useContext(Me.E_),Ht=(0,pe.Z)(Jt),Dt=be.useContext(xe.Z),Ln=nt!=null?nt:Dt,{status:un,hasFeedback:Rn,feedbackIcon:ir}=be.useContext(Te.aM),yr=(0,Se.F)(un,lt),Qe=be.useRef(null);be.useImperativeHandle(Ye,()=>{var Je;return{resizableTextArea:(Je=Qe.current)===null||Je===void 0?void 0:Je.resizableTextArea,focus:st=>{var _t,en;(0,mt.n)((en=(_t=Qe.current)===null||_t===void 0?void 0:_t.resizableTextArea)===null||en===void 0?void 0:en.textArea,st)},blur:()=>{var st;return(st=Qe.current)===null||st===void 0?void 0:st.blur()}}});const Le=Lt("input",De);let Nt;typeof Ie=="object"&&(Ie!=null&&Ie.clearIcon)?Nt=Ie:Ie&&(Nt={clearIcon:be.createElement(fe.Z,null)});const[Nn,gn]=(0,ze.ZP)(Le);return Nn(be.createElement(Ue.default,Object.assign({},kt,{disabled:Ln,allowClear:Nt,className:$e()(Pt,Xe),classes:{affixWrapper:$e()(`${Le}-textarea-affix-wrapper`,{[`${Le}-affix-wrapper-rtl`]:Ge==="rtl",[`${Le}-affix-wrapper-borderless`]:!At,[`${Le}-affix-wrapper-sm`]:Ht==="small",[`${Le}-affix-wrapper-lg`]:Ht==="large",[`${Le}-textarea-show-count`]:ke},(0,Se.Z)(`${Le}-affix-wrapper`,yr),gn)},classNames:Object.assign(Object.assign({},je),{textarea:$e()({[`${Le}-borderless`]:!At,[`${Le}-sm`]:Ht==="small",[`${Le}-lg`]:Ht==="large"},(0,Se.Z)(Le,yr),gn,je==null?void 0:je.textarea)}),prefixCls:Le,suffix:Rn&&be.createElement("span",{className:`${Le}-textarea-suffix`},ir),showCount:ke,ref:Qe})))});Xt.Z=Ct},72922:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});var fe=se(67294);function et($e,Ue){const be=(0,fe.useRef)([]),Se=()=>{be.current.push(setTimeout(()=>{var Me,xe,pe,Te;!((Me=$e.current)===null||Me===void 0)&&Me.input&&((xe=$e.current)===null||xe===void 0?void 0:xe.input.getAttribute("type"))==="password"&&(!((pe=$e.current)===null||pe===void 0)&&pe.input.hasAttribute("value"))&&((Te=$e.current)===null||Te===void 0||Te.input.removeAttribute("value"))}))};return(0,fe.useEffect)(()=>(Ue&&Se(),()=>be.current.forEach(Me=>{Me&&clearTimeout(Me)})),[]),Se}},69677:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return Ht}});var fe=se(94184),et=se.n(fe),$e=se(67294),Ue=se(53124),be=se(65223),Se=se(47673),xe=Dt=>{const{getPrefixCls:Ln,direction:un}=(0,$e.useContext)(Ue.E_),{prefixCls:Rn,className:ir}=Dt,yr=Ln("input-group",Rn),Qe=Ln("input"),[Le,Nt]=(0,Se.ZP)(Qe),Nn=et()(yr,{[`${yr}-lg`]:Dt.size==="large",[`${yr}-sm`]:Dt.size==="small",[`${yr}-compact`]:Dt.compact,[`${yr}-rtl`]:un==="rtl"},Nt,ir),gn=(0,$e.useContext)(be.aM),Je=(0,$e.useMemo)(()=>Object.assign(Object.assign({},gn),{isFormItemInput:!1}),[gn]);return Le($e.createElement("span",{className:Nn,style:Dt.style,onMouseEnter:Dt.onMouseEnter,onMouseLeave:Dt.onMouseLeave,onFocus:Dt.onFocus,onBlur:Dt.onBlur},$e.createElement(be.aM.Provider,{value:Je},Dt.children)))},pe=se(82586),Te=se(63237),mt=se(99569),ze=se(10366),It=se(17799),Ct=se(72922),ht=function(Dt,Ln){var un={};for(var Rn in Dt)Object.prototype.hasOwnProperty.call(Dt,Rn)&&Ln.indexOf(Rn)<0&&(un[Rn]=Dt[Rn]);if(Dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ir=0,Rn=Object.getOwnPropertySymbols(Dt);ir<Rn.length;ir++)Ln.indexOf(Rn[ir])<0&&Object.prototype.propertyIsEnumerable.call(Dt,Rn[ir])&&(un[Rn[ir]]=Dt[Rn[ir]]);return un};const Ye=Dt=>Dt?$e.createElement(mt.Z,null):$e.createElement(Te.Z,null),De={click:"onClick",hover:"onMouseOver"};var Jt=$e.forwardRef((Dt,Ln)=>{const{visibilityToggle:un=!0}=Dt,Rn=typeof un=="object"&&un.visible!==void 0,[ir,yr]=(0,$e.useState)(()=>Rn?un.visible:!1),Qe=(0,$e.useRef)(null);$e.useEffect(()=>{Rn&&yr(un.visible)},[Rn,un]);const Le=(0,Ct.Z)(Qe),Nt=()=>{const{disabled:ce}=Dt;ce||(ir&&Le(),yr(le=>{var ye;const ve=!le;return typeof un=="object"&&((ye=un.onVisibleChange)===null||ye===void 0||ye.call(un,ve)),ve}))},Nn=ce=>{const{action:le="click",iconRender:ye=Ye}=Dt,ve=De[le]||"",oe=ye(ir),He={[ve]:Nt,className:`${ce}-icon`,key:"passwordIcon",onMouseDown:xt=>{xt.preventDefault()},onMouseUp:xt=>{xt.preventDefault()}};return $e.cloneElement($e.isValidElement(oe)?oe:$e.createElement("span",null,oe),He)},{className:gn,prefixCls:Je,inputPrefixCls:st,size:_t}=Dt,en=ht(Dt,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Bt}=$e.useContext(Ue.E_),Ft=Bt("input",st),zt=Bt("input-password",Je),Mn=un&&Nn(zt),bn=et()(zt,gn,{[`${zt}-${_t}`]:!!_t}),Ee=Object.assign(Object.assign({},(0,ze.Z)(en,["suffix","iconRender","visibilityToggle"])),{type:ir?"text":"password",className:bn,prefixCls:Ft,suffix:Mn});return _t&&(Ee.size=_t),$e.createElement(pe.Z,Object.assign({ref:(0,It.sQ)(Ln,Qe)},Ee))}),nt=se(72395),lt=se(96159),Ie=se(71577),ke=se(98675),je=se(4173),Xe=function(Dt,Ln){var un={};for(var Rn in Dt)Object.prototype.hasOwnProperty.call(Dt,Rn)&&Ln.indexOf(Rn)<0&&(un[Rn]=Dt[Rn]);if(Dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ir=0,Rn=Object.getOwnPropertySymbols(Dt);ir<Rn.length;ir++)Ln.indexOf(Rn[ir])<0&&Object.prototype.propertyIsEnumerable.call(Dt,Rn[ir])&&(un[Rn[ir]]=Dt[Rn[ir]]);return un},kt=$e.forwardRef((Dt,Ln)=>{const{prefixCls:un,inputPrefixCls:Rn,className:ir,size:yr,suffix:Qe,enterButton:Le=!1,addonAfter:Nt,loading:Nn,disabled:gn,onSearch:Je,onChange:st,onCompositionStart:_t,onCompositionEnd:en}=Dt,Bt=Xe(Dt,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:Ft,direction:zt}=$e.useContext(Ue.E_),Mn=$e.useRef(!1),bn=Ft("input-search",un),Ee=Ft("input",Rn),{compactSize:ce}=(0,je.ri)(bn,zt),le=(0,ke.Z)($n=>{var ei;return(ei=yr!=null?yr:ce)!==null&&ei!==void 0?ei:$n}),ye=$e.useRef(null),ve=$n=>{$n&&$n.target&&$n.type==="click"&&Je&&Je($n.target.value,$n,{source:"clear"}),st&&st($n)},oe=$n=>{var ei;document.activeElement===((ei=ye.current)===null||ei===void 0?void 0:ei.input)&&$n.preventDefault()},He=$n=>{var ei,hi;Je&&Je((hi=(ei=ye.current)===null||ei===void 0?void 0:ei.input)===null||hi===void 0?void 0:hi.value,$n,{source:"input"})},xt=$n=>{Mn.current||Nn||He($n)},Yt=typeof Le=="boolean"?$e.createElement(nt.Z,null):null,pn=`${bn}-button`;let dn;const An=Le||{},tn=An.type&&An.type.__ANT_BUTTON===!0;tn||An.type==="button"?dn=(0,lt.Tm)(An,Object.assign({onMouseDown:oe,onClick:$n=>{var ei,hi;(hi=(ei=An==null?void 0:An.props)===null||ei===void 0?void 0:ei.onClick)===null||hi===void 0||hi.call(ei,$n),He($n)},key:"enterButton"},tn?{className:pn,size:le}:{})):dn=$e.createElement(Ie.ZP,{className:pn,type:Le?"primary":void 0,size:le,disabled:gn,key:"enterButton",onMouseDown:oe,onClick:He,loading:Nn,icon:Yt},Le),Nt&&(dn=[dn,(0,lt.Tm)(Nt,{key:"addonAfter"})]);const Nr=et()(bn,{[`${bn}-rtl`]:zt==="rtl",[`${bn}-${le}`]:!!le,[`${bn}-with-button`]:!!Le},ir),Wr=$n=>{Mn.current=!0,_t==null||_t($n)},Kt=$n=>{Mn.current=!1,en==null||en($n)};return $e.createElement(pe.Z,Object.assign({ref:(0,It.sQ)(ye,Ln),onPressEnter:xt},Bt,{size:le,onCompositionStart:Wr,onCompositionEnd:Kt,prefixCls:Ee,addonAfter:dn,suffix:Qe,onChange:ve,className:Nr,disabled:gn}))}),Lt=se(96330);const Ge=pe.Z;Ge.Group=xe,Ge.Search=kt,Ge.TextArea=Lt.Z,Ge.Password=Jt;var Ht=Ge},47673:function(Cn,Xt,se){"use strict";se.d(Xt,{M1:function(){return Me},TM:function(){return lt},Xy:function(){return xe},bi:function(){return mt},e5:function(){return nt},ik:function(){return ze},nz:function(){return be},pU:function(){return Se},s7:function(){return It},x0:function(){return Te}});var fe=se(14747),et=se(80110),$e=se(45503),Ue=se(67968);const be=Ie=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ie,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Se=Ie=>({borderColor:Ie.hoverBorderColor}),Me=Ie=>({borderColor:Ie.activeBorderColor,boxShadow:Ie.activeShadow,outline:0}),xe=Ie=>({color:Ie.colorTextDisabled,backgroundColor:Ie.colorBgContainerDisabled,borderColor:Ie.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Se((0,$e.TS)(Ie,{hoverBorderColor:Ie.colorBorder})))}),pe=Ie=>{const{paddingBlockLG:ke,fontSizeLG:je,lineHeightLG:Xe,borderRadiusLG:Pt,paddingInlineLG:kt}=Ie;return{padding:`${ke}px ${kt}px`,fontSize:je,lineHeight:Xe,borderRadius:Pt}},Te=Ie=>({padding:`${Ie.paddingBlockSM}px ${Ie.paddingInlineSM}px`,borderRadius:Ie.borderRadiusSM}),mt=(Ie,ke)=>{const{componentCls:je,colorError:Xe,colorWarning:Pt,errorActiveShadow:kt,warningActiveShadow:Lt,colorErrorBorderHover:Ge,colorWarningBorderHover:Ht}=Ie;return{[`&-status-error:not(${ke}-disabled):not(${ke}-borderless)${ke}`]:{borderColor:Xe,"&:hover":{borderColor:Ge},"&:focus, &-focused":Object.assign({},Me((0,$e.TS)(Ie,{activeBorderColor:Xe,activeShadow:kt}))),[`${je}-prefix, ${je}-suffix`]:{color:Xe}},[`&-status-warning:not(${ke}-disabled):not(${ke}-borderless)${ke}`]:{borderColor:Pt,"&:hover":{borderColor:Ht},"&:focus, &-focused":Object.assign({},Me((0,$e.TS)(Ie,{activeBorderColor:Pt,activeShadow:Lt}))),[`${je}-prefix, ${je}-suffix`]:{color:Pt}}}},ze=Ie=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ie.paddingBlock}px ${Ie.paddingInline}px`,color:Ie.colorText,fontSize:Ie.fontSize,lineHeight:Ie.lineHeight,backgroundColor:Ie.colorBgContainer,backgroundImage:"none",borderWidth:Ie.lineWidth,borderStyle:Ie.lineType,borderColor:Ie.colorBorder,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationMid}`},be(Ie.colorTextPlaceholder)),{"&:hover":Object.assign({},Se(Ie)),"&:focus, &-focused":Object.assign({},Me(Ie)),"&-disabled, &[disabled]":Object.assign({},xe(Ie)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ie.controlHeight,lineHeight:Ie.lineHeight,verticalAlign:"bottom",transition:`all ${Ie.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},pe(Ie)),"&-sm":Object.assign({},Te(Ie)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),It=Ie=>{const{componentCls:ke,antCls:je}=Ie;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ie.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${ke}, &-lg > ${ke}-group-addon`]:Object.assign({},pe(Ie)),[`&-sm ${ke}, &-sm > ${ke}-group-addon`]:Object.assign({},Te(Ie)),[`&-lg ${je}-select-single ${je}-select-selector`]:{height:Ie.controlHeightLG},[`&-sm ${je}-select-single ${je}-select-selector`]:{height:Ie.controlHeightSM},[`> ${ke}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${ke}-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 ${Ie.paddingInline}px`,color:Ie.colorText,fontWeight:"normal",fontSize:Ie.fontSize,textAlign:"center",backgroundColor:Ie.colorFillAlter,border:`${Ie.lineWidth}px ${Ie.lineType} ${Ie.colorBorder}`,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationSlow}`,lineHeight:1,[`${je}-select`]:{margin:`-${Ie.paddingBlock+1}px -${Ie.paddingInline}px`,[`&${je}-select-single:not(${je}-select-customize-input)`]:{[`${je}-select-selector`]:{backgroundColor:"inherit",border:`${Ie.lineWidth}px ${Ie.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${je}-select-selector`]:{color:Ie.colorPrimary}}},[`${je}-cascader-picker`]:{margin:`-9px -${Ie.paddingInline}px`,backgroundColor:"transparent",[`${je}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${ke}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${ke}-search-with-button &`]:{zIndex:0}}},[`> ${ke}:first-child, ${ke}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${je}-select ${je}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ke}-affix-wrapper`]:{[`&:not(:first-child) ${ke}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${ke}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ke}:last-child, ${ke}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${je}-select ${je}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${ke}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${ke}-search &`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius}},[`&:not(:first-child), ${ke}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${ke}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,fe.dF)()),{[`${ke}-group-addon, ${ke}-group-wrap, > ${ke}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ie.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${ke}-affix-wrapper,
|
|
|
& > ${ke}-number-affix-wrapper,
|
|
|
& > ${je}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ie.lineWidth,borderInlineEndWidth:Ie.lineWidth},[`${ke}`]:{float:"none"},[`& > ${je}-select > ${je}-select-selector,
|
|
|
& > ${je}-select-auto-complete ${ke},
|
|
|
& > ${je}-cascader-picker ${ke},
|
|
|
& > ${ke}-group-wrapper ${ke}`]:{borderInlineEndWidth:Ie.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${je}-select-focused`]:{zIndex:1},[`& > ${je}-select > ${je}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${je}-select:first-child > ${je}-select-selector,
|
|
|
& > ${je}-select-auto-complete:first-child ${ke},
|
|
|
& > ${je}-cascader-picker:first-child ${ke}`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius},[`& > *:last-child,
|
|
|
& > ${je}-select:last-child > ${je}-select-selector,
|
|
|
& > ${je}-cascader-picker:last-child ${ke},
|
|
|
& > ${je}-cascader-picker-focused:last-child ${ke}`]:{borderInlineEndWidth:Ie.lineWidth,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius},[`& > ${je}-select-auto-complete ${ke}`]:{verticalAlign:"top"},[`${ke}-group-wrapper + ${ke}-group-wrapper`]:{marginInlineStart:-Ie.lineWidth,[`${ke}-affix-wrapper`]:{borderRadius:0}},[`${ke}-group-wrapper:not(:last-child)`]:{[`&${ke}-search > ${ke}-group`]:{[`& > ${ke}-group-addon > ${ke}-search-button`]:{borderRadius:0},[`& > ${ke}`]:{borderStartStartRadius:Ie.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ie.borderRadius}}}})}},Ct=Ie=>{const{componentCls:ke,controlHeightSM:je,lineWidth:Xe}=Ie,kt=(je-Xe*2-16)/2;return{[ke]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ie)),ze(Ie)),mt(Ie,ke)),{'&[type="color"]':{height:Ie.controlHeight,[`&${ke}-lg`]:{height:Ie.controlHeightLG},[`&${ke}-sm`]:{height:je,paddingTop:kt,paddingBottom:kt}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},ht=Ie=>{const{componentCls:ke}=Ie;return{[`${ke}-clear-icon`]:{margin:0,color:Ie.colorTextQuaternary,fontSize:Ie.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ie.motionDurationSlow}`,"&:hover":{color:Ie.colorTextTertiary},"&:active":{color:Ie.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ie.inputAffixPadding}px`}}}},Ye=Ie=>{const{componentCls:ke,inputAffixPadding:je,colorTextDescription:Xe,motionDurationSlow:Pt,colorIcon:kt,colorIconHover:Lt,iconCls:Ge}=Ie;return{[`${ke}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ze(Ie)),{display:"inline-flex",[`&:not(${ke}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Se(Ie)),{zIndex:1,[`${ke}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${ke}[disabled]`]:{background:"transparent"}},[`> input${ke}`]:{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"'},[`${ke}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ie.paddingXS}},"&-show-count-suffix":{color:Xe},"&-show-count-has-suffix":{marginInlineEnd:Ie.paddingXXS},"&-prefix":{marginInlineEnd:je},"&-suffix":{marginInlineStart:je}}}),ht(Ie)),{[`${Ge}${ke}-password-icon`]:{color:kt,cursor:"pointer",transition:`all ${Pt}`,"&:hover":{color:Lt}}}),mt(Ie,`${ke}-affix-wrapper`))}},De=Ie=>{const{componentCls:ke,colorError:je,colorWarning:Xe,borderRadiusLG:Pt,borderRadiusSM:kt}=Ie;return{[`${ke}-group`]:Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ie)),It(Ie)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${ke}-group-addon`]:{borderRadius:Pt,fontSize:Ie.fontSizeLG}},"&-sm":{[`${ke}-group-addon`]:{borderRadius:kt}},"&-status-error":{[`${ke}-group-addon`]:{color:je,borderColor:je}},"&-status-warning":{[`${ke}-group-addon`]:{color:Xe,borderColor:Xe}},"&-disabled":{[`${ke}-group-addon`]:Object.assign({},xe(Ie))},[`&:not(${ke}-compact-first-item):not(${ke}-compact-last-item)${ke}-compact-item`]:{[`${ke}, ${ke}-group-addon`]:{borderRadius:0}},[`&:not(${ke}-compact-last-item)${ke}-compact-first-item`]:{[`${ke}, ${ke}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${ke}-compact-first-item)${ke}-compact-last-item`]:{[`${ke}, ${ke}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},At=Ie=>{const{componentCls:ke,antCls:je}=Ie,Xe=`${ke}-search`;return{[Xe]:{[`${ke}`]:{"&:hover, &:focus":{borderColor:Ie.colorPrimaryHover,[`+ ${ke}-group-addon ${Xe}-button:not(${je}-btn-primary)`]:{borderInlineStartColor:Ie.colorPrimaryHover}}},[`${ke}-affix-wrapper`]:{borderRadius:0},[`${ke}-lg`]:{lineHeight:Ie.lineHeightLG-2e-4},[`> ${ke}-group`]:{[`> ${ke}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Xe}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Xe}-button:not(${je}-btn-primary)`]:{color:Ie.colorTextDescription,"&:hover":{color:Ie.colorPrimaryHover},"&:active":{color:Ie.colorPrimaryActive},[`&${je}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Xe}-button`]:{height:Ie.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Xe}-button`]:{height:Ie.controlHeightLG},[`&-small ${Xe}-button`]:{height:Ie.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${ke}-compact-item`]:{[`&:not(${ke}-compact-last-item)`]:{[`${ke}-group-addon`]:{[`${ke}-search-button`]:{marginInlineEnd:-Ie.lineWidth,borderRadius:0}}},[`&:not(${ke}-compact-first-item)`]:{[`${ke},${ke}-affix-wrapper`]:{borderRadius:0}},[`> ${ke}-group-addon ${ke}-search-button,
|
|
|
> ${ke},
|
|
|
${ke}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${ke}-affix-wrapper-focused`]:{zIndex:2}}}}},Jt=Ie=>{const{componentCls:ke,paddingLG:je}=Ie,Xe=`${ke}-textarea`;return{[Xe]:{position:"relative","&-show-count":{[`> ${ke}`]:{height:"100%"},[`${ke}-data-count`]:{position:"absolute",bottom:-Ie.fontSize*Ie.lineHeight,insetInlineEnd:0,color:Ie.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${ke}`]:{paddingInlineEnd:je}},[`&-affix-wrapper${Xe}-has-feedback`]:{[`${ke}`]:{paddingInlineEnd:je}},[`&-affix-wrapper${ke}-affix-wrapper`]:{padding:0,[`> textarea${ke}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${ke}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${ke}-clear-icon`]:{position:"absolute",insetInlineEnd:Ie.paddingXS,insetBlockStart:Ie.paddingXS},[`${Xe}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ie.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function nt(Ie){return(0,$e.TS)(Ie,{inputAffixPadding:Ie.paddingXXS})}const lt=Ie=>{const{controlHeight:ke,fontSize:je,lineHeight:Xe,lineWidth:Pt,controlHeightSM:kt,controlHeightLG:Lt,fontSizeLG:Ge,lineHeightLG:Ht,paddingSM:Dt,controlPaddingHorizontalSM:Ln,controlPaddingHorizontal:un,colorFillAlter:Rn,colorPrimaryHover:ir,controlOutlineWidth:yr,controlOutline:Qe,colorErrorOutline:Le,colorWarningOutline:Nt}=Ie;return{paddingBlock:Math.max(Math.round((ke-je*Xe)/2*10)/10-Pt,3),paddingBlockSM:Math.max(Math.round((kt-je*Xe)/2*10)/10-Pt,0),paddingBlockLG:Math.ceil((Lt-Ge*Ht)/2*10)/10-Pt,paddingInline:Dt-Pt,paddingInlineSM:Ln-Pt,paddingInlineLG:un-Pt,addonBg:Rn,activeBorderColor:ir,hoverBorderColor:ir,activeShadow:`0 0 0 ${yr}px ${Qe}`,errorActiveShadow:`0 0 0 ${yr}px ${Le}`,warningActiveShadow:`0 0 0 ${yr}px ${Nt}`}};Xt.ZP=(0,Ue.Z)("Input",Ie=>{const ke=(0,$e.TS)(Ie,nt(Ie));return[Ct(ke),Jt(ke),Ye(ke),De(ke),At(ke),(0,et.c)(ke)]},lt)},38703:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return hi}});var fe=se(67294),et=se(87725),$e=se(18299),Ue=se(16646),be=se(73475),Se=se(94184),Me=se.n(Se),xe=se(10366),pe=se(53124),Te=se(87462),mt=se(1413),ze=se(45987),It={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Ct=function(){var Vt=(0,fe.useRef)([]),Vn=(0,fe.useRef)(null);return(0,fe.useEffect)(function(){var rr=Date.now(),gr=!1;Vt.current.forEach(function(Ir){if(Ir){gr=!0;var Ur=Ir.style;Ur.transitionDuration=".3s, .3s, .3s, .06s",Vn.current&&rr-Vn.current<100&&(Ur.transitionDuration="0s, 0s")}}),gr&&(Vn.current=Date.now())}),Vt.current},ht=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],Ye=function(Vt){var Vn=(0,mt.Z)((0,mt.Z)({},It),Vt),rr=Vn.className,gr=Vn.percent,Ir=Vn.prefixCls,Ur=Vn.strokeColor,Gr=Vn.strokeLinecap,Xr=Vn.strokeWidth,ui=Vn.style,br=Vn.trailColor,Ei=Vn.trailWidth,sa=Vn.transition,Ji=(0,ze.Z)(Vn,ht);delete Ji.gapPosition;var Qi=Array.isArray(gr)?gr:[gr],Ci=Array.isArray(Ur)?Ur:[Ur],gt=Ct(),En=Xr/2,kn=100-Xr/2,Tn="M ".concat(Gr==="round"?En:0,",").concat(En,`
|
|
|
L `).concat(Gr==="round"?kn:100,",").concat(En),sr="0 0 100 ".concat(Xr),tr=0;return fe.createElement("svg",(0,Te.Z)({className:Me()("".concat(Ir,"-line"),rr),viewBox:sr,preserveAspectRatio:"none",style:ui},Ji),fe.createElement("path",{className:"".concat(Ir,"-line-trail"),d:Tn,strokeLinecap:Gr,stroke:br,strokeWidth:Ei||Xr,fillOpacity:"0"}),Qi.map(function(pr,Hn){var Ze=1;switch(Gr){case"round":Ze=1-Xr/100;break;case"square":Ze=1-Xr/2/100;break;default:Ze=1;break}var at={strokeDasharray:"".concat(pr*Ze,"px, 100px"),strokeDashoffset:"-".concat(tr,"px"),transition:sa||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Et=Ci[Hn]||Ci[Ci.length-1];return tr+=pr,fe.createElement("path",{key:Hn,className:"".concat(Ir,"-line-path"),d:Tn,strokeLinecap:Gr,stroke:Et,strokeWidth:Xr,fillOpacity:"0",ref:function(Ke){gt[Hn]=Ke},style:at})}))},De=Ye,At=se(71002),Jt=se(97685),nt=se(98924),lt=0,Ie=(0,nt.Z)();function ke(){var ut;return Ie?(ut=lt,lt+=1):ut="TEST_OR_SSR",ut}var je=function(ut){var Vt=fe.useState(),Vn=(0,Jt.Z)(Vt,2),rr=Vn[0],gr=Vn[1];return fe.useEffect(function(){gr("rc_progress_".concat(ke()))},[]),ut||rr},Xe=function(Vt){var Vn=Vt.bg,rr=Vt.children;return fe.createElement("div",{style:{width:"100%",height:"100%",background:Vn}},rr)};function Pt(ut,Vt){return Object.keys(ut).map(function(Vn){var rr=parseFloat(Vn),gr="".concat(Math.floor(rr*Vt),"%");return"".concat(ut[Vn]," ").concat(gr)})}var kt=fe.forwardRef(function(ut,Vt){var Vn=ut.prefixCls,rr=ut.color,gr=ut.gradientId,Ir=ut.radius,Ur=ut.style,Gr=ut.ptg,Xr=ut.strokeLinecap,ui=ut.strokeWidth,br=ut.size,Ei=ut.gapDegree,sa=rr&&(0,At.Z)(rr)==="object",Ji=sa?"#FFF":void 0,Qi=br/2,Ci=fe.createElement("circle",{className:"".concat(Vn,"-circle-path"),r:Ir,cx:Qi,cy:Qi,stroke:Ji,strokeLinecap:Xr,strokeWidth:ui,opacity:Gr===0?0:1,style:Ur,ref:Vt});if(!sa)return Ci;var gt="".concat(gr,"-conic"),En=Ei?"".concat(180+Ei/2,"deg"):"0deg",kn=Pt(rr,(360-Ei)/360),Tn=Pt(rr,1),sr="conic-gradient(from ".concat(En,", ").concat(kn.join(", "),")"),tr="linear-gradient(to ".concat(Ei?"bottom":"top",", ").concat(Tn.join(", "),")");return fe.createElement(fe.Fragment,null,fe.createElement("mask",{id:gt},Ci),fe.createElement("foreignObject",{x:0,y:0,width:br,height:br,mask:"url(#".concat(gt,")")},fe.createElement(Xe,{bg:tr},fe.createElement(Xe,{bg:sr}))))}),Lt=kt,Ge=100,Ht=function(Vt,Vn,rr,gr,Ir,Ur,Gr,Xr,ui,br){var Ei=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,sa=rr/100*360*((360-Ur)/360),Ji=Ur===0?0:{bottom:0,top:180,left:90,right:-90}[Gr],Qi=(100-gr)/100*Vn;ui==="round"&&gr!==100&&(Qi+=br/2,Qi>=Vn&&(Qi=Vn-.01));var Ci=Ge/2;return{stroke:typeof Xr=="string"?Xr:void 0,strokeDasharray:"".concat(Vn,"px ").concat(Vt),strokeDashoffset:Qi+Ei,transform:"rotate(".concat(Ir+sa+Ji,"deg)"),transformOrigin:"".concat(Ci,"px ").concat(Ci,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},Dt=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Ln(ut){var Vt=ut!=null?ut:[];return Array.isArray(Vt)?Vt:[Vt]}var un=function(Vt){var Vn=(0,mt.Z)((0,mt.Z)({},It),Vt),rr=Vn.id,gr=Vn.prefixCls,Ir=Vn.steps,Ur=Vn.strokeWidth,Gr=Vn.trailWidth,Xr=Vn.gapDegree,ui=Xr===void 0?0:Xr,br=Vn.gapPosition,Ei=Vn.trailColor,sa=Vn.strokeLinecap,Ji=Vn.style,Qi=Vn.className,Ci=Vn.strokeColor,gt=Vn.percent,En=(0,ze.Z)(Vn,Dt),kn=Ge/2,Tn=je(rr),sr="".concat(Tn,"-gradient"),tr=kn-Ur/2,pr=Math.PI*2*tr,Hn=ui>0?90+ui/2:-90,Ze=pr*((360-ui)/360),at=(0,At.Z)(Ir)==="object"?Ir:{count:Ir,space:2},Et=at.count,jt=at.space,Ke=Ln(gt),dt=Ln(Ci),Rt=dt.find(function(qn){return qn&&(0,At.Z)(qn)==="object"}),Tt=Rt&&(0,At.Z)(Rt)==="object",Wt=Tt?"butt":sa,Zt=Ht(pr,Ze,0,100,Hn,ui,br,Ei,Wt,Ur),zn=Ct(),Sr=function(){var nr=0;return Ke.map(function(ar,ot){var tt=dt[ot]||dt[dt.length-1],vt=Ht(pr,Ze,nr,ar,Hn,ui,br,tt,Wt,Ur);return nr+=ar,fe.createElement(Lt,{key:ot,color:tt,ptg:ar,radius:tr,prefixCls:gr,gradientId:sr,style:vt,strokeLinecap:Wt,strokeWidth:Ur,gapDegree:ui,ref:function(Dn){zn[ot]=Dn},size:Ge})}).reverse()},Yn=function(){var nr=Math.round(Et*(Ke[0]/100)),ar=100/Et,ot=0;return new Array(Et).fill(null).map(function(tt,vt){var rn=vt<=nr-1?dt[0]:Ei,Dn=rn&&(0,At.Z)(rn)==="object"?"url(#".concat(sr,")"):void 0,an=Ht(pr,Ze,ot,ar,Hn,ui,br,rn,"butt",Ur,jt);return ot+=(Ze-an.strokeDashoffset+jt)*100/Ze,fe.createElement("circle",{key:vt,className:"".concat(gr,"-circle-path"),r:tr,cx:kn,cy:kn,stroke:Dn,strokeWidth:Ur,opacity:1,style:an,ref:function(fn){zn[vt]=fn}})})};return fe.createElement("svg",(0,Te.Z)({className:Me()("".concat(gr,"-circle"),Qi),viewBox:"0 0 ".concat(Ge," ").concat(Ge),style:Ji,id:rr,role:"presentation"},En),!Et&&fe.createElement("circle",{className:"".concat(gr,"-circle-trail"),r:tr,cx:kn,cy:kn,stroke:Ei,strokeLinecap:Wt,strokeWidth:Gr||Ur,style:Zt}),Et?Yn():Sr())},Rn=un,ir={Line:De,Circle:Rn},yr=se(83062),Qe=se(16397);function Le(ut){return!ut||ut<0?0:ut>100?100:ut}function Nt(ut){let{success:Vt,successPercent:Vn}=ut,rr=Vn;return Vt&&"progress"in Vt&&(rr=Vt.progress),Vt&&"percent"in Vt&&(rr=Vt.percent),rr}const Nn=ut=>{let{percent:Vt,success:Vn,successPercent:rr}=ut;const gr=Le(Nt({success:Vn,successPercent:rr}));return[gr,Le(Le(Vt)-gr)]},gn=ut=>{let{success:Vt={},strokeColor:Vn}=ut;const{strokeColor:rr}=Vt;return[rr||Qe.presetPrimaryColors.green,Vn||null]},Je=(ut,Vt,Vn)=>{var rr,gr,Ir,Ur;let Gr=-1,Xr=-1;if(Vt==="step"){const ui=Vn.steps,br=Vn.strokeWidth;typeof ut=="string"||typeof ut=="undefined"?(Gr=ut==="small"?2:14,Xr=br!=null?br:8):typeof ut=="number"?[Gr,Xr]=[ut,ut]:[Gr=14,Xr=8]=ut,Gr*=ui}else if(Vt==="line"){const ui=Vn==null?void 0:Vn.strokeWidth;typeof ut=="string"||typeof ut=="undefined"?Xr=ui||(ut==="small"?6:8):typeof ut=="number"?[Gr,Xr]=[ut,ut]:[Gr=-1,Xr=8]=ut}else(Vt==="circle"||Vt==="dashboard")&&(typeof ut=="string"||typeof ut=="undefined"?[Gr,Xr]=ut==="small"?[60,60]:[120,120]:typeof ut=="number"?[Gr,Xr]=[ut,ut]:(Gr=(gr=(rr=ut[0])!==null&&rr!==void 0?rr:ut[1])!==null&&gr!==void 0?gr:120,Xr=(Ur=(Ir=ut[0])!==null&&Ir!==void 0?Ir:ut[1])!==null&&Ur!==void 0?Ur:120));return[Gr,Xr]},st=3,_t=ut=>st/ut*100;var Bt=ut=>{const{prefixCls:Vt,trailColor:Vn=null,strokeLinecap:rr="round",gapPosition:gr,gapDegree:Ir,width:Ur=120,type:Gr,children:Xr,success:ui,size:br=Ur}=ut,[Ei,sa]=Je(br,"circle");let{strokeWidth:Ji}=ut;Ji===void 0&&(Ji=Math.max(_t(Ei),6));const Qi={width:Ei,height:sa,fontSize:Ei*.15+6},Ci=fe.useMemo(()=>{if(Ir||Ir===0)return Ir;if(Gr==="dashboard")return 75},[Ir,Gr]),gt=gr||Gr==="dashboard"&&"bottom"||void 0,En=Object.prototype.toString.call(ut.strokeColor)==="[object Object]",kn=gn({success:ui,strokeColor:ut.strokeColor}),Tn=Me()(`${Vt}-inner`,{[`${Vt}-circle-gradient`]:En}),sr=fe.createElement(Rn,{percent:Nn(ut),strokeWidth:Ji,trailWidth:Ji,strokeColor:kn,strokeLinecap:rr,trailColor:Vn,prefixCls:Vt,gapDegree:Ci,gapPosition:gt});return fe.createElement("div",{className:Tn,style:Qi},Ei<=20?fe.createElement(yr.Z,{title:Xr},fe.createElement("span",null,sr)):fe.createElement(fe.Fragment,null,sr,Xr))},Ft=function(ut,Vt){var Vn={};for(var rr in ut)Object.prototype.hasOwnProperty.call(ut,rr)&&Vt.indexOf(rr)<0&&(Vn[rr]=ut[rr]);if(ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var gr=0,rr=Object.getOwnPropertySymbols(ut);gr<rr.length;gr++)Vt.indexOf(rr[gr])<0&&Object.prototype.propertyIsEnumerable.call(ut,rr[gr])&&(Vn[rr[gr]]=ut[rr[gr]]);return Vn};const zt=ut=>{let Vt=[];return Object.keys(ut).forEach(Vn=>{const rr=parseFloat(Vn.replace(/%/g,""));isNaN(rr)||Vt.push({key:rr,value:ut[Vn]})}),Vt=Vt.sort((Vn,rr)=>Vn.key-rr.key),Vt.map(Vn=>{let{key:rr,value:gr}=Vn;return`${gr} ${rr}%`}).join(", ")},Mn=(ut,Vt)=>{const{from:Vn=Qe.presetPrimaryColors.blue,to:rr=Qe.presetPrimaryColors.blue,direction:gr=Vt==="rtl"?"to left":"to right"}=ut,Ir=Ft(ut,["from","to","direction"]);if(Object.keys(Ir).length!==0){const Ur=zt(Ir);return{backgroundImage:`linear-gradient(${gr}, ${Ur})`}}return{backgroundImage:`linear-gradient(${gr}, ${Vn}, ${rr})`}};var Ee=ut=>{const{prefixCls:Vt,direction:Vn,percent:rr,size:gr,strokeWidth:Ir,strokeColor:Ur,strokeLinecap:Gr="round",children:Xr,trailColor:ui=null,success:br}=ut,Ei=Ur&&typeof Ur!="string"?Mn(Ur,Vn):{backgroundColor:Ur},sa=Gr==="square"||Gr==="butt"?0:void 0,Ji={backgroundColor:ui||void 0,borderRadius:sa},Qi=gr!=null?gr:[-1,Ir||(gr==="small"?6:8)],[Ci,gt]=Je(Qi,"line",{strokeWidth:Ir}),En=Object.assign({width:`${Le(rr)}%`,height:gt,borderRadius:sa},Ei),kn=Nt(ut),Tn={width:`${Le(kn)}%`,height:gt,borderRadius:sa,backgroundColor:br==null?void 0:br.strokeColor},sr={width:Ci<0?"100%":Ci,height:gt};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:`${Vt}-outer`,style:sr},fe.createElement("div",{className:`${Vt}-inner`,style:Ji},fe.createElement("div",{className:`${Vt}-bg`,style:En}),kn!==void 0?fe.createElement("div",{className:`${Vt}-success-bg`,style:Tn}):null)),Xr)},le=ut=>{const{size:Vt,steps:Vn,percent:rr=0,strokeWidth:gr=8,strokeColor:Ir,trailColor:Ur=null,prefixCls:Gr,children:Xr}=ut,ui=Math.round(Vn*(rr/100)),br=Vt==="small"?2:14,Ei=Vt!=null?Vt:[br,gr],[sa,Ji]=Je(Ei,"step",{steps:Vn,strokeWidth:gr}),Qi=sa/Vn,Ci=new Array(Vn);for(let gt=0;gt<Vn;gt++){const En=Array.isArray(Ir)?Ir[gt]:Ir;Ci[gt]=fe.createElement("div",{key:gt,className:Me()(`${Gr}-steps-item`,{[`${Gr}-steps-item-active`]:gt<=ui-1}),style:{backgroundColor:gt<=ui-1?En:Ur,width:Qi,height:Ji}})}return fe.createElement("div",{className:`${Gr}-steps-outer`},Ci,Xr)},ye=se(34367),ve=se(14747),oe=se(67968),He=se(45503);const xt=ut=>{const Vt=ut?"100%":"-100%";return new ye.Keyframes(`antProgress${ut?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Vt}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Vt}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},Yt=ut=>{const{componentCls:Vt,iconCls:Vn}=ut;return{[Vt]:Object.assign(Object.assign({},(0,ve.Wf)(ut)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:ut.fontSize,marginInlineEnd:ut.marginXS,marginBottom:ut.marginXS},[`${Vt}-outer`]:{display:"inline-block",width:"100%"},[`&${Vt}-show-info`]:{[`${Vt}-outer`]:{marginInlineEnd:`calc(-2em - ${ut.marginXS}px)`,paddingInlineEnd:`calc(2em + ${ut.paddingXS}px)`}},[`${Vt}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:ut.remainingColor,borderRadius:ut.lineBorderRadius},[`${Vt}-inner:not(${Vt}-circle-gradient)`]:{[`${Vt}-circle-path`]:{stroke:ut.defaultColor}},[`${Vt}-success-bg, ${Vt}-bg`]:{position:"relative",backgroundColor:ut.defaultColor,borderRadius:ut.lineBorderRadius,transition:`all ${ut.motionDurationSlow} ${ut.motionEaseInOutCirc}`},[`${Vt}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:ut.colorSuccess},[`${Vt}-text`]:{display:"inline-block",width:"2em",marginInlineStart:ut.marginXS,color:ut.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[Vn]:{fontSize:ut.fontSize}},[`&${Vt}-status-active`]:{[`${Vt}-bg::before`]:{position:"absolute",inset:0,backgroundColor:ut.colorBgContainer,borderRadius:ut.lineBorderRadius,opacity:0,animationName:xt(),animationDuration:ut.progressActiveMotionDuration,animationTimingFunction:ut.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Vt}-rtl${Vt}-status-active`]:{[`${Vt}-bg::before`]:{animationName:xt(!0)}},[`&${Vt}-status-exception`]:{[`${Vt}-bg`]:{backgroundColor:ut.colorError},[`${Vt}-text`]:{color:ut.colorError}},[`&${Vt}-status-exception ${Vt}-inner:not(${Vt}-circle-gradient)`]:{[`${Vt}-circle-path`]:{stroke:ut.colorError}},[`&${Vt}-status-success`]:{[`${Vt}-bg`]:{backgroundColor:ut.colorSuccess},[`${Vt}-text`]:{color:ut.colorSuccess}},[`&${Vt}-status-success ${Vt}-inner:not(${Vt}-circle-gradient)`]:{[`${Vt}-circle-path`]:{stroke:ut.colorSuccess}}})}},pn=ut=>{const{componentCls:Vt,iconCls:Vn}=ut;return{[Vt]:{[`${Vt}-circle-trail`]:{stroke:ut.remainingColor},[`&${Vt}-circle ${Vt}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Vt}-circle ${Vt}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:ut.circleTextColor,fontSize:ut.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[Vn]:{fontSize:`${ut.fontSize/ut.fontSizeSM}em`}},[`${Vt}-circle&-status-exception`]:{[`${Vt}-text`]:{color:ut.colorError}},[`${Vt}-circle&-status-success`]:{[`${Vt}-text`]:{color:ut.colorSuccess}}},[`${Vt}-inline-circle`]:{lineHeight:1,[`${Vt}-inner`]:{verticalAlign:"bottom"}}}},dn=ut=>{const{componentCls:Vt}=ut;return{[Vt]:{[`${Vt}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:ut.progressStepMinWidth,marginInlineEnd:ut.progressStepMarginInlineEnd,backgroundColor:ut.remainingColor,transition:`all ${ut.motionDurationSlow}`,"&-active":{backgroundColor:ut.defaultColor}}}}}},An=ut=>{const{componentCls:Vt,iconCls:Vn}=ut;return{[Vt]:{[`${Vt}-small&-line, ${Vt}-small&-line ${Vt}-text ${Vn}`]:{fontSize:ut.fontSizeSM}}}};var tn=(0,oe.Z)("Progress",ut=>{const Vt=ut.marginXXS/2,Vn=(0,He.TS)(ut,{progressStepMarginInlineEnd:Vt,progressStepMinWidth:Vt,progressActiveMotionDuration:"2.4s"});return[Yt(Vn),pn(Vn),dn(Vn),An(Vn)]},ut=>({circleTextColor:ut.colorText,defaultColor:ut.colorInfo,remainingColor:ut.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),Nr=function(ut,Vt){var Vn={};for(var rr in ut)Object.prototype.hasOwnProperty.call(ut,rr)&&Vt.indexOf(rr)<0&&(Vn[rr]=ut[rr]);if(ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var gr=0,rr=Object.getOwnPropertySymbols(ut);gr<rr.length;gr++)Vt.indexOf(rr[gr])<0&&Object.prototype.propertyIsEnumerable.call(ut,rr[gr])&&(Vn[rr[gr]]=ut[rr[gr]]);return Vn};const Wr=null,Kt=["normal","exception","active","success"];var ei=fe.forwardRef((ut,Vt)=>{const{prefixCls:Vn,className:rr,rootClassName:gr,steps:Ir,strokeColor:Ur,percent:Gr=0,size:Xr="default",showInfo:ui=!0,type:br="line",status:Ei,format:sa,style:Ji}=ut,Qi=Nr(ut,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),Ci=fe.useMemo(()=>{var Ke,dt;const Rt=Nt(ut);return parseInt(Rt!==void 0?(Ke=Rt!=null?Rt:0)===null||Ke===void 0?void 0:Ke.toString():(dt=Gr!=null?Gr:0)===null||dt===void 0?void 0:dt.toString(),10)},[Gr,ut.success,ut.successPercent]),gt=fe.useMemo(()=>!Kt.includes(Ei)&&Ci>=100?"success":Ei||"normal",[Ei,Ci]),{getPrefixCls:En,direction:kn,progress:Tn}=fe.useContext(pe.E_),sr=En("progress",Vn),[tr,pr]=tn(sr),Hn=fe.useMemo(()=>{if(!ui)return null;const Ke=Nt(ut);let dt;const Rt=sa||(Wt=>`${Wt}%`),Tt=br==="line";return sa||gt!=="exception"&>!=="success"?dt=Rt(Le(Gr),Le(Ke)):gt==="exception"?dt=Tt?fe.createElement(Ue.Z,null):fe.createElement(be.Z,null):gt==="success"&&(dt=Tt?fe.createElement(et.Z,null):fe.createElement($e.Z,null)),fe.createElement("span",{className:`${sr}-text`,title:typeof dt=="string"?dt:void 0},dt)},[ui,Gr,Ci,gt,br,sr,sa]),Ze=Array.isArray(Ur)?Ur[0]:Ur,at=typeof Ur=="string"||Array.isArray(Ur)?Ur:void 0;let Et;br==="line"?Et=Ir?fe.createElement(le,Object.assign({},ut,{strokeColor:at,prefixCls:sr,steps:Ir}),Hn):fe.createElement(Ee,Object.assign({},ut,{strokeColor:Ze,prefixCls:sr,direction:kn}),Hn):(br==="circle"||br==="dashboard")&&(Et=fe.createElement(Bt,Object.assign({},ut,{strokeColor:Ze,prefixCls:sr,progressStatus:gt}),Hn));const jt=Me()(sr,`${sr}-status-${gt}`,`${sr}-${br==="dashboard"&&"circle"||Ir&&"steps"||br}`,{[`${sr}-inline-circle`]:br==="circle"&&Je(Xr,"circle")[0]<=20,[`${sr}-show-info`]:ui,[`${sr}-${Xr}`]:typeof Xr=="string",[`${sr}-rtl`]:kn==="rtl"},Tn==null?void 0:Tn.className,rr,gr,pr);return tr(fe.createElement("div",Object.assign({ref:Vt,style:Object.assign(Object.assign({},Tn==null?void 0:Tn.style),Ji),className:jt,role:"progressbar","aria-valuenow":Ci},(0,xe.Z)(Qi,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),Et))}),hi=ei},78045:function(Cn,Xt,se){"use strict";se.d(Xt,{ZP:function(){return Qe}});var fe=se(94184),et=se.n(fe),$e=se(5663),Ue=se(1337),be=se(67294),Se=se(53124),Me=se(98675);const xe=be.createContext(null),pe=xe.Provider;var Te=xe;const mt=be.createContext(null),ze=mt.Provider;var It=se(95860),Ct=se(17799),ht=se(98866),Ye=se(65223),De=se(14747),At=se(67968),Jt=se(45503);const nt=Le=>{const{componentCls:Nt,antCls:Nn}=Le,gn=`${Nt}-group`;return{[gn]:Object.assign(Object.assign({},(0,De.Wf)(Le)),{display:"inline-block",fontSize:0,[`&${gn}-rtl`]:{direction:"rtl"},[`${Nn}-badge ${Nn}-badge-count`]:{zIndex:1},[`> ${Nn}-badge:not(:first-child) > ${Nn}-button-wrapper`]:{borderInlineStart:"none"}})}},lt=Le=>{const{componentCls:Nt,wrapperMarginInlineEnd:Nn,colorPrimary:gn,radioSize:Je,motionDurationSlow:st,motionDurationMid:_t,motionEaseInOutCirc:en,colorBgContainer:Bt,colorBorder:Ft,lineWidth:zt,dotSize:Mn,colorBgContainerDisabled:bn,colorTextDisabled:Ee,paddingXS:ce,dotColorDisabled:le,lineType:ye,radioDotDisabledSize:ve,wireframe:oe,colorWhite:He}=Le,xt=`${Nt}-inner`;return{[`${Nt}-wrapper`]:Object.assign(Object.assign({},(0,De.Wf)(Le)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:Nn,cursor:"pointer",[`&${Nt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:Le.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${Nt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${zt}px ${ye} ${gn}`,borderRadius:"50%",visibility:"hidden",content:'""'},[Nt]:Object.assign(Object.assign({},(0,De.Wf)(Le)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${Nt}-wrapper:hover &,
|
|
|
&:hover ${xt}`]:{borderColor:gn},[`${Nt}-input:focus-visible + ${xt}`]:Object.assign({},(0,De.oN)(Le)),[`${Nt}:hover::after, ${Nt}-wrapper:hover &::after`]:{visibility:"visible"},[`${Nt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Je,height:Je,marginBlockStart:Je/-2,marginInlineStart:Je/-2,backgroundColor:oe?gn:He,borderBlockStart:0,borderInlineStart:0,borderRadius:Je,transform:"scale(0)",opacity:0,transition:`all ${st} ${en}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Je,height:Je,backgroundColor:Bt,borderColor:Ft,borderStyle:"solid",borderWidth:zt,borderRadius:"50%",transition:`all ${_t}`},[`${Nt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${Nt}-checked`]:{[xt]:{borderColor:gn,backgroundColor:oe?Bt:gn,"&::after":{transform:`scale(${Mn/Je})`,opacity:1,transition:`all ${st} ${en}`}}},[`${Nt}-disabled`]:{cursor:"not-allowed",[xt]:{backgroundColor:bn,borderColor:Ft,cursor:"not-allowed","&::after":{backgroundColor:le}},[`${Nt}-input`]:{cursor:"not-allowed"},[`${Nt}-disabled + span`]:{color:Ee,cursor:"not-allowed"},[`&${Nt}-checked`]:{[xt]:{"&::after":{transform:`scale(${ve/Je})`}}}},[`span${Nt} + *`]:{paddingInlineStart:ce,paddingInlineEnd:ce}})}},Ie=Le=>{const{buttonColor:Nt,controlHeight:Nn,componentCls:gn,lineWidth:Je,lineType:st,colorBorder:_t,motionDurationSlow:en,motionDurationMid:Bt,buttonPaddingInline:Ft,fontSize:zt,buttonBg:Mn,fontSizeLG:bn,controlHeightLG:Ee,controlHeightSM:ce,paddingXS:le,borderRadius:ye,borderRadiusSM:ve,borderRadiusLG:oe,buttonCheckedBg:He,buttonSolidCheckedColor:xt,colorTextDisabled:Yt,colorBgContainerDisabled:pn,buttonCheckedBgDisabled:dn,buttonCheckedColorDisabled:An,colorPrimary:tn,colorPrimaryHover:Nr,colorPrimaryActive:Wr,buttonSolidCheckedBg:Kt,buttonSolidCheckedHoverBg:$n,buttonSolidCheckedActiveBg:ei}=Le;return{[`${gn}-button-wrapper`]:{position:"relative",display:"inline-block",height:Nn,margin:0,paddingInline:Ft,paddingBlock:0,color:Nt,fontSize:zt,lineHeight:`${Nn-Je*2}px`,background:Mn,border:`${Je}px ${st} ${_t}`,borderBlockStartWidth:Je+.02,borderInlineStartWidth:0,borderInlineEndWidth:Je,cursor:"pointer",transition:[`color ${Bt}`,`background ${Bt}`,`box-shadow ${Bt}`].join(","),a:{color:Nt},[`> ${gn}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Je,insetInlineStart:-Je,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Je,paddingInline:0,backgroundColor:_t,transition:`background-color ${en}`,content:'""'}},"&:first-child":{borderInlineStart:`${Je}px ${st} ${_t}`,borderStartStartRadius:ye,borderEndStartRadius:ye},"&:last-child":{borderStartEndRadius:ye,borderEndEndRadius:ye},"&:first-child:last-child":{borderRadius:ye},[`${gn}-group-large &`]:{height:Ee,fontSize:bn,lineHeight:`${Ee-Je*2}px`,"&:first-child":{borderStartStartRadius:oe,borderEndStartRadius:oe},"&:last-child":{borderStartEndRadius:oe,borderEndEndRadius:oe}},[`${gn}-group-small &`]:{height:ce,paddingInline:le-Je,paddingBlock:0,lineHeight:`${ce-Je*2}px`,"&:first-child":{borderStartStartRadius:ve,borderEndStartRadius:ve},"&:last-child":{borderStartEndRadius:ve,borderEndEndRadius:ve}},"&:hover":{position:"relative",color:tn},"&:has(:focus-visible)":Object.assign({},(0,De.oN)(Le)),[`${gn}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${gn}-button-wrapper-disabled)`]:{zIndex:1,color:tn,background:He,borderColor:tn,"&::before":{backgroundColor:tn},"&:first-child":{borderColor:tn},"&:hover":{color:Nr,borderColor:Nr,"&::before":{backgroundColor:Nr}},"&:active":{color:Wr,borderColor:Wr,"&::before":{backgroundColor:Wr}}},[`${gn}-group-solid &-checked:not(${gn}-button-wrapper-disabled)`]:{color:xt,background:Kt,borderColor:Kt,"&:hover":{color:xt,background:$n,borderColor:$n},"&:active":{color:xt,background:ei,borderColor:ei}},"&-disabled":{color:Yt,backgroundColor:pn,borderColor:_t,cursor:"not-allowed","&:first-child, &:hover":{color:Yt,backgroundColor:pn,borderColor:_t}},[`&-disabled${gn}-button-wrapper-checked`]:{color:An,backgroundColor:dn,borderColor:_t,boxShadow:"none"}}}},ke=Le=>Le-4*2;var je=(0,At.Z)("Radio",Le=>{const{controlOutline:Nt,controlOutlineWidth:Nn,radioSize:gn}=Le,Je=`0 0 0 ${Nn}px ${Nt}`,st=Je,_t=ke(gn),en=(0,Jt.TS)(Le,{radioDotDisabledSize:_t,radioFocusShadow:Je,radioButtonFocusShadow:st});return[nt(en),lt(en),Ie(en)]},Le=>{const{wireframe:Nt,padding:Nn,marginXS:gn,lineWidth:Je,fontSizeLG:st,colorText:_t,colorBgContainer:en,colorTextDisabled:Bt,controlItemBgActiveDisabled:Ft,colorTextLightSolid:zt,colorPrimary:Mn,colorPrimaryHover:bn,colorPrimaryActive:Ee}=Le,ce=4,le=st,ye=Nt?ke(le):le-(ce+Je)*2;return{radioSize:le,dotSize:ye,dotColorDisabled:Bt,buttonSolidCheckedColor:zt,buttonSolidCheckedBg:Mn,buttonSolidCheckedHoverBg:bn,buttonSolidCheckedActiveBg:Ee,buttonBg:en,buttonCheckedBg:en,buttonColor:_t,buttonCheckedBgDisabled:Ft,buttonCheckedColorDisabled:Bt,buttonPaddingInline:Nn-Je,wrapperMarginInlineEnd:gn}}),Xe=se(45353),Pt=se(92429),kt=function(Le,Nt){var Nn={};for(var gn in Le)Object.prototype.hasOwnProperty.call(Le,gn)&&Nt.indexOf(gn)<0&&(Nn[gn]=Le[gn]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,gn=Object.getOwnPropertySymbols(Le);Je<gn.length;Je++)Nt.indexOf(gn[Je])<0&&Object.prototype.propertyIsEnumerable.call(Le,gn[Je])&&(Nn[gn[Je]]=Le[gn[Je]]);return Nn};const Lt=(Le,Nt)=>{var Nn,gn;const Je=be.useContext(Te),st=be.useContext(mt),{getPrefixCls:_t,direction:en,radio:Bt}=be.useContext(Se.E_),Ft=be.useRef(null),zt=(0,Ct.sQ)(Nt,Ft),{isFormItemInput:Mn}=be.useContext(Ye.aM),bn=Wr=>{var Kt,$n;(Kt=Le.onChange)===null||Kt===void 0||Kt.call(Le,Wr),($n=Je==null?void 0:Je.onChange)===null||$n===void 0||$n.call(Je,Wr)},{prefixCls:Ee,className:ce,rootClassName:le,children:ye,style:ve}=Le,oe=kt(Le,["prefixCls","className","rootClassName","children","style"]),He=_t("radio",Ee),xt=((Je==null?void 0:Je.optionType)||st)==="button",Yt=xt?`${He}-button`:He,[pn,dn]=je(He),An=Object.assign({},oe),tn=be.useContext(ht.Z);Je&&(An.name=Je.name,An.onChange=bn,An.checked=Le.value===Je.value,An.disabled=(Nn=An.disabled)!==null&&Nn!==void 0?Nn:Je.disabled),An.disabled=(gn=An.disabled)!==null&&gn!==void 0?gn:tn;const Nr=et()(`${Yt}-wrapper`,{[`${Yt}-wrapper-checked`]:An.checked,[`${Yt}-wrapper-disabled`]:An.disabled,[`${Yt}-wrapper-rtl`]:en==="rtl",[`${Yt}-wrapper-in-form-item`]:Mn},Bt==null?void 0:Bt.className,ce,le,dn);return pn(be.createElement(Xe.Z,{component:"Radio",disabled:An.disabled},be.createElement("label",{className:Nr,style:Object.assign(Object.assign({},Bt==null?void 0:Bt.style),ve),onMouseEnter:Le.onMouseEnter,onMouseLeave:Le.onMouseLeave},be.createElement(It.Z,Object.assign({},An,{className:et()(An.className,!xt&&Pt.A),type:"radio",prefixCls:Yt,ref:zt})),ye!==void 0?be.createElement("span",null,ye):null)))};var Ht=be.forwardRef(Lt);const Dt=be.forwardRef((Le,Nt)=>{const{getPrefixCls:Nn,direction:gn}=be.useContext(Se.E_),[Je,st]=(0,$e.Z)(Le.defaultValue,{value:Le.value}),_t=Kt=>{const $n=Je,ei=Kt.target.value;"value"in Le||st(ei);const{onChange:hi}=Le;hi&&ei!==$n&&hi(Kt)},{prefixCls:en,className:Bt,rootClassName:Ft,options:zt,buttonStyle:Mn="outline",disabled:bn,children:Ee,size:ce,style:le,id:ye,onMouseEnter:ve,onMouseLeave:oe,onFocus:He,onBlur:xt}=Le,Yt=Nn("radio",en),pn=`${Yt}-group`,[dn,An]=je(Yt);let tn=Ee;zt&&zt.length>0&&(tn=zt.map(Kt=>typeof Kt=="string"||typeof Kt=="number"?be.createElement(Ht,{key:Kt.toString(),prefixCls:Yt,disabled:bn,value:Kt,checked:Je===Kt},Kt):be.createElement(Ht,{key:`radio-group-value-options-${Kt.value}`,prefixCls:Yt,disabled:Kt.disabled||bn,value:Kt.value,checked:Je===Kt.value,title:Kt.title,style:Kt.style},Kt.label)));const Nr=(0,Me.Z)(ce),Wr=et()(pn,`${pn}-${Mn}`,{[`${pn}-${Nr}`]:Nr,[`${pn}-rtl`]:gn==="rtl"},Bt,Ft,An);return dn(be.createElement("div",Object.assign({},(0,Ue.Z)(Le,{aria:!0,data:!0}),{className:Wr,style:le,onMouseEnter:ve,onMouseLeave:oe,onFocus:He,onBlur:xt,id:ye,ref:Nt}),be.createElement(pe,{value:{onChange:_t,value:Je,disabled:Le.disabled,name:Le.name,optionType:Le.optionType}},tn)))});var Ln=be.memo(Dt),un=function(Le,Nt){var Nn={};for(var gn in Le)Object.prototype.hasOwnProperty.call(Le,gn)&&Nt.indexOf(gn)<0&&(Nn[gn]=Le[gn]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,gn=Object.getOwnPropertySymbols(Le);Je<gn.length;Je++)Nt.indexOf(gn[Je])<0&&Object.prototype.propertyIsEnumerable.call(Le,gn[Je])&&(Nn[gn[Je]]=Le[gn[Je]]);return Nn};const Rn=(Le,Nt)=>{const{getPrefixCls:Nn}=be.useContext(Se.E_),{prefixCls:gn}=Le,Je=un(Le,["prefixCls"]),st=Nn("radio",gn);return be.createElement(ze,{value:"button"},be.createElement(Ht,Object.assign({prefixCls:st},Je,{type:"radio",ref:Nt})))};var ir=be.forwardRef(Rn);const yr=Ht;yr.Button=ir,yr.Group=Ln,yr.__ANT_RADIO=!0;var Qe=yr},11713:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return hr}});var fe=se(94184),et=se.n(fe),$e=se(87462),Ue=se(74902),be=se(4942),Se=se(1413),Me=se(97685),xe=se(45987),pe=se(71002),Te=se(67294);function mt(Pe){var Fe=Te.useRef();Fe.current=Pe;var wt=Te.useCallback(function(){for(var it,Ot=arguments.length,on=new Array(Ot),mn=0;mn<Ot;mn++)on[mn]=arguments[mn];return(it=Fe.current)===null||it===void 0?void 0:it.call.apply(it,[Fe].concat(on))},[]);return wt}function ze(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var It=ze()?Te.useLayoutEffect:Te.useEffect,Ct=It,ht=function(Fe,wt){var it=Te.useRef(!0);It(function(){if(!it.current)return Fe()},wt),It(function(){return it.current=!1,function(){it.current=!0}},[])};function Ye(Pe){var Fe=Te.useRef(!1),wt=Te.useState(Pe),it=(0,Me.Z)(wt,2),Ot=it[0],on=it[1];Te.useEffect(function(){return Fe.current=!1,function(){Fe.current=!0}},[]);function mn(On,xn){xn&&Fe.current||on(On)}return[Ot,mn]}function De(Pe){return Pe!==void 0}function At(Pe,Fe){var wt=Fe||{},it=wt.defaultValue,Ot=wt.value,on=wt.onChange,mn=wt.postState,On=Ye(function(){return De(Ot)?Ot:De(it)?typeof it=="function"?it():it:typeof Pe=="function"?Pe():Pe}),xn=(0,Me.Z)(On,2),Qt=xn[0],Bn=xn[1],Kn=Ot!==void 0?Ot:Qt,mr=mn?mn(Kn):Kn,Fn=mt(on),_r=Ye([Kn]),Zr=(0,Me.Z)(_r,2),Tr=Zr[0],$r=Zr[1];ht(function(){var Pr=Tr[0];Qt!==Pr&&Fn(Qt,Pr)},[Tr]),ht(function(){De(Ot)||Bn(Ot)},[Ot]);var xr=mt(function(Pr,Yr){Bn(Pr,Yr),$r([Kn],Yr)});return[mr,xr]}var Jt={};function nt(Pe,Fe){}function lt(Pe,Fe){}function Ie(){Jt={}}function ke(Pe,Fe,wt){!Fe&&!Jt[wt]&&(Pe(!1,wt),Jt[wt]=!0)}function je(Pe,Fe){ke(nt,Pe,Fe)}function Xe(Pe,Fe){ke(lt,Pe,Fe)}var Pt=je,kt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Pe=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Pe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Pe==null?void 0:Pe.substr(0,4))},Lt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Fe){var wt=Fe.keyCode;if(Fe.altKey&&!Fe.ctrlKey||Fe.metaKey||wt>=Lt.F1&&wt<=Lt.F12)return!1;switch(wt){case Lt.ALT:case Lt.CAPS_LOCK:case Lt.CONTEXT_MENU:case Lt.CTRL:case Lt.DOWN:case Lt.END:case Lt.ESC:case Lt.HOME:case Lt.INSERT:case Lt.LEFT:case Lt.MAC_FF_META:case Lt.META:case Lt.NUMLOCK:case Lt.NUM_CENTER:case Lt.PAGE_DOWN:case Lt.PAGE_UP:case Lt.PAUSE:case Lt.PRINT_SCREEN:case Lt.RIGHT:case Lt.SHIFT:case Lt.UP:case Lt.WIN_KEY:case Lt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Fe){if(Fe>=Lt.ZERO&&Fe<=Lt.NINE||Fe>=Lt.NUM_ZERO&&Fe<=Lt.NUM_MULTIPLY||Fe>=Lt.A&&Fe<=Lt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Fe===0)return!0;switch(Fe){case Lt.SPACE:case Lt.QUESTION_MARK:case Lt.NUM_PLUS:case Lt.NUM_MINUS:case Lt.NUM_PERIOD:case Lt.NUM_DIVISION:case Lt.SEMICOLON:case Lt.DASH:case Lt.EQUALS:case Lt.COMMA:case Lt.PERIOD:case Lt.SLASH:case Lt.APOSTROPHE:case Lt.SINGLE_QUOTE:case Lt.OPEN_SQUARE_BRACKET:case Lt.BACKSLASH:case Lt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Ge=Lt,Ht=se(47655);function Dt(Pe,Fe,wt){var it=Te.useRef({});return(!("value"in it.current)||wt(it.current.condition,Fe))&&(it.current.value=Pe(),it.current.condition=Fe),it.current.value}function Ln(Pe,Fe){typeof Pe=="function"?Pe(Fe):(0,pe.Z)(Pe)==="object"&&Pe&&"current"in Pe&&(Pe.current=Fe)}function un(){for(var Pe=arguments.length,Fe=new Array(Pe),wt=0;wt<Pe;wt++)Fe[wt]=arguments[wt];var it=Fe.filter(function(Ot){return Ot});return it.length<=1?it[0]:function(Ot){Fe.forEach(function(on){Ln(on,Ot)})}}function Rn(){for(var Pe=arguments.length,Fe=new Array(Pe),wt=0;wt<Pe;wt++)Fe[wt]=arguments[wt];return Dt(function(){return un.apply(void 0,Fe)},Fe,function(it,Ot){return it.length===Ot.length&&it.every(function(on,mn){return on===Ot[mn]})})}function ir(Pe){var Fe,wt,it=isMemo(Pe)?Pe.type.type:Pe.type;return!(typeof it=="function"&&!((Fe=it.prototype)!==null&&Fe!==void 0&&Fe.render)||typeof Pe=="function"&&!((wt=Pe.prototype)!==null&&wt!==void 0&&wt.render))}var yr=function(Fe){var wt=Fe.className,it=Fe.customizeIcon,Ot=Fe.customizeIconProps,on=Fe.onMouseDown,mn=Fe.onClick,On=Fe.children,xn;return typeof it=="function"?xn=it(Ot):xn=it,Te.createElement("span",{className:wt,onMouseDown:function(Bn){Bn.preventDefault(),on&&on(Bn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:mn,"aria-hidden":!0},xn!==void 0?xn:Te.createElement("span",{className:et()(wt.split(/\s+/).map(function(Qt){return"".concat(Qt,"-icon")}))},On))},Qe=yr;function Le(Pe,Fe,wt,it,Ot){var on=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,mn=arguments.length>6?arguments[6]:void 0,On=arguments.length>7?arguments[7]:void 0,xn=Te.useMemo(function(){if((0,pe.Z)(it)==="object")return it.clearIcon;if(Ot)return Ot},[it,Ot]),Qt=Te.useMemo(function(){return!!(!on&&it&&(wt.length||mn)&&!(On==="combobox"&&mn===""))},[it,on,wt.length,mn,On]);return{allowClear:Qt,clearIcon:Te.createElement(Qe,{className:"".concat(Pe,"-clear"),onMouseDown:Fe,customizeIcon:xn},"\xD7")}}var Nt=Te.createContext(null);function Nn(){return Te.useContext(Nt)}function gn(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Fe=Te.useState(!1),wt=(0,Me.Z)(Fe,2),it=wt[0],Ot=wt[1],on=Te.useRef(null),mn=function(){window.clearTimeout(on.current)};Te.useEffect(function(){return mn},[]);var On=function(Qt,Bn){mn(),on.current=window.setTimeout(function(){Ot(Qt),Bn&&Bn()},Pe)};return[it,On,mn]}function Je(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Fe=Te.useRef(null),wt=Te.useRef(null);Te.useEffect(function(){return function(){window.clearTimeout(wt.current)}},[]);function it(Ot){(Ot||Fe.current===null)&&(Fe.current=Ot),window.clearTimeout(wt.current),wt.current=window.setTimeout(function(){Fe.current=null},Pe)}return[function(){return Fe.current},it]}function st(Pe,Fe,wt,it){var Ot=Te.useRef(null);Ot.current={open:Fe,triggerOpen:wt,customizedTrigger:it},Te.useEffect(function(){function on(mn){var On;if(!((On=Ot.current)!==null&&On!==void 0&&On.customizedTrigger)){var xn=mn.target;xn.shadowRoot&&mn.composed&&(xn=mn.composedPath()[0]||xn),Ot.current.open&&Pe().filter(function(Qt){return Qt}).every(function(Qt){return!Qt.contains(xn)&&Qt!==xn})&&Ot.current.triggerOpen(!1)}}return window.addEventListener("mousedown",on),function(){return window.removeEventListener("mousedown",on)}},[])}var _t=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,en=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Bt="".concat(_t," ").concat(en).split(/[\s\n]+/),Ft="aria-",zt="data-";function Mn(Pe,Fe){return Pe.indexOf(Fe)===0}function bn(Pe){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,wt;Fe===!1?wt={aria:!0,data:!0,attr:!0}:Fe===!0?wt={aria:!0}:wt=(0,Se.Z)({},Fe);var it={};return Object.keys(Pe).forEach(function(Ot){(wt.aria&&(Ot==="role"||Mn(Ot,Ft))||wt.data&&Mn(Ot,zt)||wt.attr&&Bt.includes(Ot))&&(it[Ot]=Pe[Ot])}),it}var Ee=se(48555),ce=se(14075),le=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ye=void 0;function ve(Pe,Fe){var wt=Pe.prefixCls,it=Pe.invalidate,Ot=Pe.item,on=Pe.renderItem,mn=Pe.responsive,On=Pe.responsiveDisabled,xn=Pe.registerSize,Qt=Pe.itemKey,Bn=Pe.className,Kn=Pe.style,mr=Pe.children,Fn=Pe.display,_r=Pe.order,Zr=Pe.component,Tr=Zr===void 0?"div":Zr,$r=(0,xe.Z)(Pe,le),xr=mn&&!Fn;function Pr(Pi){xn(Qt,Pi)}Te.useEffect(function(){return function(){Pr(null)}},[]);var Yr=on&&Ot!==ye?on(Ot):mr,ai;it||(ai={opacity:xr?0:1,height:xr?0:ye,overflowY:xr?"hidden":ye,order:mn?_r:ye,pointerEvents:xr?"none":ye,position:xr?"absolute":ye});var Dr={};xr&&(Dr["aria-hidden"]=!0);var li=Te.createElement(Tr,(0,$e.Z)({className:et()(!it&&wt,Bn),style:(0,Se.Z)((0,Se.Z)({},ai),Kn)},Dr,$r,{ref:Fe}),Yr);return mn&&(li=Te.createElement(Ee.Z,{onResize:function(ta){var Vi=ta.offsetWidth;Pr(Vi)},disabled:On},li)),li}var oe=Te.forwardRef(ve);oe.displayName="Item";var He=oe,xt=se(77527),Yt=se(73935),pn=se(96523);function dn(Pe){if(typeof MessageChannel=="undefined")(0,pn.Z)(Pe);else{var Fe=new MessageChannel;Fe.port1.onmessage=function(){return Pe()},Fe.port2.postMessage(void 0)}}function An(){var Pe=Te.useRef(null),Fe=function(it){Pe.current||(Pe.current=[],dn(function(){(0,Yt.unstable_batchedUpdates)(function(){Pe.current.forEach(function(Ot){Ot()}),Pe.current=null})})),Pe.current.push(it)};return Fe}function tn(Pe,Fe){var wt=Te.useState(Fe),it=(0,Me.Z)(wt,2),Ot=it[0],on=it[1],mn=(0,xt.Z)(function(On){Pe(function(){on(On)})});return[Ot,mn]}var Nr=Te.createContext(null),Wr=["component"],Kt=["className"],$n=["className"],ei=function(Fe,wt){var it=Te.useContext(Nr);if(!it){var Ot=Fe.component,on=Ot===void 0?"div":Ot,mn=(0,xe.Z)(Fe,Wr);return Te.createElement(on,(0,$e.Z)({},mn,{ref:wt}))}var On=it.className,xn=(0,xe.Z)(it,Kt),Qt=Fe.className,Bn=(0,xe.Z)(Fe,$n);return Te.createElement(Nr.Provider,{value:null},Te.createElement(He,(0,$e.Z)({ref:wt,className:et()(On,Qt)},xn,Bn)))},hi=Te.forwardRef(ei);hi.displayName="RawItem";var ut=hi,Vt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Vn="responsive",rr="invalidate";function gr(Pe){return"+ ".concat(Pe.length," ...")}function Ir(Pe,Fe){var wt=Pe.prefixCls,it=wt===void 0?"rc-overflow":wt,Ot=Pe.data,on=Ot===void 0?[]:Ot,mn=Pe.renderItem,On=Pe.renderRawItem,xn=Pe.itemKey,Qt=Pe.itemWidth,Bn=Qt===void 0?10:Qt,Kn=Pe.ssr,mr=Pe.style,Fn=Pe.className,_r=Pe.maxCount,Zr=Pe.renderRest,Tr=Pe.renderRawRest,$r=Pe.suffix,xr=Pe.component,Pr=xr===void 0?"div":xr,Yr=Pe.itemComponent,ai=Pe.onVisibleChange,Dr=(0,xe.Z)(Pe,Vt),li=Kn==="full",Pi=An(),ta=tn(Pi,null),Vi=(0,Me.Z)(ta,2),Ni=Vi[0],Xi=Vi[1],qi=Ni||0,bi=tn(Pi,new Map),Fi=(0,Me.Z)(bi,2),jr=Fi[0],ci=Fi[1],Ti=tn(Pi,0),ji=(0,Me.Z)(Ti,2),Na=ji[0],Fa=ji[1],Aa=tn(Pi,0),ua=(0,Me.Z)(Aa,2),Yi=ua[0],Mi=ua[1],Oa=tn(Pi,0),ki=(0,Me.Z)(Oa,2),Jr=ki[0],zi=ki[1],ca=(0,Te.useState)(null),Ui=(0,Me.Z)(ca,2),ia=Ui[0],fi=Ui[1],pa=(0,Te.useState)(null),xa=(0,Me.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Te.useMemo(function(){return fa===null&&li?Number.MAX_SAFE_INTEGER:fa||0},[fa,Ni]),Va=(0,Te.useState)(!1),ha=(0,Me.Z)(Va,2),ka=ha[0],Ja=ha[1],Ga="".concat(it,"-item"),so=Math.max(Na,Yi),$a=_r===Vn,Ca=on.length&&$a,_i=_r===rr,Ki=Ca||typeof _r=="number"&&on.length>_r,da=(0,Te.useMemo)(function(){var aa=on;return Ca?Ni===null&&li?aa=on:aa=on.slice(0,Math.min(on.length,qi/Bn)):typeof _r=="number"&&(aa=on.slice(0,_r)),aa},[on,Bn,Ni,_r,Ca]),Sa=(0,Te.useMemo)(function(){return Ca?on.slice(Ea+1):on.slice(da.length)},[on,da,Ca,Ea]),Ka=(0,Te.useCallback)(function(aa,Lr){var xi;return typeof xn=="function"?xn(aa):(xi=xn&&(aa==null?void 0:aa[xn]))!==null&&xi!==void 0?xi:Lr},[xn]),io=(0,Te.useCallback)(mn||function(aa){return aa},[mn]);function ho(aa,Lr,xi){fa===aa&&(Lr===void 0||Lr===ia)||(wa(aa),xi||(Ja(aa<on.length-1),ai==null||ai(aa)),Lr!==void 0&&fi(Lr))}function Oo(aa,Lr){Xi(Lr.clientWidth)}function Ro(aa,Lr){ci(function(xi){var wi=new Map(xi);return Lr===null?wi.delete(aa):wi.set(aa,Lr),wi})}function lo(aa,Lr){Mi(Lr),Fa(Yi)}function Ao(aa,Lr){zi(Lr)}function na(aa){return jr.get(Ka(da[aa],aa))}(0,ce.Z)(function(){if(qi&&typeof so=="number"&&da){var aa=Jr,Lr=da.length,xi=Lr-1;if(!Lr){ho(0,null);return}for(var wi=0;wi<Lr;wi+=1){var Di=na(wi);if(li&&(Di=Di||0),Di===void 0){ho(wi-1,void 0,!0);break}if(aa+=Di,xi===0&&aa<=qi||wi===xi-1&&aa+na(xi)<=qi){ho(xi,null);break}else if(aa+so>qi){ho(wi-1,aa-Di-Jr+Yi);break}}$r&&na(0)+Jr>qi&&fi(null)}},[qi,jr,Yi,Jr,Ka,da]);var Oi=ka&&!!Sa.length,Ta={};ia!==null&&Ca&&(Ta={position:"absolute",left:ia,top:0});var _a={prefixCls:Ga,responsive:Ca,component:Yr,invalidate:_i},uo=On?function(aa,Lr){var xi=Ka(aa,Lr);return Te.createElement(Nr.Provider,{key:xi,value:(0,Se.Z)((0,Se.Z)({},_a),{},{order:Lr,item:aa,itemKey:xi,registerSize:Ro,display:Lr<=Ea})},On(aa,Lr))}:function(aa,Lr){var xi=Ka(aa,Lr);return Te.createElement(He,(0,$e.Z)({},_a,{order:Lr,key:xi,item:aa,renderItem:io,itemKey:xi,registerSize:Ro,display:Lr<=Ea}))},ao,hs={order:Oi?Ea:Number.MAX_SAFE_INTEGER,className:"".concat(Ga,"-rest"),registerSize:lo,display:Oi};if(Tr)Tr&&(ao=Te.createElement(Nr.Provider,{value:(0,Se.Z)((0,Se.Z)({},_a),hs)},Tr(Sa)));else{var Qo=Zr||gr;ao=Te.createElement(He,(0,$e.Z)({},_a,hs),typeof Qo=="function"?Qo(Sa):Qo)}var ps=Te.createElement(Pr,(0,$e.Z)({className:et()(!_i&&it,Fn),style:mr,ref:Fe},Dr),da.map(uo),Ki?ao:null,$r&&Te.createElement(He,(0,$e.Z)({},_a,{responsive:$a,responsiveDisabled:!Ca,order:Ea,className:"".concat(Ga,"-suffix"),registerSize:Ao,display:!0,style:Ta}),$r));return $a&&(ps=Te.createElement(Ee.Z,{onResize:Oo,disabled:!Ca},ps)),ps}var Ur=Te.forwardRef(Ir);Ur.displayName="Overflow",Ur.Item=ut,Ur.RESPONSIVE=Vn,Ur.INVALIDATE=rr;var Gr=Ur,Xr=Gr,ui=function(Fe,wt){var it,Ot,on=Fe.prefixCls,mn=Fe.id,On=Fe.inputElement,xn=Fe.disabled,Qt=Fe.tabIndex,Bn=Fe.autoFocus,Kn=Fe.autoComplete,mr=Fe.editable,Fn=Fe.activeDescendantId,_r=Fe.value,Zr=Fe.maxLength,Tr=Fe.onKeyDown,$r=Fe.onMouseDown,xr=Fe.onChange,Pr=Fe.onPaste,Yr=Fe.onCompositionStart,ai=Fe.onCompositionEnd,Dr=Fe.open,li=Fe.attrs,Pi=On||Te.createElement("input",null),ta=Pi,Vi=ta.ref,Ni=ta.props,Xi=Ni.onKeyDown,qi=Ni.onChange,bi=Ni.onMouseDown,Fi=Ni.onCompositionStart,jr=Ni.onCompositionEnd,ci=Ni.style;return"maxLength"in Pi.props,Pi=Te.cloneElement(Pi,(0,Se.Z)((0,Se.Z)((0,Se.Z)({type:"search"},Ni),{},{id:mn,ref:un(wt,Vi),disabled:xn,tabIndex:Qt,autoComplete:Kn||"off",autoFocus:Bn,className:et()("".concat(on,"-selection-search-input"),(it=Pi)===null||it===void 0||(Ot=it.props)===null||Ot===void 0?void 0:Ot.className),role:"combobox","aria-label":"Search","aria-expanded":Dr||!1,"aria-haspopup":"listbox","aria-owns":"".concat(mn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(mn,"_list"),"aria-activedescendant":Dr?Fn:void 0},li),{},{value:mr?_r:"",maxLength:Zr,readOnly:!mr,unselectable:mr?null:"on",style:(0,Se.Z)((0,Se.Z)({},ci),{},{opacity:mr?null:0}),onKeyDown:function(ji){Tr(ji),Xi&&Xi(ji)},onMouseDown:function(ji){$r(ji),bi&&bi(ji)},onChange:function(ji){xr(ji),qi&&qi(ji)},onCompositionStart:function(ji){Yr(ji),Fi&&Fi(ji)},onCompositionEnd:function(ji){ai(ji),jr&&jr(ji)},onPaste:Pr})),Pi},br=Te.forwardRef(ui);br.displayName="Input";var Ei=br;function sa(Pe){return Array.isArray(Pe)?Pe:Pe!==void 0?[Pe]:[]}var Ji=typeof window!="undefined"&&window.document&&window.document.documentElement,Qi=Ji;function Ci(Pe){return Pe!=null}function gt(Pe){return!Pe&&Pe!==0}function En(Pe){return["string","number"].includes((0,pe.Z)(Pe))}function kn(Pe){var Fe=void 0;return Pe&&(En(Pe.title)?Fe=Pe.title.toString():En(Pe.label)&&(Fe=Pe.label.toString())),Fe}function Tn(Pe,Fe){Qi?Te.useLayoutEffect(Pe,Fe):Te.useEffect(Pe,Fe)}function sr(Pe){var Fe;return(Fe=Pe.key)!==null&&Fe!==void 0?Fe:Pe.value}var tr=function(Fe){Fe.preventDefault(),Fe.stopPropagation()},pr=function(Fe){var wt=Fe.id,it=Fe.prefixCls,Ot=Fe.values,on=Fe.open,mn=Fe.searchValue,On=Fe.autoClearSearchValue,xn=Fe.inputRef,Qt=Fe.placeholder,Bn=Fe.disabled,Kn=Fe.mode,mr=Fe.showSearch,Fn=Fe.autoFocus,_r=Fe.autoComplete,Zr=Fe.activeDescendantId,Tr=Fe.tabIndex,$r=Fe.removeIcon,xr=Fe.maxTagCount,Pr=Fe.maxTagTextLength,Yr=Fe.maxTagPlaceholder,ai=Yr===void 0?function(fi){return"+ ".concat(fi.length," ...")}:Yr,Dr=Fe.tagRender,li=Fe.onToggleOpen,Pi=Fe.onRemove,ta=Fe.onInputChange,Vi=Fe.onInputPaste,Ni=Fe.onInputKeyDown,Xi=Fe.onInputMouseDown,qi=Fe.onInputCompositionStart,bi=Fe.onInputCompositionEnd,Fi=Te.useRef(null),jr=(0,Te.useState)(0),ci=(0,Me.Z)(jr,2),Ti=ci[0],ji=ci[1],Na=(0,Te.useState)(!1),Fa=(0,Me.Z)(Na,2),Aa=Fa[0],ua=Fa[1],Yi="".concat(it,"-selection"),Mi=on||Kn==="multiple"&&On===!1||Kn==="tags"?mn:"",Oa=Kn==="tags"||Kn==="multiple"&&On===!1||mr&&(on||Aa);Tn(function(){ji(Fi.current.scrollWidth)},[Mi]);function ki(fi,pa,xa,fa,wa){return Te.createElement("span",{className:et()("".concat(Yi,"-item"),(0,be.Z)({},"".concat(Yi,"-item-disabled"),xa)),title:kn(fi)},Te.createElement("span",{className:"".concat(Yi,"-item-content")},pa),fa&&Te.createElement(Qe,{className:"".concat(Yi,"-item-remove"),onMouseDown:tr,onClick:wa,customizeIcon:$r},"\xD7"))}function Jr(fi,pa,xa,fa,wa){var Ea=function(ha){tr(ha),li(!on)};return Te.createElement("span",{onMouseDown:Ea},Dr({label:pa,value:fi,disabled:xa,closable:fa,onClose:wa}))}function zi(fi){var pa=fi.disabled,xa=fi.label,fa=fi.value,wa=!Bn&&!pa,Ea=xa;if(typeof Pr=="number"&&(typeof xa=="string"||typeof xa=="number")){var Va=String(Ea);Va.length>Pr&&(Ea="".concat(Va.slice(0,Pr),"..."))}var ha=function(Ja){Ja&&Ja.stopPropagation(),Pi(fi)};return typeof Dr=="function"?Jr(fa,Ea,pa,wa,ha):ki(fi,Ea,pa,wa,ha)}function ca(fi){var pa=typeof ai=="function"?ai(fi):ai;return ki({title:pa},pa,!1)}var Ui=Te.createElement("div",{className:"".concat(Yi,"-search"),style:{width:Ti},onFocus:function(){ua(!0)},onBlur:function(){ua(!1)}},Te.createElement(Ei,{ref:xn,open:on,prefixCls:it,id:wt,inputElement:null,disabled:Bn,autoFocus:Fn,autoComplete:_r,editable:Oa,activeDescendantId:Zr,value:Mi,onKeyDown:Ni,onMouseDown:Xi,onChange:ta,onPaste:Vi,onCompositionStart:qi,onCompositionEnd:bi,tabIndex:Tr,attrs:bn(Fe,!0)}),Te.createElement("span",{ref:Fi,className:"".concat(Yi,"-search-mirror"),"aria-hidden":!0},Mi,"\xA0")),ia=Te.createElement(Xr,{prefixCls:"".concat(Yi,"-overflow"),data:Ot,renderItem:zi,renderRest:ca,suffix:Ui,itemKey:sr,maxCount:xr});return Te.createElement(Te.Fragment,null,ia,!Ot.length&&!Mi&&Te.createElement("span",{className:"".concat(Yi,"-placeholder")},Qt))},Hn=pr,Ze=function(Fe){var wt=Fe.inputElement,it=Fe.prefixCls,Ot=Fe.id,on=Fe.inputRef,mn=Fe.disabled,On=Fe.autoFocus,xn=Fe.autoComplete,Qt=Fe.activeDescendantId,Bn=Fe.mode,Kn=Fe.open,mr=Fe.values,Fn=Fe.placeholder,_r=Fe.tabIndex,Zr=Fe.showSearch,Tr=Fe.searchValue,$r=Fe.activeValue,xr=Fe.maxLength,Pr=Fe.onInputKeyDown,Yr=Fe.onInputMouseDown,ai=Fe.onInputChange,Dr=Fe.onInputPaste,li=Fe.onInputCompositionStart,Pi=Fe.onInputCompositionEnd,ta=Fe.title,Vi=Te.useState(!1),Ni=(0,Me.Z)(Vi,2),Xi=Ni[0],qi=Ni[1],bi=Bn==="combobox",Fi=bi||Zr,jr=mr[0],ci=Tr||"";bi&&$r&&!Xi&&(ci=$r),Te.useEffect(function(){bi&&qi(!1)},[bi,$r]);var Ti=Bn!=="combobox"&&!Kn&&!Zr?!1:!!ci,ji=ta===void 0?kn(jr):ta,Na=function(){if(jr)return null;var Aa=Ti?{visibility:"hidden"}:void 0;return Te.createElement("span",{className:"".concat(it,"-selection-placeholder"),style:Aa},Fn)};return Te.createElement(Te.Fragment,null,Te.createElement("span",{className:"".concat(it,"-selection-search")},Te.createElement(Ei,{ref:on,prefixCls:it,id:Ot,open:Kn,inputElement:wt,disabled:mn,autoFocus:On,autoComplete:xn,editable:Fi,activeDescendantId:Qt,value:ci,onKeyDown:Pr,onMouseDown:Yr,onChange:function(Aa){qi(!0),ai(Aa)},onPaste:Dr,onCompositionStart:li,onCompositionEnd:Pi,tabIndex:_r,attrs:bn(Fe,!0),maxLength:bi?xr:void 0})),!bi&&jr?Te.createElement("span",{className:"".concat(it,"-selection-item"),title:ji,style:Ti?{visibility:"hidden"}:void 0},jr.label):null,Na())},at=Ze;function Et(Pe){return![Ge.ESC,Ge.SHIFT,Ge.BACKSPACE,Ge.TAB,Ge.WIN_KEY,Ge.ALT,Ge.META,Ge.WIN_KEY_RIGHT,Ge.CTRL,Ge.SEMICOLON,Ge.EQUALS,Ge.CAPS_LOCK,Ge.CONTEXT_MENU,Ge.F1,Ge.F2,Ge.F3,Ge.F4,Ge.F5,Ge.F6,Ge.F7,Ge.F8,Ge.F9,Ge.F10,Ge.F11,Ge.F12].includes(Pe)}var jt=function(Fe,wt){var it=(0,Te.useRef)(null),Ot=(0,Te.useRef)(!1),on=Fe.prefixCls,mn=Fe.open,On=Fe.mode,xn=Fe.showSearch,Qt=Fe.tokenWithEnter,Bn=Fe.autoClearSearchValue,Kn=Fe.onSearch,mr=Fe.onSearchSubmit,Fn=Fe.onToggleOpen,_r=Fe.onInputKeyDown,Zr=Fe.domRef;Te.useImperativeHandle(wt,function(){return{focus:function(){it.current.focus()},blur:function(){it.current.blur()}}});var Tr=Je(0),$r=(0,Me.Z)(Tr,2),xr=$r[0],Pr=$r[1],Yr=function(ci){var Ti=ci.which;(Ti===Ge.UP||Ti===Ge.DOWN)&&ci.preventDefault(),_r&&_r(ci),Ti===Ge.ENTER&&On==="tags"&&!Ot.current&&!mn&&(mr==null||mr(ci.target.value)),Et(Ti)&&Fn(!0)},ai=function(){Pr(!0)},Dr=(0,Te.useRef)(null),li=function(ci){Kn(ci,!0,Ot.current)!==!1&&Fn(!0)},Pi=function(){Ot.current=!0},ta=function(ci){Ot.current=!1,On!=="combobox"&&li(ci.target.value)},Vi=function(ci){var Ti=ci.target.value;if(Qt&&Dr.current&&/[\r\n]/.test(Dr.current)){var ji=Dr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ti=Ti.replace(ji,Dr.current)}Dr.current=null,li(Ti)},Ni=function(ci){var Ti=ci.clipboardData,ji=Ti.getData("text");Dr.current=ji},Xi=function(ci){var Ti=ci.target;if(Ti!==it.current){var ji=document.body.style.msTouchAction!==void 0;ji?setTimeout(function(){it.current.focus()}):it.current.focus()}},qi=function(ci){var Ti=xr();ci.target!==it.current&&!Ti&&On!=="combobox"&&ci.preventDefault(),(On!=="combobox"&&(!xn||!Ti)||!mn)&&(mn&&Bn!==!1&&Kn("",!0,!1),Fn())},bi={inputRef:it,onInputKeyDown:Yr,onInputMouseDown:ai,onInputChange:Vi,onInputPaste:Ni,onInputCompositionStart:Pi,onInputCompositionEnd:ta},Fi=On==="multiple"||On==="tags"?Te.createElement(Hn,(0,$e.Z)({},Fe,bi)):Te.createElement(at,(0,$e.Z)({},Fe,bi));return Te.createElement("div",{ref:Zr,className:"".concat(on,"-selector"),onClick:Xi,onMouseDown:qi},Fi)},Ke=Te.forwardRef(jt);Ke.displayName="Selector";var dt=Ke,Rt=se(62709),Tt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Wt=function(Fe){var wt=Fe===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:wt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:wt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:wt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:wt,adjustY:1},htmlRegion:"scroll"}}},Zt=function(Fe,wt){var it=Fe.prefixCls,Ot=Fe.disabled,on=Fe.visible,mn=Fe.children,On=Fe.popupElement,xn=Fe.animation,Qt=Fe.transitionName,Bn=Fe.dropdownStyle,Kn=Fe.dropdownClassName,mr=Fe.direction,Fn=mr===void 0?"ltr":mr,_r=Fe.placement,Zr=Fe.builtinPlacements,Tr=Fe.dropdownMatchSelectWidth,$r=Fe.dropdownRender,xr=Fe.dropdownAlign,Pr=Fe.getPopupContainer,Yr=Fe.empty,ai=Fe.getTriggerDOMNode,Dr=Fe.onPopupVisibleChange,li=Fe.onPopupMouseEnter,Pi=(0,xe.Z)(Fe,Tt),ta="".concat(it,"-dropdown"),Vi=On;$r&&(Vi=$r(On));var Ni=Te.useMemo(function(){return Zr||Wt(Tr)},[Zr,Tr]),Xi=xn?"".concat(ta,"-").concat(xn):Qt,qi=typeof Tr=="number",bi=Te.useMemo(function(){return qi?null:Tr===!1?"minWidth":"width"},[Tr,qi]),Fi=Bn;qi&&(Fi=(0,Se.Z)((0,Se.Z)({},Fi),{},{width:Tr}));var jr=Te.useRef(null);return Te.useImperativeHandle(wt,function(){return{getPopupElement:function(){return jr.current}}}),Te.createElement(Rt.Z,(0,$e.Z)({},Pi,{showAction:Dr?["click"]:[],hideAction:Dr?["click"]:[],popupPlacement:_r||(Fn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Ni,prefixCls:ta,popupTransitionName:Xi,popup:Te.createElement("div",{ref:jr,onMouseEnter:li},Vi),stretch:bi,popupAlign:xr,popupVisible:on,getPopupContainer:Pr,popupClassName:et()(Kn,(0,be.Z)({},"".concat(ta,"-empty"),Yr)),popupStyle:Fi,getTriggerDOMNode:ai,onPopupVisibleChange:Dr}),mn)},zn=Te.forwardRef(Zt);zn.displayName="SelectTrigger";var Sr=zn,Yn=se(84506);function qn(Pe,Fe){var wt=Pe.key,it;return"value"in Pe&&(it=Pe.value),wt!=null?wt:it!==void 0?it:"rc-index-key-".concat(Fe)}function nr(Pe,Fe){var wt=Pe||{},it=wt.label,Ot=wt.value,on=wt.options,mn=wt.groupLabel,On=it||(Fe?"children":"label");return{label:On,value:Ot||"value",options:on||"options",groupLabel:mn||On}}function ar(Pe){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt=Fe.fieldNames,it=Fe.childrenAsData,Ot=[],on=nr(wt,!1),mn=on.label,On=on.value,xn=on.options,Qt=on.groupLabel;function Bn(Kn,mr){Kn.forEach(function(Fn){if(mr||!(xn in Fn)){var _r=Fn[On];Ot.push({key:qn(Fn,Ot.length),groupOption:mr,data:Fn,label:Fn[mn],value:_r})}else{var Zr=Fn[Qt];Zr===void 0&&it&&(Zr=Fn.label),Ot.push({key:qn(Fn,Ot.length),group:!0,data:Fn,label:Zr}),Bn(Fn[xn],!0)}})}return Bn(Pe,!1),Ot}function ot(Pe){var Fe=(0,Se.Z)({},Pe);return"props"in Fe||Object.defineProperty(Fe,"props",{get:function(){return Pt(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Fe}}),Fe}function tt(Pe,Fe){if(!Fe||!Fe.length)return null;var wt=!1;function it(on,mn){var On=(0,Yn.Z)(mn),xn=On[0],Qt=On.slice(1);if(!xn)return[on];var Bn=on.split(xn);return wt=wt||Bn.length>1,Bn.reduce(function(Kn,mr){return[].concat((0,Ue.Z)(Kn),(0,Ue.Z)(it(mr,Qt)))},[]).filter(function(Kn){return Kn})}var Ot=it(Pe,Fe);return wt?Ot:null}var vt=["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"],rn=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Dn(Pe){return Pe==="tags"||Pe==="multiple"}var an=Te.forwardRef(function(Pe,Fe){var wt,it,Ot=Pe.id,on=Pe.prefixCls,mn=Pe.className,On=Pe.showSearch,xn=Pe.tagRender,Qt=Pe.direction,Bn=Pe.omitDomProps,Kn=Pe.displayValues,mr=Pe.onDisplayValuesChange,Fn=Pe.emptyOptions,_r=Pe.notFoundContent,Zr=_r===void 0?"Not Found":_r,Tr=Pe.onClear,$r=Pe.mode,xr=Pe.disabled,Pr=Pe.loading,Yr=Pe.getInputElement,ai=Pe.getRawInputElement,Dr=Pe.open,li=Pe.defaultOpen,Pi=Pe.onDropdownVisibleChange,ta=Pe.activeValue,Vi=Pe.onActiveValueChange,Ni=Pe.activeDescendantId,Xi=Pe.searchValue,qi=Pe.autoClearSearchValue,bi=Pe.onSearch,Fi=Pe.onSearchSplit,jr=Pe.tokenSeparators,ci=Pe.allowClear,Ti=Pe.suffixIcon,ji=Pe.clearIcon,Na=Pe.OptionList,Fa=Pe.animation,Aa=Pe.transitionName,ua=Pe.dropdownStyle,Yi=Pe.dropdownClassName,Mi=Pe.dropdownMatchSelectWidth,Oa=Pe.dropdownRender,ki=Pe.dropdownAlign,Jr=Pe.placement,zi=Pe.builtinPlacements,ca=Pe.getPopupContainer,Ui=Pe.showAction,ia=Ui===void 0?[]:Ui,fi=Pe.onFocus,pa=Pe.onBlur,xa=Pe.onKeyUp,fa=Pe.onKeyDown,wa=Pe.onMouseDown,Ea=(0,xe.Z)(Pe,vt),Va=Dn($r),ha=(On!==void 0?On:Va)||$r==="combobox",ka=(0,Se.Z)({},Ea);rn.forEach(function(Ia){delete ka[Ia]}),Bn==null||Bn.forEach(function(Ia){delete ka[Ia]});var Ja=Te.useState(!1),Ga=(0,Me.Z)(Ja,2),so=Ga[0],$a=Ga[1];Te.useEffect(function(){$a(kt())},[]);var Ca=Te.useRef(null),_i=Te.useRef(null),Ki=Te.useRef(null),da=Te.useRef(null),Sa=Te.useRef(null),Ka=gn(),io=(0,Me.Z)(Ka,3),ho=io[0],Oo=io[1],Ro=io[2];Te.useImperativeHandle(Fe,function(){var Ia,ma;return{focus:(Ia=da.current)===null||Ia===void 0?void 0:Ia.focus,blur:(ma=da.current)===null||ma===void 0?void 0:ma.blur,scrollTo:function(es){var ga;return(ga=Sa.current)===null||ga===void 0?void 0:ga.scrollTo(es)}}});var lo=Te.useMemo(function(){var Ia;if($r!=="combobox")return Xi;var ma=(Ia=Kn[0])===null||Ia===void 0?void 0:Ia.value;return typeof ma=="string"||typeof ma=="number"?String(ma):""},[Xi,$r,Kn]),Ao=$r==="combobox"&&typeof Yr=="function"&&Yr()||null,na=typeof ai=="function"&&ai(),Oi=Rn(_i,na==null||(wt=na.props)===null||wt===void 0?void 0:wt.ref),Ta=Te.useState(!1),_a=(0,Me.Z)(Ta,2),uo=_a[0],ao=_a[1];Ct(function(){ao(!0)},[]);var hs=At(!1,{defaultValue:li,value:Dr}),Qo=(0,Me.Z)(hs,2),ps=Qo[0],aa=Qo[1],Lr=uo?ps:!1,xi=!Zr&&Fn;(xr||xi&&Lr&&$r==="combobox")&&(Lr=!1);var wi=xi?!1:Lr,Di=Te.useCallback(function(Ia){var ma=Ia!==void 0?Ia:!Lr;xr||(aa(ma),Lr!==ma&&(Pi==null||Pi(ma)))},[xr,Lr,aa,Pi]),Ha=Te.useMemo(function(){return(jr||[]).some(function(Ia){return[`
|
|
|
`,`\r
|
|
|
`].includes(Ia)})},[jr]),ja=function(ma,Ho,es){var ga=!0,za=ma;Vi==null||Vi(null);var Ra=es?null:tt(ma,jr);return $r!=="combobox"&&Ra&&(za="",Fi==null||Fi(Ra),Di(!1),ga=!1),bi&&lo!==za&&bi(za,{source:Ho?"typing":"effect"}),ga},$o=function(ma){!ma||!ma.trim()||bi(ma,{source:"submit"})};Te.useEffect(function(){!Lr&&!Va&&$r!=="combobox"&&ja("",!1,!1)},[Lr]),Te.useEffect(function(){ps&&xr&&aa(!1),xr&&Oo(!1)},[xr]);var Uo=Je(),ls=(0,Me.Z)(Uo,2),va=ls[0],Bo=ls[1],us=function(ma){var Ho=va(),es=ma.which;if(es===Ge.ENTER&&($r!=="combobox"&&ma.preventDefault(),Lr||Di(!0)),Bo(!!lo),es===Ge.BACKSPACE&&!Ho&&Va&&!lo&&Kn.length){for(var ga=(0,Ue.Z)(Kn),za=null,Ra=ga.length-1;Ra>=0;Ra-=1){var po=ga[Ra];if(!po.disabled){ga.splice(Ra,1),za=po;break}}za&&mr(ga,{type:"remove",values:[za]})}for(var is=arguments.length,Hs=new Array(is>1?is-1:0),gs=1;gs<is;gs++)Hs[gs-1]=arguments[gs];if(Lr&&Sa.current){var Jl;(Jl=Sa.current).onKeyDown.apply(Jl,[ma].concat(Hs))}fa==null||fa.apply(void 0,[ma].concat(Hs))},cl=function(ma){for(var Ho=arguments.length,es=new Array(Ho>1?Ho-1:0),ga=1;ga<Ho;ga++)es[ga-1]=arguments[ga];if(Lr&&Sa.current){var za;(za=Sa.current).onKeyUp.apply(za,[ma].concat(es))}xa==null||xa.apply(void 0,[ma].concat(es))},As=function(ma){var Ho=Kn.filter(function(es){return es!==ma});mr(Ho,{type:"remove",values:[ma]})},ms=Te.useRef(!1),zo=function(){Oo(!0),xr||(fi&&!ms.current&&fi.apply(void 0,arguments),ia.includes("focus")&&Di(!0)),ms.current=!0},Ts=function(){Oo(!1,function(){ms.current=!1,Di(!1)}),!xr&&(lo&&($r==="tags"?bi(lo,{source:"submit"}):$r==="multiple"&&bi("",{source:"blur"})),pa&&pa.apply(void 0,arguments))},Ds=[];Te.useEffect(function(){return function(){Ds.forEach(function(Ia){return clearTimeout(Ia)}),Ds.splice(0,Ds.length)}},[]);var Ys=function(ma){var Ho,es=ma.target,ga=(Ho=Ki.current)===null||Ho===void 0?void 0:Ho.getPopupElement();if(ga&&ga.contains(es)){var za=setTimeout(function(){var Hs=Ds.indexOf(za);if(Hs!==-1&&Ds.splice(Hs,1),Ro(),!so&&!ga.contains(document.activeElement)){var gs;(gs=da.current)===null||gs===void 0||gs.focus()}});Ds.push(za)}for(var Ra=arguments.length,po=new Array(Ra>1?Ra-1:0),is=1;is<Ra;is++)po[is-1]=arguments[is];wa==null||wa.apply(void 0,[ma].concat(po))},oo=Te.useState({}),Da=(0,Me.Z)(oo,2),Xa=Da[1];function go(){Xa({})}var yo;na&&(yo=function(ma){Di(ma)}),st(function(){var Ia;return[Ca.current,(Ia=Ki.current)===null||Ia===void 0?void 0:Ia.getPopupElement()]},wi,Di,!!na);var Ko=Te.useMemo(function(){return(0,Se.Z)((0,Se.Z)({},Pe),{},{notFoundContent:Zr,open:Lr,triggerOpen:wi,id:Ot,showSearch:ha,multiple:Va,toggleOpen:Di})},[Pe,Zr,wi,Lr,Ot,ha,Va,Di]),wo=!!Ti||Pr,xs;wo&&(xs=Te.createElement(Qe,{className:et()("".concat(on,"-arrow"),(0,be.Z)({},"".concat(on,"-arrow-loading"),Pr)),customizeIcon:Ti,customizeIconProps:{loading:Pr,searchValue:lo,open:Lr,focused:ho,showSearch:ha}}));var Xl=function(){var ma;Tr==null||Tr(),(ma=da.current)===null||ma===void 0||ma.focus(),mr([],{type:"clear",values:Kn}),ja("",!1,!1)},ql=Le(on,Xl,Kn,ci,ji,xr,lo,$r),vu=ql.allowClear,Xu=ql.clearIcon,Ks=Te.createElement(Na,{ref:Sa}),Is=et()(on,mn,(it={},(0,be.Z)(it,"".concat(on,"-focused"),ho),(0,be.Z)(it,"".concat(on,"-multiple"),Va),(0,be.Z)(it,"".concat(on,"-single"),!Va),(0,be.Z)(it,"".concat(on,"-allow-clear"),ci),(0,be.Z)(it,"".concat(on,"-show-arrow"),wo),(0,be.Z)(it,"".concat(on,"-disabled"),xr),(0,be.Z)(it,"".concat(on,"-loading"),Pr),(0,be.Z)(it,"".concat(on,"-open"),Lr),(0,be.Z)(it,"".concat(on,"-customize-input"),Ao),(0,be.Z)(it,"".concat(on,"-show-search"),ha),it)),yu=Te.createElement(Sr,{ref:Ki,disabled:xr,prefixCls:on,visible:wi,popupElement:Ks,animation:Fa,transitionName:Aa,dropdownStyle:ua,dropdownClassName:Yi,direction:Qt,dropdownMatchSelectWidth:Mi,dropdownRender:Oa,dropdownAlign:ki,placement:Jr,builtinPlacements:zi,getPopupContainer:ca,empty:Fn,getTriggerDOMNode:function(){return _i.current},onPopupVisibleChange:yo,onPopupMouseEnter:go},na?Te.cloneElement(na,{ref:Oi}):Te.createElement(dt,(0,$e.Z)({},Pe,{domRef:_i,prefixCls:on,inputElement:Ao,ref:da,id:Ot,showSearch:ha,autoClearSearchValue:qi,mode:$r,activeDescendantId:Ni,tagRender:xn,values:Kn,open:Lr,onToggleOpen:Di,activeValue:ta,searchValue:lo,onSearch:ja,onSearchSubmit:$o,onRemove:As,tokenWithEnter:Ha}))),Yl;return na?Yl=yu:Yl=Te.createElement("div",(0,$e.Z)({className:Is},ka,{ref:Ca,onMouseDown:Ys,onKeyDown:us,onKeyUp:cl,onFocus:zo,onBlur:Ts}),ho&&!Lr&&Te.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(Kn.map(function(Ia){var ma=Ia.label,Ho=Ia.value;return["number","string"].includes((0,pe.Z)(ma))?ma:Ho}).join(", "))),yu,xs,vu&&Xu),Te.createElement(Nt.Provider,{value:Ko},Yl)}),cn=an,fn=function(Pe,Fe){var wt=Te.useRef({values:new Map,options:new Map}),it=Te.useMemo(function(){var on=wt.current,mn=on.values,On=on.options,xn=Pe.map(function(Kn){if(Kn.label===void 0){var mr;return(0,Se.Z)((0,Se.Z)({},Kn),{},{label:(mr=mn.get(Kn.value))===null||mr===void 0?void 0:mr.label})}return Kn}),Qt=new Map,Bn=new Map;return xn.forEach(function(Kn){Qt.set(Kn.value,Kn),Bn.set(Kn.value,Fe.get(Kn.value)||On.get(Kn.value))}),wt.current.values=Qt,wt.current.options=Bn,xn},[Pe,Fe]),Ot=Te.useCallback(function(on){return Fe.get(on)||wt.current.options.get(on)},[Fe]);return[it,Ot]};function In(Pe,Fe){return sa(Pe).join("").toUpperCase().includes(Fe)}var or=function(Pe,Fe,wt,it,Ot){return Te.useMemo(function(){if(!wt||it===!1)return Pe;var on=Fe.options,mn=Fe.label,On=Fe.value,xn=[],Qt=typeof it=="function",Bn=wt.toUpperCase(),Kn=Qt?it:function(Fn,_r){return Ot?In(_r[Ot],Bn):_r[on]?In(_r[mn!=="children"?mn:"label"],Bn):In(_r[On],Bn)},mr=Qt?function(Fn){return ot(Fn)}:function(Fn){return Fn};return Pe.forEach(function(Fn){if(Fn[on]){var _r=Kn(wt,mr(Fn));if(_r)xn.push(Fn);else{var Zr=Fn[on].filter(function(Tr){return Kn(wt,mr(Tr))});Zr.length&&xn.push((0,Se.Z)((0,Se.Z)({},Fn),{},(0,be.Z)({},on,Zr)))}return}Kn(wt,mr(Fn))&&xn.push(Fn)}),xn},[Pe,it,Ot,wt,Fe])},Ut=0,qr=ze();function Fr(){var Pe;return qr?(Pe=Ut,Ut+=1):Pe="TEST_OR_SSR",Pe}function Ri(Pe){var Fe=Te.useState(),wt=(0,Me.Z)(Fe,2),it=wt[0],Ot=wt[1];return Te.useEffect(function(){Ot("rc_select_".concat(Fr()))},[]),Pe||it}function Li(Pe){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt=[];return Te.Children.forEach(Pe,function(it){it==null&&!Fe.keepEmpty||(Array.isArray(it)?wt=wt.concat(Li(it)):(0,Ht.isFragment)(it)&&it.props?wt=wt.concat(Li(it.props.children,Fe)):wt.push(it))}),wt}var pi=["children","value"],Gi=["children"];function yi(Pe){var Fe=Pe,wt=Fe.key,it=Fe.props,Ot=it.children,on=it.value,mn=(0,xe.Z)(it,pi);return(0,Se.Z)({key:wt,value:on!==void 0?on:wt,children:Ot},mn)}function ii(Pe){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Li(Pe).map(function(wt,it){if(!Te.isValidElement(wt)||!wt.type)return null;var Ot=wt,on=Ot.type.isSelectOptGroup,mn=Ot.key,On=Ot.props,xn=On.children,Qt=(0,xe.Z)(On,Gi);return Fe||!on?yi(wt):(0,Se.Z)((0,Se.Z)({key:"__RC_SELECT_GRP__".concat(mn===null?it:mn,"__"),label:mn},Qt),{},{options:ii(xn)})}).filter(function(wt){return wt})}function Bi(Pe,Fe,wt,it,Ot){return Te.useMemo(function(){var on=Pe,mn=!Pe;mn&&(on=ii(Fe));var On=new Map,xn=new Map,Qt=function(mr,Fn,_r){_r&&typeof _r=="string"&&mr.set(Fn[_r],Fn)};function Bn(Kn){for(var mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fn=0;Fn<Kn.length;Fn+=1){var _r=Kn[Fn];!_r[wt.options]||mr?(On.set(_r[wt.value],_r),Qt(xn,_r,wt.label),Qt(xn,_r,it),Qt(xn,_r,Ot)):Bn(_r[wt.options],!0)}}return Bn(on),{options:on,valueOptions:On,labelOptions:xn}},[Pe,Fe,wt,it,Ot])}function Zi(Pe){var Fe=Te.useRef();Fe.current=Pe;var wt=Te.useCallback(function(){return Fe.current.apply(Fe,arguments)},[]);return wt}var Vr=function(){return null};Vr.isSelectOptGroup=!0;var mi=Vr,Wi=function(){return null};Wi.isSelectOption=!0;var la=Wi;function ea(Pe,Fe){var wt=(0,Se.Z)({},Pe);return Array.isArray(Fe)&&Fe.forEach(function(it){delete wt[it]}),wt}var ti=se(73299),yt=Te.createContext(null),pt=yt;function $t(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var sn=["disabled","title","children","style","className"];function _n(Pe){return typeof Pe=="string"||typeof Pe=="number"}var cr=function(Fe,wt){var it=Nn(),Ot=it.prefixCls,on=it.id,mn=it.open,On=it.multiple,xn=it.mode,Qt=it.searchValue,Bn=it.toggleOpen,Kn=it.notFoundContent,mr=it.onPopupScroll,Fn=Te.useContext(pt),_r=Fn.flattenOptions,Zr=Fn.onActiveValue,Tr=Fn.defaultActiveFirstOption,$r=Fn.onSelect,xr=Fn.menuItemSelectedIcon,Pr=Fn.rawValues,Yr=Fn.fieldNames,ai=Fn.virtual,Dr=Fn.direction,li=Fn.listHeight,Pi=Fn.listItemHeight,ta="".concat(Ot,"-item"),Vi=Dt(function(){return _r},[mn,_r],function(ki,Jr){return Jr[0]&&ki[1]!==Jr[1]}),Ni=Te.useRef(null),Xi=function(Jr){Jr.preventDefault()},qi=function(Jr){Ni.current&&Ni.current.scrollTo(typeof Jr=="number"?{index:Jr}:Jr)},bi=function(Jr){for(var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ca=Vi.length,Ui=0;Ui<ca;Ui+=1){var ia=(Jr+Ui*zi+ca)%ca,fi=Vi[ia],pa=fi.group,xa=fi.data;if(!pa&&!xa.disabled)return ia}return-1},Fi=Te.useState(function(){return bi(0)}),jr=(0,Me.Z)(Fi,2),ci=jr[0],Ti=jr[1],ji=function(Jr){var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ti(Jr);var ca={source:zi?"keyboard":"mouse"},Ui=Vi[Jr];if(!Ui){Zr(null,-1,ca);return}Zr(Ui.value,Jr,ca)};(0,Te.useEffect)(function(){ji(Tr!==!1?bi(0):-1)},[Vi.length,Qt]);var Na=Te.useCallback(function(ki){return Pr.has(ki)&&xn!=="combobox"},[xn,(0,Ue.Z)(Pr).toString(),Pr.size]);(0,Te.useEffect)(function(){var ki=setTimeout(function(){if(!On&&mn&&Pr.size===1){var zi=Array.from(Pr)[0],ca=Vi.findIndex(function(Ui){var ia=Ui.data;return ia.value===zi});ca!==-1&&(ji(ca),qi(ca))}});if(mn){var Jr;(Jr=Ni.current)===null||Jr===void 0||Jr.scrollTo(void 0)}return function(){return clearTimeout(ki)}},[mn,Qt,_r.length]);var Fa=function(Jr){Jr!==void 0&&$r(Jr,{selected:!Pr.has(Jr)}),On||Bn(!1)};if(Te.useImperativeHandle(wt,function(){return{onKeyDown:function(Jr){var zi=Jr.which,ca=Jr.ctrlKey;switch(zi){case Ge.N:case Ge.P:case Ge.UP:case Ge.DOWN:{var Ui=0;if(zi===Ge.UP?Ui=-1:zi===Ge.DOWN?Ui=1:$t()&&ca&&(zi===Ge.N?Ui=1:zi===Ge.P&&(Ui=-1)),Ui!==0){var ia=bi(ci+Ui,Ui);qi(ia),ji(ia,!0)}break}case Ge.ENTER:{var fi=Vi[ci];fi&&!fi.data.disabled?Fa(fi.value):Fa(void 0),mn&&Jr.preventDefault();break}case Ge.ESC:Bn(!1),mn&&Jr.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Jr){qi(Jr)}}}),Vi.length===0)return Te.createElement("div",{role:"listbox",id:"".concat(on,"_list"),className:"".concat(ta,"-empty"),onMouseDown:Xi},Kn);var Aa=Object.keys(Yr).map(function(ki){return Yr[ki]}),ua=function(Jr){return Jr.label};function Yi(ki,Jr){var zi=ki.group;return{role:zi?"presentation":"option",id:"".concat(on,"_list_").concat(Jr)}}var Mi=function(Jr){var zi=Vi[Jr];if(!zi)return null;var ca=zi.data||{},Ui=ca.value,ia=zi.group,fi=bn(ca,!0),pa=ua(zi);return zi?Te.createElement("div",(0,$e.Z)({"aria-label":typeof pa=="string"&&!ia?pa:null},fi,{key:Jr},Yi(zi,Jr),{"aria-selected":Na(Ui)}),Ui):null},Oa={role:"listbox",id:"".concat(on,"_list")};return Te.createElement(Te.Fragment,null,ai&&Te.createElement("div",(0,$e.Z)({},Oa,{style:{height:0,width:0,overflow:"hidden"}}),Mi(ci-1),Mi(ci),Mi(ci+1)),Te.createElement(ti.Z,{itemKey:"key",ref:Ni,data:Vi,height:li,itemHeight:Pi,fullHeight:!1,onMouseDown:Xi,onScroll:mr,virtual:ai,direction:Dr,innerProps:ai?null:Oa},function(ki,Jr){var zi,ca=ki.group,Ui=ki.groupOption,ia=ki.data,fi=ki.label,pa=ki.value,xa=ia.key;if(ca){var fa,wa=(fa=ia.title)!==null&&fa!==void 0?fa:_n(fi)?fi.toString():void 0;return Te.createElement("div",{className:et()(ta,"".concat(ta,"-group")),title:wa},fi!==void 0?fi:xa)}var Ea=ia.disabled,Va=ia.title,ha=ia.children,ka=ia.style,Ja=ia.className,Ga=(0,xe.Z)(ia,sn),so=ea(Ga,Aa),$a=Na(pa),Ca="".concat(ta,"-option"),_i=et()(ta,Ca,Ja,(zi={},(0,be.Z)(zi,"".concat(Ca,"-grouped"),Ui),(0,be.Z)(zi,"".concat(Ca,"-active"),ci===Jr&&!Ea),(0,be.Z)(zi,"".concat(Ca,"-disabled"),Ea),(0,be.Z)(zi,"".concat(Ca,"-selected"),$a),zi)),Ki=ua(ki),da=!xr||typeof xr=="function"||$a,Sa=typeof Ki=="number"?Ki:Ki||pa,Ka=_n(Sa)?Sa.toString():void 0;return Va!==void 0&&(Ka=Va),Te.createElement("div",(0,$e.Z)({},bn(so),ai?{}:Yi(ki,Jr),{"aria-selected":$a,className:_i,title:Ka,onMouseMove:function(){ci===Jr||Ea||ji(Jr)},onClick:function(){Ea||Fa(pa)},style:ka}),Te.createElement("div",{className:"".concat(Ca,"-content")},Sa),Te.isValidElement(xr)||$a,da&&Te.createElement(Qe,{className:"".concat(ta,"-option-state"),customizeIcon:xr,customizeIconProps:{isSelected:$a}},$a?"\u2713":null))}))},Mr=Te.forwardRef(cr);Mr.displayName="OptionList";var Br=Mr;function Kr(Pe){var Fe=Pe.mode,wt=Pe.options,it=Pe.children,Ot=Pe.backfill,on=Pe.allowClear,mn=Pe.placeholder,On=Pe.getInputElement,xn=Pe.showSearch,Qt=Pe.onSearch,Bn=Pe.defaultOpen,Kn=Pe.autoFocus,mr=Pe.labelInValue,Fn=Pe.value,_r=Pe.inputValue,Zr=Pe.optionLabelProp,Tr=isMultiple(Fe),$r=xn!==void 0?xn:Tr||Fe==="combobox",xr=wt||convertChildrenToData(it);if(warning(Fe!=="tags"||xr.every(function(Dr){return!Dr.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Fe==="tags"||Fe==="combobox"){var Pr=xr.some(function(Dr){return Dr.options?Dr.options.some(function(li){return typeof("value"in li?li.value:li.key)=="number"}):typeof("value"in Dr?Dr.value:Dr.key)=="number"});warning(!Pr,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Fe!=="combobox"||!Zr,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Fe==="combobox"||!Ot,"`backfill` only works with `combobox` mode."),warning(Fe==="combobox"||!On,"`getInputElement` only work with `combobox` mode."),noteOnce(Fe!=="combobox"||!On||!on||!mn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Qt&&!$r&&Fe!=="combobox"&&Fe!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Bn||Kn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Fn!=null){var Yr=toArray(Fn);warning(!mr||Yr.every(function(Dr){return _typeof(Dr)==="object"&&("key"in Dr||"value"in Dr)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Tr||Array.isArray(Fn),"`value` should be array when `mode` is `multiple` or `tags`")}if(it){var ai=null;toNodeArray(it).some(function(Dr){if(!React.isValidElement(Dr)||!Dr.type)return!1;var li=Dr,Pi=li.type;if(Pi.isSelectOption)return!1;if(Pi.isSelectOptGroup){var ta=toNodeArray(Dr.props.children).every(function(Vi){return!React.isValidElement(Vi)||!Dr.type||Vi.type.isSelectOption?!0:(ai=Vi.type,!1)});return!ta}return ai=Pi,!0}),ai&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ai.displayName||ai.name||ai,"`.")),warning(_r===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Rr(Pe,Fe){if(Pe){var wt=function it(Ot){for(var on=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,mn=0;mn<Ot.length;mn++){var On=Ot[mn];if(On[Fe==null?void 0:Fe.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!on&&Array.isArray(On[Fe==null?void 0:Fe.options])&&it(On[Fe==null?void 0:Fe.options],!0))break}};wt(Pe)}}var Qr=null,gi=["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"],Cr=["inputValue"];function di(Pe){return!Pe||(0,pe.Z)(Pe)!=="object"}var Ai=Te.forwardRef(function(Pe,Fe){var wt=Pe.id,it=Pe.mode,Ot=Pe.prefixCls,on=Ot===void 0?"rc-select":Ot,mn=Pe.backfill,On=Pe.fieldNames,xn=Pe.inputValue,Qt=Pe.searchValue,Bn=Pe.onSearch,Kn=Pe.autoClearSearchValue,mr=Kn===void 0?!0:Kn,Fn=Pe.onSelect,_r=Pe.onDeselect,Zr=Pe.dropdownMatchSelectWidth,Tr=Zr===void 0?!0:Zr,$r=Pe.filterOption,xr=Pe.filterSort,Pr=Pe.optionFilterProp,Yr=Pe.optionLabelProp,ai=Pe.options,Dr=Pe.children,li=Pe.defaultActiveFirstOption,Pi=Pe.menuItemSelectedIcon,ta=Pe.virtual,Vi=Pe.direction,Ni=Pe.listHeight,Xi=Ni===void 0?200:Ni,qi=Pe.listItemHeight,bi=qi===void 0?20:qi,Fi=Pe.value,jr=Pe.defaultValue,ci=Pe.labelInValue,Ti=Pe.onChange,ji=(0,xe.Z)(Pe,gi),Na=Ri(wt),Fa=Dn(it),Aa=!!(!ai&&Dr),ua=Te.useMemo(function(){return $r===void 0&&it==="combobox"?!1:$r},[$r,it]),Yi=Te.useMemo(function(){return nr(On,Aa)},[JSON.stringify(On),Aa]),Mi=At("",{value:Qt!==void 0?Qt:xn,postState:function(xi){return xi||""}}),Oa=(0,Me.Z)(Mi,2),ki=Oa[0],Jr=Oa[1],zi=Bi(ai,Dr,Yi,Pr,Yr),ca=zi.valueOptions,Ui=zi.labelOptions,ia=zi.options,fi=Te.useCallback(function(Lr){var xi=sa(Lr);return xi.map(function(wi){var Di,Ha,ja,$o,Uo;if(di(wi))Di=wi;else{var ls;ja=wi.key,Ha=wi.label,Di=(ls=wi.value)!==null&&ls!==void 0?ls:ja}var va=ca.get(Di);if(va){var Bo;if(Ha===void 0&&(Ha=va==null?void 0:va[Yr||Yi.label]),ja===void 0&&(ja=(Bo=va==null?void 0:va.key)!==null&&Bo!==void 0?Bo:Di),$o=va==null?void 0:va.disabled,Uo=va==null?void 0:va.title,0)var us}return{label:Ha,value:Di,key:ja,disabled:$o,title:Uo}})},[Yi,Yr,ca]),pa=At(jr,{value:Fi}),xa=(0,Me.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Te.useMemo(function(){var Lr,xi=fi(fa);return it==="combobox"&>((Lr=xi[0])===null||Lr===void 0?void 0:Lr.value)?[]:xi},[fa,fi,it]),Va=fn(Ea,ca),ha=(0,Me.Z)(Va,2),ka=ha[0],Ja=ha[1],Ga=Te.useMemo(function(){if(!it&&ka.length===1){var Lr=ka[0];if(Lr.value===null&&(Lr.label===null||Lr.label===void 0))return[]}return ka.map(function(xi){var wi;return(0,Se.Z)((0,Se.Z)({},xi),{},{label:(wi=xi.label)!==null&&wi!==void 0?wi:xi.value})})},[it,ka]),so=Te.useMemo(function(){return new Set(ka.map(function(Lr){return Lr.value}))},[ka]);Te.useEffect(function(){if(it==="combobox"){var Lr,xi=(Lr=ka[0])===null||Lr===void 0?void 0:Lr.value;Jr(Ci(xi)?String(xi):"")}},[ka]);var $a=Zi(function(Lr,xi){var wi,Di=xi!=null?xi:Lr;return wi={},(0,be.Z)(wi,Yi.value,Lr),(0,be.Z)(wi,Yi.label,Di),wi}),Ca=Te.useMemo(function(){if(it!=="tags")return ia;var Lr=(0,Ue.Z)(ia),xi=function(Di){return ca.has(Di)};return(0,Ue.Z)(ka).sort(function(wi,Di){return wi.value<Di.value?-1:1}).forEach(function(wi){var Di=wi.value;xi(Di)||Lr.push($a(Di,wi.label))}),Lr},[$a,ia,ca,ka,it]),_i=or(Ca,Yi,ki,ua,Pr),Ki=Te.useMemo(function(){return it!=="tags"||!ki||_i.some(function(Lr){return Lr[Pr||"value"]===ki})||_i.some(function(Lr){return Lr[Yi.value]===ki})?_i:[$a(ki)].concat((0,Ue.Z)(_i))},[$a,Pr,it,_i,ki,Yi]),da=Te.useMemo(function(){return xr?(0,Ue.Z)(Ki).sort(function(Lr,xi){return xr(Lr,xi)}):Ki},[Ki,xr]),Sa=Te.useMemo(function(){return ar(da,{fieldNames:Yi,childrenAsData:Aa})},[da,Yi,Aa]),Ka=function(xi){var wi=fi(xi);if(wa(wi),Ti&&(wi.length!==ka.length||wi.some(function(ja,$o){var Uo;return((Uo=ka[$o])===null||Uo===void 0?void 0:Uo.value)!==(ja==null?void 0:ja.value)}))){var Di=ci?wi:wi.map(function(ja){return ja.value}),Ha=wi.map(function(ja){return ot(Ja(ja.value))});Ti(Fa?Di:Di[0],Fa?Ha:Ha[0])}},io=Te.useState(null),ho=(0,Me.Z)(io,2),Oo=ho[0],Ro=ho[1],lo=Te.useState(0),Ao=(0,Me.Z)(lo,2),na=Ao[0],Oi=Ao[1],Ta=li!==void 0?li:it!=="combobox",_a=Te.useCallback(function(Lr,xi){var wi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Di=wi.source,Ha=Di===void 0?"keyboard":Di;Oi(xi),mn&&it==="combobox"&&Lr!==null&&Ha==="keyboard"&&Ro(String(Lr))},[mn,it]),uo=function(xi,wi,Di){var Ha=function(){var ms,zo=Ja(xi);return[ci?{label:zo==null?void 0:zo[Yi.label],value:xi,key:(ms=zo==null?void 0:zo.key)!==null&&ms!==void 0?ms:xi}:xi,ot(zo)]};if(wi&&Fn){var ja=Ha(),$o=(0,Me.Z)(ja,2),Uo=$o[0],ls=$o[1];Fn(Uo,ls)}else if(!wi&&_r&&Di!=="clear"){var va=Ha(),Bo=(0,Me.Z)(va,2),us=Bo[0],cl=Bo[1];_r(us,cl)}},ao=Zi(function(Lr,xi){var wi,Di=Fa?xi.selected:!0;Di?wi=Fa?[].concat((0,Ue.Z)(ka),[Lr]):[Lr]:wi=ka.filter(function(Ha){return Ha.value!==Lr}),Ka(wi),uo(Lr,Di),it==="combobox"?Ro(""):(!Dn||mr)&&(Jr(""),Ro(""))}),hs=function(xi,wi){Ka(xi);var Di=wi.type,Ha=wi.values;(Di==="remove"||Di==="clear")&&Ha.forEach(function(ja){uo(ja.value,!1,Di)})},Qo=function(xi,wi){if(Jr(xi),Ro(null),wi.source==="submit"){var Di=(xi||"").trim();if(Di){var Ha=Array.from(new Set([].concat((0,Ue.Z)(so),[Di])));Ka(Ha),uo(Di,!0),Jr("")}return}wi.source!=="blur"&&(it==="combobox"&&Ka(xi),Bn==null||Bn(xi))},ps=function(xi){var wi=xi;it!=="tags"&&(wi=xi.map(function(Ha){var ja=Ui.get(Ha);return ja==null?void 0:ja.value}).filter(function(Ha){return Ha!==void 0}));var Di=Array.from(new Set([].concat((0,Ue.Z)(so),(0,Ue.Z)(wi))));Ka(Di),Di.forEach(function(Ha){uo(Ha,!0)})},aa=Te.useMemo(function(){var Lr=ta!==!1&&Tr!==!1;return(0,Se.Z)((0,Se.Z)({},zi),{},{flattenOptions:Sa,onActiveValue:_a,defaultActiveFirstOption:Ta,onSelect:ao,menuItemSelectedIcon:Pi,rawValues:so,fieldNames:Yi,virtual:Lr,direction:Vi,listHeight:Xi,listItemHeight:bi,childrenAsData:Aa})},[zi,Sa,_a,Ta,ao,Pi,so,Yi,ta,Tr,Xi,bi,Aa]);return Te.createElement(pt.Provider,{value:aa},Te.createElement(cn,(0,$e.Z)({},ji,{id:Na,prefixCls:on,ref:Fe,omitDomProps:Cr,mode:it,displayValues:Ga,onDisplayValuesChange:hs,direction:Vi,searchValue:ki,onSearch:Qo,autoClearSearchValue:mr,onSearchSplit:ps,dropdownMatchSelectWidth:Tr,OptionList:Br,emptyOptions:!Sa.length,activeValue:Oo,activeDescendantId:"".concat(Na,"_list_").concat(na)})))}),Si=Ai;Si.Option=la,Si.OptGroup=mi;var _e=Si,Be=_e,Ne=se(10366),We=se(8745),qe=se(33603),rt=se(9708),bt=se(53124),Gt=se(98866),nn=se(88258),Gn=se(98675),fr=se(65223),Wn=se(4173),vn=se(87244),hn=se(13458),Sn=se(78642),Pn=se(46163),ur=function(Pe,Fe){var wt={};for(var it in Pe)Object.prototype.hasOwnProperty.call(Pe,it)&&Fe.indexOf(it)<0&&(wt[it]=Pe[it]);if(Pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ot=0,it=Object.getOwnPropertySymbols(Pe);Ot<it.length;Ot++)Fe.indexOf(it[Ot])<0&&Object.prototype.propertyIsEnumerable.call(Pe,it[Ot])&&(wt[it[Ot]]=Pe[it[Ot]]);return wt};const jn="SECRET_COMBOBOX_MODE_DO_NOT_USE",Zn=(Pe,Fe)=>{var wt,{prefixCls:it,bordered:Ot=!0,className:on,rootClassName:mn,getPopupContainer:On,popupClassName:xn,dropdownClassName:Qt,listHeight:Bn=256,placement:Kn,listItemHeight:mr=24,size:Fn,disabled:_r,notFoundContent:Zr,status:Tr,builtinPlacements:$r,dropdownMatchSelectWidth:xr,popupMatchSelectWidth:Pr,direction:Yr,style:ai,allowClear:Dr}=Pe,li=ur(Pe,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Pi,getPrefixCls:ta,renderEmpty:Vi,direction:Ni,virtual:Xi,popupMatchSelectWidth:qi,popupOverflow:bi,select:Fi}=Te.useContext(bt.E_),jr=ta("select",it),ci=ta(),Ti=Yr!=null?Yr:Ni,{compactSize:ji,compactItemClassnames:Na}=(0,Wn.ri)(jr,Ti),[Fa,Aa]=(0,vn.Z)(jr),ua=Te.useMemo(()=>{const{mode:Ca}=li;if(Ca!=="combobox")return Ca===jn?"combobox":Ca},[li.mode]),Yi=ua==="multiple"||ua==="tags",Mi=(0,Sn.Z)(li.suffixIcon,li.showArrow),Oa=(wt=Pr!=null?Pr:xr)!==null&&wt!==void 0?wt:qi,{status:ki,hasFeedback:Jr,isFormItemInput:zi,feedbackIcon:ca}=Te.useContext(fr.aM),Ui=(0,rt.F)(ki,Tr);let ia;Zr!==void 0?ia=Zr:ua==="combobox"?ia=null:ia=(Vi==null?void 0:Vi("Select"))||Te.createElement(nn.Z,{componentName:"Select"});const{suffixIcon:fi,itemIcon:pa,removeIcon:xa,clearIcon:fa}=(0,Pn.Z)(Object.assign(Object.assign({},li),{multiple:Yi,hasFeedback:Jr,feedbackIcon:ca,showSuffixIcon:Mi,prefixCls:jr,showArrow:li.showArrow,componentName:"Select"})),wa=Dr===!0?{clearIcon:fa}:Dr,Ea=(0,Ne.Z)(li,["suffixIcon","itemIcon"]),Va=et()(xn||Qt,{[`${jr}-dropdown-${Ti}`]:Ti==="rtl"},mn,Aa),ha=(0,Gn.Z)(Ca=>{var _i;return(_i=Fn!=null?Fn:ji)!==null&&_i!==void 0?_i:Ca}),ka=Te.useContext(Gt.Z),Ja=_r!=null?_r:ka,Ga=et()({[`${jr}-lg`]:ha==="large",[`${jr}-sm`]:ha==="small",[`${jr}-rtl`]:Ti==="rtl",[`${jr}-borderless`]:!Ot,[`${jr}-in-form-item`]:zi},(0,rt.Z)(jr,Ui,Jr),Na,Fi==null?void 0:Fi.className,on,mn,Aa),so=Te.useMemo(()=>Kn!==void 0?Kn:Ti==="rtl"?"bottomRight":"bottomLeft",[Kn,Ti]),$a=(0,hn.Z)($r,bi);return Fa(Te.createElement(Be,Object.assign({ref:Fe,virtual:Xi,showSearch:Fi==null?void 0:Fi.showSearch},Ea,{style:Object.assign(Object.assign({},Fi==null?void 0:Fi.style),ai),dropdownMatchSelectWidth:Oa,builtinPlacements:$a,transitionName:(0,qe.m)(ci,"slide-up",li.transitionName),listHeight:Bn,listItemHeight:mr,mode:ua,prefixCls:jr,placement:so,direction:Ti,suffixIcon:fi,menuItemSelectedIcon:pa,removeIcon:xa,allowClear:wa,notFoundContent:ia,className:Ga,getPopupContainer:On||Pi,dropdownClassName:Va,disabled:Ja})))},Jn=Te.forwardRef(Zn),Qn=(0,We.Z)(Jn);Jn.SECRET_COMBOBOX_MODE_DO_NOT_USE=jn,Jn.Option=la,Jn.OptGroup=mi,Jn._InternalPanelDoNotUseOrYouWillBeFired=Qn;var hr=Jn},87244:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Ie}});var fe=se(14747),et=se(80110),$e=se(45503),Ue=se(67968),be=se(67771),Se=se(33297);const Me=ke=>{const{optionHeight:je,optionFontSize:Xe,optionLineHeight:Pt,optionPadding:kt}=ke;return{position:"relative",display:"block",minHeight:je,padding:kt,color:ke.colorText,fontWeight:"normal",fontSize:Xe,lineHeight:Pt,boxSizing:"border-box"}};var pe=ke=>{const{antCls:je,componentCls:Xe}=ke,Pt=`${Xe}-item`,kt=`&${je}-slide-up-enter${je}-slide-up-enter-active`,Lt=`&${je}-slide-up-appear${je}-slide-up-appear-active`,Ge=`&${je}-slide-up-leave${je}-slide-up-leave-active`,Ht=`${Xe}-dropdown-placement-`;return[{[`${Xe}-dropdown`]:Object.assign(Object.assign({},(0,fe.Wf)(ke)),{position:"absolute",top:-9999,zIndex:ke.zIndexPopup,boxSizing:"border-box",padding:ke.paddingXXS,overflow:"hidden",fontSize:ke.fontSize,fontVariant:"initial",backgroundColor:ke.colorBgElevated,borderRadius:ke.borderRadiusLG,outline:"none",boxShadow:ke.boxShadowSecondary,[`
|
|
|
${kt}${Ht}bottomLeft,
|
|
|
${Lt}${Ht}bottomLeft
|
|
|
`]:{animationName:be.fJ},[`
|
|
|
${kt}${Ht}topLeft,
|
|
|
${Lt}${Ht}topLeft,
|
|
|
${kt}${Ht}topRight,
|
|
|
${Lt}${Ht}topRight
|
|
|
`]:{animationName:be.Qt},[`${Ge}${Ht}bottomLeft`]:{animationName:be.Uw},[`
|
|
|
${Ge}${Ht}topLeft,
|
|
|
${Ge}${Ht}topRight
|
|
|
`]:{animationName:be.ly},"&-hidden":{display:"none"},[`${Pt}`]:Object.assign(Object.assign({},Me(ke)),{cursor:"pointer",transition:`background ${ke.motionDurationSlow} ease`,borderRadius:ke.borderRadiusSM,"&-group":{color:ke.colorTextDescription,fontSize:ke.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},fe.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Pt}-option-disabled)`]:{backgroundColor:ke.optionActiveBg},[`&-selected:not(${Pt}-option-disabled)`]:{color:ke.optionSelectedColor,fontWeight:ke.optionSelectedFontWeight,backgroundColor:ke.optionSelectedBg,[`${Pt}-option-state`]:{color:ke.colorPrimary}},"&-disabled":{[`&${Pt}-option-selected`]:{backgroundColor:ke.colorBgContainerDisabled},color:ke.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:ke.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,be.oN)(ke,"slide-up"),(0,be.oN)(ke,"slide-down"),(0,Se.Fm)(ke,"move-up"),(0,Se.Fm)(ke,"move-down")]};const Te=2,mt=ke=>{let{controlHeightSM:je,controlHeight:Xe,lineWidth:Pt}=ke;const kt=(Xe-je)/2-Pt,Lt=Math.ceil(kt/2);return[kt,Lt]};function ze(ke,je){const{componentCls:Xe,iconCls:Pt}=ke,kt=`${Xe}-selection-overflow`,Lt=ke.multipleSelectItemHeight,[Ge]=mt(ke),Ht=je?`${Xe}-${je}`:"";return{[`${Xe}-multiple${Ht}`]:{fontSize:ke.fontSize,[kt]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Xe}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${Ge-Te}px ${Te*2}px`,borderRadius:ke.borderRadius,[`${Xe}-show-search&`]:{cursor:"text"},[`${Xe}-disabled&`]:{background:ke.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Te}px 0`,lineHeight:`${Lt}px`,visibility:"hidden",content:'"\\a0"'}},[`
|
|
|
&${Xe}-show-arrow ${Xe}-selector,
|
|
|
&${Xe}-allow-clear ${Xe}-selector
|
|
|
`]:{paddingInlineEnd:ke.fontSizeIcon+ke.controlPaddingHorizontal},[`${Xe}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Lt,marginTop:Te,marginBottom:Te,lineHeight:`${Lt-ke.lineWidth*2}px`,background:ke.multipleItemBg,border:`${ke.lineWidth}px ${ke.lineType} ${ke.multipleItemBorderColor}`,borderRadius:ke.borderRadiusSM,cursor:"default",transition:`font-size ${ke.motionDurationSlow}, line-height ${ke.motionDurationSlow}, height ${ke.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Te*2,paddingInlineStart:ke.paddingXS,paddingInlineEnd:ke.paddingXS/2,[`${Xe}-disabled&`]:{color:ke.multipleItemColorDisabled,borderColor:ke.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:ke.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,fe.Ro)()),{display:"inline-flex",alignItems:"center",color:ke.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Pt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:ke.colorIconHover}})},[`${kt}-item + ${kt}-item`]:{[`${Xe}-selection-search`]:{marginInlineStart:0}},[`${Xe}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:ke.inputPaddingHorizontalBase-Ge,"\n &-input,\n &-mirror\n ":{height:Lt,fontFamily:ke.fontFamily,lineHeight:`${Lt}px`,transition:`all ${ke.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Xe}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:ke.inputPaddingHorizontalBase,insetInlineEnd:ke.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${ke.motionDurationSlow}`}}}}var Ct=ke=>{const{componentCls:je}=ke,Xe=(0,$e.TS)(ke,{controlHeight:ke.controlHeightSM,multipleSelectItemHeight:ke.controlHeightXS,borderRadius:ke.borderRadiusSM,borderRadiusSM:ke.borderRadiusXS}),Pt=(0,$e.TS)(ke,{fontSize:ke.fontSizeLG,controlHeight:ke.controlHeightLG,multipleSelectItemHeight:ke.multipleItemHeightLG,borderRadius:ke.borderRadiusLG,borderRadiusSM:ke.borderRadius}),[,kt]=mt(ke);return[ze(ke),ze(Xe,"sm"),{[`${je}-multiple${je}-sm`]:{[`${je}-selection-placeholder`]:{insetInline:ke.controlPaddingHorizontalSM-ke.lineWidth},[`${je}-selection-search`]:{marginInlineStart:kt}}},ze(Pt,"lg")]};function ht(ke,je){const{componentCls:Xe,inputPaddingHorizontalBase:Pt,borderRadius:kt}=ke,Lt=ke.controlHeight-ke.lineWidth*2,Ge=Math.ceil(ke.fontSize*1.25),Ht=je?`${Xe}-${je}`:"";return{[`${Xe}-single${Ht}`]:{fontSize:ke.fontSize,[`${Xe}-selector`]:Object.assign(Object.assign({},(0,fe.Wf)(ke)),{display:"flex",borderRadius:kt,[`${Xe}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Pt,insetInlineEnd:Pt,bottom:0,"&-input":{width:"100%"}},[`
|
|
|
${Xe}-selection-item,
|
|
|
${Xe}-selection-placeholder
|
|
|
`]:{padding:0,lineHeight:`${Lt}px`,transition:`all ${ke.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Lt}px`}},[`${Xe}-selection-item`]:{position:"relative",userSelect:"none"},[`${Xe}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Xe}-selection-item:after`,`${Xe}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
|
&${Xe}-show-arrow ${Xe}-selection-item,
|
|
|
&${Xe}-show-arrow ${Xe}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:Ge},[`&${Xe}-open ${Xe}-selection-item`]:{color:ke.colorTextPlaceholder},[`&:not(${Xe}-customize-input)`]:{[`${Xe}-selector`]:{width:"100%",height:ke.controlHeight,padding:`0 ${Pt}px`,[`${Xe}-selection-search-input`]:{height:Lt},"&:after":{lineHeight:`${Lt}px`}}},[`&${Xe}-customize-input`]:{[`${Xe}-selector`]:{"&:after":{display:"none"},[`${Xe}-selection-search`]:{position:"static",width:"100%"},[`${Xe}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Pt}px`,"&:after":{display:"none"}}}}}}}function Ye(ke){const{componentCls:je}=ke,Xe=ke.controlPaddingHorizontalSM-ke.lineWidth;return[ht(ke),ht((0,$e.TS)(ke,{controlHeight:ke.controlHeightSM,borderRadius:ke.borderRadiusSM}),"sm"),{[`${je}-single${je}-sm`]:{[`&:not(${je}-customize-input)`]:{[`${je}-selection-search`]:{insetInlineStart:Xe,insetInlineEnd:Xe},[`${je}-selector`]:{padding:`0 ${Xe}px`},[`&${je}-show-arrow ${je}-selection-search`]:{insetInlineEnd:Xe+ke.fontSize*1.5},[`
|
|
|
&${je}-show-arrow ${je}-selection-item,
|
|
|
&${je}-show-arrow ${je}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:ke.fontSize*1.5}}}},ht((0,$e.TS)(ke,{controlHeight:ke.singleItemHeightLG,fontSize:ke.fontSizeLG,borderRadius:ke.borderRadiusLG}),"lg")]}const De=ke=>{const{componentCls:je,selectorBg:Xe}=ke;return{position:"relative",backgroundColor:Xe,border:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`,transition:`all ${ke.motionDurationMid} ${ke.motionEaseInOut}`,input:{cursor:"pointer"},[`${je}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${je}-disabled&`]:{color:ke.colorTextDisabled,background:ke.colorBgContainerDisabled,cursor:"not-allowed",[`${je}-multiple&`]:{background:ke.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},At=function(ke,je){let Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Pt,borderHoverColor:kt,outlineColor:Lt,antCls:Ge}=je,Ht=Xe?{[`${Pt}-selector`]:{borderColor:kt}}:{};return{[ke]:{[`&:not(${Pt}-disabled):not(${Pt}-customize-input):not(${Ge}-pagination-size-changer)`]:Object.assign(Object.assign({},Ht),{[`${Pt}-focused& ${Pt}-selector`]:{borderColor:kt,boxShadow:`0 0 0 ${je.controlOutlineWidth}px ${Lt}`,outline:0},[`&:hover ${Pt}-selector`]:{borderColor:kt}})}}},Jt=ke=>{const{componentCls:je}=ke;return{[`${je}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},nt=ke=>{const{componentCls:je,inputPaddingHorizontalBase:Xe,iconCls:Pt}=ke;return{[je]:Object.assign(Object.assign({},(0,fe.Wf)(ke)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${je}-customize-input) ${je}-selector`]:Object.assign(Object.assign({},De(ke)),Jt(ke)),[`${je}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},fe.vS),[`${je}-selection-placeholder`]:Object.assign(Object.assign({},fe.vS),{flex:1,color:ke.colorTextPlaceholder,pointerEvents:"none"}),[`${je}-arrow`]:Object.assign(Object.assign({},(0,fe.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,height:ke.fontSizeIcon,marginTop:-ke.fontSizeIcon/2,color:ke.colorTextQuaternary,fontSize:ke.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Pt]:{verticalAlign:"top",transition:`transform ${ke.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${je}-suffix)`]:{pointerEvents:"auto"}},[`${je}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${je}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,zIndex:1,display:"inline-block",width:ke.fontSizeIcon,height:ke.fontSizeIcon,marginTop:-ke.fontSizeIcon/2,color:ke.colorTextQuaternary,fontSize:ke.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:ke.clearBg,cursor:"pointer",opacity:0,transition:`color ${ke.motionDurationMid} ease, opacity ${ke.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:ke.colorTextTertiary}},"&:hover":{[`${je}-clear`]:{opacity:1}}}),[`${je}-has-feedback`]:{[`${je}-clear`]:{insetInlineEnd:Xe+ke.fontSize+ke.paddingXS}}}},lt=ke=>{const{componentCls:je}=ke;return[{[je]:{[`&-borderless ${je}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${je}-in-form-item`]:{width:"100%"}}},nt(ke),Ye(ke),Ct(ke),pe(ke),{[`${je}-rtl`]:{direction:"rtl"}},At(je,(0,$e.TS)(ke,{borderHoverColor:ke.colorPrimaryHover,outlineColor:ke.controlOutline})),At(`${je}-status-error`,(0,$e.TS)(ke,{borderHoverColor:ke.colorErrorHover,outlineColor:ke.colorErrorOutline}),!0),At(`${je}-status-warning`,(0,$e.TS)(ke,{borderHoverColor:ke.colorWarningHover,outlineColor:ke.colorWarningOutline}),!0),(0,et.c)(ke,{borderElCls:`${je}-selector`,focusElCls:`${je}-focused`})]};var Ie=(0,Ue.Z)("Select",(ke,je)=>{let{rootPrefixCls:Xe}=je;const Pt=(0,$e.TS)(ke,{rootPrefixCls:Xe,inputPaddingHorizontalBase:ke.paddingSM-1,multipleSelectItemHeight:ke.multipleItemHeight});return[lt(Pt)]},ke=>{const{fontSize:je,lineHeight:Xe,controlHeight:Pt,controlPaddingHorizontal:kt,zIndexPopupBase:Lt,colorText:Ge,fontWeightStrong:Ht,controlItemBgActive:Dt,controlItemBgHover:Ln,colorBgContainer:un,colorFillSecondary:Rn,controlHeightLG:ir,controlHeightSM:yr,colorBgContainerDisabled:Qe,colorTextDisabled:Le}=ke;return{zIndexPopup:Lt+50,optionSelectedColor:Ge,optionSelectedFontWeight:Ht,optionSelectedBg:Dt,optionActiveBg:Ln,optionPadding:`${(Pt-je*Xe)/2}px ${kt}px`,optionFontSize:je,optionLineHeight:Xe,optionHeight:Pt,selectorBg:un,clearBg:un,singleItemHeightLG:ir,multipleItemBg:Rn,multipleItemBorderColor:"transparent",multipleItemHeight:yr,multipleItemHeightLG:Pt,multipleSelectorBgDisabled:Qe,multipleItemColorDisabled:Le,multipleItemBorderColorDisabled:"transparent"}})},13458:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});const fe=$e=>{const be={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:$e==="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 et($e,Ue){return $e||fe(Ue)}},78642:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return fe}});function fe(et,$e){return $e!==void 0?$e:et!==null}},46163:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return xe}});var fe=se(18299),et=se(16646),$e=se(73475),Ue=se(42922),be=se(3407),Se=se(72395),Me=se(67294);function xe(pe){let{suffixIcon:Te,clearIcon:mt,menuItemSelectedIcon:ze,removeIcon:It,loading:Ct,multiple:ht,hasFeedback:Ye,prefixCls:De,showSuffixIcon:At,feedbackIcon:Jt,showArrow:nt,componentName:lt}=pe;const Ie=mt!=null?mt:Me.createElement(et.Z,null),ke=kt=>Te===null&&!Ye&&!nt?null:Me.createElement(Me.Fragment,null,At!==!1&&kt,Ye&&Jt);let je=null;if(Te!==void 0)je=ke(Te);else if(Ct)je=ke(Me.createElement(be.Z,{spin:!0}));else{const kt=`${De}-suffix`;je=Lt=>{let{open:Ge,showSearch:Ht}=Lt;return ke(Ge&&Ht?Me.createElement(Se.Z,{className:kt}):Me.createElement(Ue.Z,{className:kt}))}}let Xe=null;ze!==void 0?Xe=ze:ht?Xe=Me.createElement(fe.Z,null):Xe=null;let Pt=null;return It!==void 0?Pt=It:Pt=Me.createElement($e.Z,null),{clearIcon:Ie,suffixIcon:je,itemIcon:Xe,removeIcon:Pt}}},33507:function(Cn,Xt){"use strict";const se=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`}}});Xt.Z=se},33297:function(Cn,Xt,se){"use strict";se.d(Xt,{Fm:function(){return ze}});var fe=se(34367),et=se(93590);const $e=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}}),Ue=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}}),Se=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}}),Me=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}}),xe=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}}),pe=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}}),Te=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}}),mt={"move-up":{inKeyframes:pe,outKeyframes:Te},"move-down":{inKeyframes:$e,outKeyframes:Ue},"move-left":{inKeyframes:be,outKeyframes:Se},"move-right":{inKeyframes:Me,outKeyframes:xe}},ze=(It,Ct)=>{const{antCls:ht}=It,Ye=`${ht}-${Ct}`,{inKeyframes:De,outKeyframes:At}=mt[Ct];return[(0,et.R)(Ye,De,At,It.motionDurationMid),{[`
|
|
|
${Ye}-enter,
|
|
|
${Ye}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:It.motionEaseOutCirc},[`${Ye}-leave`]:{animationTimingFunction:It.motionEaseInOutCirc}}]}},67771:function(Cn,Xt,se){"use strict";se.d(Xt,{Qt:function(){return be},Uw:function(){return Ue},fJ:function(){return $e},ly:function(){return Se},oN:function(){return ze}});var fe=se(34367),et=se(93590);const $e=new fe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Ue=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}}),Se=new fe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Me=new fe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),xe=new fe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),pe=new fe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Te=new fe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),mt={"slide-up":{inKeyframes:$e,outKeyframes:Ue},"slide-down":{inKeyframes:be,outKeyframes:Se},"slide-left":{inKeyframes:Me,outKeyframes:xe},"slide-right":{inKeyframes:pe,outKeyframes:Te}},ze=(It,Ct)=>{const{antCls:ht}=It,Ye=`${ht}-${Ct}`,{inKeyframes:De,outKeyframes:At}=mt[Ct];return[(0,et.R)(Ye,De,At,It.motionDurationMid),{[`
|
|
|
${Ye}-enter,
|
|
|
${Ye}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:It.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${Ye}-leave`]:{animationTimingFunction:It.motionEaseInQuint}}]}},47897:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return ye}});var fe=se(3407),et=se(94184),$e=se.n(et);function Ue(){return Ue=Object.assign?Object.assign.bind():function(ve){for(var oe=1;oe<arguments.length;oe++){var He=arguments[oe];for(var xt in He)Object.prototype.hasOwnProperty.call(He,xt)&&(ve[xt]=He[xt])}return ve},Ue.apply(this,arguments)}function be(ve){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(oe){return typeof oe}:function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},be(ve)}function Se(ve,oe){if(be(ve)!=="object"||ve===null)return ve;var He=ve[Symbol.toPrimitive];if(He!==void 0){var xt=He.call(ve,oe||"default");if(be(xt)!=="object")return xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(oe==="string"?String:Number)(ve)}function Me(ve){var oe=Se(ve,"string");return be(oe)==="symbol"?oe:String(oe)}function xe(ve,oe,He){return oe=Me(oe),oe in ve?Object.defineProperty(ve,oe,{value:He,enumerable:!0,configurable:!0,writable:!0}):ve[oe]=He,ve}function pe(ve){if(Array.isArray(ve))return ve}function Te(ve,oe){var He=ve==null?null:typeof Symbol!="undefined"&&ve[Symbol.iterator]||ve["@@iterator"];if(He!=null){var xt,Yt,pn,dn,An=[],tn=!0,Nr=!1;try{if(pn=(He=He.call(ve)).next,oe===0){if(Object(He)!==He)return;tn=!1}else for(;!(tn=(xt=pn.call(He)).done)&&(An.push(xt.value),An.length!==oe);tn=!0);}catch(Wr){Nr=!0,Yt=Wr}finally{try{if(!tn&&He.return!=null&&(dn=He.return(),Object(dn)!==dn))return}finally{if(Nr)throw Yt}}return An}}function mt(ve,oe){(oe==null||oe>ve.length)&&(oe=ve.length);for(var He=0,xt=new Array(oe);He<oe;He++)xt[He]=ve[He];return xt}function ze(ve,oe){if(ve){if(typeof ve=="string")return mt(ve,oe);var He=Object.prototype.toString.call(ve).slice(8,-1);if(He==="Object"&&ve.constructor&&(He=ve.constructor.name),He==="Map"||He==="Set")return Array.from(ve);if(He==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(He))return mt(ve,oe)}}function It(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ct(ve,oe){return pe(ve)||Te(ve,oe)||ze(ve,oe)||It()}function ht(ve,oe){if(ve==null)return{};var He={},xt=Object.keys(ve),Yt,pn;for(pn=0;pn<xt.length;pn++)Yt=xt[pn],!(oe.indexOf(Yt)>=0)&&(He[Yt]=ve[Yt]);return He}function Ye(ve,oe){if(ve==null)return{};var He=ht(ve,oe),xt,Yt;if(Object.getOwnPropertySymbols){var pn=Object.getOwnPropertySymbols(ve);for(Yt=0;Yt<pn.length;Yt++)xt=pn[Yt],!(oe.indexOf(xt)>=0)&&Object.prototype.propertyIsEnumerable.call(ve,xt)&&(He[xt]=ve[xt])}return He}var De=se(67294);function At(ve){if(Array.isArray(ve))return ve}function Jt(ve,oe){var He=ve==null?null:typeof Symbol!="undefined"&&ve[Symbol.iterator]||ve["@@iterator"];if(He!=null){var xt,Yt,pn,dn,An=[],tn=!0,Nr=!1;try{if(pn=(He=He.call(ve)).next,oe===0){if(Object(He)!==He)return;tn=!1}else for(;!(tn=(xt=pn.call(He)).done)&&(An.push(xt.value),An.length!==oe);tn=!0);}catch(Wr){Nr=!0,Yt=Wr}finally{try{if(!tn&&He.return!=null&&(dn=He.return(),Object(dn)!==dn))return}finally{if(Nr)throw Yt}}return An}}function nt(ve,oe){(oe==null||oe>ve.length)&&(oe=ve.length);for(var He=0,xt=new Array(oe);He<oe;He++)xt[He]=ve[He];return xt}function lt(ve,oe){if(ve){if(typeof ve=="string")return nt(ve,oe);var He=Object.prototype.toString.call(ve).slice(8,-1);if(He==="Object"&&ve.constructor&&(He=ve.constructor.name),He==="Map"||He==="Set")return Array.from(ve);if(He==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(He))return nt(ve,oe)}}function Ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ke(ve,oe){return At(ve)||Jt(ve,oe)||lt(ve,oe)||Ie()}function je(ve){var oe=De.useRef();oe.current=ve;var He=De.useCallback(function(){for(var xt,Yt=arguments.length,pn=new Array(Yt),dn=0;dn<Yt;dn++)pn[dn]=arguments[dn];return(xt=oe.current)===null||xt===void 0?void 0:xt.call.apply(xt,[oe].concat(pn))},[]);return He}function Xe(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Pt=Xe()?De.useLayoutEffect:De.useEffect,kt=function(oe,He){var xt=De.useRef(!0);Pt(function(){return oe(xt.current)},He),Pt(function(){return xt.current=!1,function(){xt.current=!0}},[])},Lt=function(oe,He){kt(function(xt){if(!xt)return oe()},He)},Ge=null;function Ht(ve){var oe=De.useRef(!1),He=De.useState(ve),xt=ke(He,2),Yt=xt[0],pn=xt[1];De.useEffect(function(){return oe.current=!1,function(){oe.current=!0}},[]);function dn(An,tn){tn&&oe.current||pn(An)}return[Yt,dn]}function Dt(ve){return ve!==void 0}function Ln(ve,oe){var He=oe||{},xt=He.defaultValue,Yt=He.value,pn=He.onChange,dn=He.postState,An=Ht(function(){return Dt(Yt)?Yt:Dt(xt)?typeof xt=="function"?xt():xt:typeof ve=="function"?ve():ve}),tn=ke(An,2),Nr=tn[0],Wr=tn[1],Kt=Yt!==void 0?Yt:Nr,$n=dn?dn(Kt):Kt,ei=je(pn),hi=Ht([Kt]),ut=ke(hi,2),Vt=ut[0],Vn=ut[1];Lt(function(){var gr=Vt[0];Nr!==gr&&ei(Nr,gr)},[Vt]),Lt(function(){Dt(Yt)||Wr(Yt)},[Yt]);var rr=je(function(gr,Ir){Wr(gr,Ir),Vn([Kt],Ir)});return[$n,rr]}var un={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(oe){var He=oe.keyCode;if(oe.altKey&&!oe.ctrlKey||oe.metaKey||He>=un.F1&&He<=un.F12)return!1;switch(He){case un.ALT:case un.CAPS_LOCK:case un.CONTEXT_MENU:case un.CTRL:case un.DOWN:case un.END:case un.ESC:case un.HOME:case un.INSERT:case un.LEFT:case un.MAC_FF_META:case un.META:case un.NUMLOCK:case un.NUM_CENTER:case un.PAGE_DOWN:case un.PAGE_UP:case un.PAUSE:case un.PRINT_SCREEN:case un.RIGHT:case un.SHIFT:case un.UP:case un.WIN_KEY:case un.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(oe){if(oe>=un.ZERO&&oe<=un.NINE||oe>=un.NUM_ZERO&&oe<=un.NUM_MULTIPLY||oe>=un.A&&oe<=un.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&oe===0)return!0;switch(oe){case un.SPACE:case un.QUESTION_MARK:case un.NUM_PLUS:case un.NUM_MINUS:case un.NUM_PERIOD:case un.NUM_DIVISION:case un.SEMICOLON:case un.DASH:case un.EQUALS:case un.COMMA:case un.PERIOD:case un.SLASH:case un.APOSTROPHE:case un.SINGLE_QUOTE:case un.OPEN_SQUARE_BRACKET:case un.BACKSLASH:case un.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Rn=un,ir=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],yr=De.forwardRef(function(ve,oe){var He,xt=ve.prefixCls,Yt=xt===void 0?"rc-switch":xt,pn=ve.className,dn=ve.checked,An=ve.defaultChecked,tn=ve.disabled,Nr=ve.loadingIcon,Wr=ve.checkedChildren,Kt=ve.unCheckedChildren,$n=ve.onClick,ei=ve.onChange,hi=ve.onKeyDown,ut=Ye(ve,ir),Vt=Ln(!1,{value:dn,defaultValue:An}),Vn=Ct(Vt,2),rr=Vn[0],gr=Vn[1];function Ir(ui,br){var Ei=rr;return tn||(Ei=ui,gr(Ei),ei==null||ei(Ei,br)),Ei}function Ur(ui){ui.which===Rn.LEFT?Ir(!1,ui):ui.which===Rn.RIGHT&&Ir(!0,ui),hi==null||hi(ui)}function Gr(ui){var br=Ir(!rr,ui);$n==null||$n(br,ui)}var Xr=$e()(Yt,pn,(He={},xe(He,"".concat(Yt,"-checked"),rr),xe(He,"".concat(Yt,"-disabled"),tn),He));return De.createElement("button",Ue({},ut,{type:"button",role:"switch","aria-checked":rr,disabled:tn,className:Xr,ref:oe,onKeyDown:Ur,onClick:Gr}),Nr,De.createElement("span",{className:"".concat(Yt,"-inner")},De.createElement("span",{className:"".concat(Yt,"-inner-checked")},Wr),De.createElement("span",{className:"".concat(Yt,"-inner-unchecked")},Kt)))});yr.displayName="Switch";var Qe=yr,Le=se(45353),Nt=se(53124),Nn=se(98866),gn=se(98675),Je=se(84780),st=se(14747),_t=se(67968),en=se(45503);const Bt=ve=>{const{componentCls:oe,trackHeightSM:He,trackPadding:xt,trackMinWidthSM:Yt,innerMinMarginSM:pn,innerMaxMarginSM:dn,handleSizeSM:An}=ve,tn=`${oe}-inner`;return{[oe]:{[`&${oe}-small`]:{minWidth:Yt,height:He,lineHeight:`${He}px`,[`${oe}-inner`]:{paddingInlineStart:dn,paddingInlineEnd:pn,[`${tn}-checked`]:{marginInlineStart:`calc(-100% + ${An+xt*2}px - ${dn*2}px)`,marginInlineEnd:`calc(100% - ${An+xt*2}px + ${dn*2}px)`},[`${tn}-unchecked`]:{marginTop:-He,marginInlineStart:0,marginInlineEnd:0}},[`${oe}-handle`]:{width:An,height:An},[`${oe}-loading-icon`]:{top:(An-ve.switchLoadingIconSize)/2,fontSize:ve.switchLoadingIconSize},[`&${oe}-checked`]:{[`${oe}-inner`]:{paddingInlineStart:pn,paddingInlineEnd:dn,[`${tn}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${tn}-unchecked`]:{marginInlineStart:`calc(100% - ${An+xt*2}px + ${dn*2}px)`,marginInlineEnd:`calc(-100% + ${An+xt*2}px - ${dn*2}px)`}},[`${oe}-handle`]:{insetInlineStart:`calc(100% - ${An+xt}px)`}},[`&:not(${oe}-disabled):active`]:{[`&:not(${oe}-checked) ${tn}`]:{[`${tn}-unchecked`]:{marginInlineStart:ve.marginXXS/2,marginInlineEnd:-ve.marginXXS/2}},[`&${oe}-checked ${tn}`]:{[`${tn}-checked`]:{marginInlineStart:-ve.marginXXS/2,marginInlineEnd:ve.marginXXS/2}}}}}}},Ft=ve=>{const{componentCls:oe,handleSize:He}=ve;return{[oe]:{[`${oe}-loading-icon${ve.iconCls}`]:{position:"relative",top:(He-ve.fontSize)/2,color:ve.switchLoadingIconColor,verticalAlign:"top"},[`&${oe}-checked ${oe}-loading-icon`]:{color:ve.switchColor}}}},zt=ve=>{const{componentCls:oe,motion:He,trackPadding:xt,handleBg:Yt,handleShadow:pn,handleSize:dn}=ve,An=`${oe}-handle`;return{[oe]:{[An]:{position:"absolute",top:xt,insetInlineStart:xt,width:dn,height:dn,transition:`all ${ve.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Yt,borderRadius:dn/2,boxShadow:pn,transition:`all ${ve.switchDuration} ease-in-out`,content:'""'}},[`&${oe}-checked ${An}`]:{insetInlineStart:`calc(100% - ${dn+xt}px)`},[`&:not(${oe}-disabled):active`]:He?{[`${An}::before`]:{insetInlineEnd:ve.switchHandleActiveInset,insetInlineStart:0},[`&${oe}-checked ${An}::before`]:{insetInlineEnd:0,insetInlineStart:ve.switchHandleActiveInset}}:{}}}},Mn=ve=>{const{componentCls:oe,trackHeight:He,trackPadding:xt,innerMinMargin:Yt,innerMaxMargin:pn,handleSize:dn}=ve,An=`${oe}-inner`;return{[oe]:{[An]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:pn,paddingInlineEnd:Yt,transition:`padding-inline-start ${ve.switchDuration} ease-in-out, padding-inline-end ${ve.switchDuration} ease-in-out`,[`${An}-checked, ${An}-unchecked`]:{display:"block",color:ve.colorTextLightSolid,fontSize:ve.fontSizeSM,transition:`margin-inline-start ${ve.switchDuration} ease-in-out, margin-inline-end ${ve.switchDuration} ease-in-out`,pointerEvents:"none"},[`${An}-checked`]:{marginInlineStart:`calc(-100% + ${dn+xt*2}px - ${pn*2}px)`,marginInlineEnd:`calc(100% - ${dn+xt*2}px + ${pn*2}px)`},[`${An}-unchecked`]:{marginTop:-He,marginInlineStart:0,marginInlineEnd:0}},[`&${oe}-checked ${An}`]:{paddingInlineStart:Yt,paddingInlineEnd:pn,[`${An}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${An}-unchecked`]:{marginInlineStart:`calc(100% - ${dn+xt*2}px + ${pn*2}px)`,marginInlineEnd:`calc(-100% + ${dn+xt*2}px - ${pn*2}px)`}},[`&:not(${oe}-disabled):active`]:{[`&:not(${oe}-checked) ${An}`]:{[`${An}-unchecked`]:{marginInlineStart:xt*2,marginInlineEnd:-xt*2}},[`&${oe}-checked ${An}`]:{[`${An}-checked`]:{marginInlineStart:-xt*2,marginInlineEnd:xt*2}}}}}},bn=ve=>{const{componentCls:oe,trackHeight:He,trackMinWidth:xt}=ve;return{[oe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,st.Wf)(ve)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:xt,height:He,lineHeight:`${He}px`,verticalAlign:"middle",background:ve.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${ve.motionDurationMid}`,userSelect:"none",[`&:hover:not(${oe}-disabled)`]:{background:ve.colorTextTertiary}}),(0,st.Qy)(ve)),{[`&${oe}-checked`]:{background:ve.switchColor,[`&:hover:not(${oe}-disabled)`]:{background:ve.colorPrimaryHover}},[`&${oe}-loading, &${oe}-disabled`]:{cursor:"not-allowed",opacity:ve.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${oe}-rtl`]:{direction:"rtl"}})}};var Ee=(0,_t.Z)("Switch",ve=>{const oe=(0,en.TS)(ve,{switchDuration:ve.motionDurationMid,switchColor:ve.colorPrimary,switchDisabledOpacity:ve.opacityLoading,switchLoadingIconSize:ve.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${ve.opacityLoading})`,switchHandleActiveInset:"-30%"});return[bn(oe),Mn(oe),zt(oe),Ft(oe),Bt(oe)]},ve=>{const{fontSize:oe,lineHeight:He,controlHeight:xt,colorWhite:Yt}=ve,pn=oe*He,dn=xt/2,An=2,tn=pn-An*2,Nr=dn-An*2;return{trackHeight:pn,trackHeightSM:dn,trackMinWidth:tn*2+An*4,trackMinWidthSM:Nr*2+An*2,trackPadding:An,handleBg:Yt,handleSize:tn,handleSizeSM:Nr,handleShadow:`0 2px 4px 0 ${new Je.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:tn/2,innerMaxMargin:tn+An+An*2,innerMinMarginSM:Nr/2,innerMaxMarginSM:Nr+An+An*2}}),ce=function(ve,oe){var He={};for(var xt in ve)Object.prototype.hasOwnProperty.call(ve,xt)&&oe.indexOf(xt)<0&&(He[xt]=ve[xt]);if(ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Yt=0,xt=Object.getOwnPropertySymbols(ve);Yt<xt.length;Yt++)oe.indexOf(xt[Yt])<0&&Object.prototype.propertyIsEnumerable.call(ve,xt[Yt])&&(He[xt[Yt]]=ve[xt[Yt]]);return He};const le=De.forwardRef((ve,oe)=>{const{prefixCls:He,size:xt,disabled:Yt,loading:pn,className:dn,rootClassName:An,style:tn}=ve,Nr=ce(ve,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Wr,direction:Kt,switch:$n}=De.useContext(Nt.E_),ei=De.useContext(Nn.Z),hi=(Yt!=null?Yt:ei)||pn,ut=Wr("switch",He),Vt=De.createElement("div",{className:`${ut}-handle`},pn&&De.createElement(fe.Z,{className:`${ut}-loading-icon`})),[Vn,rr]=Ee(ut),gr=(0,gn.Z)(xt),Ir=$e()($n==null?void 0:$n.className,{[`${ut}-small`]:gr==="small",[`${ut}-loading`]:pn,[`${ut}-rtl`]:Kt==="rtl"},dn,An,rr),Ur=Object.assign(Object.assign({},$n==null?void 0:$n.style),tn);return Vn(De.createElement(Le.Z,{component:"Switch"},De.createElement(Qe,Object.assign({},Nr,{prefixCls:ut,className:Ir,style:Ur,disabled:hi,ref:oe,loadingIcon:Vt}))))});le.__ANT_SWITCH=!0;var ye=le},66368:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return Si}});var fe=se(73475),et=se(25877),$e=se(38308),Ue=se(94184),be=se.n(Ue),Se=se(87462),Me=se(4942),xe=se(1413),pe=se(97685),Te=se(71002),mt=se(45987),ze=se(67294),It=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var _e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(_e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(_e==null?void 0:_e.substr(0,4))};function Ct(_e){var Be=ze.useRef();Be.current=_e;var Ne=ze.useCallback(function(){for(var We,qe=arguments.length,rt=new Array(qe),bt=0;bt<qe;bt++)rt[bt]=arguments[bt];return(We=Be.current)===null||We===void 0?void 0:We.call.apply(We,[Be].concat(rt))},[]);return Ne}function ht(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ye=ht()?ze.useLayoutEffect:ze.useEffect,De=function(Be,Ne){var We=ze.useRef(!0);Ye(function(){return Be(We.current)},Ne),Ye(function(){return We.current=!1,function(){We.current=!0}},[])},At=function(Be,Ne){De(function(We){if(!We)return Be()},Ne)},Jt=null;function nt(_e){var Be=ze.useRef(!1),Ne=ze.useState(_e),We=(0,pe.Z)(Ne,2),qe=We[0],rt=We[1];ze.useEffect(function(){return Be.current=!1,function(){Be.current=!0}},[]);function bt(Gt,nn){nn&&Be.current||rt(Gt)}return[qe,bt]}function lt(_e){return _e!==void 0}function Ie(_e,Be){var Ne=Be||{},We=Ne.defaultValue,qe=Ne.value,rt=Ne.onChange,bt=Ne.postState,Gt=nt(function(){return lt(qe)?qe:lt(We)?typeof We=="function"?We():We:typeof _e=="function"?_e():_e}),nn=(0,pe.Z)(Gt,2),Gn=nn[0],fr=nn[1],Wn=qe!==void 0?qe:Gn,vn=bt?bt(Wn):Wn,hn=Ct(rt),Sn=nt([Wn]),Pn=(0,pe.Z)(Sn,2),ur=Pn[0],jn=Pn[1];At(function(){var Jn=ur[0];Gn!==Jn&&hn(Gn,Jn)},[ur]),At(function(){lt(qe)||fr(qe)},[qe]);var Zn=Ct(function(Jn,Qn){fr(Jn,Qn),jn([Wn],Qn)});return[vn,Zn]}var ke=se(62874),je=(0,ze.createContext)(null),Xe=ze.forwardRef(function(_e,Be){var Ne=_e.prefixCls,We=_e.className,qe=_e.style,rt=_e.id,bt=_e.active,Gt=_e.tabKey,nn=_e.children;return ze.createElement("div",{id:rt&&"".concat(rt,"-panel-").concat(Gt),role:"tabpanel",tabIndex:bt?0:-1,"aria-labelledby":rt&&"".concat(rt,"-tab-").concat(Gt),"aria-hidden":!bt,style:qe,className:be()(Ne,bt&&"".concat(Ne,"-active"),We),ref:Be},nn)}),Pt=Xe,kt=["key","forceRender","style","className"];function Lt(_e){var Be=_e.id,Ne=_e.activeKey,We=_e.animated,qe=_e.tabPosition,rt=_e.destroyInactiveTabPane,bt=ze.useContext(je),Gt=bt.prefixCls,nn=bt.tabs,Gn=We.tabPane,fr="".concat(Gt,"-tabpane");return ze.createElement("div",{className:be()("".concat(Gt,"-content-holder"))},ze.createElement("div",{className:be()("".concat(Gt,"-content"),"".concat(Gt,"-content-").concat(qe),(0,Me.Z)({},"".concat(Gt,"-content-animated"),Gn))},nn.map(function(Wn){var vn=Wn.key,hn=Wn.forceRender,Sn=Wn.style,Pn=Wn.className,ur=(0,mt.Z)(Wn,kt),jn=vn===Ne;return ze.createElement(ke.Z,(0,Se.Z)({key:vn,visible:jn,forceRender:hn,removeOnLeave:!!rt,leavedClassName:"".concat(fr,"-hidden")},We.tabPaneMotion),function(Zn,Jn){var Qn=Zn.style,hr=Zn.className;return ze.createElement(Pt,(0,Se.Z)({},ur,{prefixCls:fr,id:Be,tabKey:vn,animated:Gn,active:jn,style:(0,xe.Z)((0,xe.Z)({},Sn),Qn),className:be()(Pn,hr),ref:Jn}))})})))}var Ge=se(74902),Ht=se(48555),Dt=se(59864);function Ln(_e,Be,Ne){var We=ze.useRef({});return(!("value"in We.current)||Ne(We.current.condition,Be))&&(We.current.value=_e(),We.current.condition=Be),We.current.value}function un(_e,Be){typeof _e=="function"?_e(Be):(0,Te.Z)(_e)==="object"&&_e&&"current"in _e&&(_e.current=Be)}function Rn(){for(var _e=arguments.length,Be=new Array(_e),Ne=0;Ne<_e;Ne++)Be[Ne]=arguments[Ne];var We=Be.filter(function(qe){return qe});return We.length<=1?We[0]:function(qe){Be.forEach(function(rt){un(rt,qe)})}}function ir(){for(var _e=arguments.length,Be=new Array(_e),Ne=0;Ne<_e;Ne++)Be[Ne]=arguments[Ne];return Ln(function(){return Rn.apply(void 0,Be)},Be,function(We,qe){return We.length===qe.length&&We.every(function(rt,bt){return rt===qe[bt]})})}function yr(_e){var Be,Ne,We=isMemo(_e)?_e.type.type:_e.type;return!(typeof We=="function"&&!((Be=We.prototype)!==null&&Be!==void 0&&Be.render)||typeof _e=="function"&&!((Ne=_e.prototype)!==null&&Ne!==void 0&&Ne.render))}var Qe={width:0,height:0,left:0,top:0};function Le(_e,Be,Ne){return(0,ze.useMemo)(function(){for(var We,qe=new Map,rt=Be.get((We=_e[0])===null||We===void 0?void 0:We.key)||Qe,bt=rt.left+rt.width,Gt=0;Gt<_e.length;Gt+=1){var nn=_e[Gt].key,Gn=Be.get(nn);if(!Gn){var fr;Gn=Be.get((fr=_e[Gt-1])===null||fr===void 0?void 0:fr.key)||Qe}var Wn=qe.get(nn)||(0,xe.Z)({},Gn);Wn.right=bt-Wn.left-Wn.width,qe.set(nn,Wn)}return qe},[_e.map(function(We){return We.key}).join("_"),Be,Ne])}function Nt(_e,Be){var Ne=ze.useRef(_e),We=ze.useState({}),qe=(0,pe.Z)(We,2),rt=qe[1];function bt(Gt){var nn=typeof Gt=="function"?Gt(Ne.current):Gt;nn!==Ne.current&&Be(nn,Ne.current),Ne.current=nn,rt({})}return[Ne.current,bt]}var Nn=.1,gn=.01,Je=20,st=Math.pow(.995,Je);function _t(_e,Be){var Ne=(0,ze.useState)(),We=(0,pe.Z)(Ne,2),qe=We[0],rt=We[1],bt=(0,ze.useState)(0),Gt=(0,pe.Z)(bt,2),nn=Gt[0],Gn=Gt[1],fr=(0,ze.useState)(0),Wn=(0,pe.Z)(fr,2),vn=Wn[0],hn=Wn[1],Sn=(0,ze.useState)(),Pn=(0,pe.Z)(Sn,2),ur=Pn[0],jn=Pn[1],Zn=(0,ze.useRef)();function Jn(it){var Ot=it.touches[0],on=Ot.screenX,mn=Ot.screenY;rt({x:on,y:mn}),window.clearInterval(Zn.current)}function Qn(it){if(qe){it.preventDefault();var Ot=it.touches[0],on=Ot.screenX,mn=Ot.screenY;rt({x:on,y:mn});var On=on-qe.x,xn=mn-qe.y;Be(On,xn);var Qt=Date.now();Gn(Qt),hn(Qt-nn),jn({x:On,y:xn})}}function hr(){if(qe&&(rt(null),jn(null),ur)){var it=ur.x/vn,Ot=ur.y/vn,on=Math.abs(it),mn=Math.abs(Ot);if(Math.max(on,mn)<Nn)return;var On=it,xn=Ot;Zn.current=window.setInterval(function(){if(Math.abs(On)<gn&&Math.abs(xn)<gn){window.clearInterval(Zn.current);return}On*=st,xn*=st,Be(On*Je,xn*Je)},Je)}}var Pe=(0,ze.useRef)();function Fe(it){var Ot=it.deltaX,on=it.deltaY,mn=0,On=Math.abs(Ot),xn=Math.abs(on);On===xn?mn=Pe.current==="x"?Ot:on:On>xn?(mn=Ot,Pe.current="x"):(mn=on,Pe.current="y"),Be(-mn,-mn)&&it.preventDefault()}var wt=(0,ze.useRef)(null);wt.current={onTouchStart:Jn,onTouchMove:Qn,onTouchEnd:hr,onWheel:Fe},ze.useEffect(function(){function it(On){wt.current.onTouchStart(On)}function Ot(On){wt.current.onTouchMove(On)}function on(On){wt.current.onTouchEnd(On)}function mn(On){wt.current.onWheel(On)}return document.addEventListener("touchmove",Ot,{passive:!1}),document.addEventListener("touchend",on,{passive:!1}),_e.current.addEventListener("touchstart",it,{passive:!1}),_e.current.addEventListener("wheel",mn),function(){document.removeEventListener("touchmove",Ot),document.removeEventListener("touchend",on)}},[])}function en(_e){var Be=(0,ze.useState)(0),Ne=(0,pe.Z)(Be,2),We=Ne[0],qe=Ne[1],rt=(0,ze.useRef)(0),bt=(0,ze.useRef)();return bt.current=_e,At(function(){var Gt;(Gt=bt.current)===null||Gt===void 0||Gt.call(bt)},[We]),function(){rt.current===We&&(rt.current+=1,qe(rt.current))}}function Bt(_e){var Be=(0,ze.useRef)([]),Ne=(0,ze.useState)({}),We=(0,pe.Z)(Ne,2),qe=We[1],rt=(0,ze.useRef)(typeof _e=="function"?_e():_e),bt=en(function(){var nn=rt.current;Be.current.forEach(function(Gn){nn=Gn(nn)}),Be.current=[],rt.current=nn,qe({})});function Gt(nn){Be.current.push(nn),bt()}return[rt.current,Gt]}var Ft={width:0,height:0,left:0,top:0,right:0};function zt(_e,Be,Ne,We,qe,rt,bt){var Gt=bt.tabs,nn=bt.tabPosition,Gn=bt.rtl,fr,Wn,vn;return["top","bottom"].includes(nn)?(fr="width",Wn=Gn?"right":"left",vn=Math.abs(Ne)):(fr="height",Wn="top",vn=-Ne),(0,ze.useMemo)(function(){if(!Gt.length)return[0,0];for(var hn=Gt.length,Sn=hn,Pn=0;Pn<hn;Pn+=1){var ur=_e.get(Gt[Pn].key)||Ft;if(ur[Wn]+ur[fr]>vn+Be){Sn=Pn-1;break}}for(var jn=0,Zn=hn-1;Zn>=0;Zn-=1){var Jn=_e.get(Gt[Zn].key)||Ft;if(Jn[Wn]<vn){jn=Zn+1;break}}return jn>=Sn?[0,0]:[jn,Sn]},[_e,Be,We,qe,rt,vn,nn,Gt.map(function(hn){return hn.key}).join("_"),Gn])}function Mn(_e){var Be;return _e instanceof Map?(Be={},_e.forEach(function(Ne,We){Be[We]=Ne})):Be=_e,JSON.stringify(Be)}var bn="TABS_DQ";function Ee(_e){return String(_e).replace(/"/g,bn)}function ce(_e,Be,Ne,We){return!(!Ne||We||_e===!1||_e===void 0&&(Be===!1||Be===null))}function le(_e,Be){var Ne=_e.prefixCls,We=_e.editable,qe=_e.locale,rt=_e.style;return!We||We.showAdd===!1?null:ze.createElement("button",{ref:Be,type:"button",className:"".concat(Ne,"-nav-add"),style:rt,"aria-label":(qe==null?void 0:qe.addAriaLabel)||"Add tab",onClick:function(Gt){We.onEdit("add",{event:Gt})}},We.addIcon||"+")}var ye=ze.forwardRef(le),ve=ze.forwardRef(function(_e,Be){var Ne=_e.position,We=_e.prefixCls,qe=_e.extra;if(!qe)return null;var rt,bt={};return(0,Te.Z)(qe)==="object"&&!ze.isValidElement(qe)?bt=qe:bt.right=qe,Ne==="right"&&(rt=bt.right),Ne==="left"&&(rt=bt.left),rt?ze.createElement("div",{className:"".concat(We,"-extra-content"),ref:Be},rt):null}),oe=ve,He=se(62709);function xt(_e,Be,Ne){var We=React.useRef({});return(!("value"in We.current)||Ne(We.current.condition,Be))&&(We.current.value=_e(),We.current.condition=Be),We.current.value}function Yt(_e,Be){typeof _e=="function"?_e(Be):(0,Te.Z)(_e)==="object"&&_e&&"current"in _e&&(_e.current=Be)}function pn(){for(var _e=arguments.length,Be=new Array(_e),Ne=0;Ne<_e;Ne++)Be[Ne]=arguments[Ne];var We=Be.filter(function(qe){return qe});return We.length<=1?We[0]:function(qe){Be.forEach(function(rt){Yt(rt,qe)})}}function dn(){for(var _e=arguments.length,Be=new Array(_e),Ne=0;Ne<_e;Ne++)Be[Ne]=arguments[Ne];return useMemo(function(){return pn.apply(void 0,Be)},Be,function(We,qe){return We.length===qe.length&&We.every(function(rt,bt){return rt===qe[bt]})})}function An(_e){var Be,Ne,We=(0,Dt.isMemo)(_e)?_e.type.type:_e.type;return!(typeof We=="function"&&!((Be=We.prototype)!==null&&Be!==void 0&&Be.render)||typeof _e=="function"&&!((Ne=_e.prototype)!==null&&Ne!==void 0&&Ne.render))}var tn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Be){var Ne=Be.keyCode;if(Be.altKey&&!Be.ctrlKey||Be.metaKey||Ne>=tn.F1&&Ne<=tn.F12)return!1;switch(Ne){case tn.ALT:case tn.CAPS_LOCK:case tn.CONTEXT_MENU:case tn.CTRL:case tn.DOWN:case tn.END:case tn.ESC:case tn.HOME:case tn.INSERT:case tn.LEFT:case tn.MAC_FF_META:case tn.META:case tn.NUMLOCK:case tn.NUM_CENTER:case tn.PAGE_DOWN:case tn.PAGE_UP:case tn.PAUSE:case tn.PRINT_SCREEN:case tn.RIGHT:case tn.SHIFT:case tn.UP:case tn.WIN_KEY:case tn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Be){if(Be>=tn.ZERO&&Be<=tn.NINE||Be>=tn.NUM_ZERO&&Be<=tn.NUM_MULTIPLY||Be>=tn.A&&Be<=tn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Be===0)return!0;switch(Be){case tn.SPACE:case tn.QUESTION_MARK:case tn.NUM_PLUS:case tn.NUM_MINUS:case tn.NUM_PERIOD:case tn.NUM_DIVISION:case tn.SEMICOLON:case tn.DASH:case tn.EQUALS:case tn.COMMA:case tn.PERIOD:case tn.SLASH:case tn.APOSTROPHE:case tn.SINGLE_QUOTE:case tn.OPEN_SQUARE_BRACKET:case tn.BACKSLASH:case tn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Nr=tn,Wr=function(Be){return+setTimeout(Be,16)},Kt=function(Be){return clearTimeout(Be)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Wr=function(Be){return window.requestAnimationFrame(Be)},Kt=function(Be){return window.cancelAnimationFrame(Be)});var $n=0,ei=new Map;function hi(_e){ei.delete(_e)}var ut=function(Be){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;$n+=1;var We=$n;function qe(rt){if(rt===0)hi(We),Be();else{var bt=Wr(function(){qe(rt-1)});ei.set(We,bt)}}return qe(Ne),We};ut.cancel=function(_e){var Be=ei.get(_e);return hi(Be),Kt(Be)};var Vt=ut,Vn=Nr.ESC,rr=Nr.TAB;function gr(_e){var Be=_e.visible,Ne=_e.triggerRef,We=_e.onVisibleChange,qe=_e.autoFocus,rt=_e.overlayRef,bt=ze.useRef(!1),Gt=function(){if(Be){var Wn,vn;(Wn=Ne.current)===null||Wn===void 0||(vn=Wn.focus)===null||vn===void 0||vn.call(Wn),We==null||We(!1)}},nn=function(){var Wn;return(Wn=rt.current)!==null&&Wn!==void 0&&Wn.focus?(rt.current.focus(),bt.current=!0,!0):!1},Gn=function(Wn){switch(Wn.keyCode){case Vn:Gt();break;case rr:{var vn=!1;bt.current||(vn=nn()),vn?Wn.preventDefault():Gt();break}}};ze.useEffect(function(){return Be?(window.addEventListener("keydown",Gn),qe&&Vt(nn,3),function(){window.removeEventListener("keydown",Gn),bt.current=!1}):function(){bt.current=!1}},[Be])}var Ir=(0,ze.forwardRef)(function(_e,Be){var Ne=_e.overlay,We=_e.arrow,qe=_e.prefixCls,rt=(0,ze.useMemo)(function(){var Gt;return typeof Ne=="function"?Gt=Ne():Gt=Ne,Gt},[Ne]),bt=pn(Be,rt==null?void 0:rt.ref);return ze.createElement(ze.Fragment,null,We&&ze.createElement("div",{className:"".concat(qe,"-arrow")}),ze.cloneElement(rt,{ref:An(rt)?bt:void 0}))}),Ur=Ir,Gr={adjustX:1,adjustY:1},Xr=[0,0],ui={topLeft:{points:["bl","tl"],overflow:Gr,offset:[0,-4],targetOffset:Xr},top:{points:["bc","tc"],overflow:Gr,offset:[0,-4],targetOffset:Xr},topRight:{points:["br","tr"],overflow:Gr,offset:[0,-4],targetOffset:Xr},bottomLeft:{points:["tl","bl"],overflow:Gr,offset:[0,4],targetOffset:Xr},bottom:{points:["tc","bc"],overflow:Gr,offset:[0,4],targetOffset:Xr},bottomRight:{points:["tr","br"],overflow:Gr,offset:[0,4],targetOffset:Xr}},br=ui,Ei=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function sa(_e,Be){var Ne,We=_e.arrow,qe=We===void 0?!1:We,rt=_e.prefixCls,bt=rt===void 0?"rc-dropdown":rt,Gt=_e.transitionName,nn=_e.animation,Gn=_e.align,fr=_e.placement,Wn=fr===void 0?"bottomLeft":fr,vn=_e.placements,hn=vn===void 0?br:vn,Sn=_e.getPopupContainer,Pn=_e.showAction,ur=_e.hideAction,jn=_e.overlayClassName,Zn=_e.overlayStyle,Jn=_e.visible,Qn=_e.trigger,hr=Qn===void 0?["hover"]:Qn,Pe=_e.autoFocus,Fe=_e.overlay,wt=_e.children,it=_e.onVisibleChange,Ot=(0,mt.Z)(_e,Ei),on=ze.useState(),mn=(0,pe.Z)(on,2),On=mn[0],xn=mn[1],Qt="visible"in _e?Jn:On,Bn=ze.useRef(null),Kn=ze.useRef(null),mr=ze.useRef(null);ze.useImperativeHandle(Be,function(){return Bn.current});var Fn=function(Dr){xn(Dr),it==null||it(Dr)};gr({visible:Qt,triggerRef:mr,onVisibleChange:Fn,autoFocus:Pe,overlayRef:Kn});var _r=function(Dr){var li=_e.onOverlayClick;xn(!1),li&&li(Dr)},Zr=function(){return ze.createElement(Ur,{ref:Kn,overlay:Fe,prefixCls:bt,arrow:qe})},Tr=function(){return typeof Fe=="function"?Zr:Zr()},$r=function(){var Dr=_e.minOverlayWidthMatchTrigger,li=_e.alignPoint;return"minOverlayWidthMatchTrigger"in _e?Dr:!li},xr=function(){var Dr=_e.openClassName;return Dr!==void 0?Dr:"".concat(bt,"-open")},Pr=ze.cloneElement(wt,{className:be()((Ne=wt.props)===null||Ne===void 0?void 0:Ne.className,Qt&&xr()),ref:An(wt)?pn(mr,wt.ref):void 0}),Yr=ur;return!Yr&&hr.indexOf("contextMenu")!==-1&&(Yr=["click"]),ze.createElement(He.Z,(0,Se.Z)({builtinPlacements:hn},Ot,{prefixCls:bt,ref:Bn,popupClassName:be()(jn,(0,Me.Z)({},"".concat(bt,"-show-arrow"),qe)),popupStyle:Zn,action:hr,showAction:Pn,hideAction:Yr,popupPlacement:Wn,popupAlign:Gn,popupTransitionName:Gt,popupAnimation:nn,popupVisible:Qt,stretch:$r()?"minWidth":"",popup:Tr(),onPopupVisibleChange:Fn,onPopupClick:_r,getPopupContainer:Sn}),Pr)}var Ji=ze.forwardRef(sa),Qi=Ji,Ci=se(78595),gt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Be){var Ne=Be.keyCode;if(Be.altKey&&!Be.ctrlKey||Be.metaKey||Ne>=gt.F1&&Ne<=gt.F12)return!1;switch(Ne){case gt.ALT:case gt.CAPS_LOCK:case gt.CONTEXT_MENU:case gt.CTRL:case gt.DOWN:case gt.END:case gt.ESC:case gt.HOME:case gt.INSERT:case gt.LEFT:case gt.MAC_FF_META:case gt.META:case gt.NUMLOCK:case gt.NUM_CENTER:case gt.PAGE_DOWN:case gt.PAGE_UP:case gt.PAUSE:case gt.PRINT_SCREEN:case gt.RIGHT:case gt.SHIFT:case gt.UP:case gt.WIN_KEY:case gt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Be){if(Be>=gt.ZERO&&Be<=gt.NINE||Be>=gt.NUM_ZERO&&Be<=gt.NUM_MULTIPLY||Be>=gt.A&&Be<=gt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Be===0)return!0;switch(Be){case gt.SPACE:case gt.QUESTION_MARK:case gt.NUM_PLUS:case gt.NUM_MINUS:case gt.NUM_PERIOD:case gt.NUM_DIVISION:case gt.SEMICOLON:case gt.DASH:case gt.EQUALS:case gt.COMMA:case gt.PERIOD:case gt.SLASH:case gt.APOSTROPHE:case gt.SINGLE_QUOTE:case gt.OPEN_SQUARE_BRACKET:case gt.BACKSLASH:case gt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},En=gt;function kn(_e,Be){var Ne=_e.prefixCls,We=_e.id,qe=_e.tabs,rt=_e.locale,bt=_e.mobile,Gt=_e.moreIcon,nn=Gt===void 0?"More":Gt,Gn=_e.moreTransitionName,fr=_e.style,Wn=_e.className,vn=_e.editable,hn=_e.tabBarGutter,Sn=_e.rtl,Pn=_e.removeAriaLabel,ur=_e.onTabClick,jn=_e.getPopupContainer,Zn=_e.popupClassName,Jn=(0,ze.useState)(!1),Qn=(0,pe.Z)(Jn,2),hr=Qn[0],Pe=Qn[1],Fe=(0,ze.useState)(null),wt=(0,pe.Z)(Fe,2),it=wt[0],Ot=wt[1],on="".concat(We,"-more-popup"),mn="".concat(Ne,"-dropdown"),On=it!==null?"".concat(on,"-").concat(it):null,xn=rt==null?void 0:rt.dropdownAriaLabel;function Qt(Tr,$r){Tr.preventDefault(),Tr.stopPropagation(),vn.onEdit("remove",{key:$r,event:Tr})}var Bn=ze.createElement(Ci.ZP,{onClick:function($r){var xr=$r.key,Pr=$r.domEvent;ur(xr,Pr),Pe(!1)},prefixCls:"".concat(mn,"-menu"),id:on,tabIndex:-1,role:"listbox","aria-activedescendant":On,selectedKeys:[it],"aria-label":xn!==void 0?xn:"expanded dropdown"},qe.map(function(Tr){var $r=Tr.closable,xr=Tr.disabled,Pr=Tr.closeIcon,Yr=Tr.key,ai=Tr.label,Dr=ce($r,Pr,vn,xr);return ze.createElement(Ci.sN,{key:Yr,id:"".concat(on,"-").concat(Yr),role:"option","aria-controls":We&&"".concat(We,"-panel-").concat(Yr),disabled:xr},ze.createElement("span",null,ai),Dr&&ze.createElement("button",{type:"button","aria-label":Pn||"remove",tabIndex:0,className:"".concat(mn,"-menu-item-remove"),onClick:function(Pi){Pi.stopPropagation(),Qt(Pi,Yr)}},Pr||vn.removeIcon||"\xD7"))}));function Kn(Tr){for(var $r=qe.filter(function(Dr){return!Dr.disabled}),xr=$r.findIndex(function(Dr){return Dr.key===it})||0,Pr=$r.length,Yr=0;Yr<Pr;Yr+=1){xr=(xr+Tr+Pr)%Pr;var ai=$r[xr];if(!ai.disabled){Ot(ai.key);return}}}function mr(Tr){var $r=Tr.which;if(!hr){[En.DOWN,En.SPACE,En.ENTER].includes($r)&&(Pe(!0),Tr.preventDefault());return}switch($r){case En.UP:Kn(-1),Tr.preventDefault();break;case En.DOWN:Kn(1),Tr.preventDefault();break;case En.ESC:Pe(!1);break;case En.SPACE:case En.ENTER:it!==null&&ur(it,Tr);break}}(0,ze.useEffect)(function(){var Tr=document.getElementById(On);Tr&&Tr.scrollIntoView&&Tr.scrollIntoView(!1)},[it]),(0,ze.useEffect)(function(){hr||Ot(null)},[hr]);var Fn=(0,Me.Z)({},Sn?"marginRight":"marginLeft",hn);qe.length||(Fn.visibility="hidden",Fn.order=1);var _r=be()((0,Me.Z)({},"".concat(mn,"-rtl"),Sn)),Zr=bt?null:ze.createElement(Qi,{prefixCls:mn,overlay:Bn,trigger:["hover"],visible:qe.length?hr:!1,transitionName:Gn,onVisibleChange:Pe,overlayClassName:be()(_r,Zn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:jn},ze.createElement("button",{type:"button",className:"".concat(Ne,"-nav-more"),style:Fn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":on,id:"".concat(We,"-more"),"aria-expanded":hr,onKeyDown:mr},nn));return ze.createElement("div",{className:be()("".concat(Ne,"-nav-operations"),Wn),style:fr,ref:Be},Zr,ze.createElement(ye,{prefixCls:Ne,locale:rt,editable:vn}))}var Tn=ze.memo(ze.forwardRef(kn),function(_e,Be){return Be.tabMoving});function sr(_e){var Be,Ne=_e.prefixCls,We=_e.id,qe=_e.active,rt=_e.tab,bt=rt.key,Gt=rt.label,nn=rt.disabled,Gn=rt.closeIcon,fr=_e.closable,Wn=_e.renderWrapper,vn=_e.removeAriaLabel,hn=_e.editable,Sn=_e.onClick,Pn=_e.onFocus,ur=_e.style,jn="".concat(Ne,"-tab"),Zn=ce(fr,Gn,hn,nn);function Jn(Pe){nn||Sn(Pe)}function Qn(Pe){Pe.preventDefault(),Pe.stopPropagation(),hn.onEdit("remove",{key:bt,event:Pe})}var hr=ze.createElement("div",{key:bt,"data-node-key":Ee(bt),className:be()(jn,(Be={},(0,Me.Z)(Be,"".concat(jn,"-with-remove"),Zn),(0,Me.Z)(Be,"".concat(jn,"-active"),qe),(0,Me.Z)(Be,"".concat(jn,"-disabled"),nn),Be)),style:ur,onClick:Jn},ze.createElement("div",{role:"tab","aria-selected":qe,id:We&&"".concat(We,"-tab-").concat(bt),className:"".concat(jn,"-btn"),"aria-controls":We&&"".concat(We,"-panel-").concat(bt),"aria-disabled":nn,tabIndex:nn?null:0,onClick:function(Fe){Fe.stopPropagation(),Jn(Fe)},onKeyDown:function(Fe){[En.SPACE,En.ENTER].includes(Fe.which)&&(Fe.preventDefault(),Jn(Fe))},onFocus:Pn},Gt),Zn&&ze.createElement("button",{type:"button","aria-label":vn||"remove",tabIndex:0,className:"".concat(jn,"-remove"),onClick:function(Fe){Fe.stopPropagation(),Qn(Fe)}},Gn||hn.removeIcon||"\xD7"));return Wn?Wn(hr):hr}var tr=sr,pr=function(Be){return+setTimeout(Be,16)},Hn=function(Be){return clearTimeout(Be)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(pr=function(Be){return window.requestAnimationFrame(Be)},Hn=function(Be){return window.cancelAnimationFrame(Be)});var Ze=0,at=new Map;function Et(_e){at.delete(_e)}var jt=function(Be){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ze+=1;var We=Ze;function qe(rt){if(rt===0)Et(We),Be();else{var bt=pr(function(){qe(rt-1)});at.set(We,bt)}}return qe(Ne),We};jt.cancel=function(_e){var Be=at.get(_e);return Et(Be),Hn(Be)};var Ke=jt,dt=function(Be){var Ne=Be.activeTabOffset,We=Be.horizontal,qe=Be.rtl,rt=Be.indicatorSize,bt=(0,ze.useState)(),Gt=(0,pe.Z)(bt,2),nn=Gt[0],Gn=Gt[1],fr=(0,ze.useRef)(),Wn=function(Sn){return typeof rt=="function"?rt(Sn):typeof rt=="number"?rt:Sn};function vn(){Ke.cancel(fr.current)}return(0,ze.useEffect)(function(){var hn={};return Ne&&(We?(qe?(hn.right=Ne.right+Ne.width/2,hn.transform="translateX(50%)"):(hn.left=Ne.left+Ne.width/2,hn.transform="translateX(-50%)"),hn.width=Wn(Ne.width)):(hn.top=Ne.top+Ne.height/2,hn.transform="translateY(-50%)",hn.height=Wn(Ne.height))),vn(),fr.current=Ke(function(){Gn(hn)}),vn},[Ne,We,qe,rt]),{style:nn}},Rt=dt,Tt=function(Be){var Ne=Be.current||{},We=Ne.offsetWidth,qe=We===void 0?0:We,rt=Ne.offsetHeight,bt=rt===void 0?0:rt;return[qe,bt]},Wt=function(Be,Ne){return Be[Ne?0:1]};function Zt(_e,Be){var Ne,We=ze.useContext(je),qe=We.prefixCls,rt=We.tabs,bt=_e.className,Gt=_e.style,nn=_e.id,Gn=_e.animated,fr=_e.activeKey,Wn=_e.rtl,vn=_e.extra,hn=_e.editable,Sn=_e.locale,Pn=_e.tabPosition,ur=_e.tabBarGutter,jn=_e.children,Zn=_e.onTabClick,Jn=_e.onTabScroll,Qn=_e.indicatorSize,hr=(0,ze.useRef)(),Pe=(0,ze.useRef)(),Fe=(0,ze.useRef)(),wt=(0,ze.useRef)(),it=(0,ze.useRef)(),Ot=(0,ze.useRef)(),on=(0,ze.useRef)(),mn=Pn==="top"||Pn==="bottom",On=Nt(0,function(na,Oi){mn&&Jn&&Jn({direction:na>Oi?"left":"right"})}),xn=(0,pe.Z)(On,2),Qt=xn[0],Bn=xn[1],Kn=Nt(0,function(na,Oi){!mn&&Jn&&Jn({direction:na>Oi?"top":"bottom"})}),mr=(0,pe.Z)(Kn,2),Fn=mr[0],_r=mr[1],Zr=(0,ze.useState)([0,0]),Tr=(0,pe.Z)(Zr,2),$r=Tr[0],xr=Tr[1],Pr=(0,ze.useState)([0,0]),Yr=(0,pe.Z)(Pr,2),ai=Yr[0],Dr=Yr[1],li=(0,ze.useState)([0,0]),Pi=(0,pe.Z)(li,2),ta=Pi[0],Vi=Pi[1],Ni=(0,ze.useState)([0,0]),Xi=(0,pe.Z)(Ni,2),qi=Xi[0],bi=Xi[1],Fi=Bt(new Map),jr=(0,pe.Z)(Fi,2),ci=jr[0],Ti=jr[1],ji=Le(rt,ci,ai[0]),Na=Wt($r,mn),Fa=Wt(ai,mn),Aa=Wt(ta,mn),ua=Wt(qi,mn),Yi=Na<Fa+Aa,Mi=Yi?Na-ua:Na-Aa,Oa="".concat(qe,"-nav-operations-hidden"),ki=0,Jr=0;mn&&Wn?(ki=0,Jr=Math.max(0,Fa-Mi)):(ki=Math.min(0,Mi-Fa),Jr=0);function zi(na){return na<ki?ki:na>Jr?Jr:na}var ca=(0,ze.useRef)(),Ui=(0,ze.useState)(),ia=(0,pe.Z)(Ui,2),fi=ia[0],pa=ia[1];function xa(){pa(Date.now())}function fa(){window.clearTimeout(ca.current)}_t(wt,function(na,Oi){function Ta(_a,uo){_a(function(ao){var hs=zi(ao+uo);return hs})}return Yi?(mn?Ta(Bn,na):Ta(_r,Oi),fa(),xa(),!0):!1}),(0,ze.useEffect)(function(){return fa(),fi&&(ca.current=window.setTimeout(function(){pa(0)},100)),fa},[fi]);var wa=zt(ji,Mi,mn?Qt:Fn,Fa,Aa,ua,(0,xe.Z)((0,xe.Z)({},_e),{},{tabs:rt})),Ea=(0,pe.Z)(wa,2),Va=Ea[0],ha=Ea[1],ka=Ct(function(){var na=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fr,Oi=ji.get(na)||{width:0,height:0,left:0,right:0,top:0};if(mn){var Ta=Qt;Wn?Oi.right<Qt?Ta=Oi.right:Oi.right+Oi.width>Qt+Mi&&(Ta=Oi.right+Oi.width-Mi):Oi.left<-Qt?Ta=-Oi.left:Oi.left+Oi.width>-Qt+Mi&&(Ta=-(Oi.left+Oi.width-Mi)),_r(0),Bn(zi(Ta))}else{var _a=Fn;Oi.top<-Fn?_a=-Oi.top:Oi.top+Oi.height>-Fn+Mi&&(_a=-(Oi.top+Oi.height-Mi)),Bn(0),_r(zi(_a))}}),Ja={};Pn==="top"||Pn==="bottom"?Ja[Wn?"marginRight":"marginLeft"]=ur:Ja.marginTop=ur;var Ga=rt.map(function(na,Oi){var Ta=na.key;return ze.createElement(tr,{id:nn,prefixCls:qe,key:Ta,tab:na,style:Oi===0?void 0:Ja,closable:na.closable,editable:hn,active:Ta===fr,renderWrapper:jn,removeAriaLabel:Sn==null?void 0:Sn.removeAriaLabel,onClick:function(uo){Zn(Ta,uo)},onFocus:function(){ka(Ta),xa(),wt.current&&(Wn||(wt.current.scrollLeft=0),wt.current.scrollTop=0)}})}),so=function(){return Ti(function(){var Oi=new Map;return rt.forEach(function(Ta){var _a,uo=Ta.key,ao=(_a=it.current)===null||_a===void 0?void 0:_a.querySelector('[data-node-key="'.concat(Ee(uo),'"]'));ao&&Oi.set(uo,{width:ao.offsetWidth,height:ao.offsetHeight,left:ao.offsetLeft,top:ao.offsetTop})}),Oi})};(0,ze.useEffect)(function(){so()},[rt.map(function(na){return na.key}).join("_")]);var $a=en(function(){var na=Tt(hr),Oi=Tt(Pe),Ta=Tt(Fe);xr([na[0]-Oi[0]-Ta[0],na[1]-Oi[1]-Ta[1]]);var _a=Tt(on);Vi(_a);var uo=Tt(Ot);bi(uo);var ao=Tt(it);Dr([ao[0]-_a[0],ao[1]-_a[1]]),so()}),Ca=rt.slice(0,Va),_i=rt.slice(ha+1),Ki=[].concat((0,Ge.Z)(Ca),(0,Ge.Z)(_i)),da=ji.get(fr),Sa=Rt({activeTabOffset:da,horizontal:mn,rtl:Wn,indicatorSize:Qn}),Ka=Sa.style;(0,ze.useEffect)(function(){ka()},[fr,ki,Jr,Mn(da),Mn(ji),mn]),(0,ze.useEffect)(function(){$a()},[Wn]);var io=!!Ki.length,ho="".concat(qe,"-nav-wrap"),Oo,Ro,lo,Ao;return mn?Wn?(Ro=Qt>0,Oo=Qt!==Jr):(Oo=Qt<0,Ro=Qt!==ki):(lo=Fn<0,Ao=Fn!==ki),ze.createElement(Ht.Z,{onResize:$a},ze.createElement("div",{ref:ir(Be,hr),role:"tablist",className:be()("".concat(qe,"-nav"),bt),style:Gt,onKeyDown:function(){xa()}},ze.createElement(oe,{ref:Pe,position:"left",extra:vn,prefixCls:qe}),ze.createElement(Ht.Z,{onResize:$a},ze.createElement("div",{className:be()(ho,(Ne={},(0,Me.Z)(Ne,"".concat(ho,"-ping-left"),Oo),(0,Me.Z)(Ne,"".concat(ho,"-ping-right"),Ro),(0,Me.Z)(Ne,"".concat(ho,"-ping-top"),lo),(0,Me.Z)(Ne,"".concat(ho,"-ping-bottom"),Ao),Ne)),ref:wt},ze.createElement(Ht.Z,{onResize:$a},ze.createElement("div",{ref:it,className:"".concat(qe,"-nav-list"),style:{transform:"translate(".concat(Qt,"px, ").concat(Fn,"px)"),transition:fi?"none":void 0}},Ga,ze.createElement(ye,{ref:on,prefixCls:qe,locale:Sn,editable:hn,style:(0,xe.Z)((0,xe.Z)({},Ga.length===0?void 0:Ja),{},{visibility:io?"hidden":null})}),ze.createElement("div",{className:be()("".concat(qe,"-ink-bar"),(0,Me.Z)({},"".concat(qe,"-ink-bar-animated"),Gn.inkBar)),style:Ka}))))),ze.createElement(Tn,(0,Se.Z)({},_e,{removeAriaLabel:Sn==null?void 0:Sn.removeAriaLabel,ref:Ot,prefixCls:qe,tabs:Ki,className:!io&&Oa,tabMoving:!!fi})),ze.createElement(oe,{ref:Fe,position:"right",extra:vn,prefixCls:qe})))}var zn=ze.forwardRef(Zt),Sr=["renderTabBar"],Yn=["label","key"];function qn(_e){var Be=_e.renderTabBar,Ne=(0,mt.Z)(_e,Sr),We=ze.useContext(je),qe=We.tabs;if(Be){var rt=(0,xe.Z)((0,xe.Z)({},Ne),{},{panes:qe.map(function(bt){var Gt=bt.label,nn=bt.key,Gn=(0,mt.Z)(bt,Yn);return ze.createElement(Pt,(0,Se.Z)({tab:Gt,key:nn,tabKey:nn},Gn))})});return Be(rt,zn)}return ze.createElement(zn,Ne)}var nr={},ar=[],ot=function(Be){ar.push(Be)};function tt(_e,Be){if(0)var Ne}function vt(_e,Be){if(0)var Ne}function rn(){nr={}}function Dn(_e,Be,Ne){!Be&&!nr[Ne]&&(_e(!1,Ne),nr[Ne]=!0)}function an(_e,Be){Dn(tt,_e,Be)}function cn(_e,Be){Dn(vt,_e,Be)}an.preMessage=ot,an.resetWarned=rn,an.noteOnce=cn;var fn=null;function In(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Be;return _e===!1?Be={inkBar:!1,tabPane:!1}:_e===!0?Be={inkBar:!0,tabPane:!1}:Be=(0,xe.Z)({inkBar:!0},(0,Te.Z)(_e)==="object"?_e:{}),Be.tabPaneMotion&&Be.tabPane===void 0&&(Be.tabPane=!0),!Be.tabPaneMotion&&Be.tabPane&&(Be.tabPane=!1),Be}var or=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Ut=0;function qr(_e,Be){var Ne,We=_e.id,qe=_e.prefixCls,rt=qe===void 0?"rc-tabs":qe,bt=_e.className,Gt=_e.items,nn=_e.direction,Gn=_e.activeKey,fr=_e.defaultActiveKey,Wn=_e.editable,vn=_e.animated,hn=_e.tabPosition,Sn=hn===void 0?"top":hn,Pn=_e.tabBarGutter,ur=_e.tabBarStyle,jn=_e.tabBarExtraContent,Zn=_e.locale,Jn=_e.moreIcon,Qn=_e.moreTransitionName,hr=_e.destroyInactiveTabPane,Pe=_e.renderTabBar,Fe=_e.onChange,wt=_e.onTabClick,it=_e.onTabScroll,Ot=_e.getPopupContainer,on=_e.popupClassName,mn=_e.indicatorSize,On=(0,mt.Z)(_e,or),xn=ze.useMemo(function(){return(Gt||[]).filter(function(bi){return bi&&(0,Te.Z)(bi)==="object"&&"key"in bi})},[Gt]),Qt=nn==="rtl",Bn=In(vn),Kn=(0,ze.useState)(!1),mr=(0,pe.Z)(Kn,2),Fn=mr[0],_r=mr[1];(0,ze.useEffect)(function(){_r(It())},[]);var Zr=Ie(function(){var bi;return(bi=xn[0])===null||bi===void 0?void 0:bi.key},{value:Gn,defaultValue:fr}),Tr=(0,pe.Z)(Zr,2),$r=Tr[0],xr=Tr[1],Pr=(0,ze.useState)(function(){return xn.findIndex(function(bi){return bi.key===$r})}),Yr=(0,pe.Z)(Pr,2),ai=Yr[0],Dr=Yr[1];(0,ze.useEffect)(function(){var bi=xn.findIndex(function(jr){return jr.key===$r});if(bi===-1){var Fi;bi=Math.max(0,Math.min(ai,xn.length-1)),xr((Fi=xn[bi])===null||Fi===void 0?void 0:Fi.key)}Dr(bi)},[xn.map(function(bi){return bi.key}).join("_"),$r,ai]);var li=Ie(null,{value:We}),Pi=(0,pe.Z)(li,2),ta=Pi[0],Vi=Pi[1];(0,ze.useEffect)(function(){We||(Vi("rc-tabs-".concat(Ut)),Ut+=1)},[]);function Ni(bi,Fi){wt==null||wt(bi,Fi);var jr=bi!==$r;xr(bi),jr&&(Fe==null||Fe(bi))}var Xi={id:ta,activeKey:$r,animated:Bn,tabPosition:Sn,rtl:Qt,mobile:Fn},qi=(0,xe.Z)((0,xe.Z)({},Xi),{},{editable:Wn,locale:Zn,moreIcon:Jn,moreTransitionName:Qn,tabBarGutter:Pn,onTabClick:Ni,onTabScroll:it,extra:jn,style:ur,panes:null,getPopupContainer:Ot,popupClassName:on,indicatorSize:mn});return ze.createElement(je.Provider,{value:{tabs:xn,prefixCls:rt}},ze.createElement("div",(0,Se.Z)({ref:Be,id:We,className:be()(rt,"".concat(rt,"-").concat(Sn),(Ne={},(0,Me.Z)(Ne,"".concat(rt,"-mobile"),Fn),(0,Me.Z)(Ne,"".concat(rt,"-editable"),Wn),(0,Me.Z)(Ne,"".concat(rt,"-rtl"),Qt),Ne),bt)},On),ze.createElement(qn,(0,Se.Z)({},qi,{renderTabBar:Pe})),ze.createElement(Lt,(0,Se.Z)({destroyInactiveTabPane:hr},Xi,{animated:Bn}))))}var Fr=ze.forwardRef(qr),Ri=Fr,Li=Ri,pi=se(53124),Gi=se(98675),ii=()=>null,Bi=se(33603);const Zi={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Vr(_e){let Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Ne;return Be===!1?Ne={inkBar:!1,tabPane:!1}:Be===!0?Ne={inkBar:!0,tabPane:!0}:Ne=Object.assign({inkBar:!0},typeof Be=="object"?Be:{}),Ne.tabPane&&(Ne.tabPaneMotion=Object.assign(Object.assign({},Zi),{motionName:(0,Bi.m)(_e,"switch")})),Ne}var mi=se(37419),Wi=function(_e,Be){var Ne={};for(var We in _e)Object.prototype.hasOwnProperty.call(_e,We)&&Be.indexOf(We)<0&&(Ne[We]=_e[We]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,We=Object.getOwnPropertySymbols(_e);qe<We.length;qe++)Be.indexOf(We[qe])<0&&Object.prototype.propertyIsEnumerable.call(_e,We[qe])&&(Ne[We[qe]]=_e[We[qe]]);return Ne};function la(_e){return _e.filter(Be=>Be)}function ea(_e,Be){if(_e)return _e;const Ne=(0,mi.Z)(Be).map(We=>{if(ze.isValidElement(We)){const{key:qe,props:rt}=We,bt=rt||{},{tab:Gt}=bt,nn=Wi(bt,["tab"]);return Object.assign(Object.assign({key:String(qe)},nn),{label:Gt})}return null});return la(Ne)}var ti=se(14747),yt=se(67968),pt=se(45503),$t=se(67771),_n=_e=>{const{componentCls:Be,motionDurationSlow:Ne}=_e;return[{[Be]:{[`${Be}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Ne}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Ne}`}}}}},[(0,$t.oN)(_e,"slide-up"),(0,$t.oN)(_e,"slide-down")]]};const cr=_e=>{const{componentCls:Be,tabsCardPadding:Ne,cardBg:We,cardGutter:qe,colorBorderSecondary:rt,itemSelectedColor:bt}=_e;return{[`${Be}-card`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{margin:0,padding:Ne,background:We,border:`${_e.lineWidth}px ${_e.lineType} ${rt}`,transition:`all ${_e.motionDurationSlow} ${_e.motionEaseInOut}`},[`${Be}-tab-active`]:{color:bt,background:_e.colorBgContainer},[`${Be}-ink-bar`]:{visibility:"hidden"}},[`&${Be}-top, &${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginLeft:{_skip_check_:!0,value:`${qe}px`}}}},[`&${Be}-top`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:`${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0 0`},[`${Be}-tab-active`]:{borderBottomColor:_e.colorBgContainer}}},[`&${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:`0 0 ${_e.borderRadiusLG}px ${_e.borderRadiusLG}px`},[`${Be}-tab-active`]:{borderTopColor:_e.colorBgContainer}}},[`&${Be}-left, &${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginTop:`${qe}px`}}},[`&${Be}-left`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`${_e.borderRadiusLG}px 0 0 ${_e.borderRadiusLG}px`}},[`${Be}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:_e.colorBgContainer}}}},[`&${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0`}},[`${Be}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:_e.colorBgContainer}}}}}}},Mr=_e=>{const{componentCls:Be,itemHoverColor:Ne,dropdownEdgeChildVerticalPadding:We}=_e;return{[`${Be}-dropdown`]:Object.assign(Object.assign({},(0,ti.Wf)(_e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:_e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Be}-dropdown-menu`]:{maxHeight:_e.tabsDropdownHeight,margin:0,padding:`${We}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:_e.colorBgContainer,backgroundClip:"padding-box",borderRadius:_e.borderRadiusLG,outline:"none",boxShadow:_e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},ti.vS),{display:"flex",alignItems:"center",minWidth:_e.tabsDropdownWidth,margin:0,padding:`${_e.paddingXXS}px ${_e.paddingSM}px`,color:_e.colorText,fontWeight:"normal",fontSize:_e.fontSize,lineHeight:_e.lineHeight,cursor:"pointer",transition:`all ${_e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:_e.marginSM},color:_e.colorTextDescription,fontSize:_e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Ne}},"&:hover":{background:_e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:_e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Br=_e=>{const{componentCls:Be,margin:Ne,colorBorderSecondary:We,horizontalMargin:qe,verticalItemPadding:rt,verticalItemMargin:bt}=_e;return{[`${Be}-top, ${Be}-bottom`]:{flexDirection:"column",[`> ${Be}-nav, > div > ${Be}-nav`]:{margin:qe,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${_e.lineWidth}px ${_e.lineType} ${We}`,content:"''"},[`${Be}-ink-bar`]:{height:_e.lineWidthBold,"&-animated":{transition:`width ${_e.motionDurationSlow}, left ${_e.motionDurationSlow},
|
|
|
right ${_e.motionDurationSlow}`}},[`${Be}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:_e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:_e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:_e.boxShadowTabsOverflowRight},[`&${Be}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Be}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Be}-top`]:{[`> ${Be}-nav,
|
|
|
> div > ${Be}-nav`]:{"&::before":{bottom:0},[`${Be}-ink-bar`]:{bottom:0}}},[`${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{order:1,marginTop:`${Ne}px`,marginBottom:0,"&::before":{top:0},[`${Be}-ink-bar`]:{top:0}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{order:0}},[`${Be}-left, ${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{flexDirection:"column",minWidth:_e.controlHeight*1.25,[`${Be}-tab`]:{padding:rt,textAlign:"center"},[`${Be}-tab + ${Be}-tab`]:{margin:bt},[`${Be}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:_e.controlHeight},"&::before":{top:0,boxShadow:_e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:_e.boxShadowTabsOverflowBottom},[`&${Be}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Be}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Be}-ink-bar`]:{width:_e.lineWidthBold,"&-animated":{transition:`height ${_e.motionDurationSlow}, top ${_e.motionDurationSlow}`}},[`${Be}-nav-list, ${Be}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Be}-left`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${_e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`},[`> ${Be}-content > ${Be}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:_e.paddingLG}}}},[`${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{order:1,[`${Be}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-_e.lineWidth},borderRight:{_skip_check_:!0,value:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`},[`> ${Be}-content > ${Be}-tabpane`]:{paddingRight:{_skip_check_:!0,value:_e.paddingLG}}}}}},Kr=_e=>{const{componentCls:Be,cardPaddingSM:Ne,cardPaddingLG:We,horizontalItemPaddingSM:qe,horizontalItemPaddingLG:rt}=_e;return{[Be]:{"&-small":{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:qe,fontSize:_e.titleFontSizeSM}}},"&-large":{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:rt,fontSize:_e.titleFontSizeLG}}}},[`${Be}-card`]:{[`&${Be}-small`]:{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:Ne}},[`&${Be}-bottom`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:`0 0 ${_e.borderRadius}px ${_e.borderRadius}px`}},[`&${Be}-top`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:`${_e.borderRadius}px ${_e.borderRadius}px 0 0`}},[`&${Be}-right`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${_e.borderRadius}px ${_e.borderRadius}px 0`}}},[`&${Be}-left`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`${_e.borderRadius}px 0 0 ${_e.borderRadius}px`}}}},[`&${Be}-large`]:{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:We}}}}}},Rr=_e=>{const{componentCls:Be,itemActiveColor:Ne,itemHoverColor:We,iconCls:qe,tabsHorizontalItemMargin:rt,horizontalItemPadding:bt,itemSelectedColor:Gt,itemColor:nn}=_e,Gn=`${Be}-tab`;return{[Gn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:bt,fontSize:_e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:nn,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Ne}},(0,ti.Qy)(_e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-_e.marginXXS},marginLeft:{_skip_check_:!0,value:_e.marginXS},color:_e.colorTextDescription,fontSize:_e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${_e.motionDurationSlow}`,"&:hover":{color:_e.colorTextHeading}},"&:hover":{color:We},[`&${Gn}-active ${Gn}-btn`]:{color:Gt,textShadow:_e.tabsActiveTextShadow},[`&${Gn}-disabled`]:{color:_e.colorTextDisabled,cursor:"not-allowed"},[`&${Gn}-disabled ${Gn}-btn, &${Gn}-disabled ${Be}-remove`]:{"&:focus, &:active":{color:_e.colorTextDisabled}},[`& ${Gn}-remove ${qe}`]:{margin:0},[qe]:{marginRight:{_skip_check_:!0,value:_e.marginSM}}},[`${Gn} + ${Gn}`]:{margin:{_skip_check_:!0,value:rt}}}},Qr=_e=>{const{componentCls:Be,tabsHorizontalItemMarginRTL:Ne,iconCls:We,cardGutter:qe}=_e;return{[`${Be}-rtl`]:{direction:"rtl",[`${Be}-nav`]:{[`${Be}-tab`]:{margin:{_skip_check_:!0,value:Ne},[`${Be}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[We]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${_e.marginSM}px`}},[`${Be}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${_e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${_e.marginXXS}px`},[We]:{margin:0}}}},[`&${Be}-left`]:{[`> ${Be}-nav`]:{order:1},[`> ${Be}-content-holder`]:{order:0}},[`&${Be}-right`]:{[`> ${Be}-nav`]:{order:0},[`> ${Be}-content-holder`]:{order:1}},[`&${Be}-card${Be}-top, &${Be}-card${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginRight:{_skip_check_:!0,value:qe},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Be}-dropdown-rtl`]:{direction:"rtl"},[`${Be}-menu-item`]:{[`${Be}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},gi=_e=>{const{componentCls:Be,tabsCardPadding:Ne,cardHeight:We,cardGutter:qe,itemHoverColor:rt,itemActiveColor:bt,colorBorderSecondary:Gt}=_e;return{[Be]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ti.Wf)(_e)),{display:"flex",[`> ${Be}-nav, > div > ${Be}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Be}-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 ${_e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Be}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${_e.motionDurationSlow}`},[`${Be}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Be}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Be}-nav-more`]:{position:"relative",padding:Ne,background:"transparent",border:0,color:_e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:_e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Be}-nav-add`]:Object.assign({minWidth:We,marginLeft:{_skip_check_:!0,value:qe},padding:`0 ${_e.paddingXS}px`,background:"transparent",border:`${_e.lineWidth}px ${_e.lineType} ${Gt}`,borderRadius:`${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:_e.colorText,transition:`all ${_e.motionDurationSlow} ${_e.motionEaseInOut}`,"&:hover":{color:rt},"&:active, &:focus:not(:focus-visible)":{color:bt}},(0,ti.Qy)(_e))},[`${Be}-extra-content`]:{flex:"none"},[`${Be}-ink-bar`]:{position:"absolute",background:_e.inkBarColor,pointerEvents:"none"}}),Rr(_e)),{[`${Be}-content`]:{position:"relative",width:"100%"},[`${Be}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Be}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Be}-centered`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-nav-wrap`]:{[`&:not([class*='${Be}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Cr=(0,yt.Z)("Tabs",_e=>{const Be=(0,pt.TS)(_e,{tabsCardPadding:_e.cardPadding||`${(_e.cardHeight-Math.round(_e.fontSize*_e.lineHeight))/2-_e.lineWidth}px ${_e.padding}px`,dropdownEdgeChildVerticalPadding:_e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${_e.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${_e.horizontalItemGutter}px`});return[Kr(Be),Qr(Be),Br(Be),Mr(Be),cr(Be),gi(Be),_n(Be)]},_e=>{const Be=_e.controlHeightLG;return{zIndexPopup:_e.zIndexPopupBase+50,cardBg:_e.colorFillAlter,cardHeight:Be,cardPadding:"",cardPaddingSM:`${_e.paddingXXS*1.5}px ${_e.padding}px`,cardPaddingLG:`${_e.paddingXS}px ${_e.padding}px ${_e.paddingXXS*1.5}px`,titleFontSize:_e.fontSize,titleFontSizeLG:_e.fontSizeLG,titleFontSizeSM:_e.fontSize,inkBarColor:_e.colorPrimary,horizontalMargin:`0 0 ${_e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${_e.paddingSM}px 0`,horizontalItemPaddingSM:`${_e.paddingXS}px 0`,horizontalItemPaddingLG:`${_e.padding}px 0`,verticalItemPadding:`${_e.paddingXS}px ${_e.paddingLG}px`,verticalItemMargin:`${_e.margin}px 0 0 0`,itemColor:_e.colorText,itemSelectedColor:_e.colorPrimary,itemHoverColor:_e.colorPrimaryHover,itemActiveColor:_e.colorPrimaryActive,cardGutter:_e.marginXXS/2}}),di=function(_e,Be){var Ne={};for(var We in _e)Object.prototype.hasOwnProperty.call(_e,We)&&Be.indexOf(We)<0&&(Ne[We]=_e[We]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,We=Object.getOwnPropertySymbols(_e);qe<We.length;qe++)Be.indexOf(We[qe])<0&&Object.prototype.propertyIsEnumerable.call(_e,We[qe])&&(Ne[We[qe]]=_e[We[qe]]);return Ne};const Ai=_e=>{const{type:Be,className:Ne,rootClassName:We,size:qe,onEdit:rt,hideAdd:bt,centered:Gt,addIcon:nn,popupClassName:Gn,children:fr,items:Wn,animated:vn,style:hn,indicatorSize:Sn}=_e,Pn=di(_e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:ur,moreIcon:jn=ze.createElement(et.Z,null)}=Pn,{direction:Zn,tabs:Jn,getPrefixCls:Qn,getPopupContainer:hr}=ze.useContext(pi.E_),Pe=Qn("tabs",ur),[Fe,wt]=Cr(Pe);let it;Be==="editable-card"&&(it={onEdit:(Qt,Bn)=>{let{key:Kn,event:mr}=Bn;rt==null||rt(Qt==="add"?mr:Kn,Qt)},removeIcon:ze.createElement(fe.Z,null),addIcon:nn||ze.createElement($e.Z,null),showAdd:bt!==!0});const Ot=Qn(),on=ea(Wn,fr),mn=Vr(Pe,vn),On=(0,Gi.Z)(qe),xn=Object.assign(Object.assign({},Jn==null?void 0:Jn.style),hn);return Fe(ze.createElement(Li,Object.assign({direction:Zn,getPopupContainer:hr,moreTransitionName:`${Ot}-slide-up`},Pn,{items:on,className:be()({[`${Pe}-${On}`]:On,[`${Pe}-card`]:["card","editable-card"].includes(Be),[`${Pe}-editable-card`]:Be==="editable-card",[`${Pe}-centered`]:Gt},Jn==null?void 0:Jn.className,Ne,We,wt),popupClassName:be()(Gn,wt),style:xn,editable:it,moreIcon:jn,prefixCls:Pe,animated:mn,indicatorSize:Sn!=null?Sn:Jn==null?void 0:Jn.indicatorSize})))};Ai.TabPane=ii;var Si=Ai},59810:function(Cn,Xt,se){"use strict";se.d(Xt,{default:function(){return ar}});var fe=se(67294),et=se(74902),$e=se(94184),Ue=se.n($e),be=se(87462),Se=se(15671),Me=se(43144),xe=se(60136),pe=se(51630),Te=se(4942),mt=se(45987),ze=se(74165),It=se(71002),Ct=se(15861),ht=se(64217);function Ye(ot,tt){var vt="cannot ".concat(ot.method," ").concat(ot.action," ").concat(tt.status,"'"),rn=new Error(vt);return rn.status=tt.status,rn.method=ot.method,rn.url=ot.action,rn}function De(ot){var tt=ot.responseText||ot.response;if(!tt)return tt;try{return JSON.parse(tt)}catch(vt){return tt}}function At(ot){var tt=new XMLHttpRequest;ot.onProgress&&tt.upload&&(tt.upload.onprogress=function(an){an.total>0&&(an.percent=an.loaded/an.total*100),ot.onProgress(an)});var vt=new FormData;ot.data&&Object.keys(ot.data).forEach(function(Dn){var an=ot.data[Dn];if(Array.isArray(an)){an.forEach(function(cn){vt.append("".concat(Dn,"[]"),cn)});return}vt.append(Dn,an)}),ot.file instanceof Blob?vt.append(ot.filename,ot.file,ot.file.name):vt.append(ot.filename,ot.file),tt.onerror=function(an){ot.onError(an)},tt.onload=function(){return tt.status<200||tt.status>=300?ot.onError(Ye(ot,tt),De(tt)):ot.onSuccess(De(tt),tt)},tt.open(ot.method,ot.action,!0),ot.withCredentials&&"withCredentials"in tt&&(tt.withCredentials=!0);var rn=ot.headers||{};return rn["X-Requested-With"]!==null&&tt.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(rn).forEach(function(Dn){rn[Dn]!==null&&tt.setRequestHeader(Dn,rn[Dn])}),tt.send(vt),{abort:function(){tt.abort()}}}var Jt=+new Date,nt=0;function lt(){return"rc-upload-".concat(Jt,"-").concat(++nt)}var Ie=se(80334),ke=function(ot,tt){if(ot&&tt){var vt=Array.isArray(tt)?tt:tt.split(","),rn=ot.name||"",Dn=ot.type||"",an=Dn.replace(/\/.*$/,"");return vt.some(function(cn){var fn=cn.trim();if(/^\*(\/\*)?$/.test(cn))return!0;if(fn.charAt(0)==="."){var In=rn.toLowerCase(),or=fn.toLowerCase(),Ut=[or];return(or===".jpg"||or===".jpeg")&&(Ut=[".jpg",".jpeg"]),Ut.some(function(qr){return In.endsWith(qr)})}return/\/\*$/.test(fn)?an===fn.replace(/\/.*$/,""):Dn===fn?!0:/^\w+$/.test(fn)?((0,Ie.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(fn,"'.Skip for check.")),!0):!1})}return!0};function je(ot,tt){var vt=ot.createReader(),rn=[];function Dn(){vt.readEntries(function(an){var cn=Array.prototype.slice.apply(an);rn=rn.concat(cn);var fn=!cn.length;fn?tt(rn):Dn()})}Dn()}var Xe=function(tt,vt,rn){var Dn=function an(cn,fn){cn&&(cn.path=fn||"",cn.isFile?cn.file(function(In){rn(In)&&(cn.fullPath&&!In.webkitRelativePath&&(Object.defineProperties(In,{webkitRelativePath:{writable:!0}}),In.webkitRelativePath=cn.fullPath.replace(/^\//,""),Object.defineProperties(In,{webkitRelativePath:{writable:!1}})),vt([In]))}):cn.isDirectory&&je(cn,function(In){In.forEach(function(or){an(or,"".concat(fn).concat(cn.name,"/"))})}))};tt.forEach(function(an){Dn(an.webkitGetAsEntry())})},Pt=Xe,kt=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Lt=function(ot){(0,xe.Z)(vt,ot);var tt=(0,pe.Z)(vt);function vt(){var rn;(0,Se.Z)(this,vt);for(var Dn=arguments.length,an=new Array(Dn),cn=0;cn<Dn;cn++)an[cn]=arguments[cn];return rn=tt.call.apply(tt,[this].concat(an)),rn.state={uid:lt()},rn.reqs={},rn.fileInput=void 0,rn._isMounted=void 0,rn.onChange=function(fn){var In=rn.props,or=In.accept,Ut=In.directory,qr=fn.target.files,Fr=(0,et.Z)(qr).filter(function(Ri){return!Ut||ke(Ri,or)});rn.uploadFiles(Fr),rn.reset()},rn.onClick=function(fn){var In=rn.fileInput;if(In){var or=rn.props,Ut=or.children,qr=or.onClick;if(Ut&&Ut.type==="button"){var Fr=In.parentNode;Fr.focus(),Fr.querySelector("button").blur()}In.click(),qr&&qr(fn)}},rn.onKeyDown=function(fn){fn.key==="Enter"&&rn.onClick(fn)},rn.onFileDrop=function(fn){var In=rn.props.multiple;if(fn.preventDefault(),fn.type!=="dragover")if(rn.props.directory)Pt(Array.prototype.slice.call(fn.dataTransfer.items),rn.uploadFiles,function(Ut){return ke(Ut,rn.props.accept)});else{var or=(0,et.Z)(fn.dataTransfer.files).filter(function(Ut){return ke(Ut,rn.props.accept)});In===!1&&(or=or.slice(0,1)),rn.uploadFiles(or)}},rn.uploadFiles=function(fn){var In=(0,et.Z)(fn),or=In.map(function(Ut){return Ut.uid=lt(),rn.processFile(Ut,In)});Promise.all(or).then(function(Ut){var qr=rn.props.onBatchStart;qr==null||qr(Ut.map(function(Fr){var Ri=Fr.origin,Li=Fr.parsedFile;return{file:Ri,parsedFile:Li}})),Ut.filter(function(Fr){return Fr.parsedFile!==null}).forEach(function(Fr){rn.post(Fr)})})},rn.processFile=function(){var fn=(0,Ct.Z)((0,ze.Z)().mark(function In(or,Ut){var qr,Fr,Ri,Li,pi,Gi,yi,ii,Bi;return(0,ze.Z)().wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:if(qr=rn.props.beforeUpload,Fr=or,!qr){Vr.next=14;break}return Vr.prev=3,Vr.next=6,qr(or,Ut);case 6:Fr=Vr.sent,Vr.next=12;break;case 9:Vr.prev=9,Vr.t0=Vr.catch(3),Fr=!1;case 12:if(Fr!==!1){Vr.next=14;break}return Vr.abrupt("return",{origin:or,parsedFile:null,action:null,data:null});case 14:if(Ri=rn.props.action,typeof Ri!="function"){Vr.next=21;break}return Vr.next=18,Ri(or);case 18:Li=Vr.sent,Vr.next=22;break;case 21:Li=Ri;case 22:if(pi=rn.props.data,typeof pi!="function"){Vr.next=29;break}return Vr.next=26,pi(or);case 26:Gi=Vr.sent,Vr.next=30;break;case 29:Gi=pi;case 30:return yi=((0,It.Z)(Fr)==="object"||typeof Fr=="string")&&Fr?Fr:or,yi instanceof File?ii=yi:ii=new File([yi],or.name,{type:or.type}),Bi=ii,Bi.uid=or.uid,Vr.abrupt("return",{origin:or,data:Gi,parsedFile:Bi,action:Li});case 35:case"end":return Vr.stop()}},In,null,[[3,9]])}));return function(In,or){return fn.apply(this,arguments)}}(),rn.saveFileInput=function(fn){rn.fileInput=fn},rn}return(0,Me.Z)(vt,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(Dn){var an=this,cn=Dn.data,fn=Dn.origin,In=Dn.action,or=Dn.parsedFile;if(this._isMounted){var Ut=this.props,qr=Ut.onStart,Fr=Ut.customRequest,Ri=Ut.name,Li=Ut.headers,pi=Ut.withCredentials,Gi=Ut.method,yi=fn.uid,ii=Fr||At,Bi={action:In,filename:Ri,data:cn,file:or,headers:Li,withCredentials:pi,method:Gi||"post",onProgress:function(Vr){var mi=an.props.onProgress;mi==null||mi(Vr,or)},onSuccess:function(Vr,mi){var Wi=an.props.onSuccess;Wi==null||Wi(Vr,or,mi),delete an.reqs[yi]},onError:function(Vr,mi){var Wi=an.props.onError;Wi==null||Wi(Vr,mi,or),delete an.reqs[yi]}};qr(fn),this.reqs[yi]=ii(Bi)}}},{key:"reset",value:function(){this.setState({uid:lt()})}},{key:"abort",value:function(Dn){var an=this.reqs;if(Dn){var cn=Dn.uid?Dn.uid:Dn;an[cn]&&an[cn].abort&&an[cn].abort(),delete an[cn]}else Object.keys(an).forEach(function(fn){an[fn]&&an[fn].abort&&an[fn].abort(),delete an[fn]})}},{key:"render",value:function(){var Dn,an=this.props,cn=an.component,fn=an.prefixCls,In=an.className,or=an.disabled,Ut=an.id,qr=an.style,Fr=an.multiple,Ri=an.accept,Li=an.capture,pi=an.children,Gi=an.directory,yi=an.openFileDialogOnClick,ii=an.onMouseEnter,Bi=an.onMouseLeave,Zi=(0,mt.Z)(an,kt),Vr=Ue()((Dn={},(0,Te.Z)(Dn,fn,!0),(0,Te.Z)(Dn,"".concat(fn,"-disabled"),or),(0,Te.Z)(Dn,In,In),Dn)),mi=Gi?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},Wi=or?{}:{onClick:yi?this.onClick:function(){},onKeyDown:yi?this.onKeyDown:function(){},onMouseEnter:ii,onMouseLeave:Bi,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return fe.createElement(cn,(0,be.Z)({},Wi,{className:Vr,role:"button",style:qr}),fe.createElement("input",(0,be.Z)({},(0,ht.Z)(Zi,{aria:!0,data:!0}),{id:Ut,disabled:or,type:"file",ref:this.saveFileInput,onClick:function(ea){return ea.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Ri},mi,{multiple:Fr,onChange:this.onChange},Li!=null?{capture:Li}:{})),pi)}}]),vt}(fe.Component),Ge=Lt;function Ht(){}var Dt=function(ot){(0,xe.Z)(vt,ot);var tt=(0,pe.Z)(vt);function vt(){var rn;(0,Se.Z)(this,vt);for(var Dn=arguments.length,an=new Array(Dn),cn=0;cn<Dn;cn++)an[cn]=arguments[cn];return rn=tt.call.apply(tt,[this].concat(an)),rn.uploader=void 0,rn.saveUploader=function(fn){rn.uploader=fn},rn}return(0,Me.Z)(vt,[{key:"abort",value:function(Dn){this.uploader.abort(Dn)}},{key:"render",value:function(){return fe.createElement(Ge,(0,be.Z)({},this.props,{ref:this.saveUploader}))}}]),vt}(fe.Component);Dt.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Ht,onError:Ht,onSuccess:Ht,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var Ln=Dt,un=Ln,Rn=se(5663),ir=se(73935),yr=se(53124),Qe=se(98866),Le=se(10110),Nt=se(24457),Nn={icon:function(tt,vt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:vt}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:tt}}]}},name:"file",theme:"twotone"},gn=Nn,Je=se(84089),st=function(tt,vt){return fe.createElement(Je.Z,(0,be.Z)({},tt,{ref:vt,icon:gn}))},_t=fe.forwardRef(st),en=se(3407),Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Ft=Bt,zt=function(tt,vt){return fe.createElement(Je.Z,(0,be.Z)({},tt,{ref:vt,icon:Ft}))},Mn=fe.forwardRef(zt),bn={icon:function(tt,vt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:tt}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:vt}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:vt}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:vt}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:tt}}]}},name:"picture",theme:"twotone"},Ee=bn,ce=function(tt,vt){return fe.createElement(Je.Z,(0,be.Z)({},tt,{ref:vt,icon:Ee}))},le=fe.forwardRef(ce),ye=se(38379),ve=se(57838),oe=se(33603),He=se(96159),xt=se(71577);function Yt(ot){return Object.assign(Object.assign({},ot),{lastModified:ot.lastModified,lastModifiedDate:ot.lastModifiedDate,name:ot.name,size:ot.size,type:ot.type,uid:ot.uid,percent:0,originFileObj:ot})}function pn(ot,tt){const vt=(0,et.Z)(tt),rn=vt.findIndex(Dn=>{let{uid:an}=Dn;return an===ot.uid});return rn===-1?vt.push(ot):vt[rn]=ot,vt}function dn(ot,tt){const vt=ot.uid!==void 0?"uid":"name";return tt.filter(rn=>rn[vt]===ot[vt])[0]}function An(ot,tt){const vt=ot.uid!==void 0?"uid":"name",rn=tt.filter(Dn=>Dn[vt]!==ot[vt]);return rn.length===tt.length?null:rn}const tn=function(){const tt=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),rn=tt[tt.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(rn)||[""])[0]},Nr=ot=>ot.indexOf("image/")===0,Wr=ot=>{if(ot.type&&!ot.thumbUrl)return Nr(ot.type);const tt=ot.thumbUrl||ot.url||"",vt=tn(tt);return/^data:image\//.test(tt)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(vt)?!0:!(/^data:/.test(tt)||vt)},Kt=200;function $n(ot){return new Promise(tt=>{if(!ot.type||!Nr(ot.type)){tt("");return}const vt=document.createElement("canvas");vt.width=Kt,vt.height=Kt,vt.style.cssText=`position: fixed; left: 0; top: 0; width: ${Kt}px; height: ${Kt}px; z-index: 9999; display: none;`,document.body.appendChild(vt);const rn=vt.getContext("2d"),Dn=new Image;if(Dn.onload=()=>{const{width:an,height:cn}=Dn;let fn=Kt,In=Kt,or=0,Ut=0;an>cn?(In=cn*(Kt/an),Ut=-(In-fn)/2):(fn=an*(Kt/cn),or=-(fn-In)/2),rn.drawImage(Dn,or,Ut,fn,In);const qr=vt.toDataURL();document.body.removeChild(vt),window.URL.revokeObjectURL(Dn.src),tt(qr)},Dn.crossOrigin="anonymous",ot.type.startsWith("image/svg+xml")){const an=new FileReader;an.onload=()=>{an.result&&(Dn.src=an.result)},an.readAsDataURL(ot)}else if(ot.type.startsWith("image/gif")){const an=new FileReader;an.onload=()=>{an.result&&tt(an.result)},an.readAsDataURL(ot)}else Dn.src=window.URL.createObjectURL(ot)})}var ei=se(84249),hi=se(90674),ut=se(99569),Vt=se(38703),Vn=se(83062),gr=fe.forwardRef((ot,tt)=>{let{prefixCls:vt,className:rn,style:Dn,locale:an,listType:cn,file:fn,items:In,progress:or,iconRender:Ut,actionIconRender:qr,itemRender:Fr,isImgUrl:Ri,showPreviewIcon:Li,showRemoveIcon:pi,showDownloadIcon:Gi,previewIcon:yi,removeIcon:ii,downloadIcon:Bi,onPreview:Zi,onDownload:Vr,onClose:mi}=ot;var Wi,la;const{status:ea}=fn,[ti,yt]=fe.useState(ea);fe.useEffect(()=>{ea!=="removed"&&yt(ea)},[ea]);const[pt,$t]=fe.useState(!1);fe.useEffect(()=>{const qe=setTimeout(()=>{$t(!0)},300);return()=>{clearTimeout(qe)}},[]);const sn=Ut(fn);let _n=fe.createElement("div",{className:`${vt}-icon`},sn);if(cn==="picture"||cn==="picture-card"||cn==="picture-circle")if(ti==="uploading"||!fn.thumbUrl&&!fn.url){const qe=Ue()(`${vt}-list-item-thumbnail`,{[`${vt}-list-item-file`]:ti!=="uploading"});_n=fe.createElement("div",{className:qe},sn)}else{const qe=Ri!=null&&Ri(fn)?fe.createElement("img",{src:fn.thumbUrl||fn.url,alt:fn.name,className:`${vt}-list-item-image`,crossOrigin:fn.crossOrigin}):sn,rt=Ue()(`${vt}-list-item-thumbnail`,{[`${vt}-list-item-file`]:Ri&&!Ri(fn)});_n=fe.createElement("a",{className:rt,onClick:bt=>Zi(fn,bt),href:fn.url||fn.thumbUrl,target:"_blank",rel:"noopener noreferrer"},qe)}const cr=Ue()(`${vt}-list-item`,`${vt}-list-item-${ti}`),Mr=typeof fn.linkProps=="string"?JSON.parse(fn.linkProps):fn.linkProps,Br=pi?qr((typeof ii=="function"?ii(fn):ii)||fe.createElement(ei.Z,null),()=>mi(fn),vt,an.removeFile):null,Kr=Gi&&ti==="done"?qr((typeof Bi=="function"?Bi(fn):Bi)||fe.createElement(hi.Z,null),()=>Vr(fn),vt,an.downloadFile):null,Rr=cn!=="picture-card"&&cn!=="picture-circle"&&fe.createElement("span",{key:"download-delete",className:Ue()(`${vt}-list-item-actions`,{picture:cn==="picture"})},Kr,Br),Qr=Ue()(`${vt}-list-item-name`),gi=fn.url?[fe.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:Qr,title:fn.name},Mr,{href:fn.url,onClick:qe=>Zi(fn,qe)}),fn.name),Rr]:[fe.createElement("span",{key:"view",className:Qr,onClick:qe=>Zi(fn,qe),title:fn.name},fn.name),Rr],Cr={pointerEvents:"none",opacity:.5},di=Li?fe.createElement("a",{href:fn.url||fn.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:fn.url||fn.thumbUrl?void 0:Cr,onClick:qe=>Zi(fn,qe),title:an.previewFile},typeof yi=="function"?yi(fn):yi||fe.createElement(ut.Z,null)):null,Ai=(cn==="picture-card"||cn==="picture-circle")&&ti!=="uploading"&&fe.createElement("span",{className:`${vt}-list-item-actions`},di,ti==="done"&&Kr,Br),{getPrefixCls:Si}=fe.useContext(yr.E_),_e=Si(),Be=fe.createElement("div",{className:cr},_n,gi,Ai,pt&&fe.createElement(ye.default,{motionName:`${_e}-fade`,visible:ti==="uploading",motionDeadline:2e3},qe=>{let{className:rt}=qe;const bt="percent"in fn?fe.createElement(Vt.Z,Object.assign({},or,{type:"line",percent:fn.percent,"aria-label":fn["aria-label"],"aria-labelledby":fn["aria-labelledby"]})):null;return fe.createElement("div",{className:Ue()(`${vt}-list-item-progress`,rt)},bt)})),Ne=fn.response&&typeof fn.response=="string"?fn.response:((Wi=fn.error)===null||Wi===void 0?void 0:Wi.statusText)||((la=fn.error)===null||la===void 0?void 0:la.message)||an.uploadError,We=ti==="error"?fe.createElement(Vn.Z,{title:Ne,getPopupContainer:qe=>qe.parentNode},Be):Be;return fe.createElement("div",{className:Ue()(`${vt}-list-item-container`,rn),style:Dn,ref:tt},Fr?Fr(We,fn,In,{download:Vr.bind(null,fn),preview:Zi.bind(null,fn),remove:mi.bind(null,fn)}):We)});const Ir=(ot,tt)=>{const{listType:vt="text",previewFile:rn=$n,onPreview:Dn,onDownload:an,onRemove:cn,locale:fn,iconRender:In,isImageUrl:or=Wr,prefixCls:Ut,items:qr=[],showPreviewIcon:Fr=!0,showRemoveIcon:Ri=!0,showDownloadIcon:Li=!1,removeIcon:pi,previewIcon:Gi,downloadIcon:yi,progress:ii={size:[-1,2],showInfo:!1},appendAction:Bi,appendActionVisible:Zi=!0,itemRender:Vr,disabled:mi}=ot,Wi=(0,ve.Z)(),[la,ea]=fe.useState(!1);fe.useEffect(()=>{vt!=="picture"&&vt!=="picture-card"&&vt!=="picture-circle"||(qr||[]).forEach(Cr=>{typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(Cr.originFileObj instanceof File||Cr.originFileObj instanceof Blob)||Cr.thumbUrl!==void 0||(Cr.thumbUrl="",rn&&rn(Cr.originFileObj).then(di=>{Cr.thumbUrl=di||"",Wi()}))})},[vt,qr,rn]),fe.useEffect(()=>{ea(!0)},[]);const ti=(Cr,di)=>{if(Dn)return di==null||di.preventDefault(),Dn(Cr)},yt=Cr=>{typeof an=="function"?an(Cr):Cr.url&&window.open(Cr.url)},pt=Cr=>{cn==null||cn(Cr)},$t=Cr=>{if(In)return In(Cr,vt);const di=Cr.status==="uploading",Ai=or&&or(Cr)?fe.createElement(le,null):fe.createElement(_t,null);let Si=di?fe.createElement(en.Z,null):fe.createElement(Mn,null);return vt==="picture"?Si=di?fe.createElement(en.Z,null):Ai:(vt==="picture-card"||vt==="picture-circle")&&(Si=di?fn.uploading:Ai),Si},sn=(Cr,di,Ai,Si)=>{const _e={type:"text",size:"small",title:Si,onClick:Be=>{di(),(0,He.l$)(Cr)&&Cr.props.onClick&&Cr.props.onClick(Be)},className:`${Ai}-list-item-action`,disabled:mi};if((0,He.l$)(Cr)){const Be=(0,He.Tm)(Cr,Object.assign(Object.assign({},Cr.props),{onClick:()=>{}}));return fe.createElement(xt.ZP,Object.assign({},_e,{icon:Be}))}return fe.createElement(xt.ZP,Object.assign({},_e),fe.createElement("span",null,Cr))};fe.useImperativeHandle(tt,()=>({handlePreview:ti,handleDownload:yt}));const{getPrefixCls:_n}=fe.useContext(yr.E_),cr=_n("upload",Ut),Mr=_n(),Br=Ue()(`${cr}-list`,`${cr}-list-${vt}`),Kr=(0,et.Z)(qr.map(Cr=>({key:Cr.uid,file:Cr})));let Qr={motionDeadline:2e3,motionName:`${cr}-${vt==="picture-card"||vt==="picture-circle"?"animate-inline":"animate"}`,keys:Kr,motionAppear:la};const gi=fe.useMemo(()=>{const Cr=Object.assign({},(0,oe.Z)(Mr));return delete Cr.onAppearEnd,delete Cr.onEnterEnd,delete Cr.onLeaveEnd,Cr},[Mr]);return vt!=="picture-card"&&vt!=="picture-circle"&&(Qr=Object.assign(Object.assign({},gi),Qr)),fe.createElement("div",{className:Br},fe.createElement(ye.CSSMotionList,Object.assign({},Qr,{component:!1}),Cr=>{let{key:di,file:Ai,className:Si,style:_e}=Cr;return fe.createElement(gr,{key:di,locale:fn,prefixCls:cr,className:Si,style:_e,file:Ai,items:qr,progress:ii,listType:vt,isImgUrl:or,showPreviewIcon:Fr,showRemoveIcon:Ri,showDownloadIcon:Li,removeIcon:pi,previewIcon:Gi,downloadIcon:yi,iconRender:$t,actionIconRender:sn,itemRender:Vr,onPreview:ti,onDownload:yt,onClose:pt})}),Bi&&fe.createElement(ye.default,Object.assign({},Qr,{visible:Zi,forceRender:!0}),Cr=>{let{className:di,style:Ai}=Cr;return(0,He.Tm)(Bi,Si=>({className:Ue()(Si.className,di),style:Object.assign(Object.assign(Object.assign({},Ai),{pointerEvents:di?"none":void 0}),Si.style)}))}))};var Gr=fe.forwardRef(Ir),Xr=se(14747),ui=se(33507),br=se(67968),Ei=se(45503),Ji=ot=>{const{componentCls:tt,iconCls:vt}=ot;return{[`${tt}-wrapper`]:{[`${tt}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:ot.colorFillAlter,border:`${ot.lineWidth}px dashed ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,cursor:"pointer",transition:`border-color ${ot.motionDurationSlow}`,[tt]:{padding:`${ot.padding}px 0`},[`${tt}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${tt}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${tt}-disabled):hover`]:{borderColor:ot.colorPrimaryHover},[`p${tt}-drag-icon`]:{marginBottom:ot.margin,[vt]:{color:ot.colorPrimary,fontSize:ot.uploadThumbnailSize}},[`p${tt}-text`]:{margin:`0 0 ${ot.marginXXS}px`,color:ot.colorTextHeading,fontSize:ot.fontSizeLG},[`p${tt}-hint`]:{color:ot.colorTextDescription,fontSize:ot.fontSize},[`&${tt}-disabled`]:{cursor:"not-allowed",[`p${tt}-drag-icon ${vt},
|
|
|
p${tt}-text,
|
|
|
p${tt}-hint
|
|
|
`]:{color:ot.colorTextDisabled}}}}}},Ci=ot=>{const{componentCls:tt,antCls:vt,iconCls:rn,fontSize:Dn,lineHeight:an}=ot,cn=`${tt}-list-item`,fn=`${cn}-actions`,In=`${cn}-action`,or=Math.round(Dn*an);return{[`${tt}-wrapper`]:{[`${tt}-list`]:Object.assign(Object.assign({},(0,Xr.dF)()),{lineHeight:ot.lineHeight,[cn]:{position:"relative",height:ot.lineHeight*Dn,marginTop:ot.marginXS,fontSize:Dn,display:"flex",alignItems:"center",transition:`background-color ${ot.motionDurationSlow}`,"&:hover":{backgroundColor:ot.controlItemBgHover},[`${cn}-name`]:Object.assign(Object.assign({},Xr.vS),{padding:`0 ${ot.paddingXS}px`,lineHeight:an,flex:"auto",transition:`all ${ot.motionDurationSlow}`}),[fn]:{[In]:{opacity:0},[`${In}${vt}-btn-sm`]:{height:or,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
|
|
|
${In}:focus-visible,
|
|
|
&.picture ${In}
|
|
|
`]:{opacity:1},[rn]:{color:ot.actionsColor,transition:`all ${ot.motionDurationSlow}`},[`&:hover ${rn}`]:{color:ot.colorText}},[`${tt}-icon ${rn}`]:{color:ot.colorTextDescription,fontSize:Dn},[`${cn}-progress`]:{position:"absolute",bottom:-ot.uploadProgressOffset,width:"100%",paddingInlineStart:Dn+ot.paddingXS,fontSize:Dn,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${cn}:hover ${In}`]:{opacity:1,color:ot.colorText},[`${cn}-error`]:{color:ot.colorError,[`${cn}-name, ${tt}-icon ${rn}`]:{color:ot.colorError},[fn]:{[`${rn}, ${rn}:hover`]:{color:ot.colorError},[In]:{opacity:1}}},[`${tt}-list-item-container`]:{transition:`opacity ${ot.motionDurationSlow}, height ${ot.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},gt=se(34367),En=se(16932);const kn=new gt.Keyframes("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),Tn=new gt.Keyframes("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var tr=ot=>{const{componentCls:tt}=ot,vt=`${tt}-animate-inline`;return[{[`${tt}-wrapper`]:{[`${vt}-appear, ${vt}-enter, ${vt}-leave`]:{animationDuration:ot.motionDurationSlow,animationTimingFunction:ot.motionEaseInOutCirc,animationFillMode:"forwards"},[`${vt}-appear, ${vt}-enter`]:{animationName:kn},[`${vt}-leave`]:{animationName:Tn}}},{[`${tt}-wrapper`]:(0,En.J$)(ot)},kn,Tn]},pr=se(16397),Hn=se(84780);const Ze=ot=>{const{componentCls:tt,iconCls:vt,uploadThumbnailSize:rn,uploadProgressOffset:Dn}=ot,an=`${tt}-list`,cn=`${an}-item`;return{[`${tt}-wrapper`]:{[`
|
|
|
${an}${an}-picture,
|
|
|
${an}${an}-picture-card,
|
|
|
${an}${an}-picture-circle
|
|
|
`]:{[cn]:{position:"relative",height:rn+ot.lineWidth*2+ot.paddingXS*2,padding:ot.paddingXS,border:`${ot.lineWidth}px ${ot.lineType} ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,"&:hover":{background:"transparent"},[`${cn}-thumbnail`]:Object.assign(Object.assign({},Xr.vS),{width:rn,height:rn,lineHeight:`${rn+ot.paddingSM}px`,textAlign:"center",flex:"none",[vt]:{fontSize:ot.fontSizeHeading2,color:ot.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${cn}-progress`]:{bottom:Dn,width:`calc(100% - ${ot.paddingSM*2}px)`,marginTop:0,paddingInlineStart:rn+ot.paddingXS}},[`${cn}-error`]:{borderColor:ot.colorError,[`${cn}-thumbnail ${vt}`]:{[`svg path[fill='${pr.blue[0]}']`]:{fill:ot.colorErrorBg},[`svg path[fill='${pr.blue.primary}']`]:{fill:ot.colorError}}},[`${cn}-uploading`]:{borderStyle:"dashed",[`${cn}-name`]:{marginBottom:Dn}}},[`${an}${an}-picture-circle ${cn}`]:{[`&, &::before, ${cn}-thumbnail`]:{borderRadius:"50%"}}}}},at=ot=>{const{componentCls:tt,iconCls:vt,fontSizeLG:rn,colorTextLightSolid:Dn}=ot,an=`${tt}-list`,cn=`${an}-item`,fn=ot.uploadPicCardSize;return{[`
|
|
|
${tt}-wrapper${tt}-picture-card-wrapper,
|
|
|
${tt}-wrapper${tt}-picture-circle-wrapper
|
|
|
`]:Object.assign(Object.assign({},(0,Xr.dF)()),{display:"inline-block",width:"100%",[`${tt}${tt}-select`]:{width:fn,height:fn,marginInlineEnd:ot.marginXS,marginBottom:ot.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:ot.colorFillAlter,border:`${ot.lineWidth}px dashed ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,cursor:"pointer",transition:`border-color ${ot.motionDurationSlow}`,[`> ${tt}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${tt}-disabled):hover`]:{borderColor:ot.colorPrimary}},[`${an}${an}-picture-card, ${an}${an}-picture-circle`]:{[`${an}-item-container`]:{display:"inline-block",width:fn,height:fn,marginBlock:`0 ${ot.marginXS}px`,marginInline:`0 ${ot.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[cn]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${ot.paddingXS*2}px)`,height:`calc(100% - ${ot.paddingXS*2}px)`,backgroundColor:ot.colorBgMask,opacity:0,transition:`all ${ot.motionDurationSlow}`,content:'" "'}},[`${cn}:hover`]:{[`&::before, ${cn}-actions`]:{opacity:1}},[`${cn}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${ot.motionDurationSlow}`,[`${vt}-eye, ${vt}-download, ${vt}-delete`]:{zIndex:10,width:rn,margin:`0 ${ot.marginXXS}px`,fontSize:rn,cursor:"pointer",transition:`all ${ot.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${cn}-actions, ${cn}-actions:hover`]:{[`${vt}-eye, ${vt}-download, ${vt}-delete`]:{color:new Hn.C(Dn).setAlpha(.65).toRgbString(),"&:hover":{color:Dn}}},[`${cn}-thumbnail, ${cn}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${cn}-name`]:{display:"none",textAlign:"center"},[`${cn}-file + ${cn}-name`]:{position:"absolute",bottom:ot.margin,display:"block",width:`calc(100% - ${ot.paddingXS*2}px)`},[`${cn}-uploading`]:{[`&${cn}`]:{backgroundColor:ot.colorFillAlter},[`&::before, ${vt}-eye, ${vt}-download, ${vt}-delete`]:{display:"none"}},[`${cn}-progress`]:{bottom:ot.marginXL,width:`calc(100% - ${ot.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${tt}-wrapper${tt}-picture-circle-wrapper`]:{[`${tt}${tt}-select`]:{borderRadius:"50%"}}}};var jt=ot=>{const{componentCls:tt}=ot;return{[`${tt}-rtl`]:{direction:"rtl"}}};const Ke=ot=>{const{componentCls:tt,colorTextDisabled:vt}=ot;return{[`${tt}-wrapper`]:Object.assign(Object.assign({},(0,Xr.Wf)(ot)),{[tt]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${tt}-select`]:{display:"inline-block"},[`${tt}-disabled`]:{color:vt,cursor:"not-allowed"}})}};var dt=(0,br.Z)("Upload",ot=>{const{fontSizeHeading3:tt,fontSize:vt,lineHeight:rn,lineWidth:Dn,controlHeightLG:an}=ot,cn=Math.round(vt*rn),fn=(0,Ei.TS)(ot,{uploadThumbnailSize:tt*2,uploadProgressOffset:cn/2+Dn,uploadPicCardSize:an*2.55});return[Ke(fn),Ji(fn),Ze(fn),at(fn),Ci(fn),tr(fn),jt(fn),(0,ui.Z)(fn)]},ot=>({actionsColor:ot.colorTextDescription})),Rt=function(ot,tt,vt,rn){function Dn(an){return an instanceof vt?an:new vt(function(cn){cn(an)})}return new(vt||(vt=Promise))(function(an,cn){function fn(Ut){try{or(rn.next(Ut))}catch(qr){cn(qr)}}function In(Ut){try{or(rn.throw(Ut))}catch(qr){cn(qr)}}function or(Ut){Ut.done?an(Ut.value):Dn(Ut.value).then(fn,In)}or((rn=rn.apply(ot,tt||[])).next())})};const Tt=`__LIST_IGNORE_${Date.now()}__`,Wt=(ot,tt)=>{const{fileList:vt,defaultFileList:rn,onRemove:Dn,showUploadList:an=!0,listType:cn="text",onPreview:fn,onDownload:In,onChange:or,onDrop:Ut,previewFile:qr,disabled:Fr,locale:Ri,iconRender:Li,isImageUrl:pi,progress:Gi,prefixCls:yi,className:ii,type:Bi="select",children:Zi,style:Vr,itemRender:mi,maxCount:Wi,data:la={},multiple:ea=!1,action:ti="",accept:yt="",supportServerRender:pt=!0,rootClassName:$t}=ot,sn=fe.useContext(Qe.Z),_n=Fr!=null?Fr:sn,[cr,Mr]=(0,Rn.Z)(rn||[],{value:vt,postState:Pe=>Pe!=null?Pe:[]}),[Br,Kr]=fe.useState("drop"),Rr=fe.useRef(null);fe.useMemo(()=>{const Pe=Date.now();(vt||[]).forEach((Fe,wt)=>{!Fe.uid&&!Object.isFrozen(Fe)&&(Fe.uid=`__AUTO__${Pe}_${wt}__`)})},[vt]);const Qr=(Pe,Fe,wt)=>{let it=(0,et.Z)(Fe),Ot=!1;Wi===1?it=it.slice(-1):Wi&&(Ot=it.length>Wi,it=it.slice(0,Wi)),(0,ir.flushSync)(()=>{Mr(it)});const on={file:Pe,fileList:it};wt&&(on.event=wt),(!Ot||it.some(mn=>mn.uid===Pe.uid))&&(0,ir.flushSync)(()=>{or==null||or(on)})},gi=(Pe,Fe)=>Rt(void 0,void 0,void 0,function*(){const{beforeUpload:wt,transformFile:it}=ot;let Ot=Pe;if(wt){const on=yield wt(Pe,Fe);if(on===!1)return!1;if(delete Pe[Tt],on===Tt)return Object.defineProperty(Pe,Tt,{value:!0,configurable:!0}),!1;typeof on=="object"&&on&&(Ot=on)}return it&&(Ot=yield it(Ot)),Ot}),Cr=Pe=>{const Fe=Pe.filter(Ot=>!Ot.file[Tt]);if(!Fe.length)return;const wt=Fe.map(Ot=>Yt(Ot.file));let it=(0,et.Z)(cr);wt.forEach(Ot=>{it=pn(Ot,it)}),wt.forEach((Ot,on)=>{let mn=Ot;if(Fe[on].parsedFile)Ot.status="uploading";else{const{originFileObj:On}=Ot;let xn;try{xn=new File([On],On.name,{type:On.type})}catch(Qt){xn=new Blob([On],{type:On.type}),xn.name=On.name,xn.lastModifiedDate=new Date,xn.lastModified=new Date().getTime()}xn.uid=Ot.uid,mn=xn}Qr(mn,it)})},di=(Pe,Fe,wt)=>{try{typeof Pe=="string"&&(Pe=JSON.parse(Pe))}catch(on){}if(!dn(Fe,cr))return;const it=Yt(Fe);it.status="done",it.percent=100,it.response=Pe,it.xhr=wt;const Ot=pn(it,cr);Qr(it,Ot)},Ai=(Pe,Fe)=>{if(!dn(Fe,cr))return;const wt=Yt(Fe);wt.status="uploading",wt.percent=Pe.percent;const it=pn(wt,cr);Qr(wt,it,Pe)},Si=(Pe,Fe,wt)=>{if(!dn(wt,cr))return;const it=Yt(wt);it.error=Pe,it.response=Fe,it.status="error";const Ot=pn(it,cr);Qr(it,Ot)},_e=Pe=>{let Fe;Promise.resolve(typeof Dn=="function"?Dn(Pe):Dn).then(wt=>{var it;if(wt===!1)return;const Ot=An(Pe,cr);Ot&&(Fe=Object.assign(Object.assign({},Pe),{status:"removed"}),cr==null||cr.forEach(on=>{const mn=Fe.uid!==void 0?"uid":"name";on[mn]===Fe[mn]&&!Object.isFrozen(on)&&(on.status="removed")}),(it=Rr.current)===null||it===void 0||it.abort(Fe),Qr(Fe,Ot))})},Be=Pe=>{Kr(Pe.type),Pe.type==="drop"&&(Ut==null||Ut(Pe))};fe.useImperativeHandle(tt,()=>({onBatchStart:Cr,onSuccess:di,onProgress:Ai,onError:Si,fileList:cr,upload:Rr.current}));const{getPrefixCls:Ne,direction:We,upload:qe}=fe.useContext(yr.E_),rt=Ne("upload",yi),bt=Object.assign(Object.assign({onBatchStart:Cr,onError:Si,onProgress:Ai,onSuccess:di},ot),{data:la,multiple:ea,action:ti,accept:yt,supportServerRender:pt,prefixCls:rt,disabled:_n,beforeUpload:gi,onChange:void 0});delete bt.className,delete bt.style,(!Zi||_n)&&delete bt.id;const[Gt,nn]=dt(rt),[Gn]=(0,Le.Z)("Upload",Nt.Z.Upload),{showRemoveIcon:fr,showPreviewIcon:Wn,showDownloadIcon:vn,removeIcon:hn,previewIcon:Sn,downloadIcon:Pn}=typeof an=="boolean"?{}:an,ur=(Pe,Fe)=>an?fe.createElement(Gr,{prefixCls:rt,listType:cn,items:cr,previewFile:qr,onPreview:fn,onDownload:In,onRemove:_e,showRemoveIcon:!_n&&fr,showPreviewIcon:Wn,showDownloadIcon:vn,removeIcon:hn,previewIcon:Sn,downloadIcon:Pn,iconRender:Li,locale:Object.assign(Object.assign({},Gn),Ri),isImageUrl:pi,progress:Gi,appendAction:Pe,appendActionVisible:Fe,itemRender:mi,disabled:_n}):Pe,jn=Ue()(`${rt}-wrapper`,ii,$t,nn,qe==null?void 0:qe.className,{[`${rt}-rtl`]:We==="rtl",[`${rt}-picture-card-wrapper`]:cn==="picture-card",[`${rt}-picture-circle-wrapper`]:cn==="picture-circle"}),Zn=Object.assign(Object.assign({},qe==null?void 0:qe.style),Vr);if(Bi==="drag"){const Pe=Ue()(nn,rt,`${rt}-drag`,{[`${rt}-drag-uploading`]:cr.some(Fe=>Fe.status==="uploading"),[`${rt}-drag-hover`]:Br==="dragover",[`${rt}-disabled`]:_n,[`${rt}-rtl`]:We==="rtl"});return Gt(fe.createElement("span",{className:jn},fe.createElement("div",{className:Pe,style:Zn,onDrop:Be,onDragOver:Be,onDragLeave:Be},fe.createElement(un,Object.assign({},bt,{ref:Rr,className:`${rt}-btn`}),fe.createElement("div",{className:`${rt}-drag-container`},Zi))),ur()))}const Jn=Ue()(rt,`${rt}-select`,{[`${rt}-disabled`]:_n}),hr=(Pe=>fe.createElement("div",{className:Jn,style:Pe},fe.createElement(un,Object.assign({},bt,{ref:Rr}))))(Zi?void 0:{display:"none"});return Gt(cn==="picture-card"||cn==="picture-circle"?fe.createElement("span",{className:jn},ur(hr,!!Zi)):fe.createElement("span",{className:jn},hr,ur()))};var zn=fe.forwardRef(Wt),Sr=function(ot,tt){var vt={};for(var rn in ot)Object.prototype.hasOwnProperty.call(ot,rn)&&tt.indexOf(rn)<0&&(vt[rn]=ot[rn]);if(ot!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dn=0,rn=Object.getOwnPropertySymbols(ot);Dn<rn.length;Dn++)tt.indexOf(rn[Dn])<0&&Object.prototype.propertyIsEnumerable.call(ot,rn[Dn])&&(vt[rn[Dn]]=ot[rn[Dn]]);return vt},qn=fe.forwardRef((ot,tt)=>{var{style:vt,height:rn}=ot,Dn=Sr(ot,["style","height"]);return fe.createElement(zn,Object.assign({ref:tt},Dn,{type:"drag",style:Object.assign(Object.assign({},vt),{height:rn})}))});const nr=zn;nr.Dragger=qn,nr.LIST_IGNORE=Tt;var ar=nr},41771:function(Cn,Xt){"use strict";var se;var fe=typeof Symbol=="function"&&Symbol.for,et=fe?Symbol.for("react.element"):60103,$e=fe?Symbol.for("react.portal"):60106,Ue=fe?Symbol.for("react.fragment"):60107,be=fe?Symbol.for("react.strict_mode"):60108,Se=fe?Symbol.for("react.profiler"):60114,Me=fe?Symbol.for("react.provider"):60109,xe=fe?Symbol.for("react.context"):60110,pe=fe?Symbol.for("react.async_mode"):60111,Te=fe?Symbol.for("react.concurrent_mode"):60111,mt=fe?Symbol.for("react.forward_ref"):60112,ze=fe?Symbol.for("react.suspense"):60113,It=fe?Symbol.for("react.suspense_list"):60120,Ct=fe?Symbol.for("react.memo"):60115,ht=fe?Symbol.for("react.lazy"):60116,Ye=fe?Symbol.for("react.block"):60121,De=fe?Symbol.for("react.fundamental"):60117,At=fe?Symbol.for("react.responder"):60118,Jt=fe?Symbol.for("react.scope"):60119;function nt(Ie){if(typeof Ie=="object"&&Ie!==null){var ke=Ie.$$typeof;switch(ke){case et:switch(Ie=Ie.type,Ie){case pe:case Te:case Ue:case Se:case be:case ze:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case xe:case mt:case ht:case Ct:case Me:return Ie;default:return ke}}case $e:return ke}}}function lt(Ie){return nt(Ie)===Te}se=pe,se=Te,se=xe,se=Me,se=et,se=mt,se=Ue,se=ht,se=Ct,se=$e,se=Se,se=be,se=ze,se=function(Ie){return lt(Ie)||nt(Ie)===pe},se=lt,se=function(Ie){return nt(Ie)===xe},se=function(Ie){return nt(Ie)===Me},se=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===et},se=function(Ie){return nt(Ie)===mt},Xt.isFragment=function(Ie){return nt(Ie)===Ue},se=function(Ie){return nt(Ie)===ht},se=function(Ie){return nt(Ie)===Ct},se=function(Ie){return nt(Ie)===$e},se=function(Ie){return nt(Ie)===Se},se=function(Ie){return nt(Ie)===be},se=function(Ie){return nt(Ie)===ze},se=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ue||Ie===Te||Ie===Se||Ie===be||Ie===ze||Ie===It||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===ht||Ie.$$typeof===Ct||Ie.$$typeof===Me||Ie.$$typeof===xe||Ie.$$typeof===mt||Ie.$$typeof===De||Ie.$$typeof===At||Ie.$$typeof===Jt||Ie.$$typeof===Ye)},se=nt},47655:function(Cn,Xt,se){"use strict";Cn.exports=se(41771)},64701:function(Cn,Xt,se){"use strict";se.r(Xt),se.d(Xt,{ResizableTextArea:function(){return Nn},default:function(){return Bt}});var fe=se(87462),et=se(1413),$e=se(4942),Ue=se(71002),be=se(97685),Se=se(45987),Me=se(74902),xe=se(94184),pe=se.n(xe),Te=se(67656),mt=se(87887),ze=se(67294);function It(Ft){var zt=ze.useRef();zt.current=Ft;var Mn=ze.useCallback(function(){for(var bn,Ee=arguments.length,ce=new Array(Ee),le=0;le<Ee;le++)ce[le]=arguments[le];return(bn=zt.current)===null||bn===void 0?void 0:bn.call.apply(bn,[zt].concat(ce))},[]);return Mn}function Ct(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ht=Ct()?ze.useLayoutEffect:ze.useEffect,Ye=ht,De=function(zt,Mn){var bn=ze.useRef(!0);ht(function(){if(!bn.current)return zt()},Mn),ht(function(){return bn.current=!1,function(){bn.current=!0}},[])};function At(Ft){var zt=ze.useRef(!1),Mn=ze.useState(Ft),bn=(0,be.Z)(Mn,2),Ee=bn[0],ce=bn[1];ze.useEffect(function(){return zt.current=!1,function(){zt.current=!0}},[]);function le(ye,ve){ve&&zt.current||ce(ye)}return[Ee,le]}function Jt(Ft){return Ft!==void 0}function nt(Ft,zt){var Mn=zt||{},bn=Mn.defaultValue,Ee=Mn.value,ce=Mn.onChange,le=Mn.postState,ye=At(function(){return Jt(Ee)?Ee:Jt(bn)?typeof bn=="function"?bn():bn:typeof Ft=="function"?Ft():Ft}),ve=(0,be.Z)(ye,2),oe=ve[0],He=ve[1],xt=Ee!==void 0?Ee:oe,Yt=le?le(xt):xt,pn=It(ce),dn=At([xt]),An=(0,be.Z)(dn,2),tn=An[0],Nr=An[1];De(function(){var Kt=tn[0];oe!==Kt&&pn(oe,Kt)},[tn]),De(function(){Jt(Ee)||He(Ee)},[Ee]);var Wr=It(function(Kt,$n){He(Kt,$n),Nr([xt],$n)});return[Yt,Wr]}var lt=se(48555),Ie=function(zt){return+setTimeout(zt,16)},ke=function(zt){return clearTimeout(zt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ie=function(zt){return window.requestAnimationFrame(zt)},ke=function(zt){return window.cancelAnimationFrame(zt)});var je=0,Xe=new Map;function Pt(Ft){Xe.delete(Ft)}var kt=function(zt){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;je+=1;var bn=je;function Ee(ce){if(ce===0)Pt(bn),zt();else{var le=Ie(function(){Ee(ce-1)});Xe.set(bn,le)}}return Ee(Mn),bn};kt.cancel=function(Ft){var zt=Xe.get(Ft);return Pt(zt),ke(zt)};var Lt=kt,Ge=`
|
|
|
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;
|
|
|
`,Ht=["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"],Dt={},Ln;function un(Ft){var zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mn=Ft.getAttribute("id")||Ft.getAttribute("data-reactid")||Ft.getAttribute("name");if(zt&&Dt[Mn])return Dt[Mn];var bn=window.getComputedStyle(Ft),Ee=bn.getPropertyValue("box-sizing")||bn.getPropertyValue("-moz-box-sizing")||bn.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(bn.getPropertyValue("padding-bottom"))+parseFloat(bn.getPropertyValue("padding-top")),le=parseFloat(bn.getPropertyValue("border-bottom-width"))+parseFloat(bn.getPropertyValue("border-top-width")),ye=Ht.map(function(oe){return"".concat(oe,":").concat(bn.getPropertyValue(oe))}).join(";"),ve={sizingStyle:ye,paddingSize:ce,borderSize:le,boxSizing:Ee};return zt&&Mn&&(Dt[Mn]=ve),ve}function Rn(Ft){var zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,bn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Ln||(Ln=document.createElement("textarea"),Ln.setAttribute("tab-index","-1"),Ln.setAttribute("aria-hidden","true"),document.body.appendChild(Ln)),Ft.getAttribute("wrap")?Ln.setAttribute("wrap",Ft.getAttribute("wrap")):Ln.removeAttribute("wrap");var Ee=un(Ft,zt),ce=Ee.paddingSize,le=Ee.borderSize,ye=Ee.boxSizing,ve=Ee.sizingStyle;Ln.setAttribute("style","".concat(ve,";").concat(Ge)),Ln.value=Ft.value||Ft.placeholder||"";var oe=void 0,He=void 0,xt,Yt=Ln.scrollHeight;if(ye==="border-box"?Yt+=le:ye==="content-box"&&(Yt-=ce),Mn!==null||bn!==null){Ln.value=" ";var pn=Ln.scrollHeight-ce;Mn!==null&&(oe=pn*Mn,ye==="border-box"&&(oe=oe+ce+le),Yt=Math.max(oe,Yt)),bn!==null&&(He=pn*bn,ye==="border-box"&&(He=He+ce+le),xt=Yt>He?"":"hidden",Yt=Math.min(He,Yt))}var dn={height:Yt,overflowY:xt,resize:"none"};return oe&&(dn.minHeight=oe),He&&(dn.maxHeight=He),dn}var ir=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],yr=0,Qe=1,Le=2,Nt=ze.forwardRef(function(Ft,zt){var Mn=Ft,bn=Mn.prefixCls,Ee=Mn.onPressEnter,ce=Mn.defaultValue,le=Mn.value,ye=Mn.autoSize,ve=Mn.onResize,oe=Mn.className,He=Mn.style,xt=Mn.disabled,Yt=Mn.onChange,pn=Mn.onInternalAutoSize,dn=(0,Se.Z)(Mn,ir),An=nt(ce,{value:le,postState:function(Tn){return Tn!=null?Tn:""}}),tn=(0,be.Z)(An,2),Nr=tn[0],Wr=tn[1],Kt=function(Tn){Wr(Tn.target.value),Yt==null||Yt(Tn)},$n=ze.useRef();ze.useImperativeHandle(zt,function(){return{textArea:$n.current}});var ei=ze.useMemo(function(){return ye&&(0,Ue.Z)(ye)==="object"?[ye.minRows,ye.maxRows]:[]},[ye]),hi=(0,be.Z)(ei,2),ut=hi[0],Vt=hi[1],Vn=!!ye,rr=function(){try{if(document.activeElement===$n.current){var Tn=$n.current,sr=Tn.selectionStart,tr=Tn.selectionEnd,pr=Tn.scrollTop;$n.current.setSelectionRange(sr,tr),$n.current.scrollTop=pr}}catch(Hn){}},gr=ze.useState(Le),Ir=(0,be.Z)(gr,2),Ur=Ir[0],Gr=Ir[1],Xr=ze.useState(),ui=(0,be.Z)(Xr,2),br=ui[0],Ei=ui[1],sa=function(){Gr(yr)};Ye(function(){Vn&&sa()},[le,ut,Vt,Vn]),Ye(function(){if(Ur===yr)Gr(Qe);else if(Ur===Qe){var kn=Rn($n.current,!1,ut,Vt);Gr(Le),Ei(kn)}else rr()},[Ur]);var Ji=ze.useRef(),Qi=function(){Lt.cancel(Ji.current)},Ci=function(Tn){Ur===Le&&(ve==null||ve(Tn),ye&&(Qi(),Ji.current=Lt(function(){sa()})))};ze.useEffect(function(){return Qi},[]);var gt=Vn?br:null,En=(0,et.Z)((0,et.Z)({},He),gt);return(Ur===yr||Ur===Qe)&&(En.overflowY="hidden",En.overflowX="hidden"),ze.createElement(lt.Z,{onResize:Ci,disabled:!(ye||ve)},ze.createElement("textarea",(0,fe.Z)({},dn,{ref:$n,style:En,className:pe()(bn,oe,(0,$e.Z)({},"".concat(bn,"-disabled"),xt)),disabled:xt,value:Nr,onChange:Kt})))}),Nn=Nt,gn=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Je(Ft,zt){return(0,Me.Z)(Ft||"").slice(0,zt).join("")}function st(Ft,zt,Mn,bn){var Ee=Mn;return Ft?Ee=Je(Mn,bn):(0,Me.Z)(zt||"").length<Mn.length&&(0,Me.Z)(Mn||"").length>bn&&(Ee=zt),Ee}var _t=ze.forwardRef(function(Ft,zt){var Mn,bn=Ft.defaultValue,Ee=Ft.value,ce=Ft.onFocus,le=Ft.onBlur,ye=Ft.onChange,ve=Ft.allowClear,oe=Ft.maxLength,He=Ft.onCompositionStart,xt=Ft.onCompositionEnd,Yt=Ft.suffix,pn=Ft.prefixCls,dn=pn===void 0?"rc-textarea":pn,An=Ft.classes,tn=Ft.showCount,Nr=Ft.className,Wr=Ft.style,Kt=Ft.disabled,$n=Ft.hidden,ei=Ft.classNames,hi=Ft.styles,ut=Ft.onResize,Vt=(0,Se.Z)(Ft,gn),Vn=nt(bn,{value:Ee,defaultValue:bn}),rr=(0,be.Z)(Vn,2),gr=rr[0],Ir=rr[1],Ur=(0,ze.useRef)(null),Gr=ze.useState(!1),Xr=(0,be.Z)(Gr,2),ui=Xr[0],br=Xr[1],Ei=ze.useState(!1),sa=(0,be.Z)(Ei,2),Ji=sa[0],Qi=sa[1],Ci=ze.useRef(),gt=ze.useRef(0),En=ze.useState(null),kn=(0,be.Z)(En,2),Tn=kn[0],sr=kn[1],tr=function(){var nr;(nr=Ur.current)===null||nr===void 0||nr.textArea.focus()};(0,ze.useImperativeHandle)(zt,function(){return{resizableTextArea:Ur.current,focus:tr,blur:function(){var nr;(nr=Ur.current)===null||nr===void 0||nr.textArea.blur()}}}),(0,ze.useEffect)(function(){br(function(qn){return!Kt&&qn})},[Kt]);var pr=Number(oe)>0,Hn=function(nr){Qi(!0),Ci.current=gr,gt.current=nr.currentTarget.selectionStart,He==null||He(nr)},Ze=function(nr){Qi(!1);var ar=nr.currentTarget.value;if(pr){var ot,tt=gt.current>=oe+1||gt.current===((ot=Ci.current)===null||ot===void 0?void 0:ot.length);ar=st(tt,Ci.current,ar,oe)}ar!==gr&&(Ir(ar),(0,mt.rJ)(nr.currentTarget,nr,ye,ar)),xt==null||xt(nr)},at=function(nr){var ar=nr.target.value;if(!Ji&&pr){var ot=nr.target.selectionStart>=oe+1||nr.target.selectionStart===ar.length||!nr.target.selectionStart;ar=st(ot,gr,ar,oe)}Ir(ar),(0,mt.rJ)(nr.currentTarget,nr,ye,ar)},Et=function(nr){var ar=Vt.onPressEnter,ot=Vt.onKeyDown;nr.key==="Enter"&&ar&&ar(nr),ot==null||ot(nr)},jt=function(nr){br(!0),ce==null||ce(nr)},Ke=function(nr){br(!1),le==null||le(nr)},dt=function(nr){var ar;Ir(""),tr(),(0,mt.rJ)((ar=Ur.current)===null||ar===void 0?void 0:ar.textArea,nr,ye)},Rt=(0,mt.D7)(gr);!Ji&&pr&&Ee==null&&(Rt=Je(Rt,oe));var Tt=Yt,Wt;if(tn){var Zt=(0,Me.Z)(Rt).length;(0,Ue.Z)(tn)==="object"?Wt=tn.formatter({value:Rt,count:Zt,maxLength:oe}):Wt="".concat(Zt).concat(pr?" / ".concat(oe):""),Tt=ze.createElement(ze.Fragment,null,Tt,ze.createElement("span",{className:pe()("".concat(dn,"-data-count"),ei==null?void 0:ei.count),style:hi==null?void 0:hi.count},Wt))}var zn=function(nr){var ar;ut==null||ut(nr),(ar=Ur.current)!==null&&ar!==void 0&&ar.textArea.style.height&&sr(!0)},Sr=!Vt.autoSize&&!tn&&!ve,Yn=ze.createElement(Te.BaseInput,{value:Rt,allowClear:ve,handleReset:dt,suffix:Tt,prefixCls:dn,classes:{affixWrapper:pe()(An==null?void 0:An.affixWrapper,(Mn={},(0,$e.Z)(Mn,"".concat(dn,"-show-count"),tn),(0,$e.Z)(Mn,"".concat(dn,"-textarea-allow-clear"),ve),Mn))},disabled:Kt,focused:ui,className:Nr,style:(0,et.Z)((0,et.Z)({},Wr),Tn&&!Sr?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Wt=="string"?Wt:void 0}},hidden:$n,inputElement:ze.createElement(Nn,(0,fe.Z)({},Vt,{onKeyDown:Et,onChange:at,onFocus:jt,onBlur:Ke,onCompositionStart:Hn,onCompositionEnd:Ze,className:ei==null?void 0:ei.textarea,style:(0,et.Z)((0,et.Z)({},hi==null?void 0:hi.textarea),{},{resize:Wr==null?void 0:Wr.resize}),disabled:Kt,prefixCls:dn,onResize:zn,ref:Ur}))});return Yn}),en=_t,Bt=en},1337:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return xe}});var fe=se(1413),et=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,$e=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ue="".concat(et," ").concat($e).split(/[\s\n]+/),be="aria-",Se="data-";function Me(pe,Te){return pe.indexOf(Te)===0}function xe(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,mt;Te===!1?mt={aria:!0,data:!0,attr:!0}:Te===!0?mt={aria:!0}:mt=(0,fe.Z)({},Te);var ze={};return Object.keys(pe).forEach(function(It){(mt.aria&&(It==="role"||Me(It,be))||mt.data&&Me(It,Se)||mt.attr&&Ue.includes(It))&&(ze[It]=pe[It])}),ze}},88386:function(Cn,Xt,se){(function(fe){fe(se(4631))})(function(fe){fe.defineOption("placeholder","",function(xe,pe,Te){var mt=Te&&Te!=fe.Init;if(pe&&!mt)xe.on("blur",be),xe.on("change",Se),xe.on("swapDoc",Se),fe.on(xe.getInputField(),"compositionupdate",xe.state.placeholderCompose=function(){Ue(xe)}),Se(xe);else if(!pe&&mt){xe.off("blur",be),xe.off("change",Se),xe.off("swapDoc",Se),fe.off(xe.getInputField(),"compositionupdate",xe.state.placeholderCompose),et(xe);var ze=xe.getWrapperElement();ze.className=ze.className.replace(" CodeMirror-empty","")}pe&&!xe.hasFocus()&&be(xe)});function et(xe){xe.state.placeholder&&(xe.state.placeholder.parentNode.removeChild(xe.state.placeholder),xe.state.placeholder=null)}function $e(xe){et(xe);var pe=xe.state.placeholder=document.createElement("pre");pe.style.cssText="height: 0; overflow: visible",pe.style.direction=xe.getOption("direction"),pe.className="CodeMirror-placeholder CodeMirror-line-like";var Te=xe.getOption("placeholder");typeof Te=="string"&&(Te=document.createTextNode(Te)),pe.appendChild(Te),xe.display.lineSpace.insertBefore(pe,xe.display.lineSpace.firstChild)}function Ue(xe){setTimeout(function(){var pe=!1,Te=xe.getInputField();Te.nodeName=="TEXTAREA"?pe=!Te.value:xe.lineCount()==1&&(pe=!/[^\u200b]/.test(Te.querySelector(".CodeMirror-line").textContent)),pe?$e(xe):et(xe)},20)}function be(xe){Me(xe)&&$e(xe)}function Se(xe){var pe=xe.getWrapperElement(),Te=Me(xe);pe.className=pe.className.replace(" CodeMirror-empty","")+(Te?" CodeMirror-empty":""),Te?$e(xe):et(xe)}function Me(xe){return xe.lineCount()===1&&xe.getLine(0)===""}})},82801:function(Cn,Xt,se){(function(fe){fe(se(4631))})(function(fe){var et={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},$e=fe.Pos;fe.defineOption("autoCloseBrackets",!1,function(ht,Ye,De){De&&De!=fe.Init&&(ht.removeKeyMap(be),ht.state.closeBrackets=null),Ye&&(Se(Ue(Ye,"pairs")),ht.state.closeBrackets=Ye,ht.addKeyMap(be))});function Ue(ht,Ye){return Ye=="pairs"&&typeof ht=="string"?ht:typeof ht=="object"&&ht[Ye]!=null?ht[Ye]:et[Ye]}var be={Backspace:pe,Enter:Te};function Se(ht){for(var Ye=0;Ye<ht.length;Ye++){var De=ht.charAt(Ye),At="'"+De+"'";be[At]||(be[At]=Me(De))}}Se(et.pairs+"`");function Me(ht){return function(Ye){return ze(Ye,ht)}}function xe(ht){var Ye=ht.state.closeBrackets;if(!Ye||Ye.override)return Ye;var De=ht.getModeAt(ht.getCursor());return De.closeBrackets||Ye}function pe(ht){var Ye=xe(ht);if(!Ye||ht.getOption("disableInput"))return fe.Pass;for(var De=Ue(Ye,"pairs"),At=ht.listSelections(),Jt=0;Jt<At.length;Jt++){if(!At[Jt].empty())return fe.Pass;var nt=It(ht,At[Jt].head);if(!nt||De.indexOf(nt)%2!=0)return fe.Pass}for(var Jt=At.length-1;Jt>=0;Jt--){var lt=At[Jt].head;ht.replaceRange("",$e(lt.line,lt.ch-1),$e(lt.line,lt.ch+1),"+delete")}}function Te(ht){var Ye=xe(ht),De=Ye&&Ue(Ye,"explode");if(!De||ht.getOption("disableInput"))return fe.Pass;for(var At=ht.listSelections(),Jt=0;Jt<At.length;Jt++){if(!At[Jt].empty())return fe.Pass;var nt=It(ht,At[Jt].head);if(!nt||De.indexOf(nt)%2!=0)return fe.Pass}ht.operation(function(){var lt=ht.lineSeparator()||`
|
|
|
`;ht.replaceSelection(lt+lt,null),ht.execCommand("goCharLeft"),At=ht.listSelections();for(var Ie=0;Ie<At.length;Ie++){var ke=At[Ie].head.line;ht.indentLine(ke,null,!0),ht.indentLine(ke+1,null,!0)}})}function mt(ht){var Ye=fe.cmpPos(ht.anchor,ht.head)>0;return{anchor:new $e(ht.anchor.line,ht.anchor.ch+(Ye?-1:1)),head:new $e(ht.head.line,ht.head.ch+(Ye?1:-1))}}function ze(ht,Ye){var De=xe(ht);if(!De||ht.getOption("disableInput"))return fe.Pass;var At=Ue(De,"pairs"),Jt=At.indexOf(Ye);if(Jt==-1)return fe.Pass;for(var nt=Ue(De,"closeBefore"),lt=Ue(De,"triples"),Ie=At.charAt(Jt+1)==Ye,ke=ht.listSelections(),je=Jt%2==0,Xe,Pt=0;Pt<ke.length;Pt++){var kt=ke[Pt],Lt=kt.head,Ge,Ht=ht.getRange(Lt,$e(Lt.line,Lt.ch+1));if(je&&!kt.empty())Ge="surround";else if((Ie||!je)&&Ht==Ye)Ie&&Ct(ht,Lt)?Ge="both":lt.indexOf(Ye)>=0&&ht.getRange(Lt,$e(Lt.line,Lt.ch+3))==Ye+Ye+Ye?Ge="skipThree":Ge="skip";else if(Ie&&Lt.ch>1&<.indexOf(Ye)>=0&&ht.getRange($e(Lt.line,Lt.ch-2),Lt)==Ye+Ye){if(Lt.ch>2&&/\bstring/.test(ht.getTokenTypeAt($e(Lt.line,Lt.ch-2))))return fe.Pass;Ge="addFour"}else if(Ie){var Dt=Lt.ch==0?" ":ht.getRange($e(Lt.line,Lt.ch-1),Lt);if(!fe.isWordChar(Ht)&&Dt!=Ye&&!fe.isWordChar(Dt))Ge="both";else return fe.Pass}else if(je&&(Ht.length===0||/\s/.test(Ht)||nt.indexOf(Ht)>-1))Ge="both";else return fe.Pass;if(!Xe)Xe=Ge;else if(Xe!=Ge)return fe.Pass}var Ln=Jt%2?At.charAt(Jt-1):Ye,un=Jt%2?Ye:At.charAt(Jt+1);ht.operation(function(){if(Xe=="skip")ht.execCommand("goCharRight");else if(Xe=="skipThree")for(var Rn=0;Rn<3;Rn++)ht.execCommand("goCharRight");else if(Xe=="surround"){for(var ir=ht.getSelections(),Rn=0;Rn<ir.length;Rn++)ir[Rn]=Ln+ir[Rn]+un;ht.replaceSelections(ir,"around"),ir=ht.listSelections().slice();for(var Rn=0;Rn<ir.length;Rn++)ir[Rn]=mt(ir[Rn]);ht.setSelections(ir)}else Xe=="both"?(ht.replaceSelection(Ln+un,null),ht.triggerElectric(Ln+un),ht.execCommand("goCharLeft")):Xe=="addFour"&&(ht.replaceSelection(Ln+Ln+Ln+Ln,"before"),ht.execCommand("goCharRight"))})}function It(ht,Ye){var De=ht.getRange($e(Ye.line,Ye.ch-1),$e(Ye.line,Ye.ch+1));return De.length==2?De:null}function Ct(ht,Ye){var De=ht.getTokenAt($e(Ye.line,Ye.ch+1));return/\bstring/.test(De.type)&&De.start==Ye.ch&&(Ye.ch==0||!/\bstring/.test(ht.getTokenTypeAt(Ye)))}})},57341:function(Cn,Xt,se){(function(fe){fe(se(4631),se(4786))})(function(fe){fe.defineOption("autoCloseTags",!1,function(pe,Te,mt){if(mt!=fe.Init&&mt&&pe.removeKeyMap("autoCloseTags"),!!Te){var ze={name:"autoCloseTags"};(typeof Te!="object"||Te.whenClosing!==!1)&&(ze["'/'"]=function(It){return Se(It)}),(typeof Te!="object"||Te.whenOpening!==!1)&&(ze["'>'"]=function(It){return Ue(It)}),pe.addKeyMap(ze)}});var et=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],$e=["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 Ue(pe){if(pe.getOption("disableInput"))return fe.Pass;for(var Te=pe.listSelections(),mt=[],ze=pe.getOption("autoCloseTags"),It=0;It<Te.length;It++){if(!Te[It].empty())return fe.Pass;var Ct=Te[It].head,ht=pe.getTokenAt(Ct),Ye=fe.innerMode(pe.getMode(),ht.state),De=Ye.state,At=Ye.mode.xmlCurrentTag&&Ye.mode.xmlCurrentTag(De),Jt=At&&At.name;if(!Jt)return fe.Pass;var nt=Ye.mode.configuration=="html",lt=typeof ze=="object"&&ze.dontCloseTags||nt&&et,Ie=typeof ze=="object"&&ze.indentTags||nt&&$e;ht.end>Ct.ch&&(Jt=Jt.slice(0,Jt.length-ht.end+Ct.ch));var ke=Jt.toLowerCase();if(!Jt||ht.type=="string"&&(ht.end!=Ct.ch||!/[\"\']/.test(ht.string.charAt(ht.string.length-1))||ht.string.length==1)||ht.type=="tag"&&At.close||ht.string.indexOf("/")==Ct.ch-ht.start-1||lt&&Me(lt,ke)>-1||xe(pe,Ye.mode.xmlCurrentContext&&Ye.mode.xmlCurrentContext(De)||[],Jt,Ct,!0))return fe.Pass;var je=typeof ze=="object"&&ze.emptyTags;if(je&&Me(je,Jt)>-1){mt[It]={text:"/>",newPos:fe.Pos(Ct.line,Ct.ch+2)};continue}var Xe=Ie&&Me(Ie,ke)>-1;mt[It]={indent:Xe,text:">"+(Xe?`
|
|
|
|
|
|
`:"")+"</"+Jt+">",newPos:Xe?fe.Pos(Ct.line+1,0):fe.Pos(Ct.line,Ct.ch+1)}}for(var Pt=typeof ze=="object"&&ze.dontIndentOnAutoClose,It=Te.length-1;It>=0;It--){var kt=mt[It];pe.replaceRange(kt.text,Te[It].head,Te[It].anchor,"+insert");var Lt=pe.listSelections().slice(0);Lt[It]={head:kt.newPos,anchor:kt.newPos},pe.setSelections(Lt),!Pt&&kt.indent&&(pe.indentLine(kt.newPos.line,null,!0),pe.indentLine(kt.newPos.line+1,null,!0))}}function be(pe,Te){for(var mt=pe.listSelections(),ze=[],It=Te?"/":"</",Ct=pe.getOption("autoCloseTags"),ht=typeof Ct=="object"&&Ct.dontIndentOnSlash,Ye=0;Ye<mt.length;Ye++){if(!mt[Ye].empty())return fe.Pass;var De=mt[Ye].head,At=pe.getTokenAt(De),Jt=fe.innerMode(pe.getMode(),At.state),nt=Jt.state;if(Te&&(At.type=="string"||At.string.charAt(0)!="<"||At.start!=De.ch-1))return fe.Pass;var lt,Ie=Jt.mode.name!="xml"&&pe.getMode().name=="htmlmixed";if(Ie&&Jt.mode.name=="javascript")lt=It+"script";else if(Ie&&Jt.mode.name=="css")lt=It+"style";else{var ke=Jt.mode.xmlCurrentContext&&Jt.mode.xmlCurrentContext(nt);if(!ke||ke.length&&xe(pe,ke,ke[ke.length-1],De))return fe.Pass;lt=It+ke[ke.length-1]}pe.getLine(De.line).charAt(At.end)!=">"&&(lt+=">"),ze[Ye]=lt}if(pe.replaceSelections(ze),mt=pe.listSelections(),!ht)for(var Ye=0;Ye<mt.length;Ye++)(Ye==mt.length-1||mt[Ye].head.line<mt[Ye+1].head.line)&&pe.indentLine(mt[Ye].head.line)}function Se(pe){return pe.getOption("disableInput")?fe.Pass:be(pe,!0)}fe.commands.closeTag=function(pe){return be(pe)};function Me(pe,Te){if(pe.indexOf)return pe.indexOf(Te);for(var mt=0,ze=pe.length;mt<ze;++mt)if(pe[mt]==Te)return mt;return-1}function xe(pe,Te,mt,ze,It){if(!fe.scanForClosingTag)return!1;var Ct=Math.min(pe.lastLine()+1,ze.line+500),ht=fe.scanForClosingTag(pe,ze,null,Ct);if(!ht||ht.tag!=mt)return!1;for(var Ye=It?1:0,De=Te.length-1;De>=0&&Te[De]==mt;De--)++Ye;ze=ht.to;for(var De=1;De<Ye;De++){var At=fe.scanForClosingTag(pe,ze,null,Ct);if(!At||At.tag!=mt)return!1;ze=At.to}return!0}})},4786:function(Cn,Xt,se){(function(fe){fe(se(4631))})(function(fe){"use strict";var et=fe.Pos;function $e(De,At){return De.line-At.line||De.ch-At.ch}var Ue="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=Ue+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Se=new RegExp("<(/?)(["+Ue+"]["+be+"]*)","g");function Me(De,At,Jt,nt){this.line=At,this.ch=Jt,this.cm=De,this.text=De.getLine(At),this.min=nt?Math.max(nt.from,De.firstLine()):De.firstLine(),this.max=nt?Math.min(nt.to-1,De.lastLine()):De.lastLine()}function xe(De,At){var Jt=De.cm.getTokenTypeAt(et(De.line,At));return Jt&&/\btag\b/.test(Jt)}function pe(De){if(!(De.line>=De.max))return De.ch=0,De.text=De.cm.getLine(++De.line),!0}function Te(De){if(!(De.line<=De.min))return De.text=De.cm.getLine(--De.line),De.ch=De.text.length,!0}function mt(De){for(;;){var At=De.text.indexOf(">",De.ch);if(At==-1){if(pe(De))continue;return}if(!xe(De,At+1)){De.ch=At+1;continue}var Jt=De.text.lastIndexOf("/",At),nt=Jt>-1&&!/\S/.test(De.text.slice(Jt+1,At));return De.ch=At+1,nt?"selfClose":"regular"}}function ze(De){for(;;){var At=De.ch?De.text.lastIndexOf("<",De.ch-1):-1;if(At==-1){if(Te(De))continue;return}if(!xe(De,At+1)){De.ch=At;continue}Se.lastIndex=At,De.ch=At;var Jt=Se.exec(De.text);if(Jt&&Jt.index==At)return Jt}}function It(De){for(;;){Se.lastIndex=De.ch;var At=Se.exec(De.text);if(!At){if(pe(De))continue;return}if(!xe(De,At.index+1)){De.ch=At.index+1;continue}return De.ch=At.index+At[0].length,At}}function Ct(De){for(;;){var At=De.ch?De.text.lastIndexOf(">",De.ch-1):-1;if(At==-1){if(Te(De))continue;return}if(!xe(De,At+1)){De.ch=At;continue}var Jt=De.text.lastIndexOf("/",At),nt=Jt>-1&&!/\S/.test(De.text.slice(Jt+1,At));return De.ch=At+1,nt?"selfClose":"regular"}}function ht(De,At){for(var Jt=[];;){var nt=It(De),lt,Ie=De.line,ke=De.ch-(nt?nt[0].length:0);if(!nt||!(lt=mt(De)))return;if(lt!="selfClose")if(nt[1]){for(var je=Jt.length-1;je>=0;--je)if(Jt[je]==nt[2]){Jt.length=je;break}if(je<0&&(!At||At==nt[2]))return{tag:nt[2],from:et(Ie,ke),to:et(De.line,De.ch)}}else Jt.push(nt[2])}}function Ye(De,At){for(var Jt=[];;){var nt=Ct(De);if(!nt)return;if(nt=="selfClose"){ze(De);continue}var lt=De.line,Ie=De.ch,ke=ze(De);if(!ke)return;if(ke[1])Jt.push(ke[2]);else{for(var je=Jt.length-1;je>=0;--je)if(Jt[je]==ke[2]){Jt.length=je;break}if(je<0&&(!At||At==ke[2]))return{tag:ke[2],from:et(De.line,De.ch),to:et(lt,Ie)}}}}fe.registerHelper("fold","xml",function(De,At){for(var Jt=new Me(De,At.line,0);;){var nt=It(Jt);if(!nt||Jt.line!=At.line)return;var lt=mt(Jt);if(!lt)return;if(!nt[1]&<!="selfClose"){var Ie=et(Jt.line,Jt.ch),ke=ht(Jt,nt[2]);return ke&&$e(ke.from,Ie)>0?{from:Ie,to:ke.from}:null}}}),fe.findMatchingTag=function(De,At,Jt){var nt=new Me(De,At.line,At.ch,Jt);if(!(nt.text.indexOf(">")==-1&&nt.text.indexOf("<")==-1)){var lt=mt(nt),Ie=lt&&et(nt.line,nt.ch),ke=lt&&ze(nt);if(!(!lt||!ke||$e(nt,At)>0)){var je={from:et(nt.line,nt.ch),to:Ie,tag:ke[2]};return lt=="selfClose"?{open:je,close:null,at:"open"}:ke[1]?{open:Ye(nt,ke[2]),close:je,at:"close"}:(nt=new Me(De,Ie.line,Ie.ch,Jt),{open:je,close:ht(nt,ke[2]),at:"open"})}}},fe.findEnclosingTag=function(De,At,Jt,nt){for(var lt=new Me(De,At.line,At.ch,Jt);;){var Ie=Ye(lt,nt);if(!Ie)break;var ke=new Me(De,At.line,At.ch,Jt),je=ht(ke,Ie.tag);if(je)return{open:Ie,close:je}}},fe.scanForClosingTag=function(De,At,Jt,nt){var lt=new Me(De,At.line,At.ch,nt?{from:0,to:nt}:null);return ht(lt,Jt)}})},4631:function(Cn){(function(Xt,se){Cn.exports=se()})(this,function(){"use strict";var Xt=navigator.userAgent,se=navigator.platform,fe=/gecko\/\d/i.test(Xt),et=/MSIE \d/.test(Xt),$e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xt),Ue=/Edge\/(\d+)/.exec(Xt),be=et||$e||Ue,Se=be&&(et?document.documentMode||6:+(Ue||$e)[1]),Me=!Ue&&/WebKit\//.test(Xt),xe=Me&&/Qt\/\d+\.\d+/.test(Xt),pe=!Ue&&/Chrome\//.test(Xt),Te=/Opera\//.test(Xt),mt=/Apple Computer/.test(navigator.vendor),ze=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Xt),It=/PhantomJS/.test(Xt),Ct=!Ue&&/AppleWebKit/.test(Xt)&&/Mobile\/\w+/.test(Xt),ht=/Android/.test(Xt),Ye=Ct||ht||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Xt),De=Ct||/Mac/.test(se),At=/\bCrOS\b/.test(Xt),Jt=/win/i.test(se),nt=Te&&Xt.match(/Version\/(\d*\.\d*)/);nt&&(nt=Number(nt[1])),nt&&nt>=15&&(Te=!1,Me=!0);var lt=De&&(xe||Te&&(nt==null||nt<12.11)),Ie=fe||be&&Se>=9;function ke(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var je=function(x,z){var ne=x.className,te=ke(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 Xe(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function Pt(x,z){return Xe(x).appendChild(z)}function kt(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 ue=0;ue<z.length;++ue)ie.appendChild(z[ue]);return ie}function Lt(x,z,ne,te){var ie=kt(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var Ge;document.createRange?Ge=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:Ge=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 Ht(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 Dt(){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 Ln(x,z){var ne=x.className;ke(z).test(ne)||(x.className+=(ne?" ":"")+z)}function un(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!ke(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var Rn=function(x){x.select()};Ct?Rn=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:be&&(Rn=function(x){try{x.select()}catch(z){}});function ir(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function yr(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 Qe(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var ue=te||0,me=ie||0;;){var Ce=x.indexOf(" ",ue);if(Ce<0||Ce>=z)return me+(z-ue);me+=Ce-ue,me+=ne-me%ne,ue=Ce+1}}var Le=function(){this.id=null,this.f=null,this.time=0,this.handler=ir(this.onTimeout,this)};Le.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},Le.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 Nt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var Nn=50,gn={toString:function(){return"CodeMirror.Pass"}},Je={scroll:!1},st={origin:"*mouse"},_t={origin:"+move"};function en(x,z,ne){for(var te=0,ie=0;;){var ue=x.indexOf(" ",te);ue==-1&&(ue=x.length);var me=ue-te;if(ue==x.length||ie+me>=z)return te+Math.min(me,z-ie);if(ie+=ue-te,ie+=ne-ie%ne,te=ue+1,ie>=z)return te}}var Bt=[""];function Ft(x){for(;Bt.length<=x;)Bt.push(zt(Bt)+" ");return Bt[x]}function zt(x){return x[x.length-1]}function Mn(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function bn(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function Ee(){}function ce(x,z){var ne;return Object.create?ne=Object.create(x):(Ee.prototype=x,ne=new Ee),z&&yr(z,ne),ne}var le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||le.test(x))}function ve(x,z){return z?z.source.indexOf("\\w")>-1&&ye(x)?!0:z.test(x):ye(x)}function oe(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var He=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xt(x){return x.charCodeAt(0)>=768&&He.test(x)}function Yt(x,z,ne){for(;(ne<0?z>0:z<x.length)&&xt(x.charAt(z));)z+=ne;return z}function pn(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,ue=te<0?Math.ceil(ie):Math.floor(ie);if(ue==z)return x(ue)?z:ne;x(ue)?ne=ue:z=ue+te}}function dn(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,ue=0;ue<x.length;++ue){var me=x[ue];(me.from<ne&&me.to>z||z==ne&&me.to==z)&&(te(Math.max(me.from,z),Math.min(me.to,ne),me.level==1?"rtl":"ltr",ue),ie=!0)}ie||te(z,ne,"ltr")}var An=null;function tn(x,z,ne){var te;An=null;for(var ie=0;ie<x.length;++ie){var ue=x[ie];if(ue.from<z&&ue.to>z)return ie;ue.to==z&&(ue.from!=ue.to&&ne=="before"?te=ie:An=ie),ue.from==z&&(ue.from!=ue.to&&ne!="before"?te=ie:An=ie)}return te!=null?te:An}var Nr=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]/,ue=/[LRr]/,me=/[Lb1n]/,Ce=/[1n]/;function Ae(Oe,ct,Mt){this.level=Oe,this.from=ct,this.to=Mt}return function(Oe,ct){var Mt=ct=="ltr"?"L":"R";if(Oe.length==0||ct=="ltr"&&!te.test(Oe))return!1;for(var ln=Oe.length,qt=[],Xn=0;Xn<ln;++Xn)qt.push(ne(Oe.charCodeAt(Xn)));for(var dr=0,Ar=Mt;dr<ln;++dr){var Hr=qt[dr];Hr=="m"?qt[dr]=Ar:Ar=Hr}for(var ni=0,zr=Mt;ni<ln;++ni){var ri=qt[ni];ri=="1"&&zr=="r"?qt[ni]="n":ue.test(ri)&&(zr=ri,ri=="r"&&(qt[ni]="R"))}for(var $i=1,Hi=qt[0];$i<ln-1;++$i){var ba=qt[$i];ba=="+"&&Hi=="1"&&qt[$i+1]=="1"?qt[$i]="1":ba==","&&Hi==qt[$i+1]&&(Hi=="1"||Hi=="n")&&(qt[$i]=Hi),Hi=ba}for(var to=0;to<ln;++to){var Wo=qt[to];if(Wo==",")qt[to]="N";else if(Wo=="%"){var bo=void 0;for(bo=to+1;bo<ln&&qt[bo]=="%";++bo);for(var cs=to&&qt[to-1]=="!"||bo<ln&&qt[bo]=="1"?"1":"N",ds=to;ds<bo;++ds)qt[ds]=cs;to=bo-1}}for(var Io=0,fs=Mt;Io<ln;++Io){var oa=qt[Io];fs=="L"&&oa=="1"?qt[Io]="L":ue.test(oa)&&(fs=oa)}for(var So=0;So<ln;++So)if(ie.test(qt[So])){var xo=void 0;for(xo=So+1;xo<ln&&ie.test(qt[xo]);++xo);for(var Co=(So?qt[So-1]:Mt)=="L",ko=(xo<ln?qt[xo]:Mt)=="L",Wl=Co==ko?Co?"L":"R":Mt,ys=So;ys<xo;++ys)qt[ys]=Wl;So=xo-1}for(var Go=[],Wa,No=0;No<ln;)if(me.test(qt[No])){var Ec=No;for(++No;No<ln&&me.test(qt[No]);++No);Go.push(new Ae(0,Ec,No))}else{var sl=No,xl=Go.length,Vs=ct=="rtl"?1:0;for(++No;No<ln&&qt[No]!="L";++No);for(var Po=sl;Po<No;)if(Ce.test(qt[Po])){sl<Po&&(Go.splice(xl,0,new Ae(1,sl,Po)),xl+=Vs);var Ul=Po;for(++Po;Po<No&&Ce.test(qt[Po]);++Po);Go.splice(xl,0,new Ae(2,Ul,Po)),xl+=Vs,sl=Po}else++Po;sl<No&&Go.splice(xl,0,new Ae(1,sl,No))}return ct=="ltr"&&(Go[0].level==1&&(Wa=Oe.match(/^\s+/))&&(Go[0].from=Wa[0].length,Go.unshift(new Ae(0,0,Wa[0].length))),zt(Go).level==1&&(Wa=Oe.match(/\s+$/))&&(zt(Go).to-=Wa[0].length,Go.push(new Ae(0,ln-Wa[0].length,ln)))),ct=="rtl"?Go.reverse():Go}}();function Wr(x,z){var ne=x.order;return ne==null&&(ne=x.order=Nr(x.text,z)),ne}var Kt=[],$n=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]||Kt).concat(ne)}};function ei(x,z){return x._handlers&&x._handlers[z]||Kt}function hi(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 ue=Nt(ie,ne);ue>-1&&(te[z]=ie.slice(0,ue).concat(ie.slice(ue+1)))}}}function ut(x,z){var ne=ei(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 Vt(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),ut(x,ne||z.type,x,z),Gr(z)||z.codemirrorIgnore}function Vn(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)Nt(ne,z[te])==-1&&ne.push(z[te])}function rr(x,z){return ei(x,z).length>0}function gr(x){x.prototype.on=function(z,ne){$n(this,z,ne)},x.prototype.off=function(z,ne){hi(this,z,ne)}}function Ir(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function Ur(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Gr(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Xr(x){Ir(x),Ur(x)}function ui(x){return x.target||x.srcElement}function br(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),De&&x.ctrlKey&&z==1&&(z=3),z}var Ei=function(){if(be&&Se<9)return!1;var x=kt("div");return"draggable"in x||"dragDrop"in x}(),sa;function Ji(x){if(sa==null){var z=kt("span","\u200B");Pt(x,kt("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(sa=z.offsetWidth<=1&&z.offsetHeight>2&&!(be&&Se<8))}var ne=sa?kt("span","\u200B"):kt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Qi;function Ci(x){if(Qi!=null)return Qi;var z=Pt(x,document.createTextNode("A\u062EA")),ne=Ge(z,0,1).getBoundingClientRect(),te=Ge(z,1,2).getBoundingClientRect();return Xe(x),!ne||ne.left==ne.right?!1:Qi=te.right-ne.right<3}var gt=`
|
|
|
|
|
|
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 ue=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),me=ue.indexOf("\r");me!=-1?(ne.push(ue.slice(0,me)),z+=me+1):(ne.push(ue),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},En=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},kn=function(){var x=kt("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Tn=null;function sr(x){if(Tn!=null)return Tn;var z=Pt(x,kt("span","x")),ne=z.getBoundingClientRect(),te=Ge(z,0,1).getBoundingClientRect();return Tn=Math.abs(ne.left-te.left)>1}var tr={},pr={};function Hn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),tr[x]=z}function Ze(x,z){pr[x]=z}function at(x){if(typeof x=="string"&&pr.hasOwnProperty(x))x=pr[x];else if(x&&typeof x.name=="string"&&pr.hasOwnProperty(x.name)){var z=pr[x.name];typeof z=="string"&&(z={name:z}),x=ce(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return at("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return at("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function Et(x,z){z=at(z);var ne=tr[z.name];if(!ne)return Et(x,"text/plain");var te=ne(x,z);if(jt.hasOwnProperty(z.name)){var ie=jt[z.name];for(var ue in ie)ie.hasOwnProperty(ue)&&(te.hasOwnProperty(ue)&&(te["_"+ue]=te[ue]),te[ue]=ie[ue])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var me in z.modeProps)te[me]=z.modeProps[me];return te}var jt={};function Ke(x,z){var ne=jt.hasOwnProperty(x)?jt[x]:jt[x]={};yr(z,ne)}function dt(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 Rt(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 Tt(x,z,ne){return x.startState?x.startState(z,ne):!0}var Wt=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};Wt.prototype.eol=function(){return this.pos>=this.string.length},Wt.prototype.sol=function(){return this.pos==this.lineStart},Wt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Wt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Wt.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},Wt.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Wt.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Wt.prototype.skipToEnd=function(){this.pos=this.string.length},Wt.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Wt.prototype.backUp=function(x){this.pos-=x},Wt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Qe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Qe(this.string,this.lineStart,this.tabSize):0)},Wt.prototype.indentation=function(){return Qe(this.string,null,this.tabSize)-(this.lineStart?Qe(this.string,this.lineStart,this.tabSize):0)},Wt.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(me){return ne?me.toLowerCase():me},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var ue=this.string.slice(this.pos).match(x);return ue&&ue.index>0?null:(ue&&z!==!1&&(this.pos+=ue[0].length),ue)}},Wt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Wt.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Wt.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Wt.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Zt(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],ue=ie.chunkSize();if(z<ue){ne=ie;break}z-=ue}return ne.lines[z]}function zn(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(ue){var me=ue.text;ie==ne.line&&(me=me.slice(0,ne.ch)),ie==z.line&&(me=me.slice(z.ch)),te.push(me),++ie}),te}function Sr(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Yn(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function qn(x){if(x.parent==null)return null;for(var z=x.parent,ne=Nt(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 nr(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],ue=ie.height;if(z<ue){x=ie;continue e}z-=ue,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var me=0;me<x.lines.length;++me){var Ce=x.lines[me],Ae=Ce.height;if(z<Ae)break;z-=Ae}return ne+me}function ar(x,z){return z>=x.first&&z<x.first+x.size}function ot(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function tt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof tt))return new tt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function vt(x,z){return x.line-z.line||x.ch-z.ch}function rn(x,z){return x.sticky==z.sticky&&vt(x,z)==0}function Dn(x){return tt(x.line,x.ch)}function an(x,z){return vt(x,z)<0?z:x}function cn(x,z){return vt(x,z)<0?x:z}function fn(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function In(x,z){if(z.line<x.first)return tt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?tt(ne,Zt(x,ne).text.length):or(z,Zt(x,z.line).text.length)}function or(x,z){var ne=x.ch;return ne==null||ne>z?tt(x.line,z):ne<0?tt(x.line,0):x}function Ut(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=In(x,z[te]);return ne}var qr=function(x,z){this.state=x,this.lookAhead=z},Fr=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Fr.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Fr.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}},Fr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Fr.fromSaved=function(x,z,ne){return z instanceof qr?new Fr(x,dt(x.mode,z.state),ne,z.lookAhead):new Fr(x,dt(x.mode,z),ne)},Fr.prototype.save=function(x){var z=x!==!1?dt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qr(z,this.maxLookAhead):z};function Ri(x,z,ne,te){var ie=[x.state.modeGen],ue={};mi(x,z.text,x.doc.mode,ne,function(Oe,ct){return ie.push(Oe,ct)},ue,te);for(var me=ne.state,Ce=function(Oe){ne.baseTokens=ie;var ct=x.state.overlays[Oe],Mt=1,ln=0;ne.state=!0,mi(x,z.text,ct.mode,ne,function(qt,Xn){for(var dr=Mt;ln<qt;){var Ar=ie[Mt];Ar>qt&&ie.splice(Mt,1,qt,ie[Mt+1],Ar),Mt+=2,ln=Math.min(qt,Ar)}if(Xn)if(ct.opaque)ie.splice(dr,Mt-dr,qt,"overlay "+Xn),Mt=dr+2;else for(;dr<Mt;dr+=2){var Hr=ie[dr+1];ie[dr+1]=(Hr?Hr+" ":"")+"overlay "+Xn}},ue),ne.state=me,ne.baseTokens=null,ne.baseTokenPos=1},Ae=0;Ae<x.state.overlays.length;++Ae)Ce(Ae);return{styles:ie,classes:ue.bgClass||ue.textClass?ue:null}}function Li(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=pi(x,qn(z)),ie=z.text.length>x.options.maxHighlightLength&&dt(x.doc.mode,te.state),ue=Ri(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=ue.styles,ue.classes?z.styleClasses=ue.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 pi(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Fr(te,!0,z);var ue=Wi(x,z,ne),me=ue>te.first&&Zt(te,ue-1).stateAfter,Ce=me?Fr.fromSaved(te,me,ue):new Fr(te,Tt(te.mode),ue);return te.iter(ue,z,function(Ae){Gi(x,Ae.text,Ce);var Oe=Ce.line;Ae.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 Gi(x,z,ne,te){var ie=x.doc.mode,ue=new Wt(z,x.options.tabSize,ne);for(ue.start=ue.pos=te||0,z==""&&yi(ie,ne.state);!ue.eol();)ii(ie,ue,ne.state),ue.start=ue.pos}function yi(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Rt(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function ii(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Rt(x,ne).mode);var ue=x.token(z,ne);if(z.pos>z.start)return ue}throw new Error("Mode "+x.name+" failed to advance stream.")}var Bi=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function Zi(x,z,ne,te){var ie=x.doc,ue=ie.mode,me;z=In(ie,z);var Ce=Zt(ie,z.line),Ae=pi(x,z.line,ne),Oe=new Wt(Ce.text,x.options.tabSize,Ae),ct;for(te&&(ct=[]);(te||Oe.pos<z.ch)&&!Oe.eol();)Oe.start=Oe.pos,me=ii(ue,Oe,Ae.state),te&&ct.push(new Bi(Oe,me,dt(ie.mode,Ae.state)));return te?ct:new Bi(Oe,me,Ae.state)}function Vr(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 mi(x,z,ne,te,ie,ue,me){var Ce=ne.flattenSpans;Ce==null&&(Ce=x.options.flattenSpans);var Ae=0,Oe=null,ct=new Wt(z,x.options.tabSize,te),Mt,ln=x.options.addModeClass&&[null];for(z==""&&Vr(yi(ne,te.state),ue);!ct.eol();){if(ct.pos>x.options.maxHighlightLength?(Ce=!1,me&&Gi(x,z,te,ct.pos),ct.pos=z.length,Mt=null):Mt=Vr(ii(ne,ct,te.state,ln),ue),ln){var qt=ln[0].name;qt&&(Mt="m-"+(Mt?qt+" "+Mt:qt))}if(!Ce||Oe!=Mt){for(;Ae<ct.start;)Ae=Math.min(ct.start,Ae+5e3),ie(Ae,Oe);Oe=Mt}ct.start=ct.pos}for(;Ae<ct.pos;){var Xn=Math.min(ct.pos,Ae+5e3);ie(Xn,Oe),Ae=Xn}}function Wi(x,z,ne){for(var te,ie,ue=x.doc,me=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Ce=z;Ce>me;--Ce){if(Ce<=ue.first)return ue.first;var Ae=Zt(ue,Ce-1),Oe=Ae.stateAfter;if(Oe&&(!ne||Ce+(Oe instanceof qr?Oe.lookAhead:0)<=ue.modeFrontier))return Ce;var ct=Qe(Ae.text,null,x.options.tabSize);(ie==null||te>ct)&&(ie=Ce-1,te=ct)}return ie}function la(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=Zt(x,te).stateAfter;if(ie&&(!(ie instanceof qr)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var ea=!1,ti=!1;function yt(){ea=!0}function pt(){ti=!0}function $t(x,z,ne){this.marker=x,this.from=z,this.to=ne}function sn(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function _n(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function cr(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Mr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ue=x[ie],me=ue.marker,Ce=ue.from==null||(me.inclusiveLeft?ue.from<=z:ue.from<z);if(Ce||ue.from==z&&me.type=="bookmark"&&(!ne||!ue.marker.insertLeft)){var Ae=ue.to==null||(me.inclusiveRight?ue.to>=z:ue.to>z);(te||(te=[])).push(new $t(me,ue.from,Ae?null:ue.to))}}return te}function Br(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ue=x[ie],me=ue.marker,Ce=ue.to==null||(me.inclusiveRight?ue.to>=z:ue.to>z);if(Ce||ue.from==z&&me.type=="bookmark"&&(!ne||ue.marker.insertLeft)){var Ae=ue.from==null||(me.inclusiveLeft?ue.from<=z:ue.from<z);(te||(te=[])).push(new $t(me,Ae?null:ue.from-z,ue.to==null?null:ue.to-z))}}return te}function Kr(x,z){if(z.full)return null;var ne=ar(x,z.from.line)&&Zt(x,z.from.line).markedSpans,te=ar(x,z.to.line)&&Zt(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,ue=z.to.ch,me=vt(z.from,z.to)==0,Ce=Mr(ne,ie,me),Ae=Br(te,ue,me),Oe=z.text.length==1,ct=zt(z.text).length+(Oe?ie:0);if(Ce)for(var Mt=0;Mt<Ce.length;++Mt){var ln=Ce[Mt];if(ln.to==null){var qt=sn(Ae,ln.marker);qt?Oe&&(ln.to=qt.to==null?null:qt.to+ct):ln.to=ie}}if(Ae)for(var Xn=0;Xn<Ae.length;++Xn){var dr=Ae[Xn];if(dr.to!=null&&(dr.to+=ct),dr.from==null){var Ar=sn(Ce,dr.marker);Ar||(dr.from=ct,Oe&&(Ce||(Ce=[])).push(dr))}else dr.from+=ct,Oe&&(Ce||(Ce=[])).push(dr)}Ce&&(Ce=Rr(Ce)),Ae&&Ae!=Ce&&(Ae=Rr(Ae));var Hr=[Ce];if(!Oe){var ni=z.text.length-2,zr;if(ni>0&&Ce)for(var ri=0;ri<Ce.length;++ri)Ce[ri].to==null&&(zr||(zr=[])).push(new $t(Ce[ri].marker,null,null));for(var $i=0;$i<ni;++$i)Hr.push(zr);Hr.push(Ae)}return Hr}function Rr(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 Qr(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(qt){if(qt.markedSpans)for(var Xn=0;Xn<qt.markedSpans.length;++Xn){var dr=qt.markedSpans[Xn].marker;dr.readOnly&&(!te||Nt(te,dr)==-1)&&(te||(te=[])).push(dr)}}),!te)return null;for(var ie=[{from:z,to:ne}],ue=0;ue<te.length;++ue)for(var me=te[ue],Ce=me.find(0),Ae=0;Ae<ie.length;++Ae){var Oe=ie[Ae];if(!(vt(Oe.to,Ce.from)<0||vt(Oe.from,Ce.to)>0)){var ct=[Ae,1],Mt=vt(Oe.from,Ce.from),ln=vt(Oe.to,Ce.to);(Mt<0||!me.inclusiveLeft&&!Mt)&&ct.push({from:Oe.from,to:Ce.from}),(ln>0||!me.inclusiveRight&&!ln)&&ct.push({from:Ce.to,to:Oe.to}),ie.splice.apply(ie,ct),Ae+=ct.length-3}}return ie}function gi(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Cr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function di(x){return x.inclusiveLeft?-1:0}function Ai(x){return x.inclusiveRight?1:0}function Si(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),ue=vt(te.from,ie.from)||di(x)-di(z);if(ue)return-ue;var me=vt(te.to,ie.to)||Ai(x)-Ai(z);return me||z.id-x.id}function _e(x,z){var ne=ti&&x.markedSpans,te;if(ne)for(var ie=void 0,ue=0;ue<ne.length;++ue)ie=ne[ue],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||Si(te,ie.marker)<0)&&(te=ie.marker);return te}function Be(x){return _e(x,!0)}function Ne(x){return _e(x,!1)}function We(x,z){var ne=ti&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var ue=ne[ie];ue.marker.collapsed&&(ue.from==null||ue.from<z)&&(ue.to==null||ue.to>z)&&(!te||Si(te,ue.marker)<0)&&(te=ue.marker)}return te}function qe(x,z,ne,te,ie){var ue=Zt(x,z),me=ti&&ue.markedSpans;if(me)for(var Ce=0;Ce<me.length;++Ce){var Ae=me[Ce];if(Ae.marker.collapsed){var Oe=Ae.marker.find(0),ct=vt(Oe.from,ne)||di(Ae.marker)-di(ie),Mt=vt(Oe.to,te)||Ai(Ae.marker)-Ai(ie);if(!(ct>=0&&Mt<=0||ct<=0&&Mt>=0)&&(ct<=0&&(Ae.marker.inclusiveRight&&ie.inclusiveLeft?vt(Oe.to,ne)>=0:vt(Oe.to,ne)>0)||ct>=0&&(Ae.marker.inclusiveRight&&ie.inclusiveLeft?vt(Oe.from,te)<=0:vt(Oe.from,te)<0)))return!0}}}function rt(x){for(var z;z=Be(x);)x=z.find(-1,!0).line;return x}function bt(x){for(var z;z=Ne(x);)x=z.find(1,!0).line;return x}function Gt(x){for(var z,ne;z=Ne(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function nn(x,z){var ne=Zt(x,z),te=rt(ne);return ne==te?z:qn(te)}function Gn(x,z){if(z>x.lastLine())return z;var ne=Zt(x,z),te;if(!fr(x,ne))return z;for(;te=Ne(ne);)ne=te.find(1,!0).line;return qn(ne)+1}function fr(x,z){var ne=ti&&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&&Wn(x,z,te))return!0}}}function Wn(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return Wn(x,te.line,sn(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,ue=0;ue<z.markedSpans.length;++ue)if(ie=z.markedSpans[ue],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&Wn(x,z,ie))return!0}function vn(x){x=rt(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 ue=ne.parent;ue;ne=ue,ue=ne.parent)for(var me=0;me<ue.children.length;++me){var Ce=ue.children[me];if(Ce==ne)break;z+=Ce.height}return z}function hn(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=Be(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=Ne(te);){var ue=ne.find(0,!0);z-=te.text.length-ue.from.ch,te=ue.to.line,z+=te.text.length-ue.to.ch}return z}function Sn(x){var z=x.display,ne=x.doc;z.maxLine=Zt(ne,ne.first),z.maxLineLength=hn(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=hn(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var Pn=function(x,z,ne){this.text=x,Cr(this,z),this.height=ne?ne(this):1};Pn.prototype.lineNo=function(){return qn(this)},gr(Pn);function ur(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),gi(x),Cr(x,ne);var ie=te?te(x):1;ie!=x.height&&Yn(x,ie)}function jn(x){x.parent=null,gi(x)}var Zn={},Jn={};function Qn(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?Jn:Zn;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function hr(x,z){var ne=Lt("span",null,null,Me?"padding-right: .1px":null),te={pre:Lt("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 ue=ie?z.rest[ie-1]:z.line,me=void 0;te.pos=0,te.addToken=Fe,Ci(x.display.measure)&&(me=Wr(ue,x.doc.direction))&&(te.addToken=it(te.addToken,me)),te.map=[];var Ce=z!=x.display.externalMeasured&&qn(ue);on(ue,te,Li(x,ue,Ce)),ue.styleClasses&&(ue.styleClasses.bgClass&&(te.bgClass=un(ue.styleClasses.bgClass,te.bgClass||"")),ue.styleClasses.textClass&&(te.textClass=un(ue.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Ji(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(Me){var Ae=te.content.lastChild;(/\bcm-tab\b/.test(Ae.className)||Ae.querySelector&&Ae.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return ut(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=un(te.pre.className,te.textClass||"")),te}function Pe(x){var z=kt("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Fe(x,z,ne,te,ie,ue,me){if(z){var Ce=x.splitSpaces?wt(z,x.trailingSpace):z,Ae=x.cm.state.specialChars,Oe=!1,ct;if(!Ae.test(z))x.col+=z.length,ct=document.createTextNode(Ce),x.map.push(x.pos,x.pos+z.length,ct),be&&Se<9&&(Oe=!0),x.pos+=z.length;else{ct=document.createDocumentFragment();for(var Mt=0;;){Ae.lastIndex=Mt;var ln=Ae.exec(z),qt=ln?ln.index-Mt:z.length-Mt;if(qt){var Xn=document.createTextNode(Ce.slice(Mt,Mt+qt));be&&Se<9?ct.appendChild(kt("span",[Xn])):ct.appendChild(Xn),x.map.push(x.pos,x.pos+qt,Xn),x.col+=qt,x.pos+=qt}if(!ln)break;Mt+=qt+1;var dr=void 0;if(ln[0]==" "){var Ar=x.cm.options.tabSize,Hr=Ar-x.col%Ar;dr=ct.appendChild(kt("span",Ft(Hr),"cm-tab")),dr.setAttribute("role","presentation"),dr.setAttribute("cm-text"," "),x.col+=Hr}else ln[0]=="\r"||ln[0]==`
|
|
|
`?(dr=ct.appendChild(kt("span",ln[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dr.setAttribute("cm-text",ln[0]),x.col+=1):(dr=x.cm.options.specialCharPlaceholder(ln[0]),dr.setAttribute("cm-text",ln[0]),be&&Se<9?ct.appendChild(kt("span",[dr])):ct.appendChild(dr),x.col+=1);x.map.push(x.pos,x.pos+1,dr),x.pos++}}if(x.trailingSpace=Ce.charCodeAt(z.length-1)==32,ne||te||ie||Oe||ue||me){var ni=ne||"";te&&(ni+=te),ie&&(ni+=ie);var zr=kt("span",[ct],ni,ue);if(me)for(var ri in me)me.hasOwnProperty(ri)&&ri!="style"&&ri!="class"&&zr.setAttribute(ri,me[ri]);return x.content.appendChild(zr)}x.content.appendChild(ct)}}function wt(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var ue=x.charAt(ie);ue==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(ue="\xA0"),te+=ue,ne=ue==" "}return te}function it(x,z){return function(ne,te,ie,ue,me,Ce,Ae){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Oe=ne.pos,ct=Oe+te.length;;){for(var Mt=void 0,ln=0;ln<z.length&&(Mt=z[ln],!(Mt.to>Oe&&Mt.from<=Oe));ln++);if(Mt.to>=ct)return x(ne,te,ie,ue,me,Ce,Ae);x(ne,te.slice(0,Mt.to-Oe),ie,ue,null,Ce,Ae),ue=null,te=te.slice(Mt.to-Oe),Oe=Mt.to}}}function Ot(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 on(x,z,ne){var te=x.markedSpans,ie=x.text,ue=0;if(!te){for(var me=1;me<ne.length;me+=2)z.addToken(z,ie.slice(ue,ue=ne[me]),Qn(ne[me+1],z.cm.options));return}for(var Ce=ie.length,Ae=0,Oe=1,ct="",Mt,ln,qt=0,Xn,dr,Ar,Hr,ni;;){if(qt==Ae){Xn=dr=Ar=ln="",ni=null,Hr=null,qt=1/0;for(var zr=[],ri=void 0,$i=0;$i<te.length;++$i){var Hi=te[$i],ba=Hi.marker;if(ba.type=="bookmark"&&Hi.from==Ae&&ba.widgetNode)zr.push(ba);else if(Hi.from<=Ae&&(Hi.to==null||Hi.to>Ae||ba.collapsed&&Hi.to==Ae&&Hi.from==Ae)){if(Hi.to!=null&&Hi.to!=Ae&&qt>Hi.to&&(qt=Hi.to,dr=""),ba.className&&(Xn+=" "+ba.className),ba.css&&(ln=(ln?ln+";":"")+ba.css),ba.startStyle&&Hi.from==Ae&&(Ar+=" "+ba.startStyle),ba.endStyle&&Hi.to==qt&&(ri||(ri=[])).push(ba.endStyle,Hi.to),ba.title&&((ni||(ni={})).title=ba.title),ba.attributes)for(var to in ba.attributes)(ni||(ni={}))[to]=ba.attributes[to];ba.collapsed&&(!Hr||Si(Hr.marker,ba)<0)&&(Hr=Hi)}else Hi.from>Ae&&qt>Hi.from&&(qt=Hi.from)}if(ri)for(var Wo=0;Wo<ri.length;Wo+=2)ri[Wo+1]==qt&&(dr+=" "+ri[Wo]);if(!Hr||Hr.from==Ae)for(var bo=0;bo<zr.length;++bo)Ot(z,0,zr[bo]);if(Hr&&(Hr.from||0)==Ae){if(Ot(z,(Hr.to==null?Ce+1:Hr.to)-Ae,Hr.marker,Hr.from==null),Hr.to==null)return;Hr.to==Ae&&(Hr=!1)}}if(Ae>=Ce)break;for(var cs=Math.min(Ce,qt);;){if(ct){var ds=Ae+ct.length;if(!Hr){var Io=ds>cs?ct.slice(0,cs-Ae):ct;z.addToken(z,Io,Mt?Mt+Xn:Xn,Ar,Ae+Io.length==qt?dr:"",ln,ni)}if(ds>=cs){ct=ct.slice(cs-Ae),Ae=cs;break}Ae=ds,Ar=""}ct=ie.slice(ue,ue=ne[Oe++]),Mt=Qn(ne[Oe++],z.cm.options)}}}function mn(x,z,ne){this.line=z,this.rest=Gt(z),this.size=this.rest?qn(zt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=fr(x,z)}function On(x,z,ne){for(var te=[],ie,ue=z;ue<ne;ue=ie){var me=new mn(x.doc,Zt(x.doc,ue),ue);ie=ue+me.size,te.push(me)}return te}var xn=null;function Qt(x){xn?xn.ops.push(x):x.ownsGroup=xn={ops:[x],delayedCallbacks:[]}}function Bn(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 Kn(x,z){var ne=x.ownsGroup;if(ne)try{Bn(ne)}finally{xn=null,z(ne)}}var mr=null;function Fn(x,z){var ne=ei(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;xn?ie=xn.delayedCallbacks:mr?ie=mr:(ie=mr=[],setTimeout(_r,0));for(var ue=function(Ce){ie.push(function(){return ne[Ce].apply(null,te)})},me=0;me<ne.length;++me)ue(me)}}function _r(){var x=mr;mr=null;for(var z=0;z<x.length;++z)x[z]()}function Zr(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var ue=z.changes[ie];ue=="text"?Pr(x,z):ue=="gutter"?ai(x,z,ne,te):ue=="class"?Yr(x,z):ue=="widget"&&Dr(x,z,te)}z.changes=null}function Tr(x){return x.node==x.text&&(x.node=kt("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),be&&Se<8&&(x.node.style.zIndex=2)),x.node}function $r(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=Tr(z);z.background=te.insertBefore(kt("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function xr(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):hr(x,z)}function Pr(x,z){var ne=z.text.className,te=xr(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,Yr(x,z)):ne&&(z.text.className=ne)}function Yr(x,z){$r(x,z),z.line.wrapClass?Tr(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 ai(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=Tr(z);z.gutterBackground=kt("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 ue=z.line.gutterMarkers;if(x.options.lineNumbers||ue){var me=Tr(z),Ce=z.gutter=kt("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Ce),me.insertBefore(Ce,z.text),z.line.gutterClass&&(Ce.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!ue||!ue["CodeMirror-linenumbers"])&&(z.lineNumber=Ce.appendChild(kt("div",ot(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),ue)for(var Ae=0;Ae<x.display.gutterSpecs.length;++Ae){var Oe=x.display.gutterSpecs[Ae].className,ct=ue.hasOwnProperty(Oe)&&ue[Oe];ct&&Ce.appendChild(kt("div",[ct],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Oe]+"px; width: "+te.gutterWidth[Oe]+"px"))}}}function Dr(x,z,ne){z.alignable&&(z.alignable=null);for(var te=ke("CodeMirror-linewidget"),ie=z.node.firstChild,ue=void 0;ie;ie=ue)ue=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);Pi(x,z,ne)}function li(x,z,ne,te){var ie=xr(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),Yr(x,z),ai(x,z,ne,te),Pi(x,z,te),z.node}function Pi(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 ue=Tr(ne),me=0,Ce=z.widgets;me<Ce.length;++me){var Ae=Ce[me],Oe=kt("div",[Ae.node],"CodeMirror-linewidget"+(Ae.className?" "+Ae.className:""));Ae.handleMouseEvents||Oe.setAttribute("cm-ignore-events","true"),Vi(Ae,Oe,ne,te),x.display.input.setUneditable(Oe),ie&&Ae.above?ue.insertBefore(Oe,ne.gutter||ne.text):ue.appendChild(Oe),Fn(Ae,"redraw")}}function Vi(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 Ni(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Ht(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;"),Pt(z.display.measure,kt("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function Xi(x,z){for(var ne=ui(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 qi(x){return x.lineSpace.offsetTop}function bi(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function Fi(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=Pt(x.measure,kt("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 jr(x){return Nn-x.display.nativeBarWidth}function ci(x){return x.display.scroller.clientWidth-jr(x)-x.display.barWidth}function Ti(x){return x.display.scroller.clientHeight-jr(x)-x.display.barHeight}function ji(x,z,ne){var te=x.options.lineWrapping,ie=te&&ci(x);if(!z.measure.heights||te&&z.measure.width!=ie){var ue=z.measure.heights=[];if(te){z.measure.width=ie;for(var me=z.text.firstChild.getClientRects(),Ce=0;Ce<me.length-1;Ce++){var Ae=me[Ce],Oe=me[Ce+1];Math.abs(Ae.bottom-Oe.bottom)>2&&ue.push((Ae.bottom+Oe.top)/2-ne.top)}}ue.push(ne.bottom-ne.top)}}function Na(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(qn(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function Fa(x,z){z=rt(z);var ne=qn(z),te=x.display.externalMeasured=new mn(x.doc,z,ne);te.lineN=ne;var ie=te.built=hr(x,te);return te.text=ie.pre,Pt(x.display.lineMeasure,ie.pre),te}function Aa(x,z,ne,te){return Mi(x,Yi(x,z),ne,te)}function ua(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[na(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Yi(x,z){var ne=qn(z),te=ua(x,ne);te&&!te.text?te=null:te&&te.changes&&(Zr(x,te,ne,ho(x)),x.curOp.forceUpdate=!0),te||(te=Fa(x,z));var ie=Na(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Mi(x,z,ne,te,ie){z.before&&(ne=-1);var ue=ne+(te||""),me;return z.cache.hasOwnProperty(ue)?me=z.cache[ue]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ji(x,z.view,z.rect),z.hasHeights=!0),me=zi(x,z,ne,te),me.bogus||(z.cache[ue]=me)),{left:me.left,right:me.right,top:ie?me.rtop:me.top,bottom:ie?me.rbottom:me.bottom}}var Oa={left:0,right:0,top:0,bottom:0};function ki(x,z,ne){for(var te,ie,ue,me,Ce,Ae,Oe=0;Oe<x.length;Oe+=3)if(Ce=x[Oe],Ae=x[Oe+1],z<Ce?(ie=0,ue=1,me="left"):z<Ae?(ie=z-Ce,ue=ie+1):(Oe==x.length-3||z==Ae&&x[Oe+3]>z)&&(ue=Ae-Ce,ie=ue-1,z>=Ae&&(me="right")),ie!=null){if(te=x[Oe+2],Ce==Ae&&ne==(te.insertLeft?"left":"right")&&(me=ne),ne=="left"&&ie==0)for(;Oe&&x[Oe-2]==x[Oe-3]&&x[Oe-1].insertLeft;)te=x[(Oe-=3)+2],me="left";if(ne=="right"&&ie==Ae-Ce)for(;Oe<x.length-3&&x[Oe+3]==x[Oe+4]&&!x[Oe+5].insertLeft;)te=x[(Oe+=3)+2],me="right";break}return{node:te,start:ie,end:ue,collapse:me,coverStart:Ce,coverEnd:Ae}}function Jr(x,z){var ne=Oa;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 zi(x,z,ne,te){var ie=ki(z.map,ne,te),ue=ie.node,me=ie.start,Ce=ie.end,Ae=ie.collapse,Oe;if(ue.nodeType==3){for(var ct=0;ct<4;ct++){for(;me&&xt(z.line.text.charAt(ie.coverStart+me));)--me;for(;ie.coverStart+Ce<ie.coverEnd&&xt(z.line.text.charAt(ie.coverStart+Ce));)++Ce;if(be&&Se<9&&me==0&&Ce==ie.coverEnd-ie.coverStart?Oe=ue.parentNode.getBoundingClientRect():Oe=Jr(Ge(ue,me,Ce).getClientRects(),te),Oe.left||Oe.right||me==0)break;Ce=me,me=me-1,Ae="right"}be&&Se<11&&(Oe=ca(x.display.measure,Oe))}else{me>0&&(Ae=te="right");var Mt;x.options.lineWrapping&&(Mt=ue.getClientRects()).length>1?Oe=Mt[te=="right"?Mt.length-1:0]:Oe=ue.getBoundingClientRect()}if(be&&Se<9&&!me&&(!Oe||!Oe.left&&!Oe.right)){var ln=ue.parentNode.getClientRects()[0];ln?Oe={left:ln.left,right:ln.left+io(x.display),top:ln.top,bottom:ln.bottom}:Oe=Oa}for(var qt=Oe.top-z.rect.top,Xn=Oe.bottom-z.rect.top,dr=(qt+Xn)/2,Ar=z.view.measure.heights,Hr=0;Hr<Ar.length-1&&!(dr<Ar[Hr]);Hr++);var ni=Hr?Ar[Hr-1]:0,zr=Ar[Hr],ri={left:(Ae=="right"?Oe.right:Oe.left)-z.rect.left,right:(Ae=="left"?Oe.left:Oe.right)-z.rect.left,top:ni,bottom:zr};return!Oe.left&&!Oe.right&&(ri.bogus=!0),x.options.singleCursorHeightPerLine||(ri.rtop=qt,ri.rbottom=Xn),ri}function ca(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!sr(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 Ui(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 ia(x){x.display.externalMeasure=null,Xe(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Ui(x.display.view[z])}function fi(x){ia(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function pa(){return pe&&ht?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function xa(){return pe&&ht?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function fa(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=Ni(x.widgets[ne]));return z}function wa(x,z,ne,te,ie){if(!ie){var ue=fa(z);ne.top+=ue,ne.bottom+=ue}if(te=="line")return ne;te||(te="local");var me=vn(z);if(te=="local"?me+=qi(x.display):me-=x.display.viewOffset,te=="page"||te=="window"){var Ce=x.display.lineSpace.getBoundingClientRect();me+=Ce.top+(te=="window"?0:xa());var Ae=Ce.left+(te=="window"?0:pa());ne.left+=Ae,ne.right+=Ae}return ne.top+=me,ne.bottom+=me,ne}function Ea(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=pa(),ie-=xa();else if(ne=="local"||!ne){var ue=x.display.sizer.getBoundingClientRect();te+=ue.left,ie+=ue.top}var me=x.display.lineSpace.getBoundingClientRect();return{left:te-me.left,top:ie-me.top}}function Va(x,z,ne,te,ie){return te||(te=Zt(x.doc,z.line)),wa(x,te,Aa(x,te,z.ch,ie),ne)}function ha(x,z,ne,te,ie,ue){te=te||Zt(x.doc,z.line),ie||(ie=Yi(x,te));function me(Xn,dr){var Ar=Mi(x,ie,Xn,dr?"right":"left",ue);return dr?Ar.left=Ar.right:Ar.right=Ar.left,wa(x,te,Ar,ne)}var Ce=Wr(te,x.doc.direction),Ae=z.ch,Oe=z.sticky;if(Ae>=te.text.length?(Ae=te.text.length,Oe="before"):Ae<=0&&(Ae=0,Oe="after"),!Ce)return me(Oe=="before"?Ae-1:Ae,Oe=="before");function ct(Xn,dr,Ar){var Hr=Ce[dr],ni=Hr.level==1;return me(Ar?Xn-1:Xn,ni!=Ar)}var Mt=tn(Ce,Ae,Oe),ln=An,qt=ct(Ae,Mt,Oe=="before");return ln!=null&&(qt.other=ct(Ae,ln,Oe!="before")),qt}function ka(x,z){var ne=0;z=In(x.doc,z),x.options.lineWrapping||(ne=io(x.display)*z.ch);var te=Zt(x.doc,z.line),ie=vn(te)+qi(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function Ja(x,z,ne,te,ie){var ue=tt(x,z,ne);return ue.xRel=ie,te&&(ue.outside=te),ue}function Ga(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Ja(te.first,0,null,-1,-1);var ie=nr(te,ne),ue=te.first+te.size-1;if(ie>ue)return Ja(te.first+te.size-1,Zt(te,ue).text.length,null,1,1);z<0&&(z=0);for(var me=Zt(te,ie);;){var Ce=_i(x,me,ie,z,ne),Ae=We(me,Ce.ch+(Ce.xRel>0||Ce.outside>0?1:0));if(!Ae)return Ce;var Oe=Ae.find(1);if(Oe.line==ie)return Oe;me=Zt(te,ie=Oe.line)}}function so(x,z,ne,te){te-=fa(z);var ie=z.text.length,ue=pn(function(me){return Mi(x,ne,me-1).bottom<=te},ie,0);return ie=pn(function(me){return Mi(x,ne,me).top>te},ue,ie),{begin:ue,end:ie}}function $a(x,z,ne,te){ne||(ne=Yi(x,z));var ie=wa(x,z,Mi(x,ne,te),"line").top;return so(x,z,ne,ie)}function Ca(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function _i(x,z,ne,te,ie){ie-=vn(z);var ue=Yi(x,z),me=fa(z),Ce=0,Ae=z.text.length,Oe=!0,ct=Wr(z,x.doc.direction);if(ct){var Mt=(x.options.lineWrapping?da:Ki)(x,z,ne,ue,ct,te,ie);Oe=Mt.level!=1,Ce=Oe?Mt.from:Mt.to-1,Ae=Oe?Mt.to:Mt.from-1}var ln=null,qt=null,Xn=pn(function($i){var Hi=Mi(x,ue,$i);return Hi.top+=me,Hi.bottom+=me,Ca(Hi,te,ie,!1)?(Hi.top<=ie&&Hi.left<=te&&(ln=$i,qt=Hi),!0):!1},Ce,Ae),dr,Ar,Hr=!1;if(qt){var ni=te-qt.left<qt.right-te,zr=ni==Oe;Xn=ln+(zr?0:1),Ar=zr?"after":"before",dr=ni?qt.left:qt.right}else{!Oe&&(Xn==Ae||Xn==Ce)&&Xn++,Ar=Xn==0?"after":Xn==z.text.length?"before":Mi(x,ue,Xn-(Oe?1:0)).bottom+me<=ie==Oe?"after":"before";var ri=ha(x,tt(ne,Xn,Ar),"line",z,ue);dr=ri.left,Hr=ie<ri.top?-1:ie>=ri.bottom?1:0}return Xn=Yt(z.text,Xn,1),Ja(ne,Xn,Ar,Hr,te-dr)}function Ki(x,z,ne,te,ie,ue,me){var Ce=pn(function(Mt){var ln=ie[Mt],qt=ln.level!=1;return Ca(ha(x,tt(ne,qt?ln.to:ln.from,qt?"before":"after"),"line",z,te),ue,me,!0)},0,ie.length-1),Ae=ie[Ce];if(Ce>0){var Oe=Ae.level!=1,ct=ha(x,tt(ne,Oe?Ae.from:Ae.to,Oe?"after":"before"),"line",z,te);Ca(ct,ue,me,!0)&&ct.top>me&&(Ae=ie[Ce-1])}return Ae}function da(x,z,ne,te,ie,ue,me){var Ce=so(x,z,te,me),Ae=Ce.begin,Oe=Ce.end;/\s/.test(z.text.charAt(Oe-1))&&Oe--;for(var ct=null,Mt=null,ln=0;ln<ie.length;ln++){var qt=ie[ln];if(!(qt.from>=Oe||qt.to<=Ae)){var Xn=qt.level!=1,dr=Mi(x,te,Xn?Math.min(Oe,qt.to)-1:Math.max(Ae,qt.from)).right,Ar=dr<ue?ue-dr+1e9:dr-ue;(!ct||Mt>Ar)&&(ct=qt,Mt=Ar)}}return ct||(ct=ie[ie.length-1]),ct.from<Ae&&(ct={from:Ae,to:ct.to,level:ct.level}),ct.to>Oe&&(ct={from:ct.from,to:Oe,level:ct.level}),ct}var Sa;function Ka(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Sa==null){Sa=kt("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Sa.appendChild(document.createTextNode("x")),Sa.appendChild(kt("br"));Sa.appendChild(document.createTextNode("x"))}Pt(x.measure,Sa);var ne=Sa.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Xe(x.measure),ne||1}function io(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=kt("span","xxxxxxxxxx"),ne=kt("pre",[z],"CodeMirror-line-like");Pt(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function ho(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,ue=z.gutters.firstChild,me=0;ue;ue=ue.nextSibling,++me){var Ce=x.display.gutterSpecs[me].className;ne[Ce]=ue.offsetLeft+ue.clientLeft+ie,te[Ce]=ue.clientWidth}return{fixedPos:Oo(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Oo(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Ro(x){var z=Ka(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/io(x.display)-3);return function(ie){if(fr(x.doc,ie))return 0;var ue=0;if(ie.widgets)for(var me=0;me<ie.widgets.length;me++)ie.widgets[me].height&&(ue+=ie.widgets[me].height);return ne?ue+(Math.ceil(ie.text.length/te)||1)*z:ue+z}}function lo(x){var z=x.doc,ne=Ro(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Yn(te,ie)})}function Ao(x,z,ne,te){var ie=x.display;if(!ne&&ui(z).getAttribute("cm-not-content")=="true")return null;var ue,me,Ce=ie.lineSpace.getBoundingClientRect();try{ue=z.clientX-Ce.left,me=z.clientY-Ce.top}catch(Mt){return null}var Ae=Ga(x,ue,me),Oe;if(te&&Ae.xRel>0&&(Oe=Zt(x.doc,Ae.line).text).length==Ae.ch){var ct=Qe(Oe,Oe.length,x.options.tabSize)-Oe.length;Ae=tt(Ae.line,Math.max(0,Math.round((ue-Fi(x.display).left)/io(x.display))-ct))}return Ae}function na(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 Oi(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)ti&&nn(x.doc,z)<ie.viewTo&&_a(x);else if(ne<=ie.viewFrom)ti&&Gn(x.doc,ne+te)>ie.viewFrom?_a(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)_a(x);else if(z<=ie.viewFrom){var ue=uo(x,ne,ne+te,1);ue?(ie.view=ie.view.slice(ue.index),ie.viewFrom=ue.lineN,ie.viewTo+=te):_a(x)}else if(ne>=ie.viewTo){var me=uo(x,z,z,-1);me?(ie.view=ie.view.slice(0,me.index),ie.viewTo=me.lineN):_a(x)}else{var Ce=uo(x,z,z,-1),Ae=uo(x,ne,ne+te,1);Ce&&Ae?(ie.view=ie.view.slice(0,Ce.index).concat(On(x,Ce.lineN,Ae.lineN)).concat(ie.view.slice(Ae.index)),ie.viewTo+=te):_a(x)}var Oe=ie.externalMeasured;Oe&&(ne<Oe.lineN?Oe.lineN+=te:z<Oe.lineN+Oe.size&&(ie.externalMeasured=null))}function Ta(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 ue=te.view[na(x,z)];if(ue.node!=null){var me=ue.changes||(ue.changes=[]);Nt(me,ne)==-1&&me.push(ne)}}}function _a(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function uo(x,z,ne,te){var ie=na(x,z),ue,me=x.display.view;if(!ti||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Ce=x.display.viewFrom,Ae=0;Ae<ie;Ae++)Ce+=me[Ae].size;if(Ce!=z){if(te>0){if(ie==me.length-1)return null;ue=Ce+me[ie].size-z,ie++}else ue=Ce-z;z+=ue,ne+=ue}for(;nn(x.doc,ne)!=ne;){if(ie==(te<0?0:me.length-1))return null;ne+=te*me[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function ao(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=On(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=On(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(na(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(On(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,na(x,ne)))),te.viewTo=ne}function hs(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 Qo(x){x.display.input.showSelection(x.display.input.prepareSelection())}function ps(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),ue=te.selection=document.createDocumentFragment(),me=0;me<ne.sel.ranges.length;me++)if(!(!z&&me==ne.sel.primIndex)){var Ce=ne.sel.ranges[me];if(!(Ce.from().line>=x.display.viewTo||Ce.to().line<x.display.viewFrom)){var Ae=Ce.empty();(Ae||x.options.showCursorWhenSelecting)&&aa(x,Ce.head,ie),Ae||xi(x,Ce,ue)}}return te}function aa(x,z,ne){var te=ha(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(kt("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 ue=ne.appendChild(kt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ue.style.display="",ue.style.left=te.other.left+"px",ue.style.top=te.other.top+"px",ue.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Lr(x,z){return x.top-z.top||x.left-z.left}function xi(x,z,ne){var te=x.display,ie=x.doc,ue=document.createDocumentFragment(),me=Fi(x.display),Ce=me.left,Ae=Math.max(te.sizerWidth,ci(x)-te.sizer.offsetLeft)-me.right,Oe=ie.direction=="ltr";function ct(zr,ri,$i,Hi){ri<0&&(ri=0),ri=Math.round(ri),Hi=Math.round(Hi),ue.appendChild(kt("div",null,"CodeMirror-selected","position: absolute; left: "+zr+`px;
|
|
|
top: `+ri+"px; width: "+($i==null?Ae-zr:$i)+`px;
|
|
|
height: `+(Hi-ri)+"px"))}function Mt(zr,ri,$i){var Hi=Zt(ie,zr),ba=Hi.text.length,to,Wo;function bo(Io,fs){return Va(x,tt(zr,Io),"div",Hi,fs)}function cs(Io,fs,oa){var So=$a(x,Hi,null,Io),xo=fs=="ltr"==(oa=="after")?"left":"right",Co=oa=="after"?So.begin:So.end-(/\s/.test(Hi.text.charAt(So.end-1))?2:1);return bo(Co,xo)[xo]}var ds=Wr(Hi,ie.direction);return dn(ds,ri||0,$i==null?ba:$i,function(Io,fs,oa,So){var xo=oa=="ltr",Co=bo(Io,xo?"left":"right"),ko=bo(fs-1,xo?"right":"left"),Wl=ri==null&&Io==0,ys=$i==null&&fs==ba,Go=So==0,Wa=!ds||So==ds.length-1;if(ko.top-Co.top<=3){var No=(Oe?Wl:ys)&&Go,Ec=(Oe?ys:Wl)&&Wa,sl=No?Ce:(xo?Co:ko).left,xl=Ec?Ae:(xo?ko:Co).right;ct(sl,Co.top,xl-sl,Co.bottom)}else{var Vs,Po,Ul,Xo;xo?(Vs=Oe&&Wl&&Go?Ce:Co.left,Po=Oe?Ae:cs(Io,oa,"before"),Ul=Oe?Ce:cs(fs,oa,"after"),Xo=Oe&&ys&&Wa?Ae:ko.right):(Vs=Oe?cs(Io,oa,"before"):Ce,Po=!Oe&&Wl&&Go?Ae:Co.right,Ul=!Oe&&ys&&Wa?Ce:ko.left,Xo=Oe?cs(fs,oa,"after"):Ae),ct(Vs,Co.top,Po-Vs,Co.bottom),Co.bottom<ko.top&&ct(Ce,Co.bottom,null,ko.top),ct(Ul,ko.top,Xo-Ul,ko.bottom)}(!to||Lr(Co,to)<0)&&(to=Co),Lr(ko,to)<0&&(to=ko),(!Wo||Lr(Co,Wo)<0)&&(Wo=Co),Lr(ko,Wo)<0&&(Wo=ko)}),{start:to,end:Wo}}var ln=z.from(),qt=z.to();if(ln.line==qt.line)Mt(ln.line,ln.ch,qt.ch);else{var Xn=Zt(ie,ln.line),dr=Zt(ie,qt.line),Ar=rt(Xn)==rt(dr),Hr=Mt(ln.line,ln.ch,Ar?Xn.text.length+1:null).end,ni=Mt(qt.line,Ar?0:null,qt.ch).start;Ar&&(Hr.top<ni.top-2?(ct(Hr.right,Hr.top,null,Hr.bottom),ct(Ce,ni.top,ni.left,ni.bottom)):ct(Hr.right,Hr.top,ni.left-Hr.right,Hr.bottom)),Hr.bottom<ni.top&&ct(Ce,Hr.bottom,null,ni.top)}ne.appendChild(ue)}function wi(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()||$o(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Di(x){x.state.focused||(x.display.input.focus(),ja(x))}function Ha(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,$o(x))},100)}function ja(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(ut(x,"focus",x,z),x.state.focused=!0,Ln(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Me&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),wi(x))}function $o(x,z){x.state.delayingBlurEvent||(x.state.focused&&(ut(x,"blur",x,z),x.state.focused=!1,je(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function Uo(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],ue=x.options.lineWrapping,me=void 0,Ce=0;if(!ie.hidden){if(be&&Se<8){var Ae=ie.node.offsetTop+ie.node.offsetHeight;me=Ae-ne,ne=Ae}else{var Oe=ie.node.getBoundingClientRect();me=Oe.bottom-Oe.top,!ue&&ie.text.firstChild&&(Ce=ie.text.firstChild.getBoundingClientRect().right-Oe.left-1)}var ct=ie.line.height-me;if((ct>.005||ct<-.005)&&(Yn(ie.line,me),ls(ie.line),ie.rest))for(var Mt=0;Mt<ie.rest.length;Mt++)ls(ie.rest[Mt]);if(Ce>x.display.sizerWidth){var ln=Math.ceil(Ce/io(x.display));ln>x.display.maxLineLength&&(x.display.maxLineLength=ln,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function ls(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 va(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-qi(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,ue=nr(z,te),me=nr(z,ie);if(ne&&ne.ensure){var Ce=ne.ensure.from.line,Ae=ne.ensure.to.line;Ce<ue?(ue=Ce,me=nr(z,vn(Zt(z,Ce))+x.wrapper.clientHeight)):Math.min(Ae,z.lastLine())>=me&&(ue=nr(z,vn(Zt(z,Ae))-x.wrapper.clientHeight),me=Ae)}return{from:ue,to:Math.max(me,ue+1)}}function Bo(x,z){if(!Vt(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&&!It){var ue=kt("div","\u200B",null,`position: absolute;
|
|
|
top: `+(z.top-ne.viewOffset-qi(x.display))+`px;
|
|
|
height: `+(z.bottom-z.top+jr(x)+ne.barHeight)+`px;
|
|
|
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(ue),ue.scrollIntoView(ie),x.display.lineSpace.removeChild(ue)}}}function us(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?tt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?tt(z.line,z.ch+1,"before"):z);for(var ue=0;ue<5;ue++){var me=!1,Ce=ha(x,z),Ae=!ne||ne==z?Ce:ha(x,ne);ie={left:Math.min(Ce.left,Ae.left),top:Math.min(Ce.top,Ae.top)-te,right:Math.max(Ce.left,Ae.left),bottom:Math.max(Ce.bottom,Ae.bottom)+te};var Oe=As(x,ie),ct=x.doc.scrollTop,Mt=x.doc.scrollLeft;if(Oe.scrollTop!=null&&(Da(x,Oe.scrollTop),Math.abs(x.doc.scrollTop-ct)>1&&(me=!0)),Oe.scrollLeft!=null&&(go(x,Oe.scrollLeft),Math.abs(x.doc.scrollLeft-Mt)>1&&(me=!0)),!me)break}return ie}function cl(x,z){var ne=As(x,z);ne.scrollTop!=null&&Da(x,ne.scrollTop),ne.scrollLeft!=null&&go(x,ne.scrollLeft)}function As(x,z){var ne=x.display,te=Ka(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,ue=Ti(x),me={};z.bottom-z.top>ue&&(z.bottom=z.top+ue);var Ce=x.doc.height+bi(ne),Ae=z.top<te,Oe=z.bottom>Ce-te;if(z.top<ie)me.scrollTop=Ae?0:z.top;else if(z.bottom>ie+ue){var ct=Math.min(z.top,(Oe?Ce:z.bottom)-ue);ct!=ie&&(me.scrollTop=ct)}var Mt=x.options.fixedGutter?0:ne.gutters.offsetWidth,ln=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-Mt,qt=ci(x)-ne.gutters.offsetWidth,Xn=z.right-z.left>qt;return Xn&&(z.right=z.left+qt),z.left<10?me.scrollLeft=0:z.left<ln?me.scrollLeft=Math.max(0,z.left+Mt-(Xn?0:10)):z.right>qt+ln-3&&(me.scrollLeft=z.right+(Xn?0:10)-qt),me}function ms(x,z){z!=null&&(Ys(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function zo(x){Ys(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function Ts(x,z,ne){(z!=null||ne!=null)&&Ys(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Ds(x,z){Ys(x),x.curOp.scrollToPos=z}function Ys(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=ka(x,z.from),te=ka(x,z.to);oo(x,ne,te,z.margin)}}function oo(x,z,ne,te){var ie=As(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});Ts(x,ie.scrollLeft,ie.scrollTop)}function Da(x,z){Math.abs(x.doc.scrollTop-z)<2||(fe||Yu(x,{top:z}),Xa(x,z,!0),fe&&Yu(x),is(x,100))}function Xa(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 go(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,Vc(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function yo(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+bi(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+jr(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var Ko=function(x,z,ne){this.cm=ne;var te=this.vert=kt("div",[kt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=kt("div",[kt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),$n(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),$n(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,be&&Se<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ko.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 ue=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+ue)+"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}},Ko.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ko.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ko.prototype.zeroWidthHack=function(){var x=De&&!ze?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Le,this.disableVert=new Le},Ko.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),ue=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);ue!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},Ko.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var wo=function(){};wo.prototype.update=function(){return{bottom:0,right:0}},wo.prototype.setScrollLeft=function(){},wo.prototype.setScrollTop=function(){},wo.prototype.clear=function(){};function xs(x,z){z||(z=yo(x));var ne=x.display.barWidth,te=x.display.barHeight;Xl(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&Uo(x),Xl(x,yo(x)),ne=x.display.barWidth,te=x.display.barHeight}function Xl(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 ql={native:Ko,null:wo};function vu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&je(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new ql[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),$n(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"?go(x,z):Da(x,z)},x),x.display.scrollbars.addClass&&Ln(x.display.wrapper,x.display.scrollbars.addClass)}var Xu=0;function Ks(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:++Xu},Qt(x.curOp)}function Is(x){var z=x.curOp;z&&Kn(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;yu(ne)})}function yu(x){for(var z=x.ops,ne=0;ne<z.length;ne++)Yl(z[ne]);for(var te=0;te<z.length;te++)Ia(z[te]);for(var ie=0;ie<z.length;ie++)ma(z[ie]);for(var ue=0;ue<z.length;ue++)Ho(z[ue]);for(var me=0;me<z.length;me++)es(z[me])}function Yl(x){var z=x.cm,ne=z.display;Jl(z),x.updateMaxLine&&Sn(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 gs(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Ia(x){x.updatedDisplay=x.mustUpdate&&qu(x.cm,x.update)}function ma(x){var z=x.cm,ne=z.display;x.updatedDisplay&&Uo(z),x.barMeasure=yo(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Aa(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+jr(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-ci(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Ho(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&go(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==Dt();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&xs(z,x.barMeasure),x.updatedDisplay&&Qu(z,x.barMeasure),x.selectionChanged&&wi(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Di(x.cm)}function es(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Zc(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Xa(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&go(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=us(z,In(te,x.scrollToPos.from),In(te,x.scrollToPos.to),x.scrollToPos.margin);Bo(z,ie)}var ue=x.maybeHiddenMarkers,me=x.maybeUnhiddenMarkers;if(ue)for(var Ce=0;Ce<ue.length;++Ce)ue[Ce].lines.length||ut(ue[Ce],"hide");if(me)for(var Ae=0;Ae<me.length;++Ae)me[Ae].lines.length&&ut(me[Ae],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&ut(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function ga(x,z){if(x.curOp)return z();Ks(x);try{return z()}finally{Is(x)}}function za(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ks(x);try{return z.apply(x,arguments)}finally{Is(x)}}}function Ra(x){return function(){if(this.curOp)return x.apply(this,arguments);Ks(this);try{return x.apply(this,arguments)}finally{Is(this)}}}function po(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ks(z);try{return x.apply(this,arguments)}finally{Is(z)}}}function is(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,ir(Hs,x))}function Hs(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=pi(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(ue){if(te.line>=x.display.viewFrom){var me=ue.styles,Ce=ue.text.length>x.options.maxHighlightLength?dt(z.mode,te.state):null,Ae=Ri(x,ue,te,!0);Ce&&(te.state=Ce),ue.styles=Ae.styles;var Oe=ue.styleClasses,ct=Ae.classes;ct?ue.styleClasses=ct:Oe&&(ue.styleClasses=null);for(var Mt=!me||me.length!=ue.styles.length||Oe!=ct&&(!Oe||!ct||Oe.bgClass!=ct.bgClass||Oe.textClass!=ct.textClass),ln=0;!Mt&&ln<me.length;++ln)Mt=me[ln]!=ue.styles[ln];Mt&&ie.push(te.line),ue.stateAfter=te.save(),te.nextLine()}else ue.text.length<=x.options.maxHighlightLength&&Gi(x,ue.text,te),ue.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return is(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),ie.length&&ga(x,function(){for(var ue=0;ue<ie.length;ue++)Ta(x,ie[ue],"text")})}}var gs=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=va(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=ci(x),this.force=ne,this.dims=ho(x),this.events=[]};gs.prototype.signal=function(x,z){rr(x,z)&&this.events.push(arguments)},gs.prototype.finish=function(){for(var x=0;x<this.events.length;x++)ut.apply(null,this.events[x])};function Jl(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=jr(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=jr(x)+"px",z.scrollbarsClipped=!0)}function Zd(x){if(x.hasFocus())return null;var z=Dt();if(!z||!Ht(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Ht(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==Dt())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Ht(document.body,x.anchorNode)&&Ht(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 qu(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return _a(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&&hs(x)==0)return!1;bu(x)&&(_a(x),z.dims=ho(x));var ie=te.first+te.size,ue=Math.max(z.visible.from-x.options.viewportMargin,te.first),me=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<ue&&ue-ne.viewFrom<20&&(ue=Math.max(te.first,ne.viewFrom)),ne.viewTo>me&&ne.viewTo-me<20&&(me=Math.min(ie,ne.viewTo)),ti&&(ue=nn(x.doc,ue),me=Gn(x.doc,me));var Ce=ue!=ne.viewFrom||me!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;ao(x,ue,me),ne.viewOffset=vn(Zt(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Ae=hs(x);if(!Ce&&Ae==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Oe=Zd(x);return Ae>4&&(ne.lineDiv.style.display="none"),jd(x,ne.updateLineNumbers,z.dims),Ae>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Oe),Xe(ne.cursorDiv),Xe(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Ce&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,is(x,400)),ne.updateLineNumbers=null,!0}function Zc(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==ci(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+bi(x.display)-Ti(x),ne.top)}),z.visible=va(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=va(x.display,x.doc,ne));if(!qu(x,z))break;Uo(x);var ie=yo(x);Qo(x),xs(x,ie),Qu(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 Yu(x,z){var ne=new gs(x,z);if(qu(x,ne)){Uo(x),Zc(x,ne);var te=yo(x);Qo(x),xs(x,te),Qu(x,te),ne.finish()}}function jd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,ue=te.lineDiv,me=ue.firstChild;function Ce(Xn){var dr=Xn.nextSibling;return Me&&De&&x.display.currentWheelTarget==Xn?Xn.style.display="none":Xn.parentNode.removeChild(Xn),dr}for(var Ae=te.view,Oe=te.viewFrom,ct=0;ct<Ae.length;ct++){var Mt=Ae[ct];if(!Mt.hidden)if(!Mt.node||Mt.node.parentNode!=ue){var ln=li(x,Mt,Oe,ne);ue.insertBefore(ln,me)}else{for(;me!=Mt.node;)me=Ce(me);var qt=ie&&z!=null&&z<=Oe&&Mt.lineNumber;Mt.changes&&(Nt(Mt.changes,"gutter")>-1&&(qt=!1),Zr(x,Mt,Oe,ne)),qt&&(Xe(Mt.lineNumber),Mt.lineNumber.appendChild(document.createTextNode(ot(x.options,Oe)))),me=Mt.node.nextSibling}Oe+=Mt.size}for(;me;)me=Ce(me)}function Ju(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Qu(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+jr(x)+"px"}function Vc(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Oo(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,ue=te+"px",me=0;me<ne.length;me++)if(!ne[me].hidden){x.options.fixedGutter&&(ne[me].gutter&&(ne[me].gutter.style.left=ue),ne[me].gutterBackground&&(ne[me].gutterBackground.style.left=ue));var Ce=ne[me].alignable;if(Ce)for(var Ae=0;Ae<Ce.length;Ae++)Ce[Ae].style.left=ue}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function bu(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=ot(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(kt("div",[kt("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ue=ie.firstChild.offsetWidth,me=ie.offsetWidth-ue;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(ue,te.lineGutter.offsetWidth-me)+1,te.lineNumWidth=te.lineNumInnerWidth+me,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Ju(x.display),!0}return!1}function ec(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var ue=x[ie],me=null;if(typeof ue!="string"&&(me=ue.style,ue=ue.className),ue=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:ue,style:me})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function jc(x){var z=x.gutters,ne=x.gutterSpecs;Xe(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],ue=ie.className,me=ie.style,Ce=z.appendChild(kt("div",null,"CodeMirror-gutter "+ue));me&&(Ce.style.cssText=me),ue=="CodeMirror-linenumbers"&&(x.lineGutter=Ce,Ce.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Ju(x)}function Ql(x){jc(x.display),Oi(x),Vc(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=kt("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=kt("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Lt("div",null,"CodeMirror-code"),ie.selectionDiv=kt("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=kt("div",null,"CodeMirror-cursors"),ie.measure=kt("div",null,"CodeMirror-measure"),ie.lineMeasure=kt("div",null,"CodeMirror-measure"),ie.lineSpace=Lt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var ue=Lt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=kt("div",[ue],null,"position: relative"),ie.sizer=kt("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=kt("div",null,null,"position: absolute; height: "+Nn+"px; width: 1px;"),ie.gutters=kt("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=kt("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=kt("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),be&&Se<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Me&&!(fe&&Ye)&&(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=ec(te.gutters,te.lineNumbers),jc(ie),ne.init(ie)}var xu=0,Zo=null;be?Zo=-.53:fe?Zo=15:pe?Zo=-.7:mt&&(Zo=-1/3);function Pl(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 Gc(x){var z=Pl(x);return z.x*=Zo,z.y*=Zo,z}function Xc(x,z){var ne=Pl(z),te=ne.x,ie=ne.y,ue=x.display,me=ue.scroller,Ce=me.scrollWidth>me.clientWidth,Ae=me.scrollHeight>me.clientHeight;if(te&&Ce||ie&&Ae){if(ie&&De&&Me){e:for(var Oe=z.target,ct=ue.view;Oe!=me;Oe=Oe.parentNode)for(var Mt=0;Mt<ct.length;Mt++)if(ct[Mt].node==Oe){x.display.currentWheelTarget=Oe;break e}}if(te&&!fe&&!Te&&Zo!=null){ie&&Ae&&Da(x,Math.max(0,me.scrollTop+ie*Zo)),go(x,Math.max(0,me.scrollLeft+te*Zo)),(!ie||ie&&Ae)&&Ir(z),ue.wheelStartX=null;return}if(ie&&Zo!=null){var ln=ie*Zo,qt=x.doc.scrollTop,Xn=qt+ue.wrapper.clientHeight;ln<0?qt=Math.max(0,qt+ln-50):Xn=Math.min(x.doc.height,Xn+ln+50),Yu(x,{top:qt,bottom:Xn})}xu<20&&(ue.wheelStartX==null?(ue.wheelStartX=me.scrollLeft,ue.wheelStartY=me.scrollTop,ue.wheelDX=te,ue.wheelDY=ie,setTimeout(function(){if(ue.wheelStartX!=null){var dr=me.scrollLeft-ue.wheelStartX,Ar=me.scrollTop-ue.wheelStartY,Hr=Ar&&ue.wheelDY&&Ar/ue.wheelDY||dr&&ue.wheelDX&&dr/ue.wheelDX;ue.wheelStartX=ue.wheelStartY=null,Hr&&(Zo=(Zo*xu+Hr)/(xu+1),++xu)}},200)):(ue.wheelDX+=te,ue.wheelDY+=ie))}}var vs=function(x,z){this.ranges=x,this.primIndex=z};vs.prototype.primary=function(){return this.ranges[this.primIndex]},vs.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(!rn(ne.anchor,te.anchor)||!rn(ne.head,te.head))return!1}return!0},vs.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Za(Dn(this.ranges[z].anchor),Dn(this.ranges[z].head));return new vs(x,this.primIndex)},vs.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},vs.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(vt(z,te.from())>=0&&vt(x,te.to())<=0)return ne}return-1};var Za=function(x,z){this.anchor=x,this.head=z};Za.prototype.from=function(){return cn(this.anchor,this.head)},Za.prototype.to=function(){return an(this.anchor,this.head)},Za.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Es(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(ln,qt){return vt(ln.from(),qt.from())}),ne=Nt(z,ie);for(var ue=1;ue<z.length;ue++){var me=z[ue],Ce=z[ue-1],Ae=vt(Ce.to(),me.from());if(te&&!me.empty()?Ae>0:Ae>=0){var Oe=cn(Ce.from(),me.from()),ct=an(Ce.to(),me.to()),Mt=Ce.empty()?me.from()==me.head:Ce.from()==Ce.head;ue<=ne&&--ne,z.splice(--ue,2,new Za(Mt?ct:Oe,Mt?Oe:ct))}}return new vs(z,ne)}function Ps(x,z){return new vs([new Za(x,z||x)],0)}function Js(x){return x.text?tt(x.from.line+x.text.length-1,zt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function qc(x,z){if(vt(x,z.from)<0)return x;if(vt(x,z.to)<=0)return Js(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+=Js(z).ch-z.to.ch),tt(ne,te)}function tc(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Za(qc(ie.anchor,z),qc(ie.head,z)))}return Es(x.cm,ne,x.sel.primIndex)}function Ol(x,z,ne){return x.line==z.line?tt(ne.line,x.ch-z.ch+ne.ch):tt(ne.line+(x.line-z.line),x.ch)}function nc(x,z,ne){for(var te=[],ie=tt(x.first,0),ue=ie,me=0;me<z.length;me++){var Ce=z[me],Ae=Ol(Ce.from,ie,ue),Oe=Ol(Js(Ce),ie,ue);if(ie=Ce.to,ue=Oe,ne=="around"){var ct=x.sel.ranges[me],Mt=vt(ct.head,ct.anchor)<0;te[me]=new Za(Mt?Oe:Ae,Mt?Ae:Oe)}else te[me]=new Za(Ae,Ae)}return new vs(te,x.sel.primIndex)}function rc(x){x.doc.mode=Et(x.options,x.doc.modeOption),Rl(x)}function Rl(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,is(x,100),x.state.modeGen++,x.curOp&&Oi(x)}function Yc(x,z){return z.from.ch==0&&z.to.ch==0&&zt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function ic(x,z,ne,te){function ie(ni){return ne?ne[ni]:null}function ue(ni,zr,ri){ur(ni,zr,ri,te),Fn(ni,"change",ni,z)}function me(ni,zr){for(var ri=[],$i=ni;$i<zr;++$i)ri.push(new Pn(Oe[$i],ie($i),te));return ri}var Ce=z.from,Ae=z.to,Oe=z.text,ct=Zt(x,Ce.line),Mt=Zt(x,Ae.line),ln=zt(Oe),qt=ie(Oe.length-1),Xn=Ae.line-Ce.line;if(z.full)x.insert(0,me(0,Oe.length)),x.remove(Oe.length,x.size-Oe.length);else if(Yc(x,z)){var dr=me(0,Oe.length-1);ue(Mt,Mt.text,qt),Xn&&x.remove(Ce.line,Xn),dr.length&&x.insert(Ce.line,dr)}else if(ct==Mt)if(Oe.length==1)ue(ct,ct.text.slice(0,Ce.ch)+ln+ct.text.slice(Ae.ch),qt);else{var Ar=me(1,Oe.length-1);Ar.push(new Pn(ln+ct.text.slice(Ae.ch),qt,te)),ue(ct,ct.text.slice(0,Ce.ch)+Oe[0],ie(0)),x.insert(Ce.line+1,Ar)}else if(Oe.length==1)ue(ct,ct.text.slice(0,Ce.ch)+Oe[0]+Mt.text.slice(Ae.ch),ie(0)),x.remove(Ce.line+1,Xn);else{ue(ct,ct.text.slice(0,Ce.ch)+Oe[0],ie(0)),ue(Mt,ln+Mt.text.slice(Ae.ch),qt);var Hr=me(1,Oe.length-1);Xn>1&&x.remove(Ce.line+1,Xn-1),x.insert(Ce.line+1,Hr)}Fn(x,"change",x,z)}function Qs(x,z,ne){function te(ie,ue,me){if(ie.linked)for(var Ce=0;Ce<ie.linked.length;++Ce){var Ae=ie.linked[Ce];if(Ae.doc!=ue){var Oe=me&&Ae.sharedHist;ne&&!Oe||(z(Ae.doc,Oe),te(Ae.doc,ie,Oe))}}}te(x,null,!0)}function wu(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,lo(x),rc(x),Su(x),x.options.lineWrapping||Sn(x),x.options.mode=z.modeOption,Oi(x)}function Su(x){(x.doc.direction=="rtl"?Ln:je)(x.display.lineDiv,"CodeMirror-rtl")}function ac(x){ga(x,function(){Su(x),Oi(x)})}function Cu(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 oc(x,z){var ne={from:Dn(z.from),to:Js(z),text:zn(x,z.from,z.to)};return cc(x,ne,z.from.line,z.to.line+1),Qs(x,function(te){return cc(te,ne,z.from.line,z.to.line+1)},!0),ne}function Jc(x){for(;x.length;){var z=zt(x);if(z.ranges)x.pop();else break}}function sc(x,z){if(z)return Jc(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 Mu(x,z,ne,te){var ie=x.history;ie.undone.length=0;var ue=+new Date,me,Ce;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>ue-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(me=sc(ie,ie.lastOp==te)))Ce=zt(me.changes),vt(z.from,z.to)==0&&vt(z.from,Ce.to)==0?Ce.to=Js(z):me.changes.push(oc(x,z));else{var Ae=zt(ie.done);for((!Ae||!Ae.ranges)&&Eu(x.sel,ie.done),me={changes:[oc(x,z)],generation:ie.generation},ie.done.push(me);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=ue,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Ce||ut(x,"historyAdded")}function lc(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 uc(x,z,ne,te){var ie=x.history,ue=te&&te.origin;ne==ie.lastSelOp||ue&&ie.lastSelOrigin==ue&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==ue||lc(x,ue,zt(ie.done),z))?ie.done[ie.done.length-1]=z:Eu(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=ue,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Jc(ie.undone)}function Eu(x,z){var ne=zt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function cc(x,z,ne,te){var ie=z["spans_"+x.id],ue=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(me){me.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[ue]=me.markedSpans),++ue})}function dc(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(dc(ne[ie]));return te}function Qc(x,z){var ne=Xd(x,z),te=Kr(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var ue=ne[ie],me=te[ie];if(ue&&me)e:for(var Ce=0;Ce<me.length;++Ce){for(var Ae=me[Ce],Oe=0;Oe<ue.length;++Oe)if(ue[Oe].marker==Ae.marker)continue e;ue.push(Ae)}else me&&(ne[ie]=me)}return ne}function Bl(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var ue=x[ie];if(ue.ranges){te.push(ne?vs.prototype.deepCopy.call(ue):ue);continue}var me=ue.changes,Ce=[];te.push({changes:Ce});for(var Ae=0;Ae<me.length;++Ae){var Oe=me[Ae],ct=void 0;if(Ce.push({from:Oe.from,to:Oe.to,text:Oe.text}),z)for(var Mt in Oe)(ct=Mt.match(/^spans_(\d+)$/))&&Nt(z,Number(ct[1]))>-1&&(zt(Ce)[Mt]=Oe[Mt],delete Oe[Mt])}}return te}function fc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var ue=vt(z,ie)<0;ue!=vt(ne,ie)<0?(ie=z,z=ne):ue!=vt(z,ne)<0&&(z=ne)}return new Za(ie,z)}else return new Za(ne||z,z)}function Nl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),To(x,new vs([fc(x.sel.primary(),z,ne,ie)],0),te)}function oi(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),ue=0;ue<x.sel.ranges.length;ue++)te[ue]=fc(x.sel.ranges[ue],z[ue],null,ie);var me=Es(x.cm,te,x.sel.primIndex);To(x,me,ne)}function ws(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,To(x,Es(x.cm,ie,x.sel.primIndex),te)}function ed(x,z,ne,te){To(x,Ps(z,ne),te)}function qd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var ue=0;ue<ie.length;ue++)this.ranges[ue]=new Za(In(x,ie[ue].anchor),In(x,ie[ue].head))},origin:ne&&ne.origin};return ut(x,"beforeSelectionChange",x,te),x.cm&&ut(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Es(x.cm,te.ranges,te.ranges.length-1):z}function as(x,z,ne){var te=x.history.done,ie=zt(te);ie&&ie.ranges?(te[te.length-1]=z,ku(x,z,ne)):To(x,z,ne)}function To(x,z,ne){ku(x,z,ne),uc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function ku(x,z,ne){(rr(x,"beforeSelectionChange")||x.cm&&rr(x.cm,"beforeSelectionChange"))&&(z=qd(x,z,ne));var te=ne&&ne.bias||(vt(z.primary().head,x.sel.primary().head)<0?-1:1);Yd(x,Fl(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&zo(x.cm)}function Yd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Vn(x.cm)),Fn(x,"cursorActivity",x))}function Jd(x){Yd(x,Fl(x,x.sel,null,!1))}function Fl(x,z,ne,te){for(var ie,ue=0;ue<z.ranges.length;ue++){var me=z.ranges[ue],Ce=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[ue],Ae=hc(x,me.anchor,Ce&&Ce.anchor,ne,te),Oe=hc(x,me.head,Ce&&Ce.head,ne,te);(ie||Ae!=me.anchor||Oe!=me.head)&&(ie||(ie=z.ranges.slice(0,ue)),ie[ue]=new Za(Ae,Oe))}return ie?Es(x.cm,ie,z.primIndex):z}function os(x,z,ne,te,ie){var ue=Zt(x,z.line);if(ue.markedSpans)for(var me=0;me<ue.markedSpans.length;++me){var Ce=ue.markedSpans[me],Ae=Ce.marker,Oe="selectLeft"in Ae?!Ae.selectLeft:Ae.inclusiveLeft,ct="selectRight"in Ae?!Ae.selectRight:Ae.inclusiveRight;if((Ce.from==null||(Oe?Ce.from<=z.ch:Ce.from<z.ch))&&(Ce.to==null||(ct?Ce.to>=z.ch:Ce.to>z.ch))){if(ie&&(ut(Ae,"beforeCursorEnter"),Ae.explicitlyCleared))if(ue.markedSpans){--me;continue}else break;if(!Ae.atomic)continue;if(ne){var Mt=Ae.find(te<0?1:-1),ln=void 0;if((te<0?ct:Oe)&&(Mt=el(x,Mt,-te,Mt&&Mt.line==z.line?ue:null)),Mt&&Mt.line==z.line&&(ln=vt(Mt,ne))&&(te<0?ln<0:ln>0))return os(x,Mt,z,te,ie)}var qt=Ae.find(te<0?-1:1);return(te<0?Oe:ct)&&(qt=el(x,qt,te,qt.line==z.line?ue:null)),qt?os(x,qt,z,te,ie):null}}return z}function hc(x,z,ne,te,ie){var ue=te||1,me=os(x,z,ne,ue,ie)||!ie&&os(x,z,ne,ue,!0)||os(x,z,ne,-ue,ie)||!ie&&os(x,z,ne,-ue,!0);return me||(x.cantEdit=!0,tt(x.first,0))}function el(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?In(x,tt(z.line-1)):null:ne>0&&z.ch==(te||Zt(x,z.line)).text.length?z.line<x.first+x.size-1?tt(z.line+1,0):null:new tt(z.line,z.ch+ne)}function td(x){x.setSelection(tt(x.firstLine(),0),tt(x.lastLine()),Je)}function pc(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,ue,me,Ce){ie&&(te.from=In(x,ie)),ue&&(te.to=In(x,ue)),me&&(te.text=me),Ce!==void 0&&(te.origin=Ce)}),ut(x,"beforeChange",x,te),x.cm&&ut(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 dl(x,z,ne){if(x.cm){if(!x.cm.curOp)return za(x.cm,dl)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((rr(x,"beforeChange")||x.cm&&rr(x.cm,"beforeChange"))&&(z=pc(x,z,!0),!z))){var te=ea&&!ne&&Qr(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)nd(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else nd(x,z)}}function nd(x,z){if(!(z.text.length==1&&z.text[0]==""&&vt(z.from,z.to)==0)){var ne=tc(x,z);Mu(x,z,ne,x.cm?x.cm.curOp.id:NaN),$l(x,z,ne,Kr(x,z));var te=[];Qs(x,function(ie,ue){!ue&&Nt(te,ie.history)==-1&&(_u(ie.history,z),te.push(ie.history)),$l(ie,z,null,Kr(ie,z))})}}function tl(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,ue,me=x.sel,Ce=z=="undo"?ie.done:ie.undone,Ae=z=="undo"?ie.undone:ie.done,Oe=0;Oe<Ce.length&&(ue=Ce[Oe],!(ne?ue.ranges&&!ue.equals(x.sel):!ue.ranges));Oe++);if(Oe!=Ce.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(ue=Ce.pop(),ue.ranges){if(Eu(ue,Ae),ne&&!ue.equals(x.sel)){To(x,ue,{clearRedo:!1});return}me=ue}else if(te){Ce.push(ue);return}else break;var ct=[];Eu(me,Ae),Ae.push({changes:ct,generation:ie.generation}),ie.generation=ue.generation||++ie.maxGeneration;for(var Mt=rr(x,"beforeChange")||x.cm&&rr(x.cm,"beforeChange"),ln=function(dr){var Ar=ue.changes[dr];if(Ar.origin=z,Mt&&!pc(x,Ar,!1))return Ce.length=0,{};ct.push(oc(x,Ar));var Hr=dr?tc(x,Ar):zt(Ce);$l(x,Ar,Hr,Qc(x,Ar)),!dr&&x.cm&&x.cm.scrollIntoView({from:Ar.from,to:Js(Ar)});var ni=[];Qs(x,function(zr,ri){!ri&&Nt(ni,zr.history)==-1&&(_u(zr.history,Ar),ni.push(zr.history)),$l(zr,Ar,null,Qc(zr,Ar))})},qt=ue.changes.length-1;qt>=0;--qt){var Xn=ln(qt);if(Xn)return Xn.v}}}}function mc(x,z){if(z!=0&&(x.first+=z,x.sel=new vs(Mn(x.sel.ranges,function(ie){return new Za(tt(ie.anchor.line+z,ie.anchor.ch),tt(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){Oi(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ta(x.cm,te,"gutter")}}function $l(x,z,ne,te){if(x.cm&&!x.cm.curOp)return za(x.cm,$l)(x,z,ne,te);if(z.to.line<x.first){mc(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);mc(x,ie),z={from:tt(x.first,0),to:tt(z.to.line+ie,z.to.ch),text:[zt(z.text)],origin:z.origin}}var ue=x.lastLine();z.to.line>ue&&(z={from:z.from,to:tt(ue,Zt(x,ue).text.length),text:[z.text[0]],origin:z.origin}),z.removed=zn(x,z.from,z.to),ne||(ne=tc(x,z)),x.cm?Qd(x.cm,z,te):ic(x,z,te),ku(x,ne,Je),x.cantEdit&&hc(x,tt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,ue=z.from,me=z.to,Ce=!1,Ae=ue.line;x.options.lineWrapping||(Ae=qn(rt(Zt(te,ue.line))),te.iter(Ae,me.line+1,function(qt){if(qt==ie.maxLine)return Ce=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Vn(x),ic(te,z,ne,Ro(x)),x.options.lineWrapping||(te.iter(Ae,ue.line+z.text.length,function(qt){var Xn=hn(qt);Xn>ie.maxLineLength&&(ie.maxLine=qt,ie.maxLineLength=Xn,ie.maxLineChanged=!0,Ce=!1)}),Ce&&(x.curOp.updateMaxLine=!0)),la(te,ue.line),is(x,400);var Oe=z.text.length-(me.line-ue.line)-1;z.full?Oi(x):ue.line==me.line&&z.text.length==1&&!Yc(x.doc,z)?Ta(x,ue.line,"text"):Oi(x,ue.line,me.line+1,Oe);var ct=rr(x,"changes"),Mt=rr(x,"change");if(Mt||ct){var ln={from:ue,to:me,text:z.text,removed:z.removed,origin:z.origin};Mt&&Fn(x,"change",x,ln),ct&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(ln)}x.display.selForContextMenu=null}function eu(x,z,ne,te,ie){var ue;te||(te=ne),vt(te,ne)<0&&(ue=[te,ne],ne=ue[0],te=ue[1]),typeof z=="string"&&(z=x.splitLines(z)),dl(x,{from:ne,to:te,text:z,origin:ie})}function ef(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function tf(x,z,ne,te){for(var ie=0;ie<x.length;++ie){var ue=x[ie],me=!0;if(ue.ranges){ue.copied||(ue=x[ie]=ue.deepCopy(),ue.copied=!0);for(var Ce=0;Ce<ue.ranges.length;Ce++)ef(ue.ranges[Ce].anchor,z,ne,te),ef(ue.ranges[Ce].head,z,ne,te);continue}for(var Ae=0;Ae<ue.changes.length;++Ae){var Oe=ue.changes[Ae];if(ne<Oe.from.line)Oe.from=tt(Oe.from.line+te,Oe.from.ch),Oe.to=tt(Oe.to.line+te,Oe.to.ch);else if(z<=Oe.to.line){me=!1;break}}me||(x.splice(0,ie+1),ie=0)}}function _u(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;tf(x.done,ne,te,ie),tf(x.undone,ne,te,ie)}function Lu(x,z,ne,te){var ie=z,ue=z;return typeof z=="number"?ue=Zt(x,fn(x,z)):ie=qn(z),ie==null?null:(te(ue,ie)&&x.cm&&Ta(x.cm,ie,ne),ue)}function fl(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}fl.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,jn(ie),Fn(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 tu(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}tu.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 ue=Math.min(z,ie-x),me=te.height;if(te.removeInner(x,ue),this.height-=me-te.height,ie==ue&&(this.children.splice(ne--,1),te.parent=null),(z-=ue)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof fl))){var Ce=[];this.collapse(Ce),this.children=[new fl(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],ue=ie.chunkSize();if(x<=ue){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var me=ie.lines.length%25+25,Ce=me;Ce<ie.lines.length;){var Ae=new fl(ie.lines.slice(Ce,Ce+=25));ie.height-=Ae.height,this.children.splice(++te,0,Ae),Ae.parent=this}ie.lines=ie.lines.slice(0,me),this.maybeSpill()}break}x-=ue}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new tu(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=Nt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new tu(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],ue=ie.chunkSize();if(x<ue){var me=Math.min(z,ue-x);if(ie.iterN(x,me,ne))return!0;if((z-=me)==0)break;x=0}else x-=ue}}};var nu=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};nu.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=qn(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 ue=Ni(this);Yn(ne,Math.max(0,ne.height-ue)),x&&(ga(x,function(){nf(x,ne,-ue),Ta(x,te,"widget")}),Fn(x,"lineWidgetCleared",x,this,te))}},nu.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=Ni(this)-z;ie&&(fr(this.doc,te)||Yn(te,te.height+ie),ne&&ga(ne,function(){ne.curOp.forceUpdate=!0,nf(ne,te,ie),Fn(ne,"lineWidgetChanged",ne,x,qn(te))}))},gr(nu);function nf(x,z,ne){vn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&ms(x,ne)}function rf(x,z,ne,te){var ie=new nu(x,ne,te),ue=x.cm;return ue&&ie.noHScroll&&(ue.display.alignWidgets=!0),Lu(x,z,"widget",function(me){var Ce=me.widgets||(me.widgets=[]);if(ie.insertAt==null?Ce.push(ie):Ce.splice(Math.min(Ce.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=me,ue&&!fr(x,me)){var Ae=vn(me)<x.scrollTop;Yn(me,me.height+Ni(ie)),Ae&&ms(ue,ie.height),ue.curOp.forceUpdate=!0}return!0}),ue&&Fn(ue,"lineWidgetAdded",ue,ie,typeof z=="number"?z:qn(z)),ie}var af=0,hl=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++af};hl.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ks(x),rr(this,"clear")){var ne=this.find();ne&&Fn(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,ue=0;ue<this.lines.length;++ue){var me=this.lines[ue],Ce=sn(me.markedSpans,this);x&&!this.collapsed?Ta(x,qn(me),"text"):x&&(Ce.to!=null&&(ie=qn(me)),Ce.from!=null&&(te=qn(me))),me.markedSpans=_n(me.markedSpans,Ce),Ce.from==null&&this.collapsed&&!fr(this.doc,me)&&x&&Yn(me,Ka(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Ae=0;Ae<this.lines.length;++Ae){var Oe=rt(this.lines[Ae]),ct=hn(Oe);ct>x.display.maxLineLength&&(x.display.maxLine=Oe,x.display.maxLineLength=ct,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&Oi(x,te,ie+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&Jd(x.doc)),x&&Fn(x,"markerCleared",x,this,te,ie),z&&Is(x),this.parent&&this.parent.clear()}},hl.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var ue=this.lines[ie],me=sn(ue.markedSpans,this);if(me.from!=null&&(ne=tt(z?ue:qn(ue),me.from),x==-1))return ne;if(me.to!=null&&(te=tt(z?ue:qn(ue),me.to),x==1))return te}return ne&&{from:ne,to:te}},hl.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||ga(te,function(){var ie=z.line,ue=qn(z.line),me=ua(te,ue);if(me&&(Ui(me),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!fr(ne.doc,ie)&&ne.height!=null){var Ce=ne.height;ne.height=null;var Ae=Ni(ne)-Ce;Ae&&Yn(ie,ie.height+Ae)}Fn(te,"markerChanged",te,x)})},hl.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||Nt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},hl.prototype.detachLine=function(x){if(this.lines.splice(Nt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},gr(hl);function nl(x,z,ne,te,ie){if(te&&te.shared)return co(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return za(x.cm,nl)(x,z,ne,te,ie);var ue=new hl(x,ie),me=vt(z,ne);if(te&&yr(te,ue,!1),me>0||me==0&&ue.clearWhenEmpty!==!1)return ue;if(ue.replacedWith&&(ue.collapsed=!0,ue.widgetNode=Lt("span",[ue.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||ue.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(ue.widgetNode.insertLeft=!0)),ue.collapsed){if(qe(x,z.line,z,ne,ue)||z.line!=ne.line&&qe(x,ne.line,z,ne,ue))throw new Error("Inserting collapsed marker partially overlapping an existing one");pt()}ue.addToHistory&&Mu(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Ce=z.line,Ae=x.cm,Oe;if(x.iter(Ce,ne.line+1,function(Mt){Ae&&ue.collapsed&&!Ae.options.lineWrapping&&rt(Mt)==Ae.display.maxLine&&(Oe=!0),ue.collapsed&&Ce!=z.line&&Yn(Mt,0),cr(Mt,new $t(ue,Ce==z.line?z.ch:null,Ce==ne.line?ne.ch:null)),++Ce}),ue.collapsed&&x.iter(z.line,ne.line+1,function(Mt){fr(x,Mt)&&Yn(Mt,0)}),ue.clearOnEnter&&$n(ue,"beforeCursorEnter",function(){return ue.clear()}),ue.readOnly&&(yt(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),ue.collapsed&&(ue.id=++af,ue.atomic=!0),Ae){if(Oe&&(Ae.curOp.updateMaxLine=!0),ue.collapsed)Oi(Ae,z.line,ne.line+1);else if(ue.className||ue.startStyle||ue.endStyle||ue.css||ue.attributes||ue.title)for(var ct=z.line;ct<=ne.line;ct++)Ta(Ae,ct,"text");ue.atomic&&Jd(Ae.doc),Fn(Ae,"markerAdded",Ae,ue)}return ue}var ya=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Fn(this,"clear")}},ya.prototype.find=function(x,z){return this.primary.find(x,z)},gr(ya);function co(x,z,ne,te,ie){te=yr(te),te.shared=!1;var ue=[nl(x,z,ne,te,ie)],me=ue[0],Ce=te.widgetNode;return Qs(x,function(Ae){Ce&&(te.widgetNode=Ce.cloneNode(!0)),ue.push(nl(Ae,In(Ae,z),In(Ae,ne),te,ie));for(var Oe=0;Oe<Ae.linked.length;++Oe)if(Ae.linked[Oe].isParent)return;me=zt(ue)}),new ya(ue,me)}function pl(x){return x.findMarks(tt(x.first,0),x.clipPos(tt(x.lastLine())),function(z){return z.parent})}function of(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),ue=x.clipPos(ie.from),me=x.clipPos(ie.to);if(vt(ue,me)){var Ce=nl(x,ue,me,te.primary,te.primary.type);te.markers.push(Ce),Ce.parent=te}}}function Ss(x){for(var z=function(te){var ie=x[te],ue=[ie.primary.doc];Qs(ie.primary.doc,function(Ae){return ue.push(Ae)});for(var me=0;me<ie.markers.length;me++){var Ce=ie.markers[me];Nt(ue,Ce.doc)==-1&&(Ce.parent=null,ie.markers.splice(me--,1))}},ne=0;ne<x.length;ne++)z(ne)}var sf=0,Eo=function(x,z,ne,te,ie){if(!(this instanceof Eo))return new Eo(x,z,ne,te,ie);ne==null&&(ne=0),tu.call(this,[new fl([new Pn("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var ue=tt(ne,0);this.sel=Ps(ue),this.history=new Cu(null),this.id=++sf,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),ic(this,{from:ue,to:ue,text:x}),To(this,Ps(ue),Je)};Eo.prototype=ce(tu.prototype,{constructor:Eo,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=Sr(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:po(function(x){var z=tt(this.first,0),ne=this.first+this.size-1;dl(this,{from:z,to:tt(ne,Zt(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&Ts(this.cm,0,0),To(this,Ps(z),Je)}),replaceRange:function(x,z,ne,te){z=In(this,z),ne=ne?In(this,ne):z,eu(this,x,z,ne,te)},getRange:function(x,z,ne){var te=zn(this,In(this,x),In(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(ar(this,x))return Zt(this,x)},getLineNumber:function(x){return qn(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Zt(this,x)),rt(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return In(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:po(function(x,z,ne){ed(this,In(this,typeof x=="number"?tt(x,z||0):x),null,ne)}),setSelection:po(function(x,z,ne){ed(this,In(this,x),In(this,z||x),ne)}),extendSelection:po(function(x,z,ne){Nl(this,In(this,x),z&&In(this,z),ne)}),extendSelections:po(function(x,z){oi(this,Ut(this,x),z)}),extendSelectionsBy:po(function(x,z){var ne=Mn(this.sel.ranges,x);oi(this,Ut(this,ne),z)}),setSelections:po(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Za(In(this,x[ie].anchor),In(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),To(this,Es(this.cm,te,z),ne)}}),addSelection:po(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Za(In(this,x),In(this,z||x))),To(this,Es(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=zn(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=zn(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:po(function(x,z,ne){for(var te=[],ie=this.sel,ue=0;ue<ie.ranges.length;ue++){var me=ie.ranges[ue];te[ue]={from:me.from(),to:me.to(),text:this.splitLines(x[ue]),origin:ne}}for(var Ce=z&&z!="end"&&nc(this,te,z),Ae=te.length-1;Ae>=0;Ae--)dl(this,te[Ae]);Ce?as(this,Ce):this.cm&&zo(this.cm)}),undo:po(function(){tl(this,"undo")}),redo:po(function(){tl(this,"redo")}),undoSelection:po(function(){tl(this,"undo",!0)}),redoSelection:po(function(){tl(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 Cu(this.history.maxGeneration),Qs(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:Bl(this.history.done),undone:Bl(this.history.undone)}},setHistory:function(x){var z=this.history=new Cu(this.history.maxGeneration);z.done=Bl(x.done.slice(0),null,!0),z.undone=Bl(x.undone.slice(0),null,!0)},setGutterMarker:po(function(x,z,ne){return Lu(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&oe(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:po(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&Lu(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,oe(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!ar(this,x)||(z=x,x=Zt(this,x),!x))return null}else if(z=qn(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:po(function(x,z,ne){return Lu(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(ke(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:po(function(x,z,ne){return Lu(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",ue=te[ie];if(ue)if(ne==null)te[ie]=null;else{var me=ue.match(ke(ne));if(!me)return!1;var Ce=me.index+me[0].length;te[ie]=ue.slice(0,me.index)+(!me.index||Ce==ue.length?"":" ")+ue.slice(Ce)||null}else return!1;return!0})}),addLineWidget:po(function(x,z,ne){return rf(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return nl(this,In(this,x),In(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=In(this,x),nl(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=In(this,x);var z=[],ne=Zt(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=In(this,x),z=In(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(ue){var me=ue.markedSpans;if(me)for(var Ce=0;Ce<me.length;Ce++){var Ae=me[Ce];!(Ae.to!=null&&ie==x.line&&x.ch>=Ae.to||Ae.from==null&&ie!=x.line||Ae.from!=null&&ie==z.line&&Ae.from>=z.ch)&&(!ne||ne(Ae.marker))&&te.push(Ae.marker.parent||Ae.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 ue=ie.text.length+te;if(ue>x)return z=x,!0;x-=ue,++ne}),In(this,tt(ne,z))},indexFromPos:function(x){x=In(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 Eo(Sr(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 Eo(Sr(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}],of(te,pl(this)),te},unlinkDoc:function(x){if(x instanceof ra&&(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),Ss(pl(this));break}}if(x.history==this.history){var te=[x.id];Qs(x,function(ie){return te.push(ie.id)},!0),x.history=new Cu(null),x.history.done=Bl(this.history.done,te),x.history.undone=Bl(this.history.undone,te)}},iterLinkedDocs:function(x){Qs(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):gt(x)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:po(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&ac(this.cm))})}),Eo.prototype.eachLine=Eo.prototype.iter;var rd=0;function eh(x){var z=this;if(ru(z),!(Vt(z,x)||Xi(z.display,x))){Ir(x),be&&(rd=+new Date);var ne=Ao(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var ie=te.length,ue=Array(ie),me=0,Ce=function(){++me==ie&&za(z,function(){ne=In(z.doc,ne);var qt={from:ne,to:ne,text:z.doc.splitLines(ue.filter(function(Xn){return Xn!=null}).join(z.doc.lineSeparator())),origin:"paste"};dl(z.doc,qt),as(z.doc,Ps(In(z.doc,ne),In(z.doc,Js(qt))))})()},Ae=function(qt,Xn){if(z.options.allowDropFileTypes&&Nt(z.options.allowDropFileTypes,qt.type)==-1){Ce();return}var dr=new FileReader;dr.onerror=function(){return Ce()},dr.onload=function(){var Ar=dr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ar)){Ce();return}ue[Xn]=Ar,Ce()},dr.readAsText(qt)},Oe=0;Oe<te.length;Oe++)Ae(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 ct=x.dataTransfer.getData("Text");if(ct){var Mt;if(z.state.draggingText&&!z.state.draggingText.copy&&(Mt=z.listSelections()),ku(z.doc,Ps(ne,ne)),Mt)for(var ln=0;ln<Mt.length;++ln)eu(z.doc,"",Mt[ln].anchor,Mt[ln].head,"drag");z.replaceSelection(ct,"around","paste"),z.display.input.focus()}}catch(qt){}}}}function th(x,z){if(be&&(!x.state.draggingText||+new Date-rd<100)){Xr(z);return}if(!(Vt(x,z)||Xi(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!mt)){var ne=kt("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Te&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Te&&ne.parentNode.removeChild(ne)}}function id(x,z){var ne=Ao(x,z);if(ne){var te=document.createDocumentFragment();aa(x,ne,te),x.display.dragCursor||(x.display.dragCursor=kt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),Pt(x.display.dragCursor,te)}}function ru(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function iu(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 ue=0;ue<ne.length;ue++)x(ne[ue])})}}var Er=!1;function ad(){Er||(gc(),Er=!0)}function gc(){var x;$n(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,iu(vc)},100))}),$n(window,"blur",function(){return iu($o)})}function vc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Os={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Au=0;Au<10;Au++)Os[Au+48]=Os[Au+96]=String(Au);for(var yc=65;yc<=90;yc++)Os[yc]=String.fromCharCode(yc);for(var Tu=1;Tu<=12;Tu++)Os[Tu+111]=Os[Tu+63235]="F"+Tu;var Qa={};Qa.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"},Qa.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"},Qa.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"},Qa.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"]},Qa.default=De?Qa.macDefault:Qa.pcDefault;function nh(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,ue,me=0;me<z.length-1;me++){var Ce=z[me];if(/^(cmd|meta|m)$/i.test(Ce))ue=!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),ue&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function od(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=Mn(ne.split(" "),nh),ue=0;ue<ie.length;ue++){var me=void 0,Ce=void 0;ue==ie.length-1?(Ce=ie.join(" "),me=te):(Ce=ie.slice(0,ue+1).join(" "),me="...");var Ae=z[Ce];if(!Ae)z[Ce]=me;else if(Ae!=me)throw new Error("Inconsistent bindings for "+Ce)}delete x[ne]}for(var Oe in z)x[Oe]=z[Oe];return x}function rl(x,z,ne,te){z=ss(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 rl(x,z.fallthrough,ne,te);for(var ue=0;ue<z.fallthrough.length;ue++){var me=rl(x,z.fallthrough[ue],ne,te);if(me)return me}}}function Du(x){var z=typeof x=="string"?x:Os[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function ml(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(lt?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(lt?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function zl(x,z){if(Te&&x.keyCode==34&&x.char)return!1;var ne=Os[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),ml(ne,x,z))}function ss(x){return typeof x=="string"?Qa[x]:x}function ks(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var ue=z(ne[ie]);te.length&&vt(ue.from,zt(te).to)<=0;){var me=te.pop();if(vt(me.from,ue.from)<0){ue.from=me.from;break}}te.push(ue)}ga(x,function(){for(var Ce=te.length-1;Ce>=0;Ce--)eu(x.doc,"",te[Ce].from,te[Ce].to,"+delete");zo(x)})}function Vo(x,z,ne){var te=Yt(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Ws(x,z,ne){var te=Vo(x,z.ch,ne);return te==null?null:new tt(z.line,te,ne<0?"after":"before")}function Kl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var ue=Wr(ne,z.doc.direction);if(ue){var me=ie<0?zt(ue):ue[0],Ce=ie<0==(me.level==1),Ae=Ce?"after":"before",Oe;if(me.level>0||z.doc.direction=="rtl"){var ct=Yi(z,ne);Oe=ie<0?ne.text.length-1:0;var Mt=Mi(z,ct,Oe).top;Oe=pn(function(ln){return Mi(z,ct,ln).top==Mt},ie<0==(me.level==1)?me.from:me.to-1,Oe),Ae=="before"&&(Oe=Vo(ne,Oe,1))}else Oe=ie<0?me.to:me.from;return new tt(te,Oe,Ae)}}return new tt(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Us(x,z,ne,te){var ie=Wr(z,x.doc.direction);if(!ie)return Ws(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 ue=tn(ie,ne.ch,ne.sticky),me=ie[ue];if(x.doc.direction=="ltr"&&me.level%2==0&&(te>0?me.to>ne.ch:me.from<ne.ch))return Ws(z,ne,te);var Ce=function(Hr,ni){return Vo(z,Hr instanceof tt?Hr.ch:Hr,ni)},Ae,Oe=function(Hr){return x.options.lineWrapping?(Ae=Ae||Yi(x,z),$a(x,z,Ae,Hr)):{begin:0,end:z.text.length}},ct=Oe(ne.sticky=="before"?Ce(ne,-1):ne.ch);if(x.doc.direction=="rtl"||me.level==1){var Mt=me.level==1==te<0,ln=Ce(ne,Mt?1:-1);if(ln!=null&&(Mt?ln<=me.to&&ln<=ct.end:ln>=me.from&&ln>=ct.begin)){var qt=Mt?"before":"after";return new tt(ne.line,ln,qt)}}var Xn=function(Hr,ni,zr){for(var ri=function(to,Wo){return Wo?new tt(ne.line,Ce(to,1),"before"):new tt(ne.line,to,"after")};Hr>=0&&Hr<ie.length;Hr+=ni){var $i=ie[Hr],Hi=ni>0==($i.level!=1),ba=Hi?zr.begin:Ce(zr.end,-1);if($i.from<=ba&&ba<$i.to||(ba=Hi?$i.from:Ce($i.to,-1),zr.begin<=ba&&ba<zr.end))return ri(ba,Hi)}},dr=Xn(ue+te,te,ct);if(dr)return dr;var Ar=te>0?ct.end:Ce(ct.begin,-1);return Ar!=null&&!(te>0&&Ar==z.text.length)&&(dr=Xn(te>0?0:ie.length-1,te,Oe(Ar)),dr)?dr:null}var au={selectAll:td,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),Je)},killLine:function(x){return ks(x,function(z){if(z.empty()){var ne=Zt(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:tt(z.head.line+1,0)}:{from:z.head,to:tt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return ks(x,function(z){return{from:tt(z.from().line,0),to:In(x.doc,tt(z.to().line+1,0))}})},delLineLeft:function(x){return ks(x,function(z){return{from:tt(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return ks(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 ks(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(tt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(tt(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return sd(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return lf(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return ld(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")},_t)},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")},_t)},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/)?lf(x,z.head):te},_t)},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 ue=ne[ie].from(),me=Qe(x.getLine(ue.line),ue.ch,te);z.push(Ft(te-me%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return ga(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,ue=Zt(x.doc,ie.line).text;if(ue){if(ie.ch==ue.length&&(ie=new tt(ie.line,ie.ch-1)),ie.ch>0)ie=new tt(ie.line,ie.ch+1),x.replaceRange(ue.charAt(ie.ch-1)+ue.charAt(ie.ch-2),tt(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var me=Zt(x.doc,ie.line-1).text;me&&(ie=new tt(ie.line,1),x.replaceRange(ue.charAt(0)+x.doc.lineSeparator()+me.charAt(me.length-1),tt(ie.line-1,me.length-1),ie,"+transpose"))}}ne.push(new Za(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return ga(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);zo(x)})},openLine:function(x){return x.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function sd(x,z){var ne=Zt(x.doc,z),te=rt(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,te,z,1)}function ld(x,z){var ne=Zt(x.doc,z),te=bt(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,ne,z,-1)}function lf(x,z){var ne=sd(x,z.line),te=Zt(x.doc,ne.line),ie=Wr(te,x.doc.direction);if(!ie||ie[0].level==0){var ue=Math.max(ne.ch,te.text.search(/\S/)),me=z.line==ne.line&&z.ch<=ue&&z.ch;return tt(ne.line,me?0:ue,ne.sticky)}return ne}function Do(x,z,ne){if(typeof z=="string"&&(z=au[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)!=gn}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Zs(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=rl(z,x.state.keyMaps[te],ne,x);if(ie)return ie}return x.options.extraKeys&&rl(z,x.options.extraKeys,ne,x)||rl(z,x.options.keyMap,ne,x)}var rh=new Le;function ou(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(Du(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:rh.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),bc(x,ie+" "+z,ne,te))return!0}return bc(x,z,ne,te)}function bc(x,z,ne,te){var ie=Zs(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Fn(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Ir(ne),wi(x)),!!ie}function La(x,z){var ne=zl(z,!0);return ne?z.shiftKey&&!x.state.keySeq?ou(x,"Shift-"+ne,z,function(te){return Do(x,te,!0)})||ou(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Do(x,te)}):ou(x,ne,z,function(te){return Do(x,te)}):!1}function su(x,z,ne){return ou(x,"'"+ne+"'",z,function(te){return Do(x,te,!0)})}var il=null;function Iu(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=Dt(),!Vt(z,x))){be&&Se<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=La(z,x);Te&&(il=te?ne:null,!te&&ne==88&&!kn&&(De?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),fe&&!De&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Un(z)}}function Un(x){var z=x.display.lineDiv;Ln(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(je(z,"CodeMirror-crosshair"),hi(document,"keyup",ne),hi(document,"mouseover",ne))}$n(document,"keyup",ne),$n(document,"mouseover",ne)}function uf(x){x.keyCode==16&&(this.doc.sel.shift=!1),Vt(this,x)}function cf(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(Xi(z.display,x)||Vt(z,x)||x.ctrlKey&&!x.altKey||De&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Te&&ne==il){il=null,Ir(x);return}if(!(Te&&(!x.which||x.which<10)&&La(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(su(z,x,ie)||z.display.input.onKeyPress(x))}}}var ud=400,cd=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};cd.prototype.compare=function(x,z,ne){return this.time+ud>x&&vt(z,this.pos)==0&&ne==this.button};var al,Pu;function ih(x,z){var ne=+new Date;return Pu&&Pu.compare(ne,x,z)?(al=Pu=null,"triple"):al&&al.compare(ne,x,z)?(Pu=new cd(ne,x,z),al=null,"double"):(al=new cd(ne,x,z),Pu=null,"single")}function jo(x){var z=this,ne=z.display;if(!(Vt(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,Xi(ne,x)){Me||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!ts(z,x)){var te=Ao(z,x),ie=br(x),ue=te?ih(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&gl(z,ie,te,ue,x))&&(ie==1?te?wc(z,te,ue,x):ui(x)==ne.scroller&&Ir(x):ie==2?(te&&Nl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ie?z.display.input.onContextMenu(x):Ha(z)))}}}function gl(x,z,ne,te,ie){var ue="Click";return te=="double"?ue="Double"+ue:te=="triple"&&(ue="Triple"+ue),ue=(z==1?"Left":z==2?"Middle":"Right")+ue,ou(x,ml(ue,ie),ie,function(me){if(typeof me=="string"&&(me=au[me]),!me)return!1;var Ce=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Ce=me(x,ne)!=gn}finally{x.state.suppressEdits=!1}return Ce})}function xc(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var ue=At?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=ue?"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=De?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(De?ne.altKey:ne.ctrlKey)),ie}function wc(x,z,ne,te){be?setTimeout(ir(Di,x),0):x.curOp.focus=Dt();var ie=xc(x,ne,te),ue=x.doc.sel,me;x.options.dragDrop&&Ei&&!x.isReadOnly()&&ne=="single"&&(me=ue.contains(z))>-1&&(vt((me=ue.ranges[me]).from(),z)<0||z.xRel>0)&&(vt(me.to(),z)>0||z.xRel<0)?ah(x,te,z,ie):dd(x,te,z,ie)}function ah(x,z,ne,te){var ie=x.display,ue=!1,me=za(x,function(Oe){Me&&(ie.scroller.draggable=!1),x.state.draggingText=!1,hi(ie.wrapper.ownerDocument,"mouseup",me),hi(ie.wrapper.ownerDocument,"mousemove",Ce),hi(ie.scroller,"dragstart",Ae),hi(ie.scroller,"drop",me),ue||(Ir(Oe),te.addNew||Nl(x.doc,ne,null,null,te.extend),Me&&!mt||be&&Se==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Ce=function(Oe){ue=ue||Math.abs(z.clientX-Oe.clientX)+Math.abs(z.clientY-Oe.clientY)>=10},Ae=function(){return ue=!0};Me&&(ie.scroller.draggable=!0),x.state.draggingText=me,me.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),$n(ie.wrapper.ownerDocument,"mouseup",me),$n(ie.wrapper.ownerDocument,"mousemove",Ce),$n(ie.scroller,"dragstart",Ae),$n(ie.scroller,"drop",me),Ha(x),setTimeout(function(){return ie.input.focus()},20)}function df(x,z,ne){if(ne=="char")return new Za(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Za(tt(z.line,0),In(x.doc,tt(z.line+1,0)));var te=ne(x,z);return new Za(te.from,te.to)}function dd(x,z,ne,te){var ie=x.display,ue=x.doc;Ir(z);var me,Ce,Ae=ue.sel,Oe=Ae.ranges;if(te.addNew&&!te.extend?(Ce=ue.sel.contains(ne),Ce>-1?me=Oe[Ce]:me=new Za(ne,ne)):(me=ue.sel.primary(),Ce=ue.sel.primIndex),te.unit=="rectangle")te.addNew||(me=new Za(ne,ne)),ne=Ao(x,z,!0,!0),Ce=-1;else{var ct=df(x,ne,te.unit);te.extend?me=fc(me,ct.anchor,ct.head,te.extend):me=ct}te.addNew?Ce==-1?(Ce=Oe.length,To(ue,Es(x,Oe.concat([me]),Ce),{scroll:!1,origin:"*mouse"})):Oe.length>1&&Oe[Ce].empty()&&te.unit=="char"&&!te.extend?(To(ue,Es(x,Oe.slice(0,Ce).concat(Oe.slice(Ce+1)),0),{scroll:!1,origin:"*mouse"}),Ae=ue.sel):ws(ue,Ce,me,st):(Ce=0,To(ue,new vs([me],0),st),Ae=ue.sel);var Mt=ne;function ln(zr){if(vt(Mt,zr)!=0)if(Mt=zr,te.unit=="rectangle"){for(var ri=[],$i=x.options.tabSize,Hi=Qe(Zt(ue,ne.line).text,ne.ch,$i),ba=Qe(Zt(ue,zr.line).text,zr.ch,$i),to=Math.min(Hi,ba),Wo=Math.max(Hi,ba),bo=Math.min(ne.line,zr.line),cs=Math.min(x.lastLine(),Math.max(ne.line,zr.line));bo<=cs;bo++){var ds=Zt(ue,bo).text,Io=en(ds,to,$i);to==Wo?ri.push(new Za(tt(bo,Io),tt(bo,Io))):ds.length>Io&&ri.push(new Za(tt(bo,Io),tt(bo,en(ds,Wo,$i))))}ri.length||ri.push(new Za(ne,ne)),To(ue,Es(x,Ae.ranges.slice(0,Ce).concat(ri),Ce),{origin:"*mouse",scroll:!1}),x.scrollIntoView(zr)}else{var fs=me,oa=df(x,zr,te.unit),So=fs.anchor,xo;vt(oa.anchor,So)>0?(xo=oa.head,So=cn(fs.from(),oa.anchor)):(xo=oa.anchor,So=an(fs.to(),oa.head));var Co=Ae.ranges.slice(0);Co[Ce]=ff(x,new Za(In(ue,So),xo)),To(ue,Es(x,Co,Ce),st)}}var qt=ie.wrapper.getBoundingClientRect(),Xn=0;function dr(zr){var ri=++Xn,$i=Ao(x,zr,!0,te.unit=="rectangle");if($i)if(vt($i,Mt)!=0){x.curOp.focus=Dt(),ln($i);var Hi=va(ie,ue);($i.line>=Hi.to||$i.line<Hi.from)&&setTimeout(za(x,function(){Xn==ri&&dr(zr)}),150)}else{var ba=zr.clientY<qt.top?-20:zr.clientY>qt.bottom?20:0;ba&&setTimeout(za(x,function(){Xn==ri&&(ie.scroller.scrollTop+=ba,dr(zr))}),50)}}function Ar(zr){x.state.selectingText=!1,Xn=1/0,zr&&(Ir(zr),ie.input.focus()),hi(ie.wrapper.ownerDocument,"mousemove",Hr),hi(ie.wrapper.ownerDocument,"mouseup",ni),ue.history.lastSelOrigin=null}var Hr=za(x,function(zr){zr.buttons===0||!br(zr)?Ar(zr):dr(zr)}),ni=za(x,Ar);x.state.selectingText=ni,$n(ie.wrapper.ownerDocument,"mousemove",Hr),$n(ie.wrapper.ownerDocument,"mouseup",ni)}function ff(x,z){var ne=z.anchor,te=z.head,ie=Zt(x.doc,ne.line);if(vt(ne,te)==0&&ne.sticky==te.sticky)return z;var ue=Wr(ie);if(!ue)return z;var me=tn(ue,ne.ch,ne.sticky),Ce=ue[me];if(Ce.from!=ne.ch&&Ce.to!=ne.ch)return z;var Ae=me+(Ce.from==ne.ch==(Ce.level!=1)?0:1);if(Ae==0||Ae==ue.length)return z;var Oe;if(te.line!=ne.line)Oe=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var ct=tn(ue,te.ch,te.sticky),Mt=ct-me||(te.ch-ne.ch)*(Ce.level==1?-1:1);ct==Ae-1||ct==Ae?Oe=Mt<0:Oe=Mt>0}var ln=ue[Ae+(Oe?-1:0)],qt=Oe==(ln.level==1),Xn=qt?ln.from:ln.to,dr=qt?"after":"before";return ne.ch==Xn&&ne.sticky==dr?z:new Za(new tt(ne.line,Xn,dr),te)}function Ou(x,z,ne,te){var ie,ue;if(z.touches)ie=z.touches[0].clientX,ue=z.touches[0].clientY;else try{ie=z.clientX,ue=z.clientY}catch(ln){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Ir(z);var me=x.display,Ce=me.lineDiv.getBoundingClientRect();if(ue>Ce.bottom||!rr(x,ne))return Gr(z);ue-=Ce.top-me.viewOffset;for(var Ae=0;Ae<x.display.gutterSpecs.length;++Ae){var Oe=me.gutters.childNodes[Ae];if(Oe&&Oe.getBoundingClientRect().right>=ie){var ct=nr(x.doc,ue),Mt=x.display.gutterSpecs[Ae];return ut(x,ne,x,ct,Mt.className,z),Gr(z)}}}function ts(x,z){return Ou(x,z,"gutterClick",!0)}function vl(x,z){Xi(x.display,z)||hf(x,z)||Vt(x,z,"contextmenu")||Ie||x.display.input.onContextMenu(z)}function hf(x,z){return rr(x,"gutterContextMenu")?Ou(x,z,"gutterContextMenu",!1):!1}function fd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fi(x)}var yl={toString:function(){return"CodeMirror.Init"}},pf={},Sc={};function oh(x){var z=x.optionHandlers;function ne(te,ie,ue,me){x.defaults[te]=ie,ue&&(z[te]=me?function(Ce,Ae,Oe){Oe!=yl&&ue(Ce,Ae,Oe)}:ue)}x.defineOption=ne,x.Init=yl,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,rc(te)},!0),ne("indentUnit",2,rc,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){Rl(te),fi(te),Oi(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var ue=[],me=te.doc.first;te.doc.iter(function(Ae){for(var Oe=0;;){var ct=Ae.text.indexOf(ie,Oe);if(ct==-1)break;Oe=ct+ie.length,ue.push(tt(me,ct))}me++});for(var Ce=ue.length-1;Ce>=0;Ce--)eu(te.doc,ie,ue[Ce],tt(ue[Ce].line,ue[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,ue){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),ue!=yl&&te.refresh()}),ne("specialCharPlaceholder",Pe,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",Ye?"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){fd(te),Ql(te)},!0),ne("keyMap","default",function(te,ie,ue){var me=ss(ie),Ce=ue!=yl&&ss(ue);Ce&&Ce.detach&&Ce.detach(te,me),me.attach&&me.attach(te,Ce||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,mf,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=ec(ie,te.options.lineNumbers),Ql(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?Oo(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return xs(te)},!0),ne("scrollbarStyle","native",function(te){vu(te),xs(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=ec(te.options.gutters,ie),Ql(te)},!0),ne("firstLineNumber",1,Ql,!0),ne("lineNumberFormatter",function(te){return te},Ql,!0),ne("showCursorWhenSelecting",!1,Qo,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,ie){ie=="nocursor"&&($o(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,sh),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,Qo,!0),ne("singleCursorHeightPerLine",!0,Qo,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,Rl,!0),ne("addModeClass",!1,Rl,!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,Rl,!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 sh(x,z,ne){var te=ne&&ne!=yl;if(!z!=!te){var ie=x.display.dragFunctions,ue=z?$n:hi;ue(x.display.scroller,"dragstart",ie.start),ue(x.display.scroller,"dragenter",ie.enter),ue(x.display.scroller,"dragover",ie.over),ue(x.display.scroller,"dragleave",ie.leave),ue(x.display.scroller,"drop",ie.drop)}}function mf(x){x.options.lineWrapping?(Ln(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(je(x.display.wrapper,"CodeMirror-wrap"),Sn(x)),lo(x),Oi(x),fi(x),setTimeout(function(){return xs(x)},100)}function ra(x,z){var ne=this;if(!(this instanceof ra))return new ra(x,z);this.options=z=z?yr(z):{},yr(pf,z,!1);var te=z.value;typeof te=="string"?te=new Eo(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new ra.inputStyles[z.inputStyle](this),ue=this.display=new Gd(x,te,ie,z);ue.wrapper.CodeMirror=this,fd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vu(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 Le,keySeq:null,specialChars:null},z.autofocus&&!Ye&&ue.input.focus(),be&&Se<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lh(this),ad(),Ks(this),this.curOp.forceUpdate=!0,wu(this,te),z.autofocus&&!Ye||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&ja(ne)},20):$o(this);for(var me in Sc)Sc.hasOwnProperty(me)&&Sc[me](this,z[me],yl);bu(this),z.finishInit&&z.finishInit(this);for(var Ce=0;Ce<hd.length;++Ce)hd[Ce](this);Is(this),Me&&z.lineWrapping&&getComputedStyle(ue.lineDiv).textRendering=="optimizelegibility"&&(ue.lineDiv.style.textRendering="auto")}ra.defaults=pf,ra.optionHandlers=Sc;function lh(x){var z=x.display;$n(z.scroller,"mousedown",za(x,jo)),be&&Se<11?$n(z.scroller,"dblclick",za(x,function(Ae){if(!Vt(x,Ae)){var Oe=Ao(x,Ae);if(!(!Oe||ts(x,Ae)||Xi(x.display,Ae))){Ir(Ae);var ct=x.findWordAt(Oe);Nl(x.doc,ct.anchor,ct.head)}}})):$n(z.scroller,"dblclick",function(Ae){return Vt(x,Ae)||Ir(Ae)}),$n(z.scroller,"contextmenu",function(Ae){return vl(x,Ae)}),$n(z.input.getField(),"contextmenu",function(Ae){z.scroller.contains(Ae.target)||vl(x,Ae)});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 ue(Ae){if(Ae.touches.length!=1)return!1;var Oe=Ae.touches[0];return Oe.radiusX<=1&&Oe.radiusY<=1}function me(Ae,Oe){if(Oe.left==null)return!0;var ct=Oe.left-Ae.left,Mt=Oe.top-Ae.top;return ct*ct+Mt*Mt>20*20}$n(z.scroller,"touchstart",function(Ae){if(!Vt(x,Ae)&&!ue(Ae)&&!ts(x,Ae)){z.input.ensurePolled(),clearTimeout(ne);var Oe=+new Date;z.activeTouch={start:Oe,moved:!1,prev:Oe-te.end<=300?te:null},Ae.touches.length==1&&(z.activeTouch.left=Ae.touches[0].pageX,z.activeTouch.top=Ae.touches[0].pageY)}}),$n(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),$n(z.scroller,"touchend",function(Ae){var Oe=z.activeTouch;if(Oe&&!Xi(z,Ae)&&Oe.left!=null&&!Oe.moved&&new Date-Oe.start<300){var ct=x.coordsChar(z.activeTouch,"page"),Mt;!Oe.prev||me(Oe,Oe.prev)?Mt=new Za(ct,ct):!Oe.prev.prev||me(Oe,Oe.prev.prev)?Mt=x.findWordAt(ct):Mt=new Za(tt(ct.line,0),In(x.doc,tt(ct.line+1,0))),x.setSelection(Mt.anchor,Mt.head),x.focus(),Ir(Ae)}ie()}),$n(z.scroller,"touchcancel",ie),$n(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Da(x,z.scroller.scrollTop),go(x,z.scroller.scrollLeft,!0),ut(x,"scroll",x))}),$n(z.scroller,"mousewheel",function(Ae){return Xc(x,Ae)}),$n(z.scroller,"DOMMouseScroll",function(Ae){return Xc(x,Ae)}),$n(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Ae){Vt(x,Ae)||Xr(Ae)},over:function(Ae){Vt(x,Ae)||(id(x,Ae),Xr(Ae))},start:function(Ae){return th(x,Ae)},drop:za(x,eh),leave:function(Ae){Vt(x,Ae)||ru(x)}};var Ce=z.input.getField();$n(Ce,"keyup",function(Ae){return uf.call(x,Ae)}),$n(Ce,"keydown",za(x,Iu)),$n(Ce,"keypress",za(x,cf)),$n(Ce,"focus",function(Ae){return ja(x,Ae)}),$n(Ce,"blur",function(Ae){return $o(x,Ae)})}var hd=[];ra.defineInitHook=function(x){return hd.push(x)};function Rs(x,z,ne,te){var ie=x.doc,ue;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?ue=pi(x,z).state:ne="prev");var me=x.options.tabSize,Ce=Zt(ie,z),Ae=Qe(Ce.text,null,me);Ce.stateAfter&&(Ce.stateAfter=null);var Oe=Ce.text.match(/^\s*/)[0],ct;if(!te&&!/\S/.test(Ce.text))ct=0,ne="not";else if(ne=="smart"&&(ct=ie.mode.indent(ue,Ce.text.slice(Oe.length),Ce.text),ct==gn||ct>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?ct=Qe(Zt(ie,z-1).text,null,me):ct=0:ne=="add"?ct=Ae+x.options.indentUnit:ne=="subtract"?ct=Ae-x.options.indentUnit:typeof ne=="number"&&(ct=Ae+ne),ct=Math.max(0,ct);var Mt="",ln=0;if(x.options.indentWithTabs)for(var qt=Math.floor(ct/me);qt;--qt)ln+=me,Mt+=" ";if(ln<ct&&(Mt+=Ft(ct-ln)),Mt!=Oe)return eu(ie,Mt,tt(z,0),tt(z,Oe.length),"+input"),Ce.stateAfter=null,!0;for(var Xn=0;Xn<ie.sel.ranges.length;Xn++){var dr=ie.sel.ranges[Xn];if(dr.head.line==z&&dr.head.ch<Oe.length){var Ar=tt(z,Oe.length);ws(ie,Xn,new Za(Ar,Ar));break}}}var Bs=null;function bl(x){Bs=x}function pd(x,z,ne,te,ie){var ue=x.doc;x.display.shift=!1,te||(te=ue.sel);var me=+new Date-200,Ce=ie=="paste"||x.state.pasteIncoming>me,Ae=gt(z),Oe=null;if(Ce&&te.ranges.length>1)if(Bs&&Bs.text.join(`
|
|
|
`)==z){if(te.ranges.length%Bs.text.length==0){Oe=[];for(var ct=0;ct<Bs.text.length;ct++)Oe.push(ue.splitLines(Bs.text[ct]))}}else Ae.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Oe=Mn(Ae,function(Hr){return[Hr]}));for(var Mt=x.curOp.updateInput,ln=te.ranges.length-1;ln>=0;ln--){var qt=te.ranges[ln],Xn=qt.from(),dr=qt.to();qt.empty()&&(ne&&ne>0?Xn=tt(Xn.line,Xn.ch-ne):x.state.overwrite&&!Ce?dr=tt(dr.line,Math.min(Zt(ue,dr.line).text.length,dr.ch+zt(Ae).length)):Ce&&Bs&&Bs.lineWise&&Bs.text.join(`
|
|
|
`)==Ae.join(`
|
|
|
`)&&(Xn=dr=tt(Xn.line,0)));var Ar={from:Xn,to:dr,text:Oe?Oe[ln%Oe.length]:Ae,origin:ie||(Ce?"paste":x.state.cutIncoming>me?"cut":"+input")};dl(x.doc,Ar),Fn(x,"inputRead",x,Ar)}z&&!Ce&&gd(x,z),zo(x),x.curOp.updateInput<2&&(x.curOp.updateInput=Mt),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function md(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&ga(z,function(){return pd(z,ne,0,null,"paste")}),!0}function gd(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 ue=x.getModeAt(ie.head),me=!1;if(ue.electricChars){for(var Ce=0;Ce<ue.electricChars.length;Ce++)if(z.indexOf(ue.electricChars.charAt(Ce))>-1){me=Rs(x,ie.head.line,"smart");break}}else ue.electricInput&&ue.electricInput.test(Zt(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(me=Rs(x,ie.head.line,"smart"));me&&Fn(x,"electricInput",x,ie.head.line)}}}function lu(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,ue={anchor:tt(ie,0),head:tt(ie+1,0)};ne.push(ue),z.push(x.getRange(ue.anchor,ue.head))}return{text:z,ranges:ne}}function gf(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function vd(){var x=kt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=kt("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Me?x.style.width="1000px":x.setAttribute("wrap","off"),Ct&&(x.style.border="1px solid black"),gf(x),z}function yd(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 ue=this.options,me=ue[te];ue[te]==ie&&te!="mode"||(ue[te]=ie,z.hasOwnProperty(te)&&za(this,z[te])(this,ie,me),ut(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"](ss(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,ue=0;ue<ie.length;++ue)if(ie[ue]==te||ie[ue].name==te)return ie.splice(ue,1),!0},addOverlay:Ra(function(te,ie){var ue=te.token?te:x.getMode(this.options,te);if(ue.startState)throw new Error("Overlays may not be stateful.");bn(this.state.overlays,{mode:ue,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(me){return me.priority}),this.state.modeGen++,Oi(this)}),removeOverlay:Ra(function(te){for(var ie=this.state.overlays,ue=0;ue<ie.length;++ue){var me=ie[ue].modeSpec;if(me==te||typeof te=="string"&&me.name==te){ie.splice(ue,1),this.state.modeGen++,Oi(this);return}}}),indentLine:Ra(function(te,ie,ue){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),ar(this.doc,te)&&Rs(this,te,ie,ue)}),indentSelection:Ra(function(te){for(var ie=this.doc.sel.ranges,ue=-1,me=0;me<ie.length;me++){var Ce=ie[me];if(Ce.empty())Ce.head.line>ue&&(Rs(this,Ce.head.line,te,!0),ue=Ce.head.line,me==this.doc.sel.primIndex&&zo(this));else{var Ae=Ce.from(),Oe=Ce.to(),ct=Math.max(ue,Ae.line);ue=Math.min(this.lastLine(),Oe.line-(Oe.ch?0:1))+1;for(var Mt=ct;Mt<ue;++Mt)Rs(this,Mt,te);var ln=this.doc.sel.ranges;Ae.ch==0&&ie.length==ln.length&&ln[me].from().ch>0&&ws(this.doc,me,new Za(Ae,ln[me].to()),Je)}}}),getTokenAt:function(te,ie){return Zi(this,te,ie)},getLineTokens:function(te,ie){return Zi(this,tt(te),ie,!0)},getTokenTypeAt:function(te){te=In(this.doc,te);var ie=Li(this,Zt(this.doc,te.line)),ue=0,me=(ie.length-1)/2,Ce=te.ch,Ae;if(Ce==0)Ae=ie[2];else for(;;){var Oe=ue+me>>1;if((Oe?ie[Oe*2-1]:0)>=Ce)me=Oe;else if(ie[Oe*2+1]<Ce)ue=Oe+1;else{Ae=ie[Oe*2+2];break}}var ct=Ae?Ae.indexOf("overlay "):-1;return ct<0?Ae:ct==0?null:Ae.slice(0,ct-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 ue=[];if(!ne.hasOwnProperty(ie))return ue;var me=ne[ie],Ce=this.getModeAt(te);if(typeof Ce[ie]=="string")me[Ce[ie]]&&ue.push(me[Ce[ie]]);else if(Ce[ie])for(var Ae=0;Ae<Ce[ie].length;Ae++){var Oe=me[Ce[ie][Ae]];Oe&&ue.push(Oe)}else Ce.helperType&&me[Ce.helperType]?ue.push(me[Ce.helperType]):me[Ce.name]&&ue.push(me[Ce.name]);for(var ct=0;ct<me._global.length;ct++){var Mt=me._global[ct];Mt.pred(Ce,this)&&Nt(ue,Mt.val)==-1&&ue.push(Mt.val)}return ue},getStateAfter:function(te,ie){var ue=this.doc;return te=fn(ue,te==null?ue.first+ue.size-1:te),pi(this,te+1,ie).state},cursorCoords:function(te,ie){var ue,me=this.doc.sel.primary();return te==null?ue=me.head:typeof te=="object"?ue=In(this.doc,te):ue=te?me.from():me.to(),ha(this,ue,ie||"page")},charCoords:function(te,ie){return Va(this,In(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=Ea(this,te,ie||"page"),Ga(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=Ea(this,{top:te,left:0},ie||"page").top,nr(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,ue){var me=!1,Ce;if(typeof te=="number"){var Ae=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>Ae&&(te=Ae,me=!0),Ce=Zt(this.doc,te)}else Ce=te;return wa(this,Ce,{top:0,left:0},ie||"page",ue||me).top+(me?this.doc.height-vn(Ce):0)},defaultTextHeight:function(){return Ka(this.display)},defaultCharWidth:function(){return io(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,ue,me,Ce){var Ae=this.display;te=ha(this,In(this.doc,te));var Oe=te.bottom,ct=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Ae.sizer.appendChild(ie),me=="over")Oe=te.top;else if(me=="above"||me=="near"){var Mt=Math.max(Ae.wrapper.clientHeight,this.doc.height),ln=Math.max(Ae.sizer.clientWidth,Ae.lineSpace.clientWidth);(me=="above"||te.bottom+ie.offsetHeight>Mt)&&te.top>ie.offsetHeight?Oe=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=Mt&&(Oe=te.bottom),ct+ie.offsetWidth>ln&&(ct=ln-ie.offsetWidth)}ie.style.top=Oe+"px",ie.style.left=ie.style.right="",Ce=="right"?(ct=Ae.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Ce=="left"?ct=0:Ce=="middle"&&(ct=(Ae.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=ct+"px"),ue&&cl(this,{left:ct,top:Oe,right:ct+ie.offsetWidth,bottom:Oe+ie.offsetHeight})},triggerOnKeyDown:Ra(Iu),triggerOnKeyPress:Ra(cf),triggerOnKeyUp:uf,triggerOnMouseDown:Ra(jo),execCommand:function(te){if(au.hasOwnProperty(te))return au[te].call(null,this)},triggerElectric:Ra(function(te){gd(this,te)}),findPosH:function(te,ie,ue,me){var Ce=1;ie<0&&(Ce=-1,ie=-ie);for(var Ae=In(this.doc,te),Oe=0;Oe<ie&&(Ae=Cc(this.doc,Ae,Ce,ue,me),!Ae.hitSide);++Oe);return Ae},moveH:Ra(function(te,ie){var ue=this;this.extendSelectionsBy(function(me){return ue.display.shift||ue.doc.extend||me.empty()?Cc(ue.doc,me.head,te,ie,ue.options.rtlMoveVisually):te<0?me.from():me.to()},_t)}),deleteH:Ra(function(te,ie){var ue=this.doc.sel,me=this.doc;ue.somethingSelected()?me.replaceSelection("",null,"+delete"):ks(this,function(Ce){var Ae=Cc(me,Ce.head,te,ie,!1);return te<0?{from:Ae,to:Ce.head}:{from:Ce.head,to:Ae}})}),findPosV:function(te,ie,ue,me){var Ce=1,Ae=me;ie<0&&(Ce=-1,ie=-ie);for(var Oe=In(this.doc,te),ct=0;ct<ie;++ct){var Mt=ha(this,Oe,"div");if(Ae==null?Ae=Mt.left:Mt.left=Ae,Oe=vf(this,Mt,Ce,ue),Oe.hitSide)break}return Oe},moveV:Ra(function(te,ie){var ue=this,me=this.doc,Ce=[],Ae=!this.display.shift&&!me.extend&&me.sel.somethingSelected();if(me.extendSelectionsBy(function(ct){if(Ae)return te<0?ct.from():ct.to();var Mt=ha(ue,ct.head,"div");ct.goalColumn!=null&&(Mt.left=ct.goalColumn),Ce.push(Mt.left);var ln=vf(ue,Mt,te,ie);return ie=="page"&&ct==me.sel.primary()&&ms(ue,Va(ue,ln,"div").top-Mt.top),ln},_t),Ce.length)for(var Oe=0;Oe<me.sel.ranges.length;Oe++)me.sel.ranges[Oe].goalColumn=Ce[Oe]}),findWordAt:function(te){var ie=this.doc,ue=Zt(ie,te.line).text,me=te.ch,Ce=te.ch;if(ue){var Ae=this.getHelper(te,"wordChars");(te.sticky=="before"||Ce==ue.length)&&me?--me:++Ce;for(var Oe=ue.charAt(me),ct=ve(Oe,Ae)?function(Mt){return ve(Mt,Ae)}:/\s/.test(Oe)?function(Mt){return/\s/.test(Mt)}:function(Mt){return!/\s/.test(Mt)&&!ve(Mt)};me>0&&ct(ue.charAt(me-1));)--me;for(;Ce<ue.length&&ct(ue.charAt(Ce));)++Ce}return new Za(tt(te.line,me),tt(te.line,Ce))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ln(this.display.cursorDiv,"CodeMirror-overwrite"):je(this.display.cursorDiv,"CodeMirror-overwrite"),ut(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Dt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ra(function(te,ie){Ts(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-jr(this)-this.display.barHeight,width:te.scrollWidth-jr(this)-this.display.barWidth,clientHeight:Ti(this),clientWidth:ci(this)}},scrollIntoView:Ra(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:tt(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?Ds(this,te):oo(this,te.from,te.to,te.margin)}),setSize:Ra(function(te,ie){var ue=this,me=function(Ae){return typeof Ae=="number"||/^\d+$/.test(String(Ae))?Ae+"px":Ae};te!=null&&(this.display.wrapper.style.width=me(te)),ie!=null&&(this.display.wrapper.style.height=me(ie)),this.options.lineWrapping&&ia(this);var Ce=this.display.viewFrom;this.doc.iter(Ce,this.display.viewTo,function(Ae){if(Ae.widgets){for(var Oe=0;Oe<Ae.widgets.length;Oe++)if(Ae.widgets[Oe].noHScroll){Ta(ue,Ce,"widget");break}}++Ce}),this.curOp.forceUpdate=!0,ut(this,"refresh",this)}),operation:function(te){return ga(this,te)},startOperation:function(){return Ks(this)},endOperation:function(){return Is(this)},refresh:Ra(function(){var te=this.display.cachedTextHeight;Oi(this),this.curOp.forceUpdate=!0,fi(this),Ts(this,this.doc.scrollLeft,this.doc.scrollTop),Ju(this.display),(te==null||Math.abs(te-Ka(this.display))>.5||this.options.lineWrapping)&&lo(this),ut(this,"refresh",this)}),swapDoc:Ra(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),wu(this,te),fi(this),this.display.input.reset(),Ts(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Fn(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}},gr(x),x.registerHelper=function(te,ie,ue){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=ue},x.registerGlobalHelper=function(te,ie,ue,me){x.registerHelper(te,ie,me),ne[te]._global.push({pred:ue,val:me})}}function Cc(x,z,ne,te,ie){var ue=z,me=ne,Ce=Zt(x,z.line),Ae=ie&&x.direction=="rtl"?-ne:ne;function Oe(){var ni=z.line+Ae;return ni<x.first||ni>=x.first+x.size?!1:(z=new tt(ni,z.ch,z.sticky),Ce=Zt(x,ni))}function ct(ni){var zr;if(te=="codepoint"){var ri=Ce.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(ri)?zr=null:zr=new tt(z.line,Math.max(0,Math.min(Ce.text.length,z.ch+ne*(ri>=55296&&ri<56320?2:1))),-ne)}else ie?zr=Us(x.cm,Ce,z,ne):zr=Ws(Ce,z,ne);if(zr==null)if(!ni&&Oe())z=Kl(ie,x.cm,Ce,z.line,Ae);else return!1;else z=zr;return!0}if(te=="char"||te=="codepoint")ct();else if(te=="column")ct(!0);else if(te=="word"||te=="group")for(var Mt=null,ln=te=="group",qt=x.cm&&x.cm.getHelper(z,"wordChars"),Xn=!0;!(ne<0&&!ct(!Xn));Xn=!1){var dr=Ce.text.charAt(z.ch)||`
|
|
|
`,Ar=ve(dr,qt)?"w":ln&&dr==`
|
|
|
`?"n":!ln||/\s/.test(dr)?null:"p";if(ln&&!Xn&&!Ar&&(Ar="s"),Mt&&Mt!=Ar){ne<0&&(ne=1,ct(),z.sticky="after");break}if(Ar&&(Mt=Ar),ne>0&&!ct(!Xn))break}var Hr=hc(x,z,ue,me,!0);return rn(ue,Hr)&&(Hr.hitSide=!0),Hr}function vf(x,z,ne,te){var ie=x.doc,ue=z.left,me;if(te=="page"){var Ce=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ae=Math.max(Ce-.5*Ka(x.display),3);me=(ne>0?z.bottom:z.top)+ne*Ae}else te=="line"&&(me=ne>0?z.bottom+3:z.top-3);for(var Oe;Oe=Ga(x,ue,me),!!Oe.outside;){if(ne<0?me<=0:me>=ie.height){Oe.hitSide=!0;break}me+=ne*5}return Oe}var qa=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Le,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};qa.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;gf(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function ue(Ce){for(var Ae=Ce.target;Ae;Ae=Ae.parentNode){if(Ae==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ae.className))break}return!1}$n(ie,"paste",function(Ce){!ue(Ce)||Vt(te,Ce)||md(Ce,te)||Se<=11&&setTimeout(za(te,function(){return z.updateFromDOM()}),20)}),$n(ie,"compositionstart",function(Ce){z.composing={data:Ce.data,done:!1}}),$n(ie,"compositionupdate",function(Ce){z.composing||(z.composing={data:Ce.data,done:!1})}),$n(ie,"compositionend",function(Ce){z.composing&&(Ce.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),$n(ie,"touchstart",function(){return ne.forceCompositionEnd()}),$n(ie,"input",function(){z.composing||z.readFromDOMSoon()});function me(Ce){if(!(!ue(Ce)||Vt(te,Ce))){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()}),Ce.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Ae=lu(te);bl({lineWise:!0,text:Ae.text}),Ce.type=="cut"&&te.operation(function(){te.setSelections(Ae.ranges,0,Je),te.replaceSelection("",null,"cut")})}else return;if(Ce.clipboardData){Ce.clipboardData.clearData();var Oe=Bs.text.join(`
|
|
|
`);if(Ce.clipboardData.setData("Text",Oe),Ce.clipboardData.getData("Text")==Oe){Ce.preventDefault();return}}var ct=vd(),Mt=ct.firstChild;te.display.lineSpace.insertBefore(ct,te.display.lineSpace.firstChild),Mt.value=Bs.text.join(`
|
|
|
`);var ln=document.activeElement;Rn(Mt),setTimeout(function(){te.display.lineSpace.removeChild(ct),ln.focus(),ln==ie&&ne.showPrimarySelection()},50)}}$n(ie,"copy",me),$n(ie,"cut",me)},qa.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},qa.prototype.prepareSelection=function(){var x=ps(this.cm,!1);return x.focus=document.activeElement==this.div,x},qa.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},qa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qa.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 ue=Mc(z,x.anchorNode,x.anchorOffset),me=Mc(z,x.focusNode,x.focusOffset);if(!(ue&&!ue.bad&&me&&!me.bad&&vt(cn(ue,me),te)==0&&vt(an(ue,me),ie)==0)){var Ce=z.display.view,Ae=te.line>=z.display.viewFrom&&yf(z,te)||{node:Ce[0].measure.map[2],offset:0},Oe=ie.line<z.display.viewTo&&yf(z,ie);if(!Oe){var ct=Ce[Ce.length-1].measure,Mt=ct.maps?ct.maps[ct.maps.length-1]:ct.map;Oe={node:Mt[Mt.length-1],offset:Mt[Mt.length-2]-Mt[Mt.length-3]}}if(!Ae||!Oe){x.removeAllRanges();return}var ln=x.rangeCount&&x.getRangeAt(0),qt;try{qt=Ge(Ae.node,Ae.offset,Oe.offset,Oe.node)}catch(Xn){}qt&&(!fe&&z.state.focused?(x.collapse(Ae.node,Ae.offset),qt.collapsed||(x.removeAllRanges(),x.addRange(qt))):(x.removeAllRanges(),x.addRange(qt)),ln&&x.anchorNode==null?x.addRange(ln):fe&&this.startGracePeriod()),this.rememberSelection()}},qa.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)},qa.prototype.showMultipleSelections=function(x){Pt(this.cm.display.cursorDiv,x.cursors),Pt(this.cm.display.selectionDiv,x.selection)},qa.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},qa.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Ht(this.div,z)},qa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},qa.prototype.blur=function(){this.div.blur()},qa.prototype.getField=function(){return this.div},qa.prototype.supportsTouch=function(){return!0},qa.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():ga(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)},qa.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},qa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(ht&&pe&&this.cm.display.gutterSpecs.length&&uh(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=Mc(z,x.anchorNode,x.anchorOffset),te=Mc(z,x.focusNode,x.focusOffset);ne&&te&&ga(z,function(){To(z.doc,Ps(ne,te),Je),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},qa.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=tt(te.line-1,Zt(x.doc,te.line-1).length)),ie.ch==Zt(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=tt(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var ue,me,Ce;te.line==z.viewFrom||(ue=na(x,te.line))==0?(me=qn(z.view[0].line),Ce=z.view[0].node):(me=qn(z.view[ue].line),Ce=z.view[ue-1].node.nextSibling);var Ae=na(x,ie.line),Oe,ct;if(Ae==z.view.length-1?(Oe=z.viewTo-1,ct=z.lineDiv.lastChild):(Oe=qn(z.view[Ae+1].line)-1,ct=z.view[Ae+1].node.previousSibling),!Ce)return!1;for(var Mt=x.doc.splitLines(ch(x,Ce,ct,me,Oe)),ln=zn(x.doc,tt(me,0),tt(Oe,Zt(x.doc,Oe).text.length));Mt.length>1&&ln.length>1;)if(zt(Mt)==zt(ln))Mt.pop(),ln.pop(),Oe--;else if(Mt[0]==ln[0])Mt.shift(),ln.shift(),me++;else break;for(var qt=0,Xn=0,dr=Mt[0],Ar=ln[0],Hr=Math.min(dr.length,Ar.length);qt<Hr&&dr.charCodeAt(qt)==Ar.charCodeAt(qt);)++qt;for(var ni=zt(Mt),zr=zt(ln),ri=Math.min(ni.length-(Mt.length==1?qt:0),zr.length-(ln.length==1?qt:0));Xn<ri&&ni.charCodeAt(ni.length-Xn-1)==zr.charCodeAt(zr.length-Xn-1);)++Xn;if(Mt.length==1&&ln.length==1&&me==te.line)for(;qt&&qt>te.ch&&ni.charCodeAt(ni.length-Xn-1)==zr.charCodeAt(zr.length-Xn-1);)qt--,Xn++;Mt[Mt.length-1]=ni.slice(0,ni.length-Xn).replace(/^\u200b+/,""),Mt[0]=Mt[0].slice(qt).replace(/\u200b+$/,"");var $i=tt(me,qt),Hi=tt(Oe,ln.length?zt(ln).length-Xn:0);if(Mt.length>1||Mt[0]||vt($i,Hi))return eu(x.doc,Mt,$i,Hi,"+input"),!0},qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},qa.prototype.reset=function(){this.forceCompositionEnd()},qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qa.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))},qa.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&ga(this.cm,function(){return Oi(x.cm)})},qa.prototype.setUneditable=function(x){x.contentEditable="false"},qa.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||za(this.cm,pd)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},qa.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},qa.prototype.onContextMenu=function(){},qa.prototype.resetPosition=function(){},qa.prototype.needsContentAttribute=!0;function yf(x,z){var ne=ua(x,z.line);if(!ne||ne.hidden)return null;var te=Zt(x.doc,z.line),ie=Na(ne,te,z.line),ue=Wr(te,x.doc.direction),me="left";if(ue){var Ce=tn(ue,z.ch);me=Ce%2?"right":"left"}var Ae=ki(ie.map,z.ch,me);return Ae.offset=Ae.collapse=="right"?Ae.end:Ae.start,Ae}function uh(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function uu(x,z){return z&&(x.bad=!0),x}function ch(x,z,ne,te,ie){var ue="",me=!1,Ce=x.doc.lineSeparator(),Ae=!1;function Oe(qt){return function(Xn){return Xn.id==qt}}function ct(){me&&(ue+=Ce,Ae&&(ue+=Ce),me=Ae=!1)}function Mt(qt){qt&&(ct(),ue+=qt)}function ln(qt){if(qt.nodeType==1){var Xn=qt.getAttribute("cm-text");if(Xn){Mt(Xn);return}var dr=qt.getAttribute("cm-marker"),Ar;if(dr){var Hr=x.findMarks(tt(te,0),tt(ie+1,0),Oe(+dr));Hr.length&&(Ar=Hr[0].find(0))&&Mt(zn(x.doc,Ar.from,Ar.to).join(Ce));return}if(qt.getAttribute("contenteditable")=="false")return;var ni=/^(pre|div|p|li|table|br)$/i.test(qt.nodeName);if(!/^br$/i.test(qt.nodeName)&&qt.textContent.length==0)return;ni&&ct();for(var zr=0;zr<qt.childNodes.length;zr++)ln(qt.childNodes[zr]);/^(pre|p)$/i.test(qt.nodeName)&&(Ae=!0),ni&&(me=!0)}else qt.nodeType==3&&Mt(qt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;ln(z),z!=ne;)z=z.nextSibling,Ae=!1;return ue}function Mc(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return uu(x.clipPos(tt(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 ue=x.display.view[ie];if(ue.node==te)return dh(ue,z,ne)}}function dh(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Ht(te,z))return uu(tt(qn(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var ue=x.rest?zt(x.rest):x.line;return uu(tt(qn(ue),ue.text.length),ie)}var me=z.nodeType==3?z:null,Ce=z;for(!me&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(me=z.firstChild,ne&&(ne=me.nodeValue.length));Ce.parentNode!=te;)Ce=Ce.parentNode;var Ae=x.measure,Oe=Ae.maps;function ct(Ar,Hr,ni){for(var zr=-1;zr<(Oe?Oe.length:0);zr++)for(var ri=zr<0?Ae.map:Oe[zr],$i=0;$i<ri.length;$i+=3){var Hi=ri[$i+2];if(Hi==Ar||Hi==Hr){var ba=qn(zr<0?x.line:x.rest[zr]),to=ri[$i]+ni;return(ni<0||Hi!=Ar)&&(to=ri[$i+(ni?1:0)]),tt(ba,to)}}}var Mt=ct(me,Ce,ne);if(Mt)return uu(Mt,ie);for(var ln=Ce.nextSibling,qt=me?me.nodeValue.length-ne:0;ln;ln=ln.nextSibling){if(Mt=ct(ln,ln.firstChild,0),Mt)return uu(tt(Mt.line,Mt.ch-qt),ie);qt+=ln.textContent.length}for(var Xn=Ce.previousSibling,dr=ne;Xn;Xn=Xn.previousSibling){if(Mt=ct(Xn,Xn.firstChild,-1),Mt)return uu(tt(Mt.line,Mt.ch+dr),ie);dr+=Xn.textContent.length}}var eo=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new Le,this.hasSelection=!1,this.composing=null};eo.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),Ct&&(ie.style.width="0px"),$n(ie,"input",function(){be&&Se>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),$n(ie,"paste",function(me){Vt(te,me)||md(me,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function ue(me){if(!Vt(te,me)){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Ce=lu(te);bl({lineWise:!0,text:Ce.text}),me.type=="cut"?te.setSelections(Ce.ranges,null,Je):(ne.prevInput="",ie.value=Ce.text.join(`
|
|
|
`),Rn(ie))}else return;me.type=="cut"&&(te.state.cutIncoming=+new Date)}}$n(ie,"cut",ue),$n(ie,"copy",ue),$n(x.scroller,"paste",function(me){if(!(Xi(x,me)||Vt(te,me))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Ce=new Event("paste");Ce.clipboardData=me.clipboardData,ie.dispatchEvent(Ce)}}),$n(x.lineSpace,"selectstart",function(me){Xi(x,me)||Ir(me)}),$n(ie,"compositionstart",function(){var me=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:me,range:te.markText(me,te.getCursor("to"),{className:"CodeMirror-composing"})}}),$n(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},eo.prototype.createField=function(x){this.wrapper=vd(),this.textarea=this.wrapper.firstChild},eo.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},eo.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=ps(x);if(x.options.moveInputWithCursor){var ie=ha(x,ne.sel.primary().head,"div"),ue=z.wrapper.getBoundingClientRect(),me=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+me.top-ue.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+me.left-ue.left))}return te},eo.prototype.showSelection=function(x){var z=this.cm,ne=z.display;Pt(ne.cursorDiv,x.cursors),Pt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},eo.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&&Rn(this.textarea),be&&Se>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",be&&Se>=9&&(this.hasSelection=null))}},eo.prototype.getField=function(){return this.textarea},eo.prototype.supportsTouch=function(){return!1},eo.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Ye||Dt()!=this.textarea))try{this.textarea.focus()}catch(x){}},eo.prototype.blur=function(){this.textarea.blur()},eo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},eo.prototype.receivedFocus=function(){this.slowPoll()},eo.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},eo.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)},eo.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||En(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&&Se>=9&&this.hasSelection===ie||De&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var ue=ie.charCodeAt(0);if(ue==8203&&!te&&(te="\u200B"),ue==8666)return this.reset(),this.cm.execCommand("undo")}for(var me=0,Ce=Math.min(te.length,ie.length);me<Ce&&te.charCodeAt(me)==ie.charCodeAt(me);)++me;return ga(z,function(){pd(z,ie.slice(me),te.length-me,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},eo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},eo.prototype.onKeyPress=function(){be&&Se>=9&&(this.hasSelection=null),this.fastPoll()},eo.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var ue=Ao(ne,x),me=te.scroller.scrollTop;if(!ue||Te)return;var Ce=ne.options.resetSelectionOnContextMenu;Ce&&ne.doc.sel.contains(ue)==-1&&za(ne,To)(ne.doc,Ps(ue),Je);var Ae=ie.style.cssText,Oe=z.wrapper.style.cssText,ct=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(x.clientY-ct.top-5)+"px; left: "+(x.clientX-ct.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 Mt;Me&&(Mt=window.scrollY),te.input.focus(),Me&&window.scrollTo(null,Mt),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=qt,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function ln(){if(ie.selectionStart!=null){var dr=ne.somethingSelected(),Ar="\u200B"+(dr?ie.value:"");ie.value="\u21DA",ie.value=Ar,z.prevInput=dr?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=Ar.length,te.selForContextMenu=ne.doc.sel}}function qt(){if(z.contextMenuPending==qt&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Oe,ie.style.cssText=Ae,be&&Se<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=me),ie.selectionStart!=null)){(!be||be&&Se<9)&&ln();var dr=0,Ar=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?za(ne,td)(ne):dr++<10?te.detectingSelectAll=setTimeout(Ar,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(Ar,200)}}if(be&&Se>=9&&ln(),Ie){Xr(x);var Xn=function(){hi(window,"mouseup",Xn),setTimeout(qt,20)};$n(window,"mouseup",Xn)}else setTimeout(qt,50)},eo.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},eo.prototype.setUneditable=function(){},eo.prototype.needsContentAttribute=!1;function Hl(x,z){if(z=z?yr(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=Dt();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Ce.getValue()}var ie;if(x.form&&($n(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var ue=x.form;ie=ue.submit;try{var me=ue.submit=function(){te(),ue.submit=ie,ue.submit(),ue.submit=me}}catch(Ae){}}z.finishInit=function(Ae){Ae.save=te,Ae.getTextArea=function(){return x},Ae.toTextArea=function(){Ae.toTextArea=isNaN,te(),x.parentNode.removeChild(Ae.getWrapperElement()),x.style.display="",x.form&&(hi(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Ce=ra(function(Ae){return x.parentNode.insertBefore(Ae,x.nextSibling)},z);return Ce}function cu(x){x.off=hi,x.on=$n,x.wheelEventPixels=Gc,x.Doc=Eo,x.splitLines=gt,x.countColumn=Qe,x.findColumn=en,x.isWordChar=ye,x.Pass=gn,x.signal=ut,x.Line=Pn,x.changeEnd=Js,x.scrollbarModel=ql,x.Pos=tt,x.cmpPos=vt,x.modes=tr,x.mimeModes=pr,x.resolveMode=at,x.getMode=Et,x.modeExtensions=jt,x.extendMode=Ke,x.copyState=dt,x.startState=Tt,x.innerMode=Rt,x.commands=au,x.keyMap=Qa,x.keyName=zl,x.isModifierKey=Du,x.lookupKey=rl,x.normalizeKeyMap=od,x.StringStream=Wt,x.SharedTextMarker=ya,x.TextMarker=hl,x.LineWidget=nu,x.e_preventDefault=Ir,x.e_stopPropagation=Ur,x.e_stop=Xr,x.addClass=Ln,x.contains=Ht,x.rmClass=je,x.keyNames=Os}oh(ra),yd(ra);var ol="iter insert remove copy getEditor constructor".split(" ");for(var _s in Eo.prototype)Eo.prototype.hasOwnProperty(_s)&&Nt(ol,_s)<0&&(ra.prototype[_s]=function(x){return function(){return x.apply(this.doc,arguments)}}(Eo.prototype[_s]));return gr(Eo),ra.inputStyles={textarea:eo,contenteditable:qa},ra.defineMode=function(x){!ra.defaults.mode&&x!="null"&&(ra.defaults.mode=x),Hn.apply(this,arguments)},ra.defineMIME=Ze,ra.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),ra.defineMIME("text/plain","null"),ra.defineExtension=function(x,z){ra.prototype[x]=z},ra.defineDocExtension=function(x,z){Eo.prototype[x]=z},ra.fromTextArea=Hl,cu(ra),ra.version="5.58.2",ra})},49047:function(Cn,Xt,se){(function(fe){fe(se(4631),se(29589),se(52539))})(function(fe){"use strict";fe.defineMode("markdown",function(et,$e){var Ue=fe.getMode(et,"text/html"),be=Ue.name=="null";function Se(Qe){if(fe.findModeByName){var Le=fe.findModeByName(Qe);Le&&(Qe=Le.mime||Le.mimes[0])}var Nt=fe.getMode(et,Qe);return Nt.name=="null"?null:Nt}$e.highlightFormatting===void 0&&($e.highlightFormatting=!1),$e.maxBlockquoteDepth===void 0&&($e.maxBlockquoteDepth=0),$e.taskLists===void 0&&($e.taskLists=!1),$e.strikethrough===void 0&&($e.strikethrough=!1),$e.emoji===void 0&&($e.emoji=!1),$e.fencedCodeBlockHighlighting===void 0&&($e.fencedCodeBlockHighlighting=!0),$e.fencedCodeBlockDefaultMode===void 0&&($e.fencedCodeBlockDefaultMode="text/plain"),$e.xml===void 0&&($e.xml=!0),$e.tokenTypeOverrides===void 0&&($e.tokenTypeOverrides={});var Me={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 xe in Me)Me.hasOwnProperty(xe)&&$e.tokenTypeOverrides[xe]&&(Me[xe]=$e.tokenTypeOverrides[xe]);var pe=/^([*\-_])(?:\s*\1){2,}\s*$/,Te=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,mt=/^\[(x| )\](?=\s)/i,ze=$e.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,It=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Ct=/^[^#!\[\]*_\\<>` "'(~:]+/,ht=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Ye=/^\s*\[[^\]]+?\]:.*$/,De=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,At=" ";function Jt(Qe,Le,Nt){return Le.f=Le.inline=Nt,Nt(Qe,Le)}function nt(Qe,Le,Nt){return Le.f=Le.block=Nt,Nt(Qe,Le)}function lt(Qe){return!Qe||!/\S/.test(Qe.string)}function Ie(Qe){if(Qe.linkTitle=!1,Qe.linkHref=!1,Qe.linkText=!1,Qe.em=!1,Qe.strong=!1,Qe.strikethrough=!1,Qe.quote=0,Qe.indentedCode=!1,Qe.f==je){var Le=be;if(!Le){var Nt=fe.innerMode(Ue,Qe.htmlState);Le=Nt.mode.name=="xml"&&Nt.state.tagStart===null&&!Nt.state.context&&Nt.state.tokenize.isInText}Le&&(Qe.f=Lt,Qe.block=ke,Qe.htmlState=null)}return Qe.trailingSpace=0,Qe.trailingSpaceNewLine=!1,Qe.prevLine=Qe.thisLine,Qe.thisLine={stream:null},null}function ke(Qe,Le){var Nt=Qe.column()===Le.indentation,Nn=lt(Le.prevLine.stream),gn=Le.indentedCode,Je=Le.prevLine.hr,st=Le.list!==!1,_t=(Le.listStack[Le.listStack.length-1]||0)+3;Le.indentedCode=!1;var en=Le.indentation;if(Le.indentationDiff===null&&(Le.indentationDiff=Le.indentation,st)){for(Le.list=null;en<Le.listStack[Le.listStack.length-1];)Le.listStack.pop(),Le.listStack.length?Le.indentation=Le.listStack[Le.listStack.length-1]:Le.list=!1;Le.list!==!1&&(Le.indentationDiff=en-Le.listStack[Le.listStack.length-1])}var Bt=!Nn&&!Je&&!Le.prevLine.header&&(!st||!gn)&&!Le.prevLine.fencedCodeEnd,Ft=(Le.list===!1||Je||Nn)&&Le.indentation<=_t&&Qe.match(pe),zt=null;if(Le.indentationDiff>=4&&(gn||Le.prevLine.fencedCodeEnd||Le.prevLine.header||Nn))return Qe.skipToEnd(),Le.indentedCode=!0,Me.code;if(Qe.eatSpace())return null;if(Nt&&Le.indentation<=_t&&(zt=Qe.match(ze))&&zt[1].length<=6)return Le.quote=0,Le.header=zt[1].length,Le.thisLine.header=!0,$e.highlightFormatting&&(Le.formatting="header"),Le.f=Le.inline,Pt(Le);if(Le.indentation<=_t&&Qe.eat(">"))return Le.quote=Nt?1:Le.quote+1,$e.highlightFormatting&&(Le.formatting="quote"),Qe.eatSpace(),Pt(Le);if(!Ft&&!Le.setext&&Nt&&Le.indentation<=_t&&(zt=Qe.match(Te))){var Mn=zt[1]?"ol":"ul";return Le.indentation=en+Qe.current().length,Le.list=!0,Le.quote=0,Le.listStack.push(Le.indentation),Le.em=!1,Le.strong=!1,Le.code=!1,Le.strikethrough=!1,$e.taskLists&&Qe.match(mt,!1)&&(Le.taskList=!0),Le.f=Le.inline,$e.highlightFormatting&&(Le.formatting=["list","list-"+Mn]),Pt(Le)}else{if(Nt&&Le.indentation<=_t&&(zt=Qe.match(ht,!0)))return Le.quote=0,Le.fencedEndRE=new RegExp(zt[1]+"+ *$"),Le.localMode=$e.fencedCodeBlockHighlighting&&Se(zt[2]||$e.fencedCodeBlockDefaultMode),Le.localMode&&(Le.localState=fe.startState(Le.localMode)),Le.f=Le.block=Xe,$e.highlightFormatting&&(Le.formatting="code-block"),Le.code=-1,Pt(Le);if(Le.setext||(!Bt||!st)&&!Le.quote&&Le.list===!1&&!Le.code&&!Ft&&!Ye.test(Qe.string)&&(zt=Qe.lookAhead(1))&&(zt=zt.match(It)))return Le.setext?(Le.header=Le.setext,Le.setext=0,Qe.skipToEnd(),$e.highlightFormatting&&(Le.formatting="header")):(Le.header=zt[0].charAt(0)=="="?1:2,Le.setext=Le.header),Le.thisLine.header=!0,Le.f=Le.inline,Pt(Le);if(Ft)return Qe.skipToEnd(),Le.hr=!0,Le.thisLine.hr=!0,Me.hr;if(Qe.peek()==="[")return Jt(Qe,Le,un)}return Jt(Qe,Le,Le.inline)}function je(Qe,Le){var Nt=Ue.token(Qe,Le.htmlState);if(!be){var Nn=fe.innerMode(Ue,Le.htmlState);(Nn.mode.name=="xml"&&Nn.state.tagStart===null&&!Nn.state.context&&Nn.state.tokenize.isInText||Le.md_inside&&Qe.current().indexOf(">")>-1)&&(Le.f=Lt,Le.block=ke,Le.htmlState=null)}return Nt}function Xe(Qe,Le){var Nt=Le.listStack[Le.listStack.length-1]||0,Nn=Le.indentation<Nt,gn=Nt+3;if(Le.fencedEndRE&&Le.indentation<=gn&&(Nn||Qe.match(Le.fencedEndRE))){$e.highlightFormatting&&(Le.formatting="code-block");var Je;return Nn||(Je=Pt(Le)),Le.localMode=Le.localState=null,Le.block=ke,Le.f=Lt,Le.fencedEndRE=null,Le.code=0,Le.thisLine.fencedCodeEnd=!0,Nn?nt(Qe,Le,Le.block):Je}else return Le.localMode?Le.localMode.token(Qe,Le.localState):(Qe.skipToEnd(),Me.code)}function Pt(Qe){var Le=[];if(Qe.formatting){Le.push(Me.formatting),typeof Qe.formatting=="string"&&(Qe.formatting=[Qe.formatting]);for(var Nt=0;Nt<Qe.formatting.length;Nt++)Le.push(Me.formatting+"-"+Qe.formatting[Nt]),Qe.formatting[Nt]==="header"&&Le.push(Me.formatting+"-"+Qe.formatting[Nt]+"-"+Qe.header),Qe.formatting[Nt]==="quote"&&(!$e.maxBlockquoteDepth||$e.maxBlockquoteDepth>=Qe.quote?Le.push(Me.formatting+"-"+Qe.formatting[Nt]+"-"+Qe.quote):Le.push("error"))}if(Qe.taskOpen)return Le.push("meta"),Le.length?Le.join(" "):null;if(Qe.taskClosed)return Le.push("property"),Le.length?Le.join(" "):null;if(Qe.linkHref?Le.push(Me.linkHref,"url"):(Qe.strong&&Le.push(Me.strong),Qe.em&&Le.push(Me.em),Qe.strikethrough&&Le.push(Me.strikethrough),Qe.emoji&&Le.push(Me.emoji),Qe.linkText&&Le.push(Me.linkText),Qe.code&&Le.push(Me.code),Qe.image&&Le.push(Me.image),Qe.imageAltText&&Le.push(Me.imageAltText,"link"),Qe.imageMarker&&Le.push(Me.imageMarker)),Qe.header&&Le.push(Me.header,Me.header+"-"+Qe.header),Qe.quote&&(Le.push(Me.quote),!$e.maxBlockquoteDepth||$e.maxBlockquoteDepth>=Qe.quote?Le.push(Me.quote+"-"+Qe.quote):Le.push(Me.quote+"-"+$e.maxBlockquoteDepth)),Qe.list!==!1){var Nn=(Qe.listStack.length-1)%3;Nn?Nn===1?Le.push(Me.list2):Le.push(Me.list3):Le.push(Me.list1)}return Qe.trailingSpaceNewLine?Le.push("trailing-space-new-line"):Qe.trailingSpace&&Le.push("trailing-space-"+(Qe.trailingSpace%2?"a":"b")),Le.length?Le.join(" "):null}function kt(Qe,Le){if(Qe.match(Ct,!0))return Pt(Le)}function Lt(Qe,Le){var Nt=Le.text(Qe,Le);if(typeof Nt!="undefined")return Nt;if(Le.list)return Le.list=null,Pt(Le);if(Le.taskList){var Nn=Qe.match(mt,!0)[1]===" ";return Nn?Le.taskOpen=!0:Le.taskClosed=!0,$e.highlightFormatting&&(Le.formatting="task"),Le.taskList=!1,Pt(Le)}if(Le.taskOpen=!1,Le.taskClosed=!1,Le.header&&Qe.match(/^#+$/,!0))return $e.highlightFormatting&&(Le.formatting="header"),Pt(Le);var gn=Qe.next();if(Le.linkTitle){Le.linkTitle=!1;var Je=gn;gn==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var st="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(Qe.match(new RegExp(st),!0))return Me.linkHref}if(gn==="`"){var _t=Le.formatting;$e.highlightFormatting&&(Le.formatting="code"),Qe.eatWhile("`");var en=Qe.current().length;if(Le.code==0&&(!Le.quote||en==1))return Le.code=en,Pt(Le);if(en==Le.code){var Bt=Pt(Le);return Le.code=0,Bt}else return Le.formatting=_t,Pt(Le)}else if(Le.code)return Pt(Le);if(gn==="\\"&&(Qe.next(),$e.highlightFormatting)){var Ft=Pt(Le),zt=Me.formatting+"-escape";return Ft?Ft+" "+zt:zt}if(gn==="!"&&Qe.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Le.imageMarker=!0,Le.image=!0,$e.highlightFormatting&&(Le.formatting="image"),Pt(Le);if(gn==="["&&Le.imageMarker&&Qe.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Le.imageMarker=!1,Le.imageAltText=!0,$e.highlightFormatting&&(Le.formatting="image"),Pt(Le);if(gn==="]"&&Le.imageAltText){$e.highlightFormatting&&(Le.formatting="image");var Ft=Pt(Le);return Le.imageAltText=!1,Le.image=!1,Le.inline=Le.f=Ht,Ft}if(gn==="["&&!Le.image)return Le.linkText&&Qe.match(/^.*?\]/)||(Le.linkText=!0,$e.highlightFormatting&&(Le.formatting="link")),Pt(Le);if(gn==="]"&&Le.linkText){$e.highlightFormatting&&(Le.formatting="link");var Ft=Pt(Le);return Le.linkText=!1,Le.inline=Le.f=Qe.match(/\(.*?\)| ?\[.*?\]/,!1)?Ht:Lt,Ft}if(gn==="<"&&Qe.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Le.f=Le.inline=Ge,$e.highlightFormatting&&(Le.formatting="link");var Ft=Pt(Le);return Ft?Ft+=" ":Ft="",Ft+Me.linkInline}if(gn==="<"&&Qe.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Le.f=Le.inline=Ge,$e.highlightFormatting&&(Le.formatting="link");var Ft=Pt(Le);return Ft?Ft+=" ":Ft="",Ft+Me.linkEmail}if($e.xml&&gn==="<"&&Qe.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Mn=Qe.string.indexOf(">",Qe.pos);if(Mn!=-1){var bn=Qe.string.substring(Qe.start,Mn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(bn)&&(Le.md_inside=!0)}return Qe.backUp(1),Le.htmlState=fe.startState(Ue),nt(Qe,Le,je)}if($e.xml&&gn==="<"&&Qe.match(/^\/\w*?>/))return Le.md_inside=!1,"tag";if(gn==="*"||gn==="_"){for(var Ee=1,ce=Qe.pos==1?" ":Qe.string.charAt(Qe.pos-2);Ee<3&&Qe.eat(gn);)Ee++;var le=Qe.peek()||" ",ye=!/\s/.test(le)&&(!De.test(le)||/\s/.test(ce)||De.test(ce)),ve=!/\s/.test(ce)&&(!De.test(ce)||/\s/.test(le)||De.test(le)),oe=null,He=null;if(Ee%2&&(!Le.em&&ye&&(gn==="*"||!ve||De.test(ce))?oe=!0:Le.em==gn&&ve&&(gn==="*"||!ye||De.test(le))&&(oe=!1)),Ee>1&&(!Le.strong&&ye&&(gn==="*"||!ve||De.test(ce))?He=!0:Le.strong==gn&&ve&&(gn==="*"||!ye||De.test(le))&&(He=!1)),He!=null||oe!=null){$e.highlightFormatting&&(Le.formatting=oe==null?"strong":He==null?"em":"strong em"),oe===!0&&(Le.em=gn),He===!0&&(Le.strong=gn);var Bt=Pt(Le);return oe===!1&&(Le.em=!1),He===!1&&(Le.strong=!1),Bt}}else if(gn===" "&&(Qe.eat("*")||Qe.eat("_"))){if(Qe.peek()===" ")return Pt(Le);Qe.backUp(1)}if($e.strikethrough){if(gn==="~"&&Qe.eatWhile(gn)){if(Le.strikethrough){$e.highlightFormatting&&(Le.formatting="strikethrough");var Bt=Pt(Le);return Le.strikethrough=!1,Bt}else if(Qe.match(/^[^\s]/,!1))return Le.strikethrough=!0,$e.highlightFormatting&&(Le.formatting="strikethrough"),Pt(Le)}else if(gn===" "&&Qe.match(/^~~/,!0)){if(Qe.peek()===" ")return Pt(Le);Qe.backUp(2)}}if($e.emoji&&gn===":"&&Qe.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Le.emoji=!0,$e.highlightFormatting&&(Le.formatting="emoji");var xt=Pt(Le);return Le.emoji=!1,xt}return gn===" "&&(Qe.match(/^ +$/,!1)?Le.trailingSpace++:Le.trailingSpace&&(Le.trailingSpaceNewLine=!0)),Pt(Le)}function Ge(Qe,Le){var Nt=Qe.next();if(Nt===">"){Le.f=Le.inline=Lt,$e.highlightFormatting&&(Le.formatting="link");var Nn=Pt(Le);return Nn?Nn+=" ":Nn="",Nn+Me.linkInline}return Qe.match(/^[^>]+/,!0),Me.linkInline}function Ht(Qe,Le){if(Qe.eatSpace())return null;var Nt=Qe.next();return Nt==="("||Nt==="["?(Le.f=Le.inline=Ln(Nt==="("?")":"]"),$e.highlightFormatting&&(Le.formatting="link-string"),Le.linkHref=!0,Pt(Le)):"error"}var Dt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Ln(Qe){return function(Le,Nt){var Nn=Le.next();if(Nn===Qe){Nt.f=Nt.inline=Lt,$e.highlightFormatting&&(Nt.formatting="link-string");var gn=Pt(Nt);return Nt.linkHref=!1,gn}return Le.match(Dt[Qe]),Nt.linkHref=!0,Pt(Nt)}}function un(Qe,Le){return Qe.match(/^([^\]\\]|\\.)*\]:/,!1)?(Le.f=Rn,Qe.next(),$e.highlightFormatting&&(Le.formatting="link"),Le.linkText=!0,Pt(Le)):Jt(Qe,Le,Lt)}function Rn(Qe,Le){if(Qe.match(/^\]:/,!0)){Le.f=Le.inline=ir,$e.highlightFormatting&&(Le.formatting="link");var Nt=Pt(Le);return Le.linkText=!1,Nt}return Qe.match(/^([^\]\\]|\\.)+/,!0),Me.linkText}function ir(Qe,Le){return Qe.eatSpace()?null:(Qe.match(/^[^\s]+/,!0),Qe.peek()===void 0?Le.linkTitle=!0:Qe.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Le.f=Le.inline=Lt,Me.linkHref+" url")}var yr={startState:function(){return{f:ke,prevLine:{stream:null},thisLine:{stream:null},block:ke,htmlState:null,indentation:0,inline:Lt,text:kt,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(Qe){return{f:Qe.f,prevLine:Qe.prevLine,thisLine:Qe.thisLine,block:Qe.block,htmlState:Qe.htmlState&&fe.copyState(Ue,Qe.htmlState),indentation:Qe.indentation,localMode:Qe.localMode,localState:Qe.localMode?fe.copyState(Qe.localMode,Qe.localState):null,inline:Qe.inline,text:Qe.text,formatting:!1,linkText:Qe.linkText,linkTitle:Qe.linkTitle,linkHref:Qe.linkHref,code:Qe.code,em:Qe.em,strong:Qe.strong,strikethrough:Qe.strikethrough,emoji:Qe.emoji,header:Qe.header,setext:Qe.setext,hr:Qe.hr,taskList:Qe.taskList,list:Qe.list,listStack:Qe.listStack.slice(0),quote:Qe.quote,indentedCode:Qe.indentedCode,trailingSpace:Qe.trailingSpace,trailingSpaceNewLine:Qe.trailingSpaceNewLine,md_inside:Qe.md_inside,fencedEndRE:Qe.fencedEndRE}},token:function(Qe,Le){if(Le.formatting=!1,Qe!=Le.thisLine.stream){if(Le.header=0,Le.hr=!1,Qe.match(/^\s*$/,!0))return Ie(Le),null;if(Le.prevLine=Le.thisLine,Le.thisLine={stream:Qe},Le.taskList=!1,Le.trailingSpace=0,Le.trailingSpaceNewLine=!1,!Le.localState&&(Le.f=Le.block,Le.f!=je)){var Nt=Qe.match(/^\s*/,!0)[0].replace(/\t/g,At).length;if(Le.indentation=Nt,Le.indentationDiff=null,Nt>0)return null}}return Le.f(Qe,Le)},innerMode:function(Qe){return Qe.block==je?{state:Qe.htmlState,mode:Ue}:Qe.localState?{state:Qe.localState,mode:Qe.localMode}:{state:Qe,mode:yr}},indent:function(Qe,Le,Nt){return Qe.block==je&&Ue.indent?Ue.indent(Qe.htmlState,Le,Nt):Qe.localState&&Qe.localMode.indent?Qe.localMode.indent(Qe.localState,Le,Nt):fe.Pass},blankLine:Ie,getType:Pt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return yr},"xml"),fe.defineMIME("text/markdown","markdown"),fe.defineMIME("text/x-markdown","markdown")})},52539:function(Cn,Xt,se){(function(fe){fe(se(4631))})(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 et=0;et<fe.modeInfo.length;et++){var $e=fe.modeInfo[et];$e.mimes&&($e.mime=$e.mimes[0])}fe.findModeByMIME=function(Ue){Ue=Ue.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Se=fe.modeInfo[be];if(Se.mime==Ue)return Se;if(Se.mimes){for(var Me=0;Me<Se.mimes.length;Me++)if(Se.mimes[Me]==Ue)return Se}}if(/\+xml$/.test(Ue))return fe.findModeByMIME("application/xml");if(/\+json$/.test(Ue))return fe.findModeByMIME("application/json")},fe.findModeByExtension=function(Ue){Ue=Ue.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Se=fe.modeInfo[be];if(Se.ext){for(var Me=0;Me<Se.ext.length;Me++)if(Se.ext[Me]==Ue)return Se}}},fe.findModeByFileName=function(Ue){for(var be=0;be<fe.modeInfo.length;be++){var Se=fe.modeInfo[be];if(Se.file&&Se.file.test(Ue))return Se}var Me=Ue.lastIndexOf("."),xe=Me>-1&&Ue.substring(Me+1,Ue.length);if(xe)return fe.findModeByExtension(xe)},fe.findModeByName=function(Ue){Ue=Ue.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Se=fe.modeInfo[be];if(Se.name.toLowerCase()==Ue)return Se;if(Se.alias){for(var Me=0;Me<Se.alias.length;Me++)if(Se.alias[Me].toLowerCase()==Ue)return Se}}}})},80785:function(Cn,Xt,se){(function(fe){fe(se(4631))})(function(fe){"use strict";fe.defineMode("stex",function(et,$e){"use strict";function Ue(Ct,ht){Ct.cmdState.push(ht)}function be(Ct){return Ct.cmdState.length>0?Ct.cmdState[Ct.cmdState.length-1]:null}function Se(Ct){var ht=Ct.cmdState.pop();ht&&ht.closeBracket()}function Me(Ct){for(var ht=Ct.cmdState,Ye=ht.length-1;Ye>=0;Ye--){var De=ht[Ye];if(De.name!="DEFAULT")return De}return{styleIdentifier:function(){return null}}}function xe(Ct,ht,Ye){return function(){this.name=Ct,this.bracketNo=0,this.style=ht,this.styles=Ye,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var pe={};pe.importmodule=xe("importmodule","tag",["string","builtin"]),pe.documentclass=xe("documentclass","tag",["","atom"]),pe.usepackage=xe("usepackage","tag",["atom"]),pe.begin=xe("begin","tag",["atom"]),pe.end=xe("end","tag",["atom"]),pe.label=xe("label","tag",["atom"]),pe.ref=xe("ref","tag",["atom"]),pe.eqref=xe("eqref","tag",["atom"]),pe.cite=xe("cite","tag",["atom"]),pe.bibitem=xe("bibitem","tag",["atom"]),pe.Bibitem=xe("Bibitem","tag",["atom"]),pe.RBibitem=xe("RBibitem","tag",["atom"]),pe.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Te(Ct,ht){Ct.f=ht}function mt(Ct,ht){var Ye;if(Ct.match(/^\\[a-zA-Z@]+/)){var De=Ct.current().slice(1);return Ye=pe.hasOwnProperty(De)?pe[De]:pe.DEFAULT,Ye=new Ye,Ue(ht,Ye),Te(ht,It),Ye.style}if(Ct.match(/^\\[$&%#{}_]/)||Ct.match(/^\\[,;!\/\\]/))return"tag";if(Ct.match("\\["))return Te(ht,function(Jt,nt){return ze(Jt,nt,"\\]")}),"keyword";if(Ct.match("\\("))return Te(ht,function(Jt,nt){return ze(Jt,nt,"\\)")}),"keyword";if(Ct.match("$$"))return Te(ht,function(Jt,nt){return ze(Jt,nt,"$$")}),"keyword";if(Ct.match("$"))return Te(ht,function(Jt,nt){return ze(Jt,nt,"$")}),"keyword";var At=Ct.next();if(At=="%")return Ct.skipToEnd(),"comment";if(At=="}"||At=="]"){if(Ye=be(ht),Ye)Ye.closeBracket(At),Te(ht,It);else return"error";return"bracket"}else return At=="{"||At=="["?(Ye=pe.DEFAULT,Ye=new Ye,Ue(ht,Ye),"bracket"):/\d/.test(At)?(Ct.eatWhile(/[\w.%]/),"atom"):(Ct.eatWhile(/[\w\-_]/),Ye=Me(ht),Ye.name=="begin"&&(Ye.argument=Ct.current()),Ye.styleIdentifier())}function ze(Ct,ht,Ye){if(Ct.eatSpace())return null;if(Ye&&Ct.match(Ye))return Te(ht,mt),"keyword";if(Ct.match(/^\\[a-zA-Z@]+/))return"tag";if(Ct.match(/^[a-zA-Z]+/))return"variable-2";if(Ct.match(/^\\[$&%#{}_]/)||Ct.match(/^\\[,;!\/]/)||Ct.match(/^[\^_&]/))return"tag";if(Ct.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Ct.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var De=Ct.next();return De=="{"||De=="}"||De=="["||De=="]"||De=="("||De==")"?"bracket":De=="%"?(Ct.skipToEnd(),"comment"):"error"}function It(Ct,ht){var Ye=Ct.peek(),De;return Ye=="{"||Ye=="["?(De=be(ht),De.openBracket(Ye),Ct.eat(Ye),Te(ht,mt),"bracket"):/[ \t\r]/.test(Ye)?(Ct.eat(Ye),null):(Te(ht,mt),Se(ht),mt(Ct,ht))}return{startState:function(){var Ct=$e.inMathMode?function(ht,Ye){return ze(ht,Ye)}:mt;return{cmdState:[],f:Ct}},copyState:function(Ct){return{cmdState:Ct.cmdState.slice(),f:Ct.f}},token:function(Ct,ht){return ht.f(Ct,ht)},blankLine:function(Ct){Ct.f=mt,Ct.cmdState.length=0},lineComment:"%"}}),fe.defineMIME("text/x-stex","stex"),fe.defineMIME("text/x-latex","stex")})},29589:function(Cn,Xt,se){(function(fe){fe(se(4631))})(function(fe){"use strict";var et={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},$e={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};fe.defineMode("xml",function(Ue,be){var Se=Ue.indentUnit,Me={},xe=be.htmlMode?et:$e;for(var pe in xe)Me[pe]=xe[pe];for(var pe in be)Me[pe]=be[pe];var Te,mt;function ze(Ge,Ht){function Dt(Rn){return Ht.tokenize=Rn,Rn(Ge,Ht)}var Ln=Ge.next();if(Ln=="<")return Ge.eat("!")?Ge.eat("[")?Ge.match("CDATA[")?Dt(ht("atom","]]>")):null:Ge.match("--")?Dt(ht("comment","-->")):Ge.match("DOCTYPE",!0,!0)?(Ge.eatWhile(/[\w\._\-]/),Dt(Ye(1))):null:Ge.eat("?")?(Ge.eatWhile(/[\w\._\-]/),Ht.tokenize=ht("meta","?>"),"meta"):(Te=Ge.eat("/")?"closeTag":"openTag",Ht.tokenize=It,"tag bracket");if(Ln=="&"){var un;return Ge.eat("#")?Ge.eat("x")?un=Ge.eatWhile(/[a-fA-F\d]/)&&Ge.eat(";"):un=Ge.eatWhile(/[\d]/)&&Ge.eat(";"):un=Ge.eatWhile(/[\w\.\-:]/)&&Ge.eat(";"),un?"atom":"error"}else return Ge.eatWhile(/[^&<]/),null}ze.isInText=!0;function It(Ge,Ht){var Dt=Ge.next();if(Dt==">"||Dt=="/"&&Ge.eat(">"))return Ht.tokenize=ze,Te=Dt==">"?"endTag":"selfcloseTag","tag bracket";if(Dt=="=")return Te="equals",null;if(Dt=="<"){Ht.tokenize=ze,Ht.state=nt,Ht.tagName=Ht.tagStart=null;var Ln=Ht.tokenize(Ge,Ht);return Ln?Ln+" tag error":"tag error"}else return/[\'\"]/.test(Dt)?(Ht.tokenize=Ct(Dt),Ht.stringStartCol=Ge.column(),Ht.tokenize(Ge,Ht)):(Ge.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ct(Ge){var Ht=function(Dt,Ln){for(;!Dt.eol();)if(Dt.next()==Ge){Ln.tokenize=It;break}return"string"};return Ht.isInAttribute=!0,Ht}function ht(Ge,Ht){return function(Dt,Ln){for(;!Dt.eol();){if(Dt.match(Ht)){Ln.tokenize=ze;break}Dt.next()}return Ge}}function Ye(Ge){return function(Ht,Dt){for(var Ln;(Ln=Ht.next())!=null;){if(Ln=="<")return Dt.tokenize=Ye(Ge+1),Dt.tokenize(Ht,Dt);if(Ln==">")if(Ge==1){Dt.tokenize=ze;break}else return Dt.tokenize=Ye(Ge-1),Dt.tokenize(Ht,Dt)}return"meta"}}function De(Ge,Ht,Dt){this.prev=Ge.context,this.tagName=Ht,this.indent=Ge.indented,this.startOfLine=Dt,(Me.doNotIndent.hasOwnProperty(Ht)||Ge.context&&Ge.context.noIndent)&&(this.noIndent=!0)}function At(Ge){Ge.context&&(Ge.context=Ge.context.prev)}function Jt(Ge,Ht){for(var Dt;;){if(!Ge.context||(Dt=Ge.context.tagName,!Me.contextGrabbers.hasOwnProperty(Dt)||!Me.contextGrabbers[Dt].hasOwnProperty(Ht)))return;At(Ge)}}function nt(Ge,Ht,Dt){return Ge=="openTag"?(Dt.tagStart=Ht.column(),lt):Ge=="closeTag"?Ie:nt}function lt(Ge,Ht,Dt){return Ge=="word"?(Dt.tagName=Ht.current(),mt="tag",Xe):Me.allowMissingTagName&&Ge=="endTag"?(mt="tag bracket",Xe(Ge,Ht,Dt)):(mt="error",lt)}function Ie(Ge,Ht,Dt){if(Ge=="word"){var Ln=Ht.current();return Dt.context&&Dt.context.tagName!=Ln&&Me.implicitlyClosed.hasOwnProperty(Dt.context.tagName)&&At(Dt),Dt.context&&Dt.context.tagName==Ln||Me.matchClosing===!1?(mt="tag",ke):(mt="tag error",je)}else return Me.allowMissingTagName&&Ge=="endTag"?(mt="tag bracket",ke(Ge,Ht,Dt)):(mt="error",je)}function ke(Ge,Ht,Dt){return Ge!="endTag"?(mt="error",ke):(At(Dt),nt)}function je(Ge,Ht,Dt){return mt="error",ke(Ge,Ht,Dt)}function Xe(Ge,Ht,Dt){if(Ge=="word")return mt="attribute",Pt;if(Ge=="endTag"||Ge=="selfcloseTag"){var Ln=Dt.tagName,un=Dt.tagStart;return Dt.tagName=Dt.tagStart=null,Ge=="selfcloseTag"||Me.autoSelfClosers.hasOwnProperty(Ln)?Jt(Dt,Ln):(Jt(Dt,Ln),Dt.context=new De(Dt,Ln,un==Dt.indented)),nt}return mt="error",Xe}function Pt(Ge,Ht,Dt){return Ge=="equals"?kt:(Me.allowMissing||(mt="error"),Xe(Ge,Ht,Dt))}function kt(Ge,Ht,Dt){return Ge=="string"?Lt:Ge=="word"&&Me.allowUnquoted?(mt="string",Xe):(mt="error",Xe(Ge,Ht,Dt))}function Lt(Ge,Ht,Dt){return Ge=="string"?Lt:Xe(Ge,Ht,Dt)}return{startState:function(Ge){var Ht={tokenize:ze,state:nt,indented:Ge||0,tagName:null,tagStart:null,context:null};return Ge!=null&&(Ht.baseIndent=Ge),Ht},token:function(Ge,Ht){if(!Ht.tagName&&Ge.sol()&&(Ht.indented=Ge.indentation()),Ge.eatSpace())return null;Te=null;var Dt=Ht.tokenize(Ge,Ht);return(Dt||Te)&&Dt!="comment"&&(mt=null,Ht.state=Ht.state(Te||Dt,Ge,Ht),mt&&(Dt=mt=="error"?Dt+" error":mt)),Dt},indent:function(Ge,Ht,Dt){var Ln=Ge.context;if(Ge.tokenize.isInAttribute)return Ge.tagStart==Ge.indented?Ge.stringStartCol+1:Ge.indented+Se;if(Ln&&Ln.noIndent)return fe.Pass;if(Ge.tokenize!=It&&Ge.tokenize!=ze)return Dt?Dt.match(/^(\s*)/)[0].length:0;if(Ge.tagName)return Me.multilineTagIndentPastTag!==!1?Ge.tagStart+Ge.tagName.length+2:Ge.tagStart+Se*(Me.multilineTagIndentFactor||1);if(Me.alignCDATA&&/<!\[CDATA\[/.test(Ht))return 0;var un=Ht&&/^<(\/)?([\w_:\.-]*)/.exec(Ht);if(un&&un[1])for(;Ln;)if(Ln.tagName==un[2]){Ln=Ln.prev;break}else if(Me.implicitlyClosed.hasOwnProperty(Ln.tagName))Ln=Ln.prev;else break;else if(un)for(;Ln;){var Rn=Me.contextGrabbers[Ln.tagName];if(Rn&&Rn.hasOwnProperty(un[2]))Ln=Ln.prev;else break}for(;Ln&&Ln.prev&&!Ln.startOfLine;)Ln=Ln.prev;return Ln?Ln.indent+Se:Ge.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Me.htmlMode?"html":"xml",helperType:Me.htmlMode?"html":"xml",skipAttribute:function(Ge){Ge.state==kt&&(Ge.state=Xe)},xmlCurrentTag:function(Ge){return Ge.tagName?{name:Ge.tagName,close:Ge.type=="closeTag"}:null},xmlCurrentContext:function(Ge){for(var Ht=[],Dt=Ge.context;Dt;Dt=Dt.prev)Dt.tagName&&Ht.push(Dt.tagName);return Ht.reverse()}}}),fe.defineMIME("text/xml","xml"),fe.defineMIME("application/xml","xml"),fe.mimeModes.hasOwnProperty("text/html")||fe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},15979:function(Cn,Xt,se){"use strict";se.d(Xt,{hP:function(){return bn}});var fe=function(Ee,ce){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(le,ye){le.__proto__=ye}||function(le,ye){for(var ve in ye)Object.prototype.hasOwnProperty.call(ye,ve)&&(le[ve]=ye[ve])})(Ee,ce)};function et(Ee,ce){function le(){this.constructor=Ee}fe(Ee,ce),Ee.prototype=ce===null?Object.create(ce):(le.prototype=ce.prototype,new le)}function $e(Ee,ce,le,ye){return new(le||(le=Promise))(function(ve,oe){function He(pn){try{Yt(ye.next(pn))}catch(dn){oe(dn)}}function xt(pn){try{Yt(ye.throw(pn))}catch(dn){oe(dn)}}function Yt(pn){var dn;pn.done?ve(pn.value):(dn=pn.value,dn instanceof le?dn:new le(function(An){An(dn)})).then(He,xt)}Yt((ye=ye.apply(Ee,ce||[])).next())})}function Ue(Ee,ce){var le,ye,ve,oe,He={label:0,sent:function(){if(1&ve[0])throw ve[1];return ve[1]},trys:[],ops:[]};return oe={next:xt(0),throw:xt(1),return:xt(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function xt(Yt){return function(pn){return function(dn){if(le)throw new TypeError("Generator is already executing.");for(;He;)try{if(le=1,ye&&(ve=2&dn[0]?ye.return:dn[0]?ye.throw||((ve=ye.return)&&ve.call(ye),0):ye.next)&&!(ve=ve.call(ye,dn[1])).done)return ve;switch(ye=0,ve&&(dn=[2&dn[0],ve.value]),dn[0]){case 0:case 1:ve=dn;break;case 4:return He.label++,{value:dn[1],done:!1};case 5:He.label++,ye=dn[1],dn=[0];continue;case 7:dn=He.ops.pop(),He.trys.pop();continue;default:if(ve=He.trys,!((ve=ve.length>0&&ve[ve.length-1])||dn[0]!==6&&dn[0]!==2)){He=0;continue}if(dn[0]===3&&(!ve||dn[1]>ve[0]&&dn[1]<ve[3])){He.label=dn[1];break}if(dn[0]===6&&He.label<ve[1]){He.label=ve[1],ve=dn;break}if(ve&&He.label<ve[2]){He.label=ve[2],He.ops.push(dn);break}ve[2]&&He.ops.pop(),He.trys.pop();continue}dn=ce.call(Ee,He)}catch(An){dn=[6,An],ye=0}finally{le=ve=0}if(5&dn[0])throw dn[1];return{value:dn[0]?dn[1]:void 0,done:!0}}([Yt,pn])}}}function be(){for(var Ee=0,ce=0,le=arguments.length;ce<le;ce++)Ee+=arguments[ce].length;var ye=Array(Ee),ve=0;for(ce=0;ce<le;ce++)for(var oe=arguments[ce],He=0,xt=oe.length;He<xt;He++,ve++)ye[ve]=oe[He];return ye}var Se=function(){function Ee(){}return Ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Ee.setAttributes=function(ce,le){for(var ye=0,ve=le;ye<ve.length;ye++){var oe=ve[ye],He=oe[0],xt=oe[1];ce.setAttribute(He,xt)}},Ee.createRect=function(ce,le,ye){var ve=document.createElementNS("http://www.w3.org/2000/svg","rect");return ve.setAttribute("width",ce.toString()),ve.setAttribute("height",le.toString()),ye&&Ee.setAttributes(ve,ye),ve},Ee.createLine=function(ce,le,ye,ve,oe){var He=document.createElementNS("http://www.w3.org/2000/svg","line");return He.setAttribute("x1",ce.toString()),He.setAttribute("y1",le.toString()),He.setAttribute("x2",ye.toString()),He.setAttribute("y2",ve.toString()),oe&&Ee.setAttributes(He,oe),He},Ee.createPolygon=function(ce,le){var ye=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ye.setAttribute("points",ce),le&&Ee.setAttributes(ye,le),ye},Ee.createCircle=function(ce,le){var ye=document.createElementNS("http://www.w3.org/2000/svg","circle");return ye.setAttribute("cx",(ce/2).toString()),ye.setAttribute("cy",(ce/2).toString()),ye.setAttribute("r",ce.toString()),le&&Ee.setAttributes(ye,le),ye},Ee.createEllipse=function(ce,le,ye){var ve=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ve.setAttribute("cx",(ce/2).toString()),ve.setAttribute("cy",(le/2).toString()),ve.setAttribute("rx",(ce/2).toString()),ve.setAttribute("ry",(le/2).toString()),ye&&Ee.setAttributes(ve,ye),ve},Ee.createGroup=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","g");return ce&&Ee.setAttributes(le,ce),le},Ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Ee.createMarker=function(ce,le,ye,ve,oe,He,xt){var Yt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Ee.setAttributes(Yt,[["id",ce],["orient",le],["markerWidth",ye.toString()],["markerHeight",ve.toString()],["refX",oe.toString()],["refY",He.toString()]]),Yt.appendChild(xt),Yt},Ee.createText=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","text");return le.setAttribute("x","0"),le.setAttribute("y","0"),ce&&Ee.setAttributes(le,ce),le},Ee.createTSpan=function(ce,le){var ye=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ye.textContent=ce,le&&Ee.setAttributes(ye,le),ye},Ee.createImage=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","image");return ce&&Ee.setAttributes(le,ce),le},Ee.createPoint=function(ce,le){var ye=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ye.x=ce,ye.y=le,ye},Ee.createPath=function(ce,le){var ye=document.createElementNS("http://www.w3.org/2000/svg","path");return ye.setAttribute("d",ce),le&&Ee.setAttributes(ye,le),ye},Ee}(),Me=function(){function Ee(){}return Ee.addKey=function(ce){Ee.key=ce},Object.defineProperty(Ee,"isLicensed",{get:function(){return!!Ee.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Ee.key)},enumerable:!1,configurable:!0}),Ee}(),xe=function(){function Ee(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Ee.prototype.rasterize=function(ce,le,ye){var ve=this;return new Promise(function(oe){var He=ye!==void 0?ye:document.createElement("canvas");ce===null&&(ve.markersOnly=!0,ve.naturalSize=!1);var xt=document.createElementNS("http://www.w3.org/2000/svg","svg");xt.setAttribute("xmlns","http://www.w3.org/2000/svg"),xt.setAttribute("width",le.width.baseVal.valueAsString),xt.setAttribute("height",le.height.baseVal.valueAsString),xt.setAttribute("viewBox","0 0 "+le.viewBox.baseVal.width.toString()+" "+le.viewBox.baseVal.height.toString()),xt.innerHTML=le.innerHTML,ve.naturalSize===!0?(xt.width.baseVal.value=ce.naturalWidth,xt.height.baseVal.value=ce.naturalHeight):ve.width!==void 0&&ve.height!==void 0&&(xt.width.baseVal.value=ve.width,xt.height.baseVal.value=ve.height),He.width=xt.width.baseVal.value,He.height=xt.height.baseVal.value;var Yt=xt.outerHTML,pn=He.getContext("2d");ve.markersOnly!==!0&&pn.drawImage(ce,0,0,He.width,He.height);var dn=window.URL,An=new Image(He.width,He.height);An.setAttribute("crossOrigin","anonymous");var tn=new Blob([Yt],{type:"image/svg+xml"}),Nr=dn.createObjectURL(tn);An.onload=function(){pn.drawImage(An,0,0),dn.revokeObjectURL(Nr);var Wr=He.toDataURL(ve.imageType,ve.imageQuality);oe(Wr)},An.src=Nr})},Ee}(),pe=function(){},Te=function(){function Ee(ce){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ce+"_"}return Object.defineProperty(Ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.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(Ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Ee.prototype.addClass=function(ce){return this.styleSheet===void 0&&this.addStyleSheet(),ce.name=""+this.classNamePrefix+ce.localName,this.classes.push(ce),this.styleSheet.sheet.insertRule("."+ce.name+" {"+ce.style+"}",this.styleSheet.sheet.cssRules.length),ce},Ee.prototype.addRule=function(ce){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ce),this.styleSheet.sheet.insertRule(ce.selector+" {"+ce.style+"}",this.styleSheet.sheet.cssRules.length)},Ee.prototype.addStyleSheet=function(){var ce;this.styleSheet=document.createElement("style"),((ce=this.styleSheetRoot)!==null&&ce!==void 0?ce:document.head).appendChild(this.styleSheet),this.addRule(new mt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new ze("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new ze("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},Ee.prototype.removeStyleSheet=function(){var ce;this.styleSheet&&(((ce=this.styleSheetRoot)!==null&&ce!==void 0?ce:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Ee}(),mt=function(Ee,ce){this.selector=Ee,this.style=ce},ze=function(Ee,ce){this.localName=Ee,this.style=ce},It=function(){function Ee(ce,le,ye,ve,oe){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=ce,this.displayMode=le,this.markerItems=ye,this.uiStyleSettings=ve,this.styles=oe,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Ee.prototype.show=function(ce){var le=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ce,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ye=document.createElement("div");ye.className=this.toolbarBlockStyleClass.name,ye.style.whiteSpace="nowrap",this.uiContainer.appendChild(ye),this.addActionButton(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(oe){var He=document.createElement("div");He.className=""+le.toolbarButtonStyleClass.name,He.setAttribute("data-type-name",oe.typeName),He.innerHTML=oe.icon,He.addEventListener("click",function(){le.markerToolbarButtonClicked(He,oe)}),le.buttons.push(He),le.markerButtons.push(He)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ve=document.createElement("div");ve.className=this.toolbarBlockStyleClass.name,ve.style.whiteSpace="nowrap",ve.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ve),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Ee.prototype.addButtonClickListener=function(ce){this.buttonClickListeners.push(ce)},Ee.prototype.removeButtonClickListener=function(ce){this.buttonClickListeners.indexOf(ce)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(ce),1)},Ee.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Ee.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var ce=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var le=0;le<this.markerButtons.length;le++)le<ce||le===ce&&this.markerButtons.length-1===ce?this.markerButtonBlock.appendChild(this.markerButtons[le]):(le===ce&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[le]))}},Ee.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")},Ee.prototype.resetButtonStyles=function(){var ce=this;this.buttons.forEach(function(le){le.className=le.className.replace(ce.uiStyleSettings.toolbarButtonStyleColorsClassName?ce.uiStyleSettings.toolbarButtonStyleColorsClassName:ce.toolbarButtonStyleColorsClass.name,"").trim(),le.className=le.className.replace(ce.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?ce.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:ce.toolbarActiveButtonStyleColorsClass.name,"").trim(),le.className+=" "+(ce.uiStyleSettings.toolbarButtonStyleColorsClassName?ce.uiStyleSettings.toolbarButtonStyleColorsClassName:ce.toolbarButtonStyleColorsClass.name)})},Ee.prototype.addActionButton=function(ce,le,ye){var ve=this,oe=document.createElement("div");switch(oe.className=""+this.toolbarButtonStyleClass.name,oe.innerHTML=le,oe.setAttribute("data-action",ye),oe.addEventListener("click",function(){ve.actionToolbarButtonClicked(oe,ye)}),ye){case"select":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":oe.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":oe.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":oe.style.fill=this.uiStyleSettings.closeButtonColor}ce.appendChild(oe),this.buttons.push(oe)},Ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("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 ze("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("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 ze("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var ce=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*ce)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*ce)+`px;
|
|
|
padding: `+ce+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},Ee.prototype.markerToolbarButtonClicked=function(ce,le){this.setActiveButton(ce),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ye){return ye("marker",le)}),this.markerButtonOverflowBlock.style.display="none"},Ee.prototype.actionToolbarButtonClicked=function(ce,le){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ye){return ye("action",le)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Ee.prototype.setActiveButton=function(ce){this.resetButtonStyles(),ce.className=ce.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),ce.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Ee.prototype.setActiveMarkerButton=function(ce){var le=this.markerButtons.find(function(ye){return ye.getAttribute("data-type-name")===ce});le&&this.setActiveButton(le)},Ee.prototype.setCurrentMarker=function(ce){var le=this;this.currentMarker=ce,this.buttons.filter(function(ye){return/delete|notes/.test(ye.getAttribute("data-action"))}).forEach(function(ye){le.currentMarker===void 0?(ye.style.fillOpacity="0.4",ye.style.pointerEvents="none"):(ye.style.fillOpacity="1",ye.style.pointerEvents="all")})},Ee}(),Ct=function(){function Ee(ce,le,ye,ve){this.panels=[],this.panelButtons=[],this.markerjsContainer=ce,this.displayMode=le,this.uiStyleSettings=ye,this.styles=ve,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Ee.prototype.addStyles=function(){var ce;this.toolboxStyleClass=this.styles.addClass(new ze("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 ze("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var le=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("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 ze("toolbox-panel-row_colors",`
|
|
|
background-color: `+((ce=this.uiStyleSettings.toolboxBackgroundColor)!==null&&ce!==void 0?ce:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
|
|
|
padding: `+le+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new mt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new mt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},Ee.prototype.show=function(ce){var le;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ce,this.uiContainer.className=this.toolboxStyleClass.name+" "+((le=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&le!==void 0?le:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Ee.prototype.setPanelButtons=function(ce){var le,ye,ve=this;this.panels=ce,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((le=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&le!==void 0?le:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ye=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ye!==void 0?ye:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(oe){var He;oe.uiStyleSettings=ve.uiStyleSettings;var xt=document.createElement("div");xt.className=ve.toolboxButtonStyleClass.name+" "+((He=ve.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&He!==void 0?He:ve.toolboxButtonStyleColorsClass.name),xt.innerHTML=oe.icon,xt.title=oe.title,xt.addEventListener("click",function(){ve.panelButtonClick(oe)}),ve.panelButtons.push(xt),ve.buttonRow.appendChild(xt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Ee.prototype.panelButtonClick=function(ce){var le=this,ye=-1;if(ce!==this.activePanel){ye=this.panels.indexOf(ce),this.panelRow.innerHTML="";var ve=ce.getUi();ve.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ve),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=ce}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){le.displayMode==="inline"?le.panelRow.style.display="none":le.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(oe,He){var xt,Yt;oe.className=le.toolboxButtonStyleClass.name+" "+(He===ye?""+((xt=le.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xt!==void 0?xt:le.toolboxActiveButtonStyleColorsClass.name):""+((Yt=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Yt!==void 0?Yt:le.toolboxButtonStyleColorsClass.name))})},Ee}(),ht=function(Ee,ce){this.title=Ee,this.icon=ce},Ye=function(Ee){function ce(le,ye,ve,oe){var He=Ee.call(this,le,oe||'<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 He.colors=[],He.addTransparent=!1,He.colorBoxes=[],He.colors=ye,He.currentColor=ve,He.setCurrentColor=He.setCurrentColor.bind(He),He.getColorBox=He.getColorBox.bind(He),He}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.whiteSpace="nowrap",this.colors.forEach(function(ve){var oe=le.getColorBox(ve);ye.appendChild(oe),le.colorBoxes.push(oe)}),ye},ce.prototype.getColorBox=function(le){var ye=this,ve=this.uiStyleSettings.toolbarHeight/4,oe=this.uiStyleSettings.toolbarHeight-ve,He=document.createElement("div");He.style.display="inline-block",He.style.boxSizing="content-box",He.style.width=oe-2+"px",He.style.height=oe-2+"px",He.style.padding="1px",He.style.marginRight="2px",He.style.marginBottom="2px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderRadius=(oe+2)/2+"px",He.style.borderColor=le===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){ye.setCurrentColor(le,He)});var xt=document.createElement("div");return xt.style.display="inline-block",xt.style.width=oe-2+"px",xt.style.height=oe-2+"px",xt.style.backgroundColor=le,xt.style.borderRadius=oe/2+"px",le==="transparent"&&(xt.style.fill=this.uiStyleSettings.toolboxAccentColor,xt.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),He.appendChild(xt),He},ce.prototype.setCurrentColor=function(le,ye){var ve=this;this.currentColor=le,this.colorBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(le)},ce}(ht),De=function(){function Ee(ce,le,ye){this._state="new",this._isSelected=!1,this._container=ce,this._overlayContainer=le,this.globalSettings=ye,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Ee.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Ee.prototype.ownsTarget=function(ce){return!1},Object.defineProperty(Ee.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Ee.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Ee.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Ee.prototype.pointerDown=function(ce,le){},Ee.prototype.dblClick=function(ce,le){},Ee.prototype.manipulate=function(ce){},Ee.prototype.pointerUp=function(ce){this.stateChanged()},Ee.prototype.dispose=function(){},Ee.prototype.addMarkerVisualToContainer=function(ce){this.container.childNodes.length>0?this.container.insertBefore(ce,this.container.childNodes[0]):this.container.appendChild(ce)},Ee.prototype.getState=function(){return{typeName:Ee.typeName,state:this.state,notes:this.notes}},Ee.prototype.restoreState=function(ce){this._state=ce.state,this.notes=ce.notes},Ee.prototype.scale=function(ce,le){},Ee.prototype.colorChanged=function(ce){this.onColorChanged&&this.onColorChanged(ce),this.stateChanged()},Ee.prototype.fillColorChanged=function(ce){this.onFillColorChanged&&this.onFillColorChanged(ce),this.stateChanged()},Ee.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var ce=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),ce.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(ce)&&this.onStateChanged(this)}},Ee.typeName="MarkerBase",Ee}(),At=function(){function Ee(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Ee.prototype.findGripByVisual=function(ce){return this.topLeft.ownsTarget(ce)?this.topLeft:this.topCenter.ownsTarget(ce)?this.topCenter:this.topRight.ownsTarget(ce)?this.topRight:this.centerLeft.ownsTarget(ce)?this.centerLeft:this.centerRight.ownsTarget(ce)?this.centerRight:this.bottomLeft.ownsTarget(ce)?this.bottomLeft:this.bottomCenter.ownsTarget(ce)?this.bottomCenter:this.bottomRight.ownsTarget(ce)?this.bottomRight:void 0},Ee}(),Jt=function(){function Ee(){this.GRIP_SIZE=10,this.visual=Se.createGroup(),this.visual.appendChild(Se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Ee.prototype.ownsTarget=function(ce){return ce===this.visual||ce===this.visual.childNodes[0]||ce===this.visual.childNodes[1]},Ee}(),nt=function(){function Ee(){}return Ee.toITransformMatrix=function(ce){return{a:ce.a,b:ce.b,c:ce.c,d:ce.d,e:ce.e,f:ce.f}},Ee.toSVGMatrix=function(ce,le){return ce.a=le.a,ce.b=le.b,ce.c=le.c,ce.d=le.d,ce.e=le.e,ce.f=le.f,ce},Ee}(),lt=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.left=0,oe.top=0,oe.width=0,oe.height=0,oe.defaultSize={x:50,y:20},oe.offsetX=0,oe.offsetY=0,oe.rotationAngle=0,oe.CB_DISTANCE=10,oe._suppressMarkerCreateEvent=!1,oe.container.transform.baseVal.appendItem(Se.createTransform()),oe.setupControlBox(),oe}return et(ce,Ee),Object.defineProperty(ce.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"visual",{get:function(){return this._visual},set:function(le){this._visual=le;var ye=Se.createTransform();this._visual.transform.baseVal.appendItem(ye)},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(le){return!!Ee.prototype.ownsTarget.call(this,le)||!!(this.controlGrips.findGripByVisual(le)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(le))},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="new"&&(this.left=le.x,this.top=le.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ve=this.unrotatePoint(le);if(this.manipulationStartX=ve.x,this.manipulationStartY=ve.y,this.offsetX=ve.x-this.left,this.offsetY=ve.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ye),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ye)){this.activeGrip=this.rotatorGrip;var oe=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=oe.x-this.width/2,this.top=oe.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var He=this.container.transform.baseVal.getItem(0);He.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(He,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},ce.prototype.pointerUp=function(le){var ye=this.state;Ee.prototype.pointerUp.call(this,le),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(le),this._state="select",ye==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},ce.prototype.moveVisual=function(le){this.visual.style.transform="translate("+le.x+"px, "+le.y+"px)"},ce.prototype.manipulate=function(le){var ye=this.unrotatePoint(le);this.state==="creating"?this.resize(le):this.state==="move"?(this.left=this.manipulationStartLeft+(ye.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ye.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ye):this.state==="rotate"&&this.rotate(le)},ce.prototype.resize=function(le){var ye=this.manipulationStartLeft,ve=this.manipulationStartWidth,oe=this.manipulationStartTop,He=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ye=this.manipulationStartLeft+le.x-this.manipulationStartX,ve=this.manipulationStartWidth+this.manipulationStartLeft-ye;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ve=this.manipulationStartWidth+le.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:oe=this.manipulationStartTop+le.y-this.manipulationStartY,He=this.manipulationStartHeight+this.manipulationStartTop-oe;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:He=this.manipulationStartHeight+le.y-this.manipulationStartY}ve>=0?(this.left=ye,this.width=ve):(this.left=ye+ve,this.width=-ve),He>=0?(this.top=oe,this.height=He):(this.top=oe+He,this.height=-He),this.setSize()},ce.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},ce.prototype.rotate=function(le){if(Math.abs(le.x-this.centerX)>.1){var ye=Math.sign(le.x-this.centerX);this.rotationAngle=180*Math.atan((le.y-this.centerY)/(le.x-this.centerX))/Math.PI+90*ye,this.applyRotation()}},ce.prototype.applyRotation=function(){var le=this.container.transform.baseVal.getItem(0);le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(le,0)},ce.prototype.rotatePoint=function(le){if(this.rotationAngle===0)return le;var ye=this.container.getCTM(),ve=Se.createPoint(le.x,le.y);return{x:(ve=ve.matrixTransform(ye)).x,y:ve.y}},ce.prototype.unrotatePoint=function(le){if(this.rotationAngle===0)return le;var ye=this.container.getCTM();ye=ye.inverse();var ve=Se.createPoint(le.x,le.y);return{x:(ve=ve.matrixTransform(ye)).x,y:ve.y}},ce.prototype.select=function(){Ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ce.prototype.deselect=function(){Ee.prototype.deselect.call(this),this.controlBox.style.display="none"},ce.prototype.setupControlBox=function(){this.controlBox=Se.createGroup();var le=Se.createTransform();le.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(le),this.container.appendChild(this.controlBox),this.controlRect=Se.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=Se.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 At,this.addControlGrips(),this.controlBox.style.display="none"},ce.prototype.adjustControlBox=function(){var le=this.controlBox.transform.baseVal.getItem(0);le.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(le,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()},ce.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()},ce.prototype.createGrip=function(){var le=new Jt;return le.visual.transform.baseVal.appendItem(Se.createTransform()),this.controlBox.appendChild(le.visual),le},ce.prototype.positionGrips=function(){var le=this.controlGrips.topLeft.GRIP_SIZE,ye=-le/2,ve=ye,oe=(this.width+this.CB_DISTANCE)/2-le/2,He=(this.height+this.CB_DISTANCE)/2-le/2,xt=this.height+this.CB_DISTANCE-le/2,Yt=this.width+this.CB_DISTANCE-le/2;this.positionGrip(this.controlGrips.topLeft.visual,ye,ve),this.positionGrip(this.controlGrips.topCenter.visual,oe,ve),this.positionGrip(this.controlGrips.topRight.visual,Yt,ve),this.positionGrip(this.controlGrips.centerLeft.visual,ye,He),this.positionGrip(this.controlGrips.centerRight.visual,Yt,He),this.positionGrip(this.controlGrips.bottomLeft.visual,ye,xt),this.positionGrip(this.controlGrips.bottomCenter.visual,oe,xt),this.positionGrip(this.controlGrips.bottomRight.visual,Yt,xt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,oe,ve-3*this.CB_DISTANCE)},ce.prototype.positionGrip=function(le,ye,ve){var oe=le.transform.baseVal.getItem(0);oe.setTranslate(ye,ve),le.transform.baseVal.replaceItem(oe,0)},ce.prototype.hideControlBox=function(){this.controlBox.style.display="none"},ce.prototype.showControlBox=function(){this.controlBox.style.display=""},ce.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:nt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:nt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Ee.prototype.getState.call(this))},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le);var ye=le;this.left=ye.left,this.top=ye.top,this.width=ye.width,this.height=ye.height,this.rotationAngle=ye.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ye.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ye.containerTransformMatrix))},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye);var ve=this.rotatePoint({x:this.left,y:this.top}),oe=this.unrotatePoint({x:ve.x*le,y:ve.y*ye});this.left=oe.x,this.top=oe.y,this.width=this.width*le,this.height=this.height*ye,this.adjustControlBox()},ce}(De),Ie=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual)},ce.prototype.createVisual=function(){this.visual=Se.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)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){Ee.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),this.setSize()},ce.prototype.setSize=function(){Ee.prototype.setSize.call(this),Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},ce.prototype.pointerUp=function(le){Ee.prototype.pointerUp.call(this,le),this.setSize()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.visual&&Se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.visual&&Se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.visual&&Se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.visual&&Se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ce.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ee.prototype.getState.call(this))},ce.prototype.restoreState=function(le){var ye=le;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),Ee.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.setSize()},ce.title="Rectangle marker",ce}(lt),ke=function(Ee){function ce(le,ye,ve,oe){var He=Ee.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return He.widths=[],He.widthBoxes=[],He.widths=ye,He.currentWidth=ve,He.setCurrentWidth=He.setCurrentWidth.bind(He),He}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.widths.forEach(function(ve){var oe=document.createElement("div");oe.style.display="flex",oe.style.flexGrow="2",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=ve===le.currentWidth?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentWidth(ve,oe)}),ye.appendChild(oe);var He=document.createElement("div");He.innerText=ve.toString(),He.style.marginRight="5px",oe.appendChild(He);var xt=document.createElement("div");xt.style.minHeight="20px",xt.style.flexGrow="2",xt.style.display="flex",xt.style.alignItems="center";var Yt=document.createElement("hr");Yt.style.minWidth="20px",Yt.style.border="0px",Yt.style.borderTop=ve+"px solid "+le.uiStyleSettings.toolboxColor,Yt.style.flexGrow="2",xt.appendChild(Yt),oe.appendChild(xt),le.widthBoxes.push(oe)}),ye},ce.prototype.setCurrentWidth=function(le,ye){var ve=this;this.currentWidth=le,this.widthBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},ce}(ht),je=function(Ee){function ce(le,ye,ve,oe){var He=Ee.call(this,le,oe||'<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 He.styles=[],He.styleBoxes=[],He.styles=ye,He.currentStyle=ve,He.setCurrentStyle=He.setCurrentStyle.bind(He),He}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.styles.forEach(function(ve){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/le.styles.length-5+"%",oe.style.borderColor=ve===le.currentStyle?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentStyle(ve,oe)}),ye.appendChild(oe);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.overflow="hidden";var xt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+le.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ve!==""?'stroke-dasharray="'+ve+'"':"")+` />
|
|
|
</svg>`;He.innerHTML=xt,oe.appendChild(He),le.styleBoxes.push(oe)}),ye},ce.prototype.setCurrentStyle=function(le,ye){var ve=this;this.currentStyle=le,this.styleBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},ce}(ht),Xe=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.strokeColor=ve.defaultColor,oe.strokeWidth=ve.defaultStrokeWidth,oe.strokeDasharray=ve.defaultStrokeDasharray,oe.strokePanel=new Ye("Line color",ve.defaultColorSet,ve.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new je("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return et(ce,Ee),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Ee.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="FrameMarker",ce.title="Frame marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',ce}(Ie),Pt=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"},kt=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.x1=0,oe.y1=0,oe.x2=0,oe.y2=0,oe.defaultLength=50,oe.manipulationStartX=0,oe.manipulationStartY=0,oe.manipulationStartX1=0,oe.manipulationStartY1=0,oe.manipulationStartX2=0,oe.manipulationStartY2=0,oe.setupControlBox(),oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!!Ee.prototype.ownsTarget.call(this,le)||!(!this.grip1.ownsTarget(le)&&!this.grip2.ownsTarget(le))},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.state==="new"&&(this.x1=le.x,this.y1=le.y,this.x2=le.x,this.y2=le.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(ye)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ye)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},ce.prototype.pointerUp=function(le){var ye=this.state;Ee.prototype.pointerUp.call(this,le),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(le),this._state="select",ye==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},ce.prototype.adjustVisual=function(){},ce.prototype.manipulate=function(le){this.state==="creating"?this.resize(le):this.state==="move"?(this.x1=this.manipulationStartX1+le.x-this.manipulationStartX,this.y1=this.manipulationStartY1+le.y-this.manipulationStartY,this.x2=this.manipulationStartX2+le.x-this.manipulationStartX,this.y2=this.manipulationStartY2+le.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(le)},ce.prototype.resize=function(le){switch(this.activeGrip){case this.grip1:this.x1=le.x,this.y1=le.y;break;case this.grip2:case void 0:this.x2=le.x,this.y2=le.y}this.adjustVisual(),this.adjustControlBox()},ce.prototype.select=function(){Ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ce.prototype.deselect=function(){Ee.prototype.deselect.call(this),this.controlBox.style.display="none"},ce.prototype.setupControlBox=function(){this.controlBox=Se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},ce.prototype.adjustControlBox=function(){this.positionGrips()},ce.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},ce.prototype.createGrip=function(){var le=new Jt;return le.visual.transform.baseVal.appendItem(Se.createTransform()),this.controlBox.appendChild(le.visual),le},ce.prototype.positionGrips=function(){var le=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-le/2,this.y1-le/2),this.positionGrip(this.grip2.visual,this.x2-le/2,this.y2-le/2)},ce.prototype.positionGrip=function(le,ye,ve){var oe=le.transform.baseVal.getItem(0);oe.setTranslate(ye,ve),le.transform.baseVal.replaceItem(oe,0)},ce.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Ee.prototype.getState.call(this))},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le);var ye=le;this.x1=ye.x1,this.y1=ye.y1,this.x2=ye.x2,this.y2=ye.y2},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.x1=this.x1*le,this.y1=this.y1*ye,this.x2=this.x2*le,this.y2=this.y2*ye,this.adjustVisual(),this.adjustControlBox()},ce}(De),Lt=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.strokeColor=ve.defaultColor,oe.strokeWidth=ve.defaultStrokeWidth,oe.strokeDasharray=ve.defaultStrokeDasharray,oe.strokePanel=new Ye("Line color",ve.defaultColorSet,ve.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new je("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.selectorLine&&le!==this.visibleLine)},ce.prototype.createVisual=function(){this.visual=Se.createGroup(),this.selectorLine=Se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Se.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)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},ce.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()),Se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.adjustVisual(),this.colorChanged(le)},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.adjustVisual()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le);var ye=le;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.createVisual(),this.adjustVisual()},ce.typeName="LineMarker",ce.title="Line marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',ce}(kt),Ge=function(Ee){function ce(le,ye,ve,oe){var He=Ee.call(this,le,oe||'<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 He.fonts=[],He.fontBoxes=[],He.fonts=ye,He.currentFont=ve,He.setCurrentFont=He.setCurrentFont.bind(He),He}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.flexGrow="2",this.fonts.forEach(function(ve){var oe=document.createElement("div");oe.style.display="inline-block",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/le.fonts.length-5+"%",oe.style.borderColor=ve===le.currentFont?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentFont(ve,oe)}),ye.appendChild(oe);var He=document.createElement("div");He.style.display="flex",He.style.minHeight="20px",He.style.flexGrow="2",He.style.fontFamily=ve,He.style.overflow="hidden";var xt=document.createElement("div");xt.style.whiteSpace="nowrap",xt.style.overflow="hidden",xt.style.textOverflow="ellipsis",xt.innerHTML="The quick brown fox jumps over the lazy dog",He.appendChild(xt),oe.appendChild(He),le.fontBoxes.push(oe)}),ye},ce.prototype.setCurrentFont=function(le,ye){var ve=this;this.currentFont=le,this.fontBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},ce}(ht),Ht=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.color="transparent",oe.padding=5,oe.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",oe.text=oe.DEFAULT_TEXT,oe.isMoved=!1,oe.color=ve.defaultColor,oe.fontFamily=ve.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setColor=oe.setColor.bind(oe),oe.setFont=oe.setFont.bind(oe),oe.renderText=oe.renderText.bind(oe),oe.sizeText=oe.sizeText.bind(oe),oe.textEditDivClicked=oe.textEditDivClicked.bind(oe),oe.showTextEditor=oe.showTextEditor.bind(oe),oe.setSize=oe.setSize.bind(oe),oe.positionTextEditor=oe.positionTextEditor.bind(oe),oe.colorPanel=new Ye("Color",ve.defaultColorSet,ve.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.fontFamilyPanel=new Ge("Font",ve.defaultFontFamilies,ve.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){if(Ee.prototype.ownsTarget.call(this,le)||le===this.visual||le===this.textElement||le===this.bgRectangle)return!0;var ye=!1;return this.textElement.childNodes.forEach(function(ve){ve===le&&(ye=!0)}),ye},ce.prototype.createVisual=function(){this.visual=Se.createGroup(),this.bgRectangle=Se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Se.createTransform()),this.textElement.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.isMoved=!1,this.pointerDownPoint=le,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.renderText=function(){var le=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(ye){le.textElement.appendChild(Se.createTSpan(ye.trim()===""?" ":ye.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},ce.prototype.getTextScale=function(){var le=this.textElement.getBBox(),ye=1;if(le.width>0&&le.height>0){var ve=(1*this.width-this.width*this.padding*2/100)/le.width,oe=(1*this.height-this.height*this.padding*2/100)/le.height;ye=Math.min(ve,oe)}return ye},ce.prototype.getTextPosition=function(le){var ye=this.textElement.getBBox(),ve=0,oe=0;return ye.width>0&&ye.height>0&&(ve=(this.width-ye.width*le)/2,oe=this.height/2-ye.height*le/2),{x:ve,y:oe}},ce.prototype.sizeText=function(){var le=this.textElement.getBBox(),ye=this.getTextScale(),ve=this.getTextPosition(ye);ve.y-=le.y*ye,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ve.x+"px, "+ve.y+"px) scale("+ye+", "+ye+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ve.x,ve.y),this.textElement.transform.baseVal.getItem(1).setScale(ye,ye))},ce.prototype.manipulate=function(le){Ee.prototype.manipulate.call(this,le),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(le.x-this.pointerDownPoint.x)>5||Math.abs(le.y-this.pointerDownPoint.y)>5)},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),this.isMoved=!0,this.setSize(),this.sizeText()},ce.prototype.setSize=function(){Ee.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},ce.prototype.pointerUp=function(le){var ye=this.state;ye==="creating"&&(this._suppressMarkerCreateEvent=!0),Ee.prototype.pointerUp.call(this,le),this.setSize(),(ye==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},ce.prototype.showTextEditor=function(){var le=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(ye){ye.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ye=Number.parseFloat(le.textEditor.style.fontSize);le.textEditor.clientWidth>=Number.parseInt(le.textEditor.style.maxWidth)&&ye>.9;)ye-=.1,le.textEditor.style.fontSize=Math.max(ye,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ye){ye.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ye){if(ye.clipboardData){var ve=ye.clipboardData.getData("text"),oe=window.getSelection();if(!oe.rangeCount)return!1;oe.deleteFromDocument(),oe.getRangeAt(0).insertNode(document.createTextNode(ve)),ye.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){le.textEditDivClicked(le.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},ce.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var le=this.getTextScale(),ye=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ve=this.textElement.getBBox(),oe={x:ve.width*le,y:ve.height*le};ye.x-=oe.x/2,ye.y-=oe.y/2,this.textEditor.style.top=ye.y+"px",this.textEditor.style.left=ye.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ye.x+"px",this.textEditor.style.fontSize=Math.max(16*le,12)+"px",this.textElement.style.display="none"}},ce.prototype.textEditDivClicked=function(le){this.text=le.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},ce.prototype.select=function(){Ee.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},ce.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Ee.prototype.deselect.call(this)},ce.prototype.dblClick=function(le,ye){Ee.prototype.dblClick.call(this,le,ye),this.showTextEditor()},ce.prototype.setColor=function(le){this.textElement&&Se.setAttributes(this.textElement,[["fill",le]]),this.color=le,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(le)},ce.prototype.setFont=function(le){this.textElement&&Se.setAttributes(this.textElement,[["font-family",le]]),this.fontFamily=le,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},ce.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},ce.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ye=le;this.color=ye.color,this.fontFamily=ye.fontFamily,this.padding=ye.padding,this.text=ye.text,this.createVisual(),Ee.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.setSize(),this.sizeText(),this.positionTextEditor()},ce.typeName="TextMarker",ce.title="Text marker",ce.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>',ce}(lt),Dt=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.color="transparent",oe.lineWidth=3,oe.drawing=!1,oe.pixelRatio=1,oe.color=ve.defaultColor,oe.lineWidth=ve.defaultStrokeWidth,oe.pixelRatio=ve.freehandPixelRatio,oe.setColor=oe.setColor.bind(oe),oe.addCanvas=oe.addCanvas.bind(oe),oe.finishCreation=oe.finishCreation.bind(oe),oe.setLineWidth=oe.setLineWidth.bind(oe),oe.colorPanel=new Ye("Color",ve.defaultColorSet,ve.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.lineWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.lineWidthPanel.onWidthChanged=oe.setLineWidth,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.drawingImage)},ce.prototype.createVisual=function(){this.visual=Se.createGroup(),this.drawingImage=Se.createImage(),this.visual.appendChild(this.drawingImage);var le=Se.createTransform();this.visual.transform.baseVal.appendItem(le),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ye){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(le.x,le.y),this.drawing=!0):Ee.prototype.pointerDown.call(this,le,ye)},ce.prototype.manipulate=function(le){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(le.x,le.y),this.canvasContext.stroke()):Ee.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},ce.prototype.pointerUp=function(le){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Ee.prototype.pointerUp.call(this,le)},ce.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)},ce.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Ee.prototype.select.call(this)},ce.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Ee.prototype.deselect.call(this)},ce.prototype.finishCreation=function(){for(var le=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ye=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ve=ye[0],oe=ye[1],He=ye[2],xt=ye[3],Yt=!1,pn=0;pn<this.canvasElement.height;pn++)for(var dn=0;dn<this.canvasElement.width;dn++)le.data[pn*this.canvasElement.width*4+4*dn+3]>0&&(Yt=!0,pn<oe&&(oe=pn),dn<ve&&(ve=dn),pn>xt&&(xt=pn),dn>He&&(He=dn));if(Yt){this.left=ve/this.pixelRatio,this.top=oe/this.pixelRatio,this.width=(He-ve)/this.pixelRatio,this.height=(xt-oe)/this.pixelRatio;var An=document.createElement("canvas");An.width=He-ve,An.height=xt-oe,An.getContext("2d").putImageData(this.canvasContext.getImageData(ve,oe,He-ve,xt-oe),0,0),this.drawingImgUrl=An.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},ce.prototype.setDrawingImage=function(){Se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},ce.prototype.setColor=function(le){this.color=le,this.colorChanged(le)},ce.prototype.setLineWidth=function(le){this.lineWidth=le},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({drawingImgUrl:this.drawingImgUrl},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){this.createVisual(),Ee.prototype.restoreState.call(this,le),this.drawingImgUrl=le.drawingImgUrl,this.setDrawingImage()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.setDrawingImage()},ce.typeName="FreehandMarker",ce.title="Freehand marker",ce.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>',ce}(lt),Ln=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ve||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return oe.typeBoxes=[],oe.currentType=ye,oe.setCurrentType=oe.setCurrentType.bind(oe),oe}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2";for(var ve=function(xt){var Yt="both";switch(xt){case 0:Yt="both";break;case 1:Yt="start";break;case 2:Yt="end";break;case 3:Yt="none"}var pn=document.createElement("div");if(pn.style.display="flex",pn.style.flexGrow="2",pn.style.alignItems="center",pn.style.justifyContent="space-between",pn.style.padding="5px",pn.style.borderWidth="2px",pn.style.borderStyle="solid",pn.style.borderColor=Yt===oe.currentType?oe.uiStyleSettings.toolboxAccentColor:"transparent",pn.addEventListener("click",function(){le.setCurrentType(Yt,pn)}),ye.appendChild(pn),Yt==="both"||Yt==="start"){var dn=document.createElement("div");dn.style.display="flex",dn.style.alignItems="center",dn.style.minHeight="20px",dn.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="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,dn.style.marginLeft="5px",pn.appendChild(dn)}var An=document.createElement("div");An.style.display="flex",An.style.alignItems="center",An.style.minHeight="20px",An.style.flexGrow="2";var tn=document.createElement("hr");if(tn.style.minWidth="20px",tn.style.border="0px",tn.style.borderTop="3px solid "+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee"),tn.style.flexGrow="2",An.appendChild(tn),pn.appendChild(An),Yt==="both"||Yt==="end"){var Nr=document.createElement("div");Nr.style.display="flex",Nr.style.alignItems="center",Nr.style.minHeight="20px",Nr.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="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Nr.style.marginRight="5px",pn.appendChild(Nr)}oe.typeBoxes.push(pn)},oe=this,He=0;He<4;He++)ve(He);return ye},ce.prototype.setCurrentType=function(le,ye){var ve=this;this.currentType=le,this.typeBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings!==void 0?ve.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},ce}(ht),un=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.arrowType="end",oe.arrowBaseHeight=10,oe.arrowBaseWidth=10,oe.getArrowPoints=oe.getArrowPoints.bind(oe),oe.setArrowType=oe.setArrowType.bind(oe),oe.arrowTypePanel=new Ln("Arrow type","end"),oe.arrowTypePanel.onArrowTypeChanged=oe.setArrowType,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.arrow1&&le!==this.arrow2)},ce.prototype.getArrowPoints=function(le,ye){var ve=this.arrowBaseWidth+2*this.strokeWidth,oe=this.arrowBaseHeight+2*this.strokeWidth;return le-ve/2+","+(ye+oe/2)+" "+le+","+(ye-oe/2)+" "+(le+ve/2)+","+(ye+oe/2)},ce.prototype.createTips=function(){this.arrow1=Se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.arrow2)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="creating"&&this.createTips()},ce.prototype.adjustVisual=function(){if(Ee.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",Se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var le=0;Math.abs(this.x1-this.x2)>.1&&(le=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var ye=this.arrow1.transform.baseVal.getItem(0);ye.setRotate(le,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ye,0);var ve=this.arrow2.transform.baseVal.getItem(0);ve.setRotate(le+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ve,0)}},ce.prototype.setArrowType=function(le){this.arrowType=le,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({arrowType:this.arrowType},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le);var ye=le;this.arrowType=ye.arrowType,this.createTips(),this.adjustVisual()},ce.typeName="ArrowMarker",ce.title="Arrow marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',ce}(Lt),Rn=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.fillColor=ve.defaultFillColor,oe.strokeWidth=0,oe.fillPanel=new Ye("Color",ve.defaultColorSet,ve.defaultFillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe}return et(ce,Ee),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Ee.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="CoverMarker",ce.title="Cover marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',ce}(Ie),ir=function(Ee){function ce(le,ye,ve,oe){var He=Ee.call(this,le,oe||'<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 He.opacities=[],He.opacityBoxes=[],He.opacities=ye,He.currentOpacity=ve,He.setCurrentOpacity=He.setCurrentOpacity.bind(He),He}return et(ce,Ee),ce.prototype.getUi=function(){var le=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",ye.style.justifyContent="space-between",this.opacities.forEach(function(ve){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="center",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=ve===le.currentOpacity?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentOpacity(ve,oe)}),ye.appendChild(oe);var He=document.createElement("div");He.innerText=100*ve+"%",oe.appendChild(He),le.opacityBoxes.push(oe)}),ye},ce.prototype.setCurrentOpacity=function(le,ye){var ve=this;this.currentOpacity=le,this.opacityBoxes.forEach(function(oe){oe.style.borderColor=oe===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},ce}(ht),yr=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.setOpacity=oe.setOpacity.bind(oe),oe.fillColor=ve.defaultHighlightColor,oe.strokeWidth=0,oe.opacity=ve.defaultHighlightOpacity,oe.fillPanel=new Ye("Color",ve.defaultColorSet,oe.fillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe.opacityPanel=new ir("Opacity",ve.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return et(ce,Ee),ce.prototype.setOpacity=function(le){this.opacity=le,this.visual&&Se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Ee.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="HighlightMarker",ce.title="Highlight marker",ce.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>',ce}(Rn),Qe='<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>',Le='<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>',Nt=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.bgColor="transparent",oe.tipPosition={x:0,y:0},oe.tipBase1Position={x:0,y:0},oe.tipBase2Position={x:0,y:0},oe.tipMoving=!1,oe.color=ve.defaultStrokeColor,oe.bgColor=ve.defaultFillColor,oe.fontFamily=ve.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setBgColor=oe.setBgColor.bind(oe),oe.getTipPoints=oe.getTipPoints.bind(oe),oe.positionTip=oe.positionTip.bind(oe),oe.setTipPoints=oe.setTipPoints.bind(oe),oe.colorPanel=new Ye("Text color",ve.defaultColorSet,oe.color,Qe),oe.colorPanel.onColorChanged=oe.setColor,oe.bgColorPanel=new Ye("Fill color",ve.defaultColorSet,oe.bgColor,Le),oe.bgColorPanel.onColorChanged=oe.setBgColor,oe.fontFamilyPanel=new Ge("Font",ve.defaultFontFamilies,ve.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe.tipGrip=new Jt,oe.tipGrip.visual.transform.baseVal.appendItem(Se.createTransform()),oe.controlBox.appendChild(oe.tipGrip.visual),oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return Ee.prototype.ownsTarget.call(this,le)||this.tipGrip.ownsTarget(le)||this.tip===le},ce.prototype.createTip=function(){Se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},ce.prototype.pointerDown=function(le,ye){this.state==="new"&&Ee.prototype.pointerDown.call(this,le,ye),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ye)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Ee.prototype.pointerDown.call(this,le,ye)},ce.prototype.pointerUp=function(le){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Ee.prototype.pointerUp.call(this,le);else{var ye=this.state==="creating";Ee.prototype.pointerUp.call(this,le),this.setTipPoints(ye),this.positionTip()}},ce.prototype.manipulate=function(le){if(this.tipMoving){var ye=this.unrotatePoint(le);this.tipPosition={x:ye.x-this.manipulationStartLeft,y:ye.y-this.manipulationStartTop},this.positionTip()}else Ee.prototype.manipulate.call(this,le)},ce.prototype.setBgColor=function(le){this.bgRectangle&&this.tip&&(Se.setAttributes(this.bgRectangle,[["fill",le]]),Se.setAttributes(this.tip,[["fill",le]])),this.bgColor=le,this.fillColorChanged(le)},ce.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},ce.prototype.setTipPoints=function(le){le===void 0&&(le=!1);var ye=Math.min(this.height/2,15),ve=this.height/5;le&&(this.tipPosition={x:ye+ve/2,y:this.height+20});var oe=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:ye,y:0},this.tipBase2Position={x:ye+ve,y:0}):(this.tipBase1Position={x:0,y:ye},this.tipBase2Position={x:0,y:ye+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ye-ve,y:0},this.tipBase2Position={x:this.width-ye,y:0}):(this.tipBase1Position={x:this.width,y:ye},this.tipBase2Position={x:this.width,y:ye+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?oe<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ye-ve,y:this.height},this.tipBase2Position={x:this.width-ye,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ye-ve},this.tipBase2Position={x:this.width,y:this.height-ye}):oe<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:ye,y:this.height},this.tipBase2Position={x:ye+ve,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ye},this.tipBase2Position={x:0,y:this.height-ye-ve})},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),this.positionTip()},ce.prototype.positionTip=function(){Se.setAttributes(this.tip,[["points",this.getTipPoints()]]);var le=this.tipGrip.visual.transform.baseVal.getItem(0);le.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(le,0)},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ce.prototype.select=function(){this.positionTip(),Ee.prototype.select.call(this)},ce.prototype.getState=function(){var le=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ye=le;this.bgColor=ye.bgColor,this.tipPosition=ye.tipPosition,Ee.prototype.restoreState.call(this,le),this.createTip(),this.setTipPoints()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.tipPosition={x:this.tipPosition.x*le,y:this.tipPosition.y*ye},this.positionTip()},ce.typeName="CalloutMarker",ce.title="Callout marker",ce.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>',ce}(Ht),Nn=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.strokeColor=ve.defaultColor,oe.strokeWidth=ve.defaultStrokeWidth,oe.strokeDasharray=ve.defaultStrokeDasharray,oe.fillColor=ve.defaultFillColor,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.setOpacity=oe.setOpacity.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe.strokePanel=new Ye("Line color",be(ve.defaultColorSet,["transparent"]),ve.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.fillPanel=new Ye("Fill color",be(ve.defaultColorSet,["transparent"]),oe.fillColor,Le),oe.fillPanel.onColorChanged=oe.setFillColor,oe.strokeWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new je("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe.opacityPanel=new ir("Opacity",ve.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual)},ce.prototype.createVisual=function(){this.visual=Se.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)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){Ee.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),this.setSize()},ce.prototype.setSize=function(){Ee.prototype.setSize.call(this),Se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},ce.prototype.pointerUp=function(le){Ee.prototype.pointerUp.call(this,le),this.setSize()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.visual&&Se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.visual&&Se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(le),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.visual&&Se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.visual&&Se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ce.prototype.setOpacity=function(le){this.opacity=le,this.visual&&Se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ye=le;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),Ee.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.setSize()},ce.typeName="EllipseMarker",ce.title="Ellipse marker",ce.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>',ce}(lt),gn=function(Ee){function ce(le,ye,ve){return Ee.call(this,le,ye,ve)||this}return et(ce,Ee),Object.defineProperty(ce.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.tip1&&le!==this.tip2)},ce.prototype.createTips=function(){this.tip1=Se.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(Se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Se.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(Se.createTransform()),this.visual.appendChild(this.tip2)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.state==="creating"&&this.createTips()},ce.prototype.adjustVisual=function(){if(Ee.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Se.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()]]),Se.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 le=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ye=this.tip1.transform.baseVal.getItem(0);ye.setRotate(le,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ye,0);var ve=this.tip2.transform.baseVal.getItem(0);ve.setRotate(le+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ve,0)}},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Ee.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le),this.createTips(),this.adjustVisual()},ce.typeName="MeasurementMarker",ce.title="Measurement marker",ce.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>',ce}(Lt),Je=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.strokePanel.colors=ve.defaultColorSet,oe.fillColor="transparent",oe}return et(ce,Ee),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Ee.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="EllipseFrameMarker",ce.title="Ellipse frame marker",ce.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>',ce}(Nn),st=function(){function Ee(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Ee.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Ee.prototype.addUndoStep=function(ce){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(ce)||(this.undoStack.push(ce),JSON.stringify(this.lastRedoStep)!==JSON.stringify(ce)&&this.redoStack.splice(0,this.redoStack.length))},Ee.prototype.replaceLastUndoStep=function(ce){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=ce)},Ee.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Ee.prototype.undo=function(){if(this.undoStack.length>1){var ce=this.undoStack.pop();return ce!==void 0&&this.redoStack.push(ce),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Ee.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Ee}(),_t=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.curveX=0,oe.curveY=0,oe.manipulationStartCurveX=0,oe.manipulationStartCurveY=0,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.positionGrips=oe.positionGrips.bind(oe),oe.addControlGrips=oe.addControlGrips.bind(oe),oe.adjustVisual=oe.adjustVisual.bind(oe),oe.setupControlBox=oe.setupControlBox.bind(oe),oe.resize=oe.resize.bind(oe),oe.strokeColor=ve.defaultColor,oe.strokeWidth=ve.defaultStrokeWidth,oe.strokeDasharray=ve.defaultStrokeDasharray,oe.strokePanel=new Ye("Line color",ve.defaultColorSet,ve.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new je("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.selectorCurve&&le!==this.visibleCurve&&!this.curveGrip.ownsTarget(le))},ce.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},ce.prototype.createVisual=function(){this.visual=Se.createGroup(),this.selectorCurve=Se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Se.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)},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=le.x,this.curveY=le.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ye)&&(this.activeGrip=this.curveGrip,this._state="resize")},ce.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ce.prototype.setupControlBox=function(){Ee.prototype.setupControlBox.call(this),this.curveControlLine1=Se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Se.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)},ce.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Ee.prototype.addControlGrips.call(this)},ce.prototype.positionGrips=function(){Ee.prototype.positionGrips.call(this);var le=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-le/2,this.curveY-le/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()))},ce.prototype.manipulate=function(le){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+le.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+le.y-this.manipulationStartY),Ee.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){this.activeGrip===this.curveGrip&&(this.curveX=le.x,this.curveY=le.y),Ee.prototype.resize.call(this,le),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.adjustVisual(),this.colorChanged(le)},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.adjustVisual()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.adjustVisual()},ce.prototype.scale=function(le,ye){this.curveX=this.curveX*le,this.curveY=this.curveY*ye,Ee.prototype.scale.call(this,le,ye)},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Ee.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){Ee.prototype.restoreState.call(this,le);var ye=le;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.curveX=ye.curveX,this.curveY=ye.curveY,this.createVisual(),this.adjustVisual()},ce.typeName="CurveMarker",ce.title="Curve marker",ce.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>',ce}(kt),en=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,ye,ve)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.textColor="transparent",oe.fontSize="1rem",oe.isMoved=!1,oe.captionText="Caption",oe.PADDING=5,oe.captionBoxWidth=0,oe.captionBoxHeight=0,oe.strokeColor=ve.defaultColor,oe.strokeWidth=ve.defaultStrokeWidth,oe.strokeDasharray=ve.defaultStrokeDasharray,oe.fillColor=ve.defaultFillColor,oe.textColor=ve.defaultStrokeColor,oe.fontFamily=ve.defaultFontFamily,oe.fontSize=ve.defaultCaptionFontSize,oe.captionText=ve.defaultCaptionText,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe.sizeCaption=oe.sizeCaption.bind(oe),oe.setCaptionText=oe.setCaptionText.bind(oe),oe.showTextEditor=oe.showTextEditor.bind(oe),oe.positionTextEditor=oe.positionTextEditor.bind(oe),oe.finishTextEditing=oe.finishTextEditing.bind(oe),oe.setFont=oe.setFont.bind(oe),oe.setTextColor=oe.setTextColor.bind(oe),oe.strokePanel=new Ye("Line color",be(ve.defaultColorSet,["transparent"]),oe.strokeColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.fillPanel=new Ye("Fill color",be(ve.defaultColorSet,["transparent"]),oe.fillColor,Le),oe.fillPanel.onColorChanged=oe.setFillColor,oe.strokeWidthPanel=new ke("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new je("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe.fontFamilyPanel=new Ge("Font",ve.defaultFontFamilies,ve.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe.textColorPanel=new Ye("Text color",ve.defaultColorSet,oe.textColor,Qe),oe.textColorPanel.onColorChanged=oe.setTextColor,oe}return et(ce,Ee),ce.prototype.ownsTarget=function(le){return!(!Ee.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.frame&&le!==this.captionBg&&le!==this.captionElement)},ce.prototype.createVisual=function(){this.visual=Se.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Se.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Se.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=Se.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()},ce.prototype.setCaptionText=function(le){this.captionText=le,this.captionElement.textContent=this.captionText,this.sizeCaption()},ce.prototype.pointerDown=function(le,ye){Ee.prototype.pointerDown.call(this,le,ye),this.isMoved=!1,this.pointerDownPoint=le,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){Ee.prototype.manipulate.call(this,le),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(le.x-this.pointerDownPoint.x)>5||Math.abs(le.y-this.pointerDownPoint.y)>5)},ce.prototype.resize=function(le){Ee.prototype.resize.call(this,le),this.setSize()},ce.prototype.sizeCaption=function(){var le=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=le.width+2*this.PADDING,this.captionBoxHeight=le.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Se.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')"]]),Se.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')"]])},ce.prototype.showTextEditor=function(){var le=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(ye){ye.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(ye){ye.key==="Enter"&&le.finishTextEditing(le.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(ye){ye.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){le.finishTextEditing(le.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){le.finishTextEditing(le.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},ce.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"))},ce.prototype.finishTextEditing=function(le){this.setCaptionText(le.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},ce.prototype.setFont=function(le){this.captionElement&&Se.setAttributes(this.captionElement,[["font-family",le]]),this.fontFamily=le,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},ce.prototype.setTextColor=function(le){this.captionElement&&Se.setAttributes(this.captionElement,[["fill",le]]),this.textColor=le,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},ce.prototype.setSize=function(){Ee.prototype.setSize.call(this),Se.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},ce.prototype.pointerUp=function(le){Ee.prototype.pointerUp.call(this,le),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},ce.prototype.dblClick=function(le,ye){Ee.prototype.dblClick.call(this,le,ye),this.showTextEditor()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.frame&&Se.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.captionBg&&Se.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(le),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.frame&&Se.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.frame&&Se.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=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},Ee.prototype.getState.call(this));return le.typeName=this.typeName,le},ce.prototype.restoreState=function(le){var ye=le;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.textColor=ye.textColor,this.fontFamily=ye.fontFamily,this.captionText=ye.captionText,this.fontSize=ye.fontSize,this.createVisual(),Ee.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ye){Ee.prototype.scale.call(this,le,ye),this.setSize()},ce.typeName="CaptionFrameMarker",ce.title="Caption frame marker",ce.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>',ce}(lt),Bt=function(){function Ee(ce,le){le===void 0&&(le=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=ce,this.cancelable=le}return Object.defineProperty(Ee.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Ee.prototype.preventDefault=function(){this._defaultPrevented=!0},Ee}(),Ft=function(Ee){function ce(le,ye,ve){var oe=Ee.call(this,le,!1)||this;return oe.dataUrl=ye,oe.state=ve,oe}return et(ce,Ee),ce}(Bt),zt=function(Ee){function ce(le,ye,ve){ve===void 0&&(ve=!1);var oe=Ee.call(this,le,ve)||this;return oe.marker=ye,oe}return et(ce,Ee),ce}(Bt),Mn=function(){function Ee(){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 Ee.prototype.addEventListener=function(ce,le){this[ce].push(le)},Ee.prototype.removeEventListener=function(ce,le){var ye=this[ce].indexOf(le);ye>-1&&this[ce].splice(ye,1)},Ee}(),bn=function(){function Ee(ce){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pt,this._isOpen=!1,this.undoRedoManager=new st,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 Mn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Ee.instanceCounter++,this.styles=new Te(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=ce,this.targetRoot=document.body,this.width=ce.clientWidth,this.height=ce.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(Ee.prototype,"ALL_MARKER_TYPES",{get:function(){return[Xe,Dt,un,Ht,Je,Nn,yr,Nt,gn,Rn,Lt,_t,en]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Xe,Dt,un,Ht,Nn,yr,Nt]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Xe,Dt,un,Ht,yr]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(ce){var le=this;this._availableMarkerTypes.splice(0),ce.forEach(function(ye){if(typeof ye=="string"){var ve=le.ALL_MARKER_TYPES.find(function(oe){return oe.typeName===ye});ve!==void 0&&le._availableMarkerTypes.push(ve)}else le._availableMarkerTypes.push(ye)})},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(ce){this._zoomLevel=ce,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(Ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Ee.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Ee.prototype.show=function(){var ce=this;this.styles.styleSheetRoot===void 0&&pe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=pe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(le){return le(new Bt(ce))})},Ee.prototype.render=function(){return $e(this,void 0,void 0,function(){var ce;return Ue(this,function(le){switch(le.label){case 0:return this.setCurrentMarker(),(ce=new xe).naturalSize=this.renderAtNaturalSize,ce.imageType=this.renderImageType,ce.imageQuality=this.renderImageQuality,ce.markersOnly=this.renderMarkersOnly,ce.width=this.renderWidth,ce.height=this.renderHeight,[4,ce.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return le.sent(),[4,ce.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,le.sent()]}})})},Ee.prototype.close=function(ce){var le=this;if(ce===void 0&&(ce=!1),this.isOpen){var ye=!1;ce||this.eventListeners.beforeclose.forEach(function(ve){var oe=new Bt(le,!0);ve(oe),oe.defaultPrevented&&(ye=!0)}),ye||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ve){return ve(new Bt(le))}),this.detachEvents(),this._isOpen=!1)}},Ee.prototype.addMarkersToToolbar=function(){for(var ce,le=[],ye=0;ye<arguments.length;ye++)le[ye]=arguments[ye];(ce=this._availableMarkerTypes).push.apply(ce,le)},Ee.prototype.addRenderEventListener=function(ce){this.addEventListener("render",function(le){ce(le.dataUrl,le.state)})},Ee.prototype.removeRenderEventListener=function(ce){},Ee.prototype.addCloseEventListener=function(ce){this.addEventListener("close",function(){ce()})},Ee.prototype.removeCloseEventListener=function(ce){},Ee.prototype.setupResizeObserver=function(){var ce=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ce.resize(ce.target.clientWidth,ce.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return ce.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Ee.prototype.onPopupTargetResize=function(){var ce=1*this.target.clientWidth/this.target.clientHeight,le=this.editorCanvas.clientWidth/ce>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*ce:this.editorCanvas.clientWidth,ye=le<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/ce;this.resize(le,ye)},Ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Ee.prototype.resize=function(ce,le){this._isResizing=!0;var ye=ce/this.imageWidth,ve=le/this.imageHeight;this.imageWidth=Math.round(ce),this.imageHeight=Math.round(le),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(ye,ve),this._isResizing=!1},Ee.prototype.scaleMarkers=function(ce,le){var ye,ve=this;this._currentMarker&&this._currentMarker instanceof Ht?this._currentMarker.scale(ce,le):(ye=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(oe){oe!==ve._currentMarker&&oe.scale(ce,le)}),ye!==void 0&&this.setCurrentMarker(ye)},Ee.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"},Ee.prototype.setTopLeft=function(){var ce=this.editingTarget.getBoundingClientRect(),le=this.editorCanvas.getBoundingClientRect();this.left=ce.left-le.left,this.top=ce.top-le.top},Ee.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)},Ee.prototype.addDefs=function(){for(var ce,le=[],ye=0;ye<arguments.length;ye++)le[ye]=arguments[ye];this.defs=Se.createDefs(),this.addDefsToImage(),(ce=this.defs).append.apply(ce,le)},Ee.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Ee.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)},Ee.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Ee.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Ee.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)},Ee.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Ee.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)},Ee.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 ce=document.createElement("a");ce.href="https://markerjs.com/",ce.target="_blank",ce.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>',ce.title="Powered by marker.js",ce.style.display="grid",ce.style.alignItems="center",ce.style.justifyItems="center",ce.style.padding="3px",ce.style.width="20px",ce.style.height="20px",this.logoUI.appendChild(ce),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Ee.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")},Ee.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"},Ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Ee.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 ce=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=ce+"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 It(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 Ct(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Ee.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Ee.prototype.removeMarker=function(ce){this.markerImage.removeChild(ce.container),this.markers.indexOf(ce)>-1&&this.markers.splice(this.markers.indexOf(ce),1),ce.dispose()},Ee.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())},Ee.prototype.toolbarButtonClicked=function(ce,le){if(ce==="marker"&&le!==void 0)this.createNewMarker(le);else if(ce==="action")switch(le){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()}},Ee.prototype.deleteSelectedMarker=function(){var ce=this;if(this._currentMarker!==void 0){var le=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ve){var oe=new zt(ce,ce._currentMarker,!0);ve(oe),oe.defaultPrevented&&(le=!0)}),!le){var ye=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ve){return ve(new zt(ce,ye))})}}},Ee.prototype.clear=function(){var ce=this,le=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(He){var xt=new zt(ce,void 0,!0);He(xt),xt.defaultPrevented&&(le=!0)}),!le)){this.setCurrentMarker();for(var ye=function(He){var xt=ve.markers[He];ve.setCurrentMarker(ve.markers[He]),ve._currentMarker.dispose(),ve.markerImage.removeChild(ve._currentMarker.container),ve.markers.splice(ve.markers.indexOf(ve._currentMarker),1),ve.eventListeners.markerdelete.forEach(function(Yt){return Yt(new zt(ce,xt))})},ve=this,oe=this.markers.length-1;oe>=0;oe--)ye(oe);this.addUndoStep()}},Object.defineProperty(Ee.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Ee.prototype.showNotesEditor=function(){var ce;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=(ce=this._currentMarker.notes)!==null&&ce!==void 0?ce:"",this.overlayContainer.appendChild(this.notesArea))},Ee.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)},Ee.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Ee.prototype.addUndoStep=function(){var ce=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var le=this.getState(),ye=this.undoRedoManager.getLastUndoStep();if(!ye||ye.width===le.width&&ye.height===le.height){var ve=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(le),ve<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(oe){return oe(new Bt(ce))})}else this.undoRedoManager.replaceLastUndoStep(le),this.eventListeners.statechange.forEach(function(oe){return oe(new Bt(ce))})}},Ee.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Ee.prototype.undoStep=function(){var ce=this,le=this.undoRedoManager.undo();le!==void 0&&(this.restoreState(le),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ye){return ye(new Bt(ce))}))},Ee.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Ee.prototype.redoStep=function(){var ce=this,le=this.undoRedoManager.redo();le!==void 0&&(this.restoreState(le),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ye){return ye(new Bt(ce))}))},Ee.prototype.stepZoom=function(){var ce=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=ce<this.zoomSteps.length-1?this.zoomSteps[ce+1]:this.zoomSteps[0]},Ee.prototype.panTo=function(ce){this.contentDiv.scrollBy({left:this.prevPanPoint.x-ce.x,top:this.prevPanPoint.y-ce.y}),this.prevPanPoint=ce},Ee.prototype.startRenderAndClose=function(){return $e(this,void 0,void 0,function(){var ce,le,ye=this;return Ue(this,function(ve){switch(ve.label){case 0:return[4,this.render()];case 1:return ce=ve.sent(),le=this.getState(),this.eventListeners.render.forEach(function(oe){return oe(new Ft(ye,ce,le))}),this.close(!0),[2]}})})},Ee.prototype.getState=function(ce){ce===!0&&this.setCurrentMarker();var le={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ye){return le.markers.push(ye.getState())}),le},Ee.prototype.restoreState=function(ce){var le=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);ce.markers.forEach(function(ye){var ve=le._availableMarkerTypes.find(function(He){return He.typeName===ye.typeName});if(ve!==void 0){var oe=le.addNewMarker(ve);oe.restoreState(ye),le.markers.push(oe)}}),ce.width&&ce.height&&(ce.width!==this.imageWidth||ce.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/ce.width,this.imageHeight/ce.height),this.eventListeners.restorestate.forEach(function(ye){return ye(new Bt(le))})},Ee.prototype.addNewMarker=function(ce){var le=Se.createGroup();return this.markerImage.appendChild(le),new ce(le,this.overlayContainer,this.settings)},Ee.prototype.createNewMarker=function(ce){var le,ye=this;(le=typeof ce=="string"?this._availableMarkerTypes.find(function(ve){return ve.typeName===ce}):ce)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(le),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(le.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ve){return ve(new zt(ye,ye._currentMarker))}))},Ee.prototype.markerCreated=function(ce){var le=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(ce),this.setCurrentMarker(ce),ce instanceof Dt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Dt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ye){return ye(new zt(le,le._currentMarker))})},Ee.prototype.colorChanged=function(ce){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=ce,this.settings.defaultStrokeColor=ce)},Ee.prototype.fillColorChanged=function(ce){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=ce)},Ee.prototype.markerStateChanged=function(ce){var le=this;this.eventListeners.markerchange.forEach(function(ye){return ye(new zt(le,ce))})},Ee.prototype.setCurrentMarker=function(ce){var le=this;this._currentMarker!==ce&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ye){return ye(new zt(le,le._currentMarker))})),this._currentMarker=ce,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(ye){return ye(new zt(le,le._currentMarker))}))},Ee.prototype.onPointerDown=function(ce){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||ce.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var le=this.markers.find(function(ye){return ye.ownsTarget(ce.target)});le!==void 0?(this.setCurrentMarker(le),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ce.clientX,ce.clientY),ce.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:ce.clientX,y:ce.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ce.clientX,ce.clientY))},Ee.prototype.onDblClick=function(ce){if(this._isFocused||this.focus(),this.mode==="select"){var le=this.markers.find(function(ye){return ye.ownsTarget(ce.target)});le!==void 0&&le!==this._currentMarker&&this.setCurrentMarker(le),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(ce.clientX,ce.clientY),ce.target):this.setCurrentMarker()}},Ee.prototype.onPointerMove=function(ce){this.touchPoints!==1&&ce.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||ce.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(ce.clientX,ce.clientY)):this.zoomLevel>1&&this.panTo({x:ce.clientX,y:ce.clientY}))},Ee.prototype.onPointerUp=function(ce){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(ce.clientX,ce.clientY)),this.isDragging=!1,this.addUndoStep()},Ee.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Ee.prototype.onKeyUp=function(ce){this._currentMarker===void 0||this.notesArea!==void 0||ce.key!=="Delete"&&ce.key!=="Backspace"||this.deleteSelectedMarker()},Ee.prototype.clientToLocalCoordinates=function(ce,le){var ye=this.markerImage.getBoundingClientRect();return{x:(ce-ye.left)/this.zoomLevel,y:(le-ye.top)/this.zoomLevel}},Ee.prototype.onWindowResize=function(){this.positionUI()},Ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var ce=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=ce+"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()},Ee.prototype.addLicenseKey=function(ce){Me.addKey(ce)},Ee.prototype.addEventListener=function(ce,le){this.eventListeners.addEventListener(ce,le)},Ee.prototype.removeEventListener=function(ce,le){this.eventListeners.removeEventListener(ce,le)},Ee.prototype.renderState=function(ce){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(ce),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Ee.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Ee.prototype.focus=function(){var ce=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(le){return le(new Bt(ce))}))},Ee.prototype.blur=function(){var ce=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(le){return le(new Bt(ce))}))},Ee.instanceCounter=0,Ee}()},95860:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return nt}});var fe=se(87462),et=se(1413),$e=se(4942),Ue=se(97685),be=se(45987),Se=se(94184),Me=se.n(Se),xe=se(67294);function pe(lt){var Ie=xe.useRef();Ie.current=lt;var ke=xe.useCallback(function(){for(var je,Xe=arguments.length,Pt=new Array(Xe),kt=0;kt<Xe;kt++)Pt[kt]=arguments[kt];return(je=Ie.current)===null||je===void 0?void 0:je.call.apply(je,[Ie].concat(Pt))},[]);return ke}function Te(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var mt=Te()?xe.useLayoutEffect:xe.useEffect,ze=function(Ie,ke){var je=xe.useRef(!0);mt(function(){return Ie(je.current)},ke),mt(function(){return je.current=!1,function(){je.current=!0}},[])},It=function(Ie,ke){ze(function(je){if(!je)return Ie()},ke)},Ct=null;function ht(lt){var Ie=xe.useRef(!1),ke=xe.useState(lt),je=(0,Ue.Z)(ke,2),Xe=je[0],Pt=je[1];xe.useEffect(function(){return Ie.current=!1,function(){Ie.current=!0}},[]);function kt(Lt,Ge){Ge&&Ie.current||Pt(Lt)}return[Xe,kt]}function Ye(lt){return lt!==void 0}function De(lt,Ie){var ke=Ie||{},je=ke.defaultValue,Xe=ke.value,Pt=ke.onChange,kt=ke.postState,Lt=ht(function(){return Ye(Xe)?Xe:Ye(je)?typeof je=="function"?je():je:typeof lt=="function"?lt():lt}),Ge=(0,Ue.Z)(Lt,2),Ht=Ge[0],Dt=Ge[1],Ln=Xe!==void 0?Xe:Ht,un=kt?kt(Ln):Ln,Rn=pe(Pt),ir=ht([Ln]),yr=(0,Ue.Z)(ir,2),Qe=yr[0],Le=yr[1];It(function(){var Nn=Qe[0];Ht!==Nn&&Rn(Ht,Nn)},[Qe]),It(function(){Ye(Xe)||Dt(Xe)},[Xe]);var Nt=pe(function(Nn,gn){Dt(Nn,gn),Le([Ln],gn)});return[un,Nt]}var At=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Jt=(0,xe.forwardRef)(function(lt,Ie){var ke,je=lt.prefixCls,Xe=je===void 0?"rc-checkbox":je,Pt=lt.className,kt=lt.style,Lt=lt.checked,Ge=lt.disabled,Ht=lt.defaultChecked,Dt=Ht===void 0?!1:Ht,Ln=lt.type,un=Ln===void 0?"checkbox":Ln,Rn=lt.title,ir=lt.onChange,yr=(0,be.Z)(lt,At),Qe=(0,xe.useRef)(null),Le=De(Dt,{value:Lt}),Nt=(0,Ue.Z)(Le,2),Nn=Nt[0],gn=Nt[1];(0,xe.useImperativeHandle)(Ie,function(){return{focus:function(){var en;(en=Qe.current)===null||en===void 0||en.focus()},blur:function(){var en;(en=Qe.current)===null||en===void 0||en.blur()},input:Qe.current}});var Je=Me()(Xe,Pt,(ke={},(0,$e.Z)(ke,"".concat(Xe,"-checked"),Nn),(0,$e.Z)(ke,"".concat(Xe,"-disabled"),Ge),ke)),st=function(en){Ge||("checked"in lt||gn(en.target.checked),ir==null||ir({target:(0,et.Z)((0,et.Z)({},lt),{},{type:un,checked:en.target.checked}),stopPropagation:function(){en.stopPropagation()},preventDefault:function(){en.preventDefault()},nativeEvent:en.nativeEvent}))};return xe.createElement("span",{className:Je,title:Rn,style:kt},xe.createElement("input",(0,fe.Z)({},yr,{className:"".concat(Xe,"-input"),ref:Qe,onChange:st,disabled:Ge,checked:!!Nn,type:un})),xe.createElement("span",{className:"".concat(Xe,"-inner")}))}),nt=Jt},26819:function(Cn,Xt){"use strict";var se;var fe=typeof Symbol=="function"&&Symbol.for,et=fe?Symbol.for("react.element"):60103,$e=fe?Symbol.for("react.portal"):60106,Ue=fe?Symbol.for("react.fragment"):60107,be=fe?Symbol.for("react.strict_mode"):60108,Se=fe?Symbol.for("react.profiler"):60114,Me=fe?Symbol.for("react.provider"):60109,xe=fe?Symbol.for("react.context"):60110,pe=fe?Symbol.for("react.async_mode"):60111,Te=fe?Symbol.for("react.concurrent_mode"):60111,mt=fe?Symbol.for("react.forward_ref"):60112,ze=fe?Symbol.for("react.suspense"):60113,It=fe?Symbol.for("react.suspense_list"):60120,Ct=fe?Symbol.for("react.memo"):60115,ht=fe?Symbol.for("react.lazy"):60116,Ye=fe?Symbol.for("react.block"):60121,De=fe?Symbol.for("react.fundamental"):60117,At=fe?Symbol.for("react.responder"):60118,Jt=fe?Symbol.for("react.scope"):60119;function nt(Ie){if(typeof Ie=="object"&&Ie!==null){var ke=Ie.$$typeof;switch(ke){case et:switch(Ie=Ie.type,Ie){case pe:case Te:case Ue:case Se:case be:case ze:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case xe:case mt:case ht:case Ct:case Me:return Ie;default:return ke}}case $e:return ke}}}function lt(Ie){return nt(Ie)===Te}se=pe,se=Te,se=xe,se=Me,se=et,se=mt,se=Ue,se=ht,se=Ct,se=$e,se=Se,se=be,se=ze,se=function(Ie){return lt(Ie)||nt(Ie)===pe},se=lt,se=function(Ie){return nt(Ie)===xe},se=function(Ie){return nt(Ie)===Me},se=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===et},se=function(Ie){return nt(Ie)===mt},se=function(Ie){return nt(Ie)===Ue},se=function(Ie){return nt(Ie)===ht},Xt.isMemo=function(Ie){return nt(Ie)===Ct},se=function(Ie){return nt(Ie)===$e},se=function(Ie){return nt(Ie)===Se},se=function(Ie){return nt(Ie)===be},se=function(Ie){return nt(Ie)===ze},se=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ue||Ie===Te||Ie===Se||Ie===be||Ie===ze||Ie===It||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===ht||Ie.$$typeof===Ct||Ie.$$typeof===Me||Ie.$$typeof===xe||Ie.$$typeof===mt||Ie.$$typeof===De||Ie.$$typeof===At||Ie.$$typeof===Jt||Ie.$$typeof===Ye)},se=nt},18459:function(Cn,Xt,se){"use strict";Cn.exports=se(26819)},16651:function(Cn,Xt){"use strict";var se;var fe=Symbol.for("react.element"),et=Symbol.for("react.portal"),$e=Symbol.for("react.fragment"),Ue=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),Me=Symbol.for("react.context"),xe=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),mt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),It=Symbol.for("react.lazy"),Ct=Symbol.for("react.offscreen"),ht;ht=Symbol.for("react.module.reference");function Ye(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case fe:switch(De=De.type,De){case $e:case be:case Ue:case Te:case mt:return De;default:switch(De=De&&De.$$typeof,De){case xe:case Me:case pe:case It:case ze:case Se:return De;default:return At}}case et:return At}}}se=Me,se=Se,se=fe,se=pe,se=$e,se=It,se=ze,se=et,se=be,se=Ue,se=Te,se=mt,se=function(){return!1},se=function(){return!1},se=function(De){return Ye(De)===Me},se=function(De){return Ye(De)===Se},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},se=function(De){return Ye(De)===pe},se=function(De){return Ye(De)===$e},se=function(De){return Ye(De)===It},se=function(De){return Ye(De)===ze},se=function(De){return Ye(De)===et},se=function(De){return Ye(De)===be},se=function(De){return Ye(De)===Ue},se=function(De){return Ye(De)===Te},se=function(De){return Ye(De)===mt},se=function(De){return typeof De=="string"||typeof De=="function"||De===$e||De===be||De===Ue||De===Te||De===mt||De===Ct||typeof De=="object"&&De!==null&&(De.$$typeof===It||De.$$typeof===ze||De.$$typeof===Se||De.$$typeof===Me||De.$$typeof===pe||De.$$typeof===ht||De.getModuleId!==void 0)},se=Ye},33993:function(Cn,Xt,se){"use strict";se(16651)},82523:function(Cn,Xt){"use strict";var se;var fe=Symbol.for("react.element"),et=Symbol.for("react.portal"),$e=Symbol.for("react.fragment"),Ue=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),Me=Symbol.for("react.context"),xe=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),mt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),It=Symbol.for("react.lazy"),Ct=Symbol.for("react.offscreen"),ht;ht=Symbol.for("react.module.reference");function Ye(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case fe:switch(De=De.type,De){case $e:case be:case Ue:case Te:case mt:return De;default:switch(De=De&&De.$$typeof,De){case xe:case Me:case pe:case It:case ze:case Se:return De;default:return At}}case et:return At}}}se=Me,se=Se,se=fe,se=pe,se=$e,se=It,se=ze,se=et,se=be,se=Ue,se=Te,se=mt,se=function(){return!1},se=function(){return!1},se=function(De){return Ye(De)===Me},se=function(De){return Ye(De)===Se},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},se=function(De){return Ye(De)===pe},se=function(De){return Ye(De)===$e},se=function(De){return Ye(De)===It},se=function(De){return Ye(De)===ze},se=function(De){return Ye(De)===et},se=function(De){return Ye(De)===be},se=function(De){return Ye(De)===Ue},se=function(De){return Ye(De)===Te},se=function(De){return Ye(De)===mt},se=function(De){return typeof De=="string"||typeof De=="function"||De===$e||De===be||De===Ue||De===Te||De===mt||De===Ct||typeof De=="object"&&De!==null&&(De.$$typeof===It||De.$$typeof===ze||De.$$typeof===Se||De.$$typeof===Me||De.$$typeof===pe||De.$$typeof===ht||De.getModuleId!==void 0)},se=Ye},27183:function(Cn,Xt,se){"use strict";se(82523)},67656:function(Cn,Xt,se){"use strict";se.r(Xt),se.d(Xt,{BaseInput:function(){return Te},default:function(){return Jt}});var fe=se(87462),et=se(1413),$e=se(4942),Ue=se(71002),be=se(94184),Se=se.n(be),Me=se(67294),xe=se(87887),pe=function(lt){var Ie,ke,je=lt.inputElement,Xe=lt.prefixCls,Pt=lt.prefix,kt=lt.suffix,Lt=lt.addonBefore,Ge=lt.addonAfter,Ht=lt.className,Dt=lt.style,Ln=lt.disabled,un=lt.readOnly,Rn=lt.focused,ir=lt.triggerFocus,yr=lt.allowClear,Qe=lt.value,Le=lt.handleReset,Nt=lt.hidden,Nn=lt.classes,gn=lt.classNames,Je=lt.dataAttrs,st=lt.styles,_t=lt.components,en=(_t==null?void 0:_t.affixWrapper)||"span",Bt=(_t==null?void 0:_t.groupWrapper)||"span",Ft=(_t==null?void 0:_t.wrapper)||"span",zt=(_t==null?void 0:_t.groupAddon)||"span",Mn=(0,Me.useRef)(null),bn=function(An){var tn;(tn=Mn.current)!==null&&tn!==void 0&&tn.contains(An.target)&&(ir==null||ir())},Ee=function(){var An;if(!yr)return null;var tn=!Ln&&!un&&Qe,Nr="".concat(Xe,"-clear-icon"),Wr=(0,Ue.Z)(yr)==="object"&&yr!==null&&yr!==void 0&&yr.clearIcon?yr.clearIcon:"\u2716";return Me.createElement("span",{onClick:Le,onMouseDown:function($n){return $n.preventDefault()},className:Se()(Nr,(An={},(0,$e.Z)(An,"".concat(Nr,"-hidden"),!tn),(0,$e.Z)(An,"".concat(Nr,"-has-suffix"),!!kt),An)),role:"button",tabIndex:-1},Wr)},ce=(0,Me.cloneElement)(je,{value:Qe,hidden:Nt,className:Se()((Ie=je.props)===null||Ie===void 0?void 0:Ie.className,!(0,xe.X3)(lt)&&!(0,xe.He)(lt)&&Ht)||null,style:(0,et.Z)((0,et.Z)({},(ke=je.props)===null||ke===void 0?void 0:ke.style),!(0,xe.X3)(lt)&&!(0,xe.He)(lt)?Dt:{})});if((0,xe.X3)(lt)){var le,ye="".concat(Xe,"-affix-wrapper"),ve=Se()(ye,(le={},(0,$e.Z)(le,"".concat(ye,"-disabled"),Ln),(0,$e.Z)(le,"".concat(ye,"-focused"),Rn),(0,$e.Z)(le,"".concat(ye,"-readonly"),un),(0,$e.Z)(le,"".concat(ye,"-input-with-clear-btn"),kt&&yr&&Qe),le),!(0,xe.He)(lt)&&Ht,Nn==null?void 0:Nn.affixWrapper,gn==null?void 0:gn.affixWrapper),oe=(kt||yr)&&Me.createElement("span",{className:Se()("".concat(Xe,"-suffix"),gn==null?void 0:gn.suffix),style:st==null?void 0:st.suffix},Ee(),kt);ce=Me.createElement(en,(0,fe.Z)({className:ve,style:(0,et.Z)((0,et.Z)({},(0,xe.He)(lt)?void 0:Dt),st==null?void 0:st.affixWrapper),hidden:!(0,xe.He)(lt)&&Nt,onClick:bn},Je==null?void 0:Je.affixWrapper,{ref:Mn}),Pt&&Me.createElement("span",{className:Se()("".concat(Xe,"-prefix"),gn==null?void 0:gn.prefix),style:st==null?void 0:st.prefix},Pt),(0,Me.cloneElement)(je,{value:Qe,hidden:null}),oe)}if((0,xe.He)(lt)){var He="".concat(Xe,"-group"),xt="".concat(He,"-addon"),Yt=Se()("".concat(Xe,"-wrapper"),He,Nn==null?void 0:Nn.wrapper),pn=Se()("".concat(Xe,"-group-wrapper"),Ht,Nn==null?void 0:Nn.group);return Me.createElement(Bt,{className:pn,style:Dt,hidden:Nt},Me.createElement(Ft,{className:Yt},Lt&&Me.createElement(zt,{className:xt},Lt),(0,Me.cloneElement)(ce,{hidden:null}),Ge&&Me.createElement(zt,{className:xt},Ge)))}return ce},Te=pe,mt=se(74902),ze=se(97685),It=se(45987),Ct=se(21770),ht=se(98423),Ye=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],De=(0,Me.forwardRef)(function(nt,lt){var Ie=nt.autoComplete,ke=nt.onChange,je=nt.onFocus,Xe=nt.onBlur,Pt=nt.onPressEnter,kt=nt.onKeyDown,Lt=nt.prefixCls,Ge=Lt===void 0?"rc-input":Lt,Ht=nt.disabled,Dt=nt.htmlSize,Ln=nt.className,un=nt.maxLength,Rn=nt.suffix,ir=nt.showCount,yr=nt.type,Qe=yr===void 0?"text":yr,Le=nt.classes,Nt=nt.classNames,Nn=nt.styles,gn=(0,It.Z)(nt,Ye),Je=(0,Ct.Z)(nt.defaultValue,{value:nt.value}),st=(0,ze.Z)(Je,2),_t=st[0],en=st[1],Bt=(0,Me.useState)(!1),Ft=(0,ze.Z)(Bt,2),zt=Ft[0],Mn=Ft[1],bn=(0,Me.useRef)(null),Ee=function(pn){bn.current&&(0,xe.nH)(bn.current,pn)};(0,Me.useImperativeHandle)(lt,function(){return{focus:Ee,blur:function(){var pn;(pn=bn.current)===null||pn===void 0||pn.blur()},setSelectionRange:function(pn,dn,An){var tn;(tn=bn.current)===null||tn===void 0||tn.setSelectionRange(pn,dn,An)},select:function(){var pn;(pn=bn.current)===null||pn===void 0||pn.select()},input:bn.current}}),(0,Me.useEffect)(function(){Mn(function(Yt){return Yt&&Ht?!1:Yt})},[Ht]);var ce=function(pn){nt.value===void 0&&en(pn.target.value),bn.current&&(0,xe.rJ)(bn.current,pn,ke)},le=function(pn){Pt&&pn.key==="Enter"&&Pt(pn),kt==null||kt(pn)},ye=function(pn){Mn(!0),je==null||je(pn)},ve=function(pn){Mn(!1),Xe==null||Xe(pn)},oe=function(pn){en(""),Ee(),bn.current&&(0,xe.rJ)(bn.current,pn,ke)},He=function(){var pn=(0,ht.Z)(nt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Me.createElement("input",(0,fe.Z)({autoComplete:Ie},pn,{onChange:ce,onFocus:ye,onBlur:ve,onKeyDown:le,className:Se()(Ge,(0,$e.Z)({},"".concat(Ge,"-disabled"),Ht),Nt==null?void 0:Nt.input),style:Nn==null?void 0:Nn.input,ref:bn,size:Dt,type:Qe}))},xt=function(){var pn=Number(un)>0;if(Rn||ir){var dn=(0,xe.D7)(_t),An=(0,mt.Z)(dn).length,tn=(0,Ue.Z)(ir)==="object"?ir.formatter({value:dn,count:An,maxLength:un}):"".concat(An).concat(pn?" / ".concat(un):"");return Me.createElement(Me.Fragment,null,!!ir&&Me.createElement("span",{className:Se()("".concat(Ge,"-show-count-suffix"),(0,$e.Z)({},"".concat(Ge,"-show-count-has-suffix"),!!Rn),Nt==null?void 0:Nt.count),style:(0,et.Z)({},Nn==null?void 0:Nn.count)},tn),Rn)}return null};return Me.createElement(Te,(0,fe.Z)({},gn,{prefixCls:Ge,className:Ln,inputElement:He(),handleReset:oe,value:(0,xe.D7)(_t),focused:zt,triggerFocus:Ee,suffix:xt(),disabled:Ht,classes:Le,classNames:Nt,styles:Nn}))}),At=De,Jt=At},87887:function(Cn,Xt,se){"use strict";se.d(Xt,{D7:function(){return be},He:function(){return fe},X3:function(){return et},nH:function(){return Ue},rJ:function(){return $e}});function fe(Se){return!!(Se.addonBefore||Se.addonAfter)}function et(Se){return!!(Se.prefix||Se.suffix||Se.allowClear)}function $e(Se,Me,xe,pe){if(xe){var Te=Me;if(Me.type==="click"){var mt=Se.cloneNode(!0);Te=Object.create(Me,{target:{value:mt},currentTarget:{value:mt}}),mt.value="",xe(Te);return}if(pe!==void 0){Te=Object.create(Me,{target:{value:Se},currentTarget:{value:Se}}),Se.value=pe,xe(Te);return}xe(Te)}}function Ue(Se,Me){if(Se){Se.focus(Me);var xe=Me||{},pe=xe.cursor;if(pe){var Te=Se.value.length;switch(pe){case"start":Se.setSelectionRange(0,0);break;case"end":Se.setSelectionRange(Te,Te);break;default:Se.setSelectionRange(0,Te)}}}}function be(Se){return typeof Se=="undefined"||Se===null?"":String(Se)}},78595:function(Cn,Xt,se){"use strict";se.d(Xt,{iz:function(){return Kr},ck:function(){return or},BW:function(){return Br},sN:function(){return or},Wd:function(){return $t},ZP:function(){return Be},Xl:function(){return tn}});var fe=se(87462),et=se(4942),$e=se(1413),Ue=se(74902),be=se(97685),Se=se(45987),Me=se(94184),xe=se.n(Me),pe=se(67294),Te=se(48555);function mt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ze=mt()?pe.useLayoutEffect:pe.useEffect,It=function(We,qe){var rt=pe.useRef(!0);ze(function(){return We(rt.current)},qe),ze(function(){return rt.current=!1,function(){rt.current=!0}},[])},Ct=function(We,qe){It(function(rt){if(!rt)return We()},qe)},ht=It,Ye=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],De=void 0;function At(Ne,We){var qe=Ne.prefixCls,rt=Ne.invalidate,bt=Ne.item,Gt=Ne.renderItem,nn=Ne.responsive,Gn=Ne.responsiveDisabled,fr=Ne.registerSize,Wn=Ne.itemKey,vn=Ne.className,hn=Ne.style,Sn=Ne.children,Pn=Ne.display,ur=Ne.order,jn=Ne.component,Zn=jn===void 0?"div":jn,Jn=(0,Se.Z)(Ne,Ye),Qn=nn&&!Pn;function hr(Ot){fr(Wn,Ot)}pe.useEffect(function(){return function(){hr(null)}},[]);var Pe=Gt&&bt!==De?Gt(bt):Sn,Fe;rt||(Fe={opacity:Qn?0:1,height:Qn?0:De,overflowY:Qn?"hidden":De,order:nn?ur:De,pointerEvents:Qn?"none":De,position:Qn?"absolute":De});var wt={};Qn&&(wt["aria-hidden"]=!0);var it=pe.createElement(Zn,(0,fe.Z)({className:xe()(!rt&&qe,vn),style:(0,$e.Z)((0,$e.Z)({},Fe),hn)},wt,Jn,{ref:We}),Pe);return nn&&(it=pe.createElement(Te.Z,{onResize:function(on){var mn=on.offsetWidth;hr(mn)},disabled:Gn},it)),it}var Jt=pe.forwardRef(At);Jt.displayName="Item";var nt=Jt;function lt(Ne){var We=pe.useRef();We.current=Ne;var qe=pe.useCallback(function(){for(var rt,bt=arguments.length,Gt=new Array(bt),nn=0;nn<bt;nn++)Gt[nn]=arguments[nn];return(rt=We.current)===null||rt===void 0?void 0:rt.call.apply(rt,[We].concat(Gt))},[]);return qe}var Ie=se(73935),ke=function(We){return+setTimeout(We,16)},je=function(We){return clearTimeout(We)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ke=function(We){return window.requestAnimationFrame(We)},je=function(We){return window.cancelAnimationFrame(We)});var Xe=0,Pt=new Map;function kt(Ne){Pt.delete(Ne)}var Lt=function(We){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Xe+=1;var rt=Xe;function bt(Gt){if(Gt===0)kt(rt),We();else{var nn=ke(function(){bt(Gt-1)});Pt.set(rt,nn)}}return bt(qe),rt};Lt.cancel=function(Ne){var We=Pt.get(Ne);return kt(We),je(We)};var Ge=Lt;function Ht(Ne){if(typeof MessageChannel=="undefined")Ge(Ne);else{var We=new MessageChannel;We.port1.onmessage=function(){return Ne()},We.port2.postMessage(void 0)}}function Dt(){var Ne=pe.useRef(null),We=function(rt){Ne.current||(Ne.current=[],Ht(function(){(0,Ie.unstable_batchedUpdates)(function(){Ne.current.forEach(function(bt){bt()}),Ne.current=null})})),Ne.current.push(rt)};return We}function Ln(Ne,We){var qe=pe.useState(We),rt=(0,be.Z)(qe,2),bt=rt[0],Gt=rt[1],nn=lt(function(Gn){Ne(function(){Gt(Gn)})});return[bt,nn]}var un=pe.createContext(null),Rn=["component"],ir=["className"],yr=["className"],Qe=function(We,qe){var rt=pe.useContext(un);if(!rt){var bt=We.component,Gt=bt===void 0?"div":bt,nn=(0,Se.Z)(We,Rn);return pe.createElement(Gt,(0,fe.Z)({},nn,{ref:qe}))}var Gn=rt.className,fr=(0,Se.Z)(rt,ir),Wn=We.className,vn=(0,Se.Z)(We,yr);return pe.createElement(un.Provider,{value:null},pe.createElement(nt,(0,fe.Z)({ref:qe,className:xe()(Gn,Wn)},fr,vn)))},Le=pe.forwardRef(Qe);Le.displayName="RawItem";var Nt=Le,Nn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],gn="responsive",Je="invalidate";function st(Ne){return"+ ".concat(Ne.length," ...")}function _t(Ne,We){var qe=Ne.prefixCls,rt=qe===void 0?"rc-overflow":qe,bt=Ne.data,Gt=bt===void 0?[]:bt,nn=Ne.renderItem,Gn=Ne.renderRawItem,fr=Ne.itemKey,Wn=Ne.itemWidth,vn=Wn===void 0?10:Wn,hn=Ne.ssr,Sn=Ne.style,Pn=Ne.className,ur=Ne.maxCount,jn=Ne.renderRest,Zn=Ne.renderRawRest,Jn=Ne.suffix,Qn=Ne.component,hr=Qn===void 0?"div":Qn,Pe=Ne.itemComponent,Fe=Ne.onVisibleChange,wt=(0,Se.Z)(Ne,Nn),it=hn==="full",Ot=Dt(),on=Ln(Ot,null),mn=(0,be.Z)(on,2),On=mn[0],xn=mn[1],Qt=On||0,Bn=Ln(Ot,new Map),Kn=(0,be.Z)(Bn,2),mr=Kn[0],Fn=Kn[1],_r=Ln(Ot,0),Zr=(0,be.Z)(_r,2),Tr=Zr[0],$r=Zr[1],xr=Ln(Ot,0),Pr=(0,be.Z)(xr,2),Yr=Pr[0],ai=Pr[1],Dr=Ln(Ot,0),li=(0,be.Z)(Dr,2),Pi=li[0],ta=li[1],Vi=(0,pe.useState)(null),Ni=(0,be.Z)(Vi,2),Xi=Ni[0],qi=Ni[1],bi=(0,pe.useState)(null),Fi=(0,be.Z)(bi,2),jr=Fi[0],ci=Fi[1],Ti=pe.useMemo(function(){return jr===null&&it?Number.MAX_SAFE_INTEGER:jr||0},[jr,On]),ji=(0,pe.useState)(!1),Na=(0,be.Z)(ji,2),Fa=Na[0],Aa=Na[1],ua="".concat(rt,"-item"),Yi=Math.max(Tr,Yr),Mi=ur===gn,Oa=Gt.length&&Mi,ki=ur===Je,Jr=Oa||typeof ur=="number"&&Gt.length>ur,zi=(0,pe.useMemo)(function(){var _i=Gt;return Oa?On===null&&it?_i=Gt:_i=Gt.slice(0,Math.min(Gt.length,Qt/vn)):typeof ur=="number"&&(_i=Gt.slice(0,ur)),_i},[Gt,vn,On,ur,Oa]),ca=(0,pe.useMemo)(function(){return Oa?Gt.slice(Ti+1):Gt.slice(zi.length)},[Gt,zi,Oa,Ti]),Ui=(0,pe.useCallback)(function(_i,Ki){var da;return typeof fr=="function"?fr(_i):(da=fr&&(_i==null?void 0:_i[fr]))!==null&&da!==void 0?da:Ki},[fr]),ia=(0,pe.useCallback)(nn||function(_i){return _i},[nn]);function fi(_i,Ki,da){jr===_i&&(Ki===void 0||Ki===Xi)||(ci(_i),da||(Aa(_i<Gt.length-1),Fe==null||Fe(_i)),Ki!==void 0&&qi(Ki))}function pa(_i,Ki){xn(Ki.clientWidth)}function xa(_i,Ki){Fn(function(da){var Sa=new Map(da);return Ki===null?Sa.delete(_i):Sa.set(_i,Ki),Sa})}function fa(_i,Ki){ai(Ki),$r(Yr)}function wa(_i,Ki){ta(Ki)}function Ea(_i){return mr.get(Ui(zi[_i],_i))}ht(function(){if(Qt&&typeof Yi=="number"&&zi){var _i=Pi,Ki=zi.length,da=Ki-1;if(!Ki){fi(0,null);return}for(var Sa=0;Sa<Ki;Sa+=1){var Ka=Ea(Sa);if(it&&(Ka=Ka||0),Ka===void 0){fi(Sa-1,void 0,!0);break}if(_i+=Ka,da===0&&_i<=Qt||Sa===da-1&&_i+Ea(da)<=Qt){fi(da,null);break}else if(_i+Yi>Qt){fi(Sa-1,_i-Ka-Pi+Yr);break}}Jn&&Ea(0)+Pi>Qt&&qi(null)}},[Qt,mr,Yr,Pi,Ui,zi]);var Va=Fa&&!!ca.length,ha={};Xi!==null&&Oa&&(ha={position:"absolute",left:Xi,top:0});var ka={prefixCls:ua,responsive:Oa,component:Pe,invalidate:ki},Ja=Gn?function(_i,Ki){var da=Ui(_i,Ki);return pe.createElement(un.Provider,{key:da,value:(0,$e.Z)((0,$e.Z)({},ka),{},{order:Ki,item:_i,itemKey:da,registerSize:xa,display:Ki<=Ti})},Gn(_i,Ki))}:function(_i,Ki){var da=Ui(_i,Ki);return pe.createElement(nt,(0,fe.Z)({},ka,{order:Ki,key:da,item:_i,renderItem:ia,itemKey:da,registerSize:xa,display:Ki<=Ti}))},Ga,so={order:Va?Ti:Number.MAX_SAFE_INTEGER,className:"".concat(ua,"-rest"),registerSize:fa,display:Va};if(Zn)Zn&&(Ga=pe.createElement(un.Provider,{value:(0,$e.Z)((0,$e.Z)({},ka),so)},Zn(ca)));else{var $a=jn||st;Ga=pe.createElement(nt,(0,fe.Z)({},ka,so),typeof $a=="function"?$a(ca):$a)}var Ca=pe.createElement(hr,(0,fe.Z)({className:xe()(!ki&&rt,Pn),style:Sn,ref:We},wt),zi.map(Ja),Jr?Ga:null,Jn&&pe.createElement(nt,(0,fe.Z)({},ka,{responsive:Mi,responsiveDisabled:!Oa,order:Ti,className:"".concat(ua,"-suffix"),registerSize:wa,display:!0,style:ha}),Jn));return Mi&&(Ca=pe.createElement(Te.Z,{onResize:pa,disabled:!Oa},Ca)),Ca}var en=pe.forwardRef(_t);en.displayName="Overflow",en.Item=Nt,en.RESPONSIVE=gn,en.INVALIDATE=Je;var Bt=en,Ft=Bt,zt=se(21770),Mn=se(80334),bn=se(91881),Ee=pe.createContext(null);function ce(Ne,We){return Ne===void 0?null:"".concat(Ne,"-").concat(We)}function le(Ne){var We=pe.useContext(Ee);return ce(We,Ne)}var ye=se(56982),ve=["children","locked"],oe=pe.createContext(null);function He(Ne,We){var qe=(0,$e.Z)({},Ne);return Object.keys(We).forEach(function(rt){var bt=We[rt];bt!==void 0&&(qe[rt]=bt)}),qe}function xt(Ne){var We=Ne.children,qe=Ne.locked,rt=(0,Se.Z)(Ne,ve),bt=pe.useContext(oe),Gt=(0,ye.Z)(function(){return He(bt,rt)},[bt,rt],function(nn,Gn){return!qe&&(nn[0]!==Gn[0]||!(0,bn.Z)(nn[1],Gn[1],!0))});return pe.createElement(oe.Provider,{value:Gt},We)}var Yt=[],pn=pe.createContext(null);function dn(){return pe.useContext(pn)}var An=pe.createContext(Yt);function tn(Ne){var We=pe.useContext(An);return pe.useMemo(function(){return Ne!==void 0?[].concat((0,Ue.Z)(We),[Ne]):We},[We,Ne])}var Nr=pe.createContext(null),Wr=pe.createContext({}),Kt=Wr,$n=se(15105),ei=se(75164),hi=function(Ne){if(!Ne)return!1;if(Ne instanceof Element){if(Ne.offsetParent)return!0;if(Ne.getBBox){var We=Ne.getBBox(),qe=We.width,rt=We.height;if(qe||rt)return!0}if(Ne.getBoundingClientRect){var bt=Ne.getBoundingClientRect(),Gt=bt.width,nn=bt.height;if(Gt||nn)return!0}}return!1};function ut(Ne){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(hi(Ne)){var qe=Ne.nodeName.toLowerCase(),rt=["input","select","textarea","button"].includes(qe)||Ne.isContentEditable||qe==="a"&&!!Ne.getAttribute("href"),bt=Ne.getAttribute("tabindex"),Gt=Number(bt),nn=null;return bt&&!Number.isNaN(Gt)?nn=Gt:rt&&nn===null&&(nn=0),rt&&Ne.disabled&&(nn=null),nn!==null&&(nn>=0||We&&nn<0)}return!1}function Vt(Ne){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,qe=(0,Ue.Z)(Ne.querySelectorAll("*")).filter(function(rt){return ut(rt,We)});return ut(Ne,We)&&qe.unshift(Ne),qe}var Vn=null;function rr(){Vn=document.activeElement}function gr(){Vn=null}function Ir(){if(Vn)try{Vn.focus()}catch(Ne){}}function Ur(Ne,We){if(We.keyCode===9){var qe=Vt(Ne),rt=qe[We.shiftKey?0:qe.length-1],bt=rt===document.activeElement||Ne===document.activeElement;if(bt){var Gt=qe[We.shiftKey?qe.length-1:0];Gt.focus(),We.preventDefault()}}}var Gr=$n.Z.LEFT,Xr=$n.Z.RIGHT,ui=$n.Z.UP,br=$n.Z.DOWN,Ei=$n.Z.ENTER,sa=$n.Z.ESC,Ji=$n.Z.HOME,Qi=$n.Z.END,Ci=[ui,br,Gr,Xr];function gt(Ne,We,qe,rt){var bt,Gt,nn,Gn,fr="prev",Wn="next",vn="children",hn="parent";if(Ne==="inline"&&rt===Ei)return{inlineTrigger:!0};var Sn=(bt={},(0,et.Z)(bt,ui,fr),(0,et.Z)(bt,br,Wn),bt),Pn=(Gt={},(0,et.Z)(Gt,Gr,qe?Wn:fr),(0,et.Z)(Gt,Xr,qe?fr:Wn),(0,et.Z)(Gt,br,vn),(0,et.Z)(Gt,Ei,vn),Gt),ur=(nn={},(0,et.Z)(nn,ui,fr),(0,et.Z)(nn,br,Wn),(0,et.Z)(nn,Ei,vn),(0,et.Z)(nn,sa,hn),(0,et.Z)(nn,Gr,qe?vn:hn),(0,et.Z)(nn,Xr,qe?hn:vn),nn),jn={inline:Sn,horizontal:Pn,vertical:ur,inlineSub:Sn,horizontalSub:ur,verticalSub:ur},Zn=(Gn=jn["".concat(Ne).concat(We?"":"Sub")])===null||Gn===void 0?void 0:Gn[rt];switch(Zn){case fr:return{offset:-1,sibling:!0};case Wn:return{offset:1,sibling:!0};case hn:return{offset:-1,sibling:!1};case vn:return{offset:1,sibling:!1};default:return null}}function En(Ne){for(var We=Ne;We;){if(We.getAttribute("data-menu-list"))return We;We=We.parentElement}return null}function kn(Ne,We){for(var qe=Ne||document.activeElement;qe;){if(We.has(qe))return qe;qe=qe.parentElement}return null}function Tn(Ne,We){var qe=Vt(Ne,!0);return qe.filter(function(rt){return We.has(rt)})}function sr(Ne,We,qe){var rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ne)return null;var bt=Tn(Ne,We),Gt=bt.length,nn=bt.findIndex(function(Gn){return qe===Gn});return rt<0?nn===-1?nn=Gt-1:nn-=1:rt>0&&(nn+=1),nn=(nn+Gt)%Gt,bt[nn]}function tr(Ne,We,qe,rt,bt,Gt,nn,Gn,fr,Wn){var vn=pe.useRef(),hn=pe.useRef();hn.current=We;var Sn=function(){ei.Z.cancel(vn.current)};return pe.useEffect(function(){return function(){Sn()}},[]),function(Pn){var ur=Pn.which;if([].concat(Ci,[Ei,sa,Ji,Qi]).includes(ur)){var jn,Zn,Jn,Qn=function(){jn=new Set,Zn=new Map,Jn=new Map;var Kn=Gt();return Kn.forEach(function(mr){var Fn=document.querySelector("[data-menu-id='".concat(ce(rt,mr),"']"));Fn&&(jn.add(Fn),Jn.set(Fn,mr),Zn.set(mr,Fn))}),jn};Qn();var hr=Zn.get(We),Pe=kn(hr,jn),Fe=Jn.get(Pe),wt=gt(Ne,nn(Fe,!0).length===1,qe,ur);if(!wt&&ur!==Ji&&ur!==Qi)return;(Ci.includes(ur)||[Ji,Qi].includes(ur))&&Pn.preventDefault();var it=function(Kn){if(Kn){var mr=Kn,Fn=Kn.querySelector("a");Fn!=null&&Fn.getAttribute("href")&&(mr=Fn);var _r=Jn.get(Kn);Gn(_r),Sn(),vn.current=(0,ei.Z)(function(){hn.current===_r&&mr.focus()})}};if([Ji,Qi].includes(ur)||wt.sibling||!Pe){var Ot;!Pe||Ne==="inline"?Ot=bt.current:Ot=En(Pe);var on,mn=Tn(Ot,jn);ur===Ji?on=mn[0]:ur===Qi?on=mn[mn.length-1]:on=sr(Ot,jn,Pe,wt.offset),it(on)}else if(wt.inlineTrigger)fr(Fe);else if(wt.offset>0)fr(Fe,!0),Sn(),vn.current=(0,ei.Z)(function(){Qn();var Bn=Pe.getAttribute("aria-controls"),Kn=document.getElementById(Bn),mr=sr(Kn,jn);it(mr)},5);else if(wt.offset<0){var On=nn(Fe,!0),xn=On[On.length-2],Qt=Zn.get(xn);fr(xn,!1),it(Qt)}}Wn==null||Wn(Pn)}}function pr(Ne){Promise.resolve().then(Ne)}var Hn="__RC_UTIL_PATH_SPLIT__",Ze=function(We){return We.join(Hn)},at=function(We){return We.split(Hn)},Et="rc-menu-more";function jt(){var Ne=pe.useState({}),We=(0,be.Z)(Ne,2),qe=We[1],rt=(0,pe.useRef)(new Map),bt=(0,pe.useRef)(new Map),Gt=pe.useState([]),nn=(0,be.Z)(Gt,2),Gn=nn[0],fr=nn[1],Wn=(0,pe.useRef)(0),vn=(0,pe.useRef)(!1),hn=function(){vn.current||qe({})},Sn=(0,pe.useCallback)(function(hr,Pe){var Fe=Ze(Pe);bt.current.set(Fe,hr),rt.current.set(hr,Fe),Wn.current+=1;var wt=Wn.current;pr(function(){wt===Wn.current&&hn()})},[]),Pn=(0,pe.useCallback)(function(hr,Pe){var Fe=Ze(Pe);bt.current.delete(Fe),rt.current.delete(hr)},[]),ur=(0,pe.useCallback)(function(hr){fr(hr)},[]),jn=(0,pe.useCallback)(function(hr,Pe){var Fe=rt.current.get(hr)||"",wt=at(Fe);return Pe&&Gn.includes(wt[0])&&wt.unshift(Et),wt},[Gn]),Zn=(0,pe.useCallback)(function(hr,Pe){return hr.some(function(Fe){var wt=jn(Fe,!0);return wt.includes(Pe)})},[jn]),Jn=function(){var Pe=(0,Ue.Z)(rt.current.keys());return Gn.length&&Pe.push(Et),Pe},Qn=(0,pe.useCallback)(function(hr){var Pe="".concat(rt.current.get(hr)).concat(Hn),Fe=new Set;return(0,Ue.Z)(bt.current.keys()).forEach(function(wt){wt.startsWith(Pe)&&Fe.add(bt.current.get(wt))}),Fe},[]);return pe.useEffect(function(){return function(){vn.current=!0}},[]),{registerPath:Sn,unregisterPath:Pn,refreshOverflowKeys:ur,isSubPathKey:Zn,getKeyPath:jn,getKeys:Jn,getSubPathKeys:Qn}}function Ke(Ne){var We=pe.useRef(Ne);We.current=Ne;var qe=pe.useCallback(function(){for(var rt,bt=arguments.length,Gt=new Array(bt),nn=0;nn<bt;nn++)Gt[nn]=arguments[nn];return(rt=We.current)===null||rt===void 0?void 0:rt.call.apply(rt,[We].concat(Gt))},[]);return Ne?qe:void 0}var dt=Math.random().toFixed(5).toString().slice(2),Rt=0;function Tt(Ne){var We=(0,zt.Z)(Ne,{value:Ne}),qe=(0,be.Z)(We,2),rt=qe[0],bt=qe[1];return pe.useEffect(function(){Rt+=1;var Gt="".concat(dt,"-").concat(Rt);bt("rc-menu-uuid-".concat(Gt))},[]),rt}var Wt=se(15671),Zt=se(43144),zn=se(60136),Sr=se(51630),Yn=se(98423),qn=se(42550);function nr(Ne,We,qe,rt){var bt=pe.useContext(oe),Gt=bt.activeKey,nn=bt.onActive,Gn=bt.onInactive,fr={active:Gt===Ne};return We||(fr.onMouseEnter=function(Wn){qe==null||qe({key:Ne,domEvent:Wn}),nn(Ne)},fr.onMouseLeave=function(Wn){rt==null||rt({key:Ne,domEvent:Wn}),Gn(Ne)}),fr}function ar(Ne){var We=pe.useContext(oe),qe=We.mode,rt=We.rtl,bt=We.inlineIndent;if(qe!=="inline")return null;var Gt=Ne;return rt?{paddingRight:Gt*bt}:{paddingLeft:Gt*bt}}function ot(Ne){var We=Ne.icon,qe=Ne.props,rt=Ne.children,bt;return We===null||We===!1?null:(typeof We=="function"?bt=pe.createElement(We,(0,$e.Z)({},qe)):typeof We!="boolean"&&(bt=We),bt||rt||null)}var tt=["item"];function vt(Ne){var We=Ne.item,qe=(0,Se.Z)(Ne,tt);return Object.defineProperty(qe,"item",{get:function(){return(0,Mn.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),We}}),qe}var rn=["title","attribute","elementRef"],Dn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],an=["active"],cn=function(Ne){(0,zn.Z)(qe,Ne);var We=(0,Sr.Z)(qe);function qe(){return(0,Wt.Z)(this,qe),We.apply(this,arguments)}return(0,Zt.Z)(qe,[{key:"render",value:function(){var bt=this.props,Gt=bt.title,nn=bt.attribute,Gn=bt.elementRef,fr=(0,Se.Z)(bt,rn),Wn=(0,Yn.Z)(fr,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Mn.ZP)(!nn,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),pe.createElement(Ft.Item,(0,fe.Z)({},nn,{title:typeof Gt=="string"?Gt:void 0},Wn,{ref:Gn}))}}]),qe}(pe.Component),fn=pe.forwardRef(function(Ne,We){var qe,rt=Ne.style,bt=Ne.className,Gt=Ne.eventKey,nn=Ne.warnKey,Gn=Ne.disabled,fr=Ne.itemIcon,Wn=Ne.children,vn=Ne.role,hn=Ne.onMouseEnter,Sn=Ne.onMouseLeave,Pn=Ne.onClick,ur=Ne.onKeyDown,jn=Ne.onFocus,Zn=(0,Se.Z)(Ne,Dn),Jn=le(Gt),Qn=pe.useContext(oe),hr=Qn.prefixCls,Pe=Qn.onItemClick,Fe=Qn.disabled,wt=Qn.overflowDisabled,it=Qn.itemIcon,Ot=Qn.selectedKeys,on=Qn.onActive,mn=pe.useContext(Kt),On=mn._internalRenderMenuItem,xn="".concat(hr,"-item"),Qt=pe.useRef(),Bn=pe.useRef(),Kn=Fe||Gn,mr=(0,qn.x1)(We,Bn),Fn=tn(Gt),_r=function(Ni){return{key:Gt,keyPath:(0,Ue.Z)(Fn).reverse(),item:Qt.current,domEvent:Ni}},Zr=fr||it,Tr=nr(Gt,Kn,hn,Sn),$r=Tr.active,xr=(0,Se.Z)(Tr,an),Pr=Ot.includes(Gt),Yr=ar(Fn.length),ai=function(Ni){if(!Kn){var Xi=_r(Ni);Pn==null||Pn(vt(Xi)),Pe(Xi)}},Dr=function(Ni){if(ur==null||ur(Ni),Ni.which===$n.Z.ENTER){var Xi=_r(Ni);Pn==null||Pn(vt(Xi)),Pe(Xi)}},li=function(Ni){on(Gt),jn==null||jn(Ni)},Pi={};Ne.role==="option"&&(Pi["aria-selected"]=Pr);var ta=pe.createElement(cn,(0,fe.Z)({ref:Qt,elementRef:mr,role:vn===null?"none":vn||"menuitem",tabIndex:Gn?null:-1,"data-menu-id":wt&&Jn?null:Jn},Zn,xr,Pi,{component:"li","aria-disabled":Gn,style:(0,$e.Z)((0,$e.Z)({},Yr),rt),className:xe()(xn,(qe={},(0,et.Z)(qe,"".concat(xn,"-active"),$r),(0,et.Z)(qe,"".concat(xn,"-selected"),Pr),(0,et.Z)(qe,"".concat(xn,"-disabled"),Kn),qe),bt),onClick:ai,onKeyDown:Dr,onFocus:li}),Wn,pe.createElement(ot,{props:(0,$e.Z)((0,$e.Z)({},Ne),{},{isSelected:Pr}),icon:Zr}));return On&&(ta=On(ta,Ne,{selected:Pr})),ta});function In(Ne,We){var qe=Ne.eventKey,rt=dn(),bt=tn(qe);return pe.useEffect(function(){if(rt)return rt.registerPath(qe,bt),function(){rt.unregisterPath(qe,bt)}},[bt]),rt?null:pe.createElement(fn,(0,fe.Z)({},Ne,{ref:We}))}var or=pe.forwardRef(In),Ut=["className","children"],qr=function(We,qe){var rt=We.className,bt=We.children,Gt=(0,Se.Z)(We,Ut),nn=pe.useContext(oe),Gn=nn.prefixCls,fr=nn.mode,Wn=nn.rtl;return pe.createElement("ul",(0,fe.Z)({className:xe()(Gn,Wn&&"".concat(Gn,"-rtl"),"".concat(Gn,"-sub"),"".concat(Gn,"-").concat(fr==="inline"?"inline":"vertical"),rt),role:"menu"},Gt,{"data-menu-list":!0,ref:qe}),bt)},Fr=pe.forwardRef(qr);Fr.displayName="SubMenuList";var Ri=Fr,Li=se(50344);function pi(Ne,We){return(0,Li.Z)(Ne).map(function(qe,rt){if(pe.isValidElement(qe)){var bt,Gt,nn=qe.key,Gn=(bt=(Gt=qe.props)===null||Gt===void 0?void 0:Gt.eventKey)!==null&&bt!==void 0?bt:nn,fr=Gn==null;fr&&(Gn="tmp_key-".concat([].concat((0,Ue.Z)(We),[rt]).join("-")));var Wn={key:Gn,eventKey:Gn};return pe.cloneElement(qe,Wn)}return qe})}var Gi=se(62709),yi={adjustX:1,adjustY:1},ii={topLeft:{points:["bl","tl"],overflow:yi},topRight:{points:["br","tr"],overflow:yi},bottomLeft:{points:["tl","bl"],overflow:yi},bottomRight:{points:["tr","br"],overflow:yi},leftTop:{points:["tr","tl"],overflow:yi},leftBottom:{points:["br","bl"],overflow:yi},rightTop:{points:["tl","tr"],overflow:yi},rightBottom:{points:["bl","br"],overflow:yi}},Bi={topLeft:{points:["bl","tl"],overflow:yi},topRight:{points:["br","tr"],overflow:yi},bottomLeft:{points:["tl","bl"],overflow:yi},bottomRight:{points:["tr","br"],overflow:yi},rightTop:{points:["tr","tl"],overflow:yi},rightBottom:{points:["br","bl"],overflow:yi},leftTop:{points:["tl","tr"],overflow:yi},leftBottom:{points:["bl","br"],overflow:yi}},Zi=null;function Vr(Ne,We,qe){if(We)return We;if(qe)return qe[Ne]||qe.other}var mi={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Wi(Ne){var We=Ne.prefixCls,qe=Ne.visible,rt=Ne.children,bt=Ne.popup,Gt=Ne.popupStyle,nn=Ne.popupClassName,Gn=Ne.popupOffset,fr=Ne.disabled,Wn=Ne.mode,vn=Ne.onVisibleChange,hn=pe.useContext(oe),Sn=hn.getPopupContainer,Pn=hn.rtl,ur=hn.subMenuOpenDelay,jn=hn.subMenuCloseDelay,Zn=hn.builtinPlacements,Jn=hn.triggerSubMenuAction,Qn=hn.forceSubMenuRender,hr=hn.rootClassName,Pe=hn.motion,Fe=hn.defaultMotions,wt=pe.useState(!1),it=(0,be.Z)(wt,2),Ot=it[0],on=it[1],mn=Pn?(0,$e.Z)((0,$e.Z)({},Bi),Zn):(0,$e.Z)((0,$e.Z)({},ii),Zn),On=mi[Wn],xn=Vr(Wn,Pe,Fe),Qt=pe.useRef(xn);Wn!=="inline"&&(Qt.current=xn);var Bn=(0,$e.Z)((0,$e.Z)({},Qt.current),{},{leavedClassName:"".concat(We,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Kn=pe.useRef();return pe.useEffect(function(){return Kn.current=(0,ei.Z)(function(){on(qe)}),function(){ei.Z.cancel(Kn.current)}},[qe]),pe.createElement(Gi.Z,{prefixCls:We,popupClassName:xe()("".concat(We,"-popup"),(0,et.Z)({},"".concat(We,"-rtl"),Pn),nn,hr),stretch:Wn==="horizontal"?"minWidth":null,getPopupContainer:Sn,builtinPlacements:mn,popupPlacement:On,popupVisible:Ot,popup:bt,popupStyle:Gt,popupAlign:Gn&&{offset:Gn},action:fr?[]:[Jn],mouseEnterDelay:ur,mouseLeaveDelay:jn,onPopupVisibleChange:vn,forceRender:Qn,popupMotion:Bn,fresh:!0},rt)}var la=se(62874);function ea(Ne){var We=Ne.id,qe=Ne.open,rt=Ne.keyPath,bt=Ne.children,Gt="inline",nn=pe.useContext(oe),Gn=nn.prefixCls,fr=nn.forceSubMenuRender,Wn=nn.motion,vn=nn.defaultMotions,hn=nn.mode,Sn=pe.useRef(!1);Sn.current=hn===Gt;var Pn=pe.useState(!Sn.current),ur=(0,be.Z)(Pn,2),jn=ur[0],Zn=ur[1],Jn=Sn.current?qe:!1;pe.useEffect(function(){Sn.current&&Zn(!1)},[hn]);var Qn=(0,$e.Z)({},Vr(Gt,Wn,vn));rt.length>1&&(Qn.motionAppear=!1);var hr=Qn.onVisibleChanged;return Qn.onVisibleChanged=function(Pe){return!Sn.current&&!Pe&&Zn(!0),hr==null?void 0:hr(Pe)},jn?null:pe.createElement(xt,{mode:Gt,locked:!Sn.current},pe.createElement(la.Z,(0,fe.Z)({visible:Jn},Qn,{forceRender:fr,removeOnLeave:!1,leavedClassName:"".concat(Gn,"-hidden")}),function(Pe){var Fe=Pe.className,wt=Pe.style;return pe.createElement(Ri,{id:We,className:Fe,style:wt},bt)}))}var ti=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],yt=["active"],pt=function(We){var qe,rt=We.style,bt=We.className,Gt=We.title,nn=We.eventKey,Gn=We.warnKey,fr=We.disabled,Wn=We.internalPopupClose,vn=We.children,hn=We.itemIcon,Sn=We.expandIcon,Pn=We.popupClassName,ur=We.popupOffset,jn=We.popupStyle,Zn=We.onClick,Jn=We.onMouseEnter,Qn=We.onMouseLeave,hr=We.onTitleClick,Pe=We.onTitleMouseEnter,Fe=We.onTitleMouseLeave,wt=(0,Se.Z)(We,ti),it=le(nn),Ot=pe.useContext(oe),on=Ot.prefixCls,mn=Ot.mode,On=Ot.openKeys,xn=Ot.disabled,Qt=Ot.overflowDisabled,Bn=Ot.activeKey,Kn=Ot.selectedKeys,mr=Ot.itemIcon,Fn=Ot.expandIcon,_r=Ot.onItemClick,Zr=Ot.onOpenChange,Tr=Ot.onActive,$r=pe.useContext(Kt),xr=$r._internalRenderSubMenuItem,Pr=pe.useContext(Nr),Yr=Pr.isSubPathKey,ai=tn(),Dr="".concat(on,"-submenu"),li=xn||fr,Pi=pe.useRef(),ta=pe.useRef(),Vi=hn!=null?hn:mr,Ni=Sn!=null?Sn:Fn,Xi=On.includes(nn),qi=!Qt&&Xi,bi=Yr(Kn,nn),Fi=nr(nn,li,Pe,Fe),jr=Fi.active,ci=(0,Se.Z)(Fi,yt),Ti=pe.useState(!1),ji=(0,be.Z)(Ti,2),Na=ji[0],Fa=ji[1],Aa=function(wa){li||Fa(wa)},ua=function(wa){Aa(!0),Jn==null||Jn({key:nn,domEvent:wa})},Yi=function(wa){Aa(!1),Qn==null||Qn({key:nn,domEvent:wa})},Mi=pe.useMemo(function(){return jr||(mn!=="inline"?Na||Yr([Bn],nn):!1)},[mn,jr,Bn,Na,nn,Yr]),Oa=ar(ai.length),ki=function(wa){li||(hr==null||hr({key:nn,domEvent:wa}),mn==="inline"&&Zr(nn,!Xi))},Jr=Ke(function(fa){Zn==null||Zn(vt(fa)),_r(fa)}),zi=function(wa){mn!=="inline"&&Zr(nn,wa)},ca=function(){Tr(nn)},Ui=it&&"".concat(it,"-popup"),ia=pe.createElement("div",(0,fe.Z)({role:"menuitem",style:Oa,className:"".concat(Dr,"-title"),tabIndex:li?null:-1,ref:Pi,title:typeof Gt=="string"?Gt:null,"data-menu-id":Qt&&it?null:it,"aria-expanded":qi,"aria-haspopup":!0,"aria-controls":Ui,"aria-disabled":li,onClick:ki,onFocus:ca},ci),Gt,pe.createElement(ot,{icon:mn!=="horizontal"?Ni:void 0,props:(0,$e.Z)((0,$e.Z)({},We),{},{isOpen:qi,isSubMenu:!0})},pe.createElement("i",{className:"".concat(Dr,"-arrow")}))),fi=pe.useRef(mn);if(mn!=="inline"&&ai.length>1?fi.current="vertical":fi.current=mn,!Qt){var pa=fi.current;ia=pe.createElement(Wi,{mode:pa,prefixCls:Dr,visible:!Wn&&qi&&mn!=="inline",popupClassName:Pn,popupOffset:ur,popupStyle:jn,popup:pe.createElement(xt,{mode:pa==="horizontal"?"vertical":pa},pe.createElement(Ri,{id:Ui,ref:ta},vn)),disabled:li,onVisibleChange:zi},ia)}var xa=pe.createElement(Ft.Item,(0,fe.Z)({role:"none"},wt,{component:"li",style:rt,className:xe()(Dr,"".concat(Dr,"-").concat(mn),bt,(qe={},(0,et.Z)(qe,"".concat(Dr,"-open"),qi),(0,et.Z)(qe,"".concat(Dr,"-active"),Mi),(0,et.Z)(qe,"".concat(Dr,"-selected"),bi),(0,et.Z)(qe,"".concat(Dr,"-disabled"),li),qe)),onMouseEnter:ua,onMouseLeave:Yi}),ia,!Qt&&pe.createElement(ea,{id:Ui,open:qi,keyPath:ai},vn));return xr&&(xa=xr(xa,We,{selected:bi,active:Mi,open:qi,disabled:li})),pe.createElement(xt,{onItemClick:Jr,mode:mn==="horizontal"?"vertical":mn,itemIcon:Vi,expandIcon:Ni},xa)};function $t(Ne){var We=Ne.eventKey,qe=Ne.children,rt=tn(We),bt=pi(qe,rt),Gt=dn();pe.useEffect(function(){if(Gt)return Gt.registerPath(We,rt),function(){Gt.unregisterPath(We,rt)}},[rt]);var nn;return Gt?nn=bt:nn=pe.createElement(pt,Ne,bt),pe.createElement(An.Provider,{value:rt},nn)}var sn=se(71002),_n=["className","title","eventKey","children"],cr=["children"],Mr=function(We){var qe=We.className,rt=We.title,bt=We.eventKey,Gt=We.children,nn=(0,Se.Z)(We,_n),Gn=pe.useContext(oe),fr=Gn.prefixCls,Wn="".concat(fr,"-item-group");return pe.createElement("li",(0,fe.Z)({role:"presentation"},nn,{onClick:function(hn){return hn.stopPropagation()},className:xe()(Wn,qe)}),pe.createElement("div",{role:"presentation",className:"".concat(Wn,"-title"),title:typeof rt=="string"?rt:void 0},rt),pe.createElement("ul",{role:"group",className:"".concat(Wn,"-list")},Gt))};function Br(Ne){var We=Ne.children,qe=(0,Se.Z)(Ne,cr),rt=tn(qe.eventKey),bt=pi(We,rt),Gt=dn();return Gt?bt:pe.createElement(Mr,(0,Yn.Z)(qe,["warnKey"]),bt)}function Kr(Ne){var We=Ne.className,qe=Ne.style,rt=pe.useContext(oe),bt=rt.prefixCls,Gt=dn();return Gt?null:pe.createElement("li",{role:"separator",className:xe()("".concat(bt,"-item-divider"),We),style:qe})}var Rr=["label","children","key","type"];function Qr(Ne){return(Ne||[]).map(function(We,qe){if(We&&(0,sn.Z)(We)==="object"){var rt=We,bt=rt.label,Gt=rt.children,nn=rt.key,Gn=rt.type,fr=(0,Se.Z)(rt,Rr),Wn=nn!=null?nn:"tmp-".concat(qe);return Gt||Gn==="group"?Gn==="group"?pe.createElement(Br,(0,fe.Z)({key:Wn},fr,{title:bt}),Qr(Gt)):pe.createElement($t,(0,fe.Z)({key:Wn},fr,{title:bt}),Qr(Gt)):Gn==="divider"?pe.createElement(Kr,(0,fe.Z)({key:Wn},fr)):pe.createElement(or,(0,fe.Z)({key:Wn},fr),bt)}return null}).filter(function(We){return We})}function gi(Ne,We,qe){var rt=Ne;return We&&(rt=Qr(We)),pi(rt,qe)}var Cr=["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"],di=[],Ai=pe.forwardRef(function(Ne,We){var qe,rt,bt=Ne,Gt=bt.prefixCls,nn=Gt===void 0?"rc-menu":Gt,Gn=bt.rootClassName,fr=bt.style,Wn=bt.className,vn=bt.tabIndex,hn=vn===void 0?0:vn,Sn=bt.items,Pn=bt.children,ur=bt.direction,jn=bt.id,Zn=bt.mode,Jn=Zn===void 0?"vertical":Zn,Qn=bt.inlineCollapsed,hr=bt.disabled,Pe=bt.disabledOverflow,Fe=bt.subMenuOpenDelay,wt=Fe===void 0?.1:Fe,it=bt.subMenuCloseDelay,Ot=it===void 0?.1:it,on=bt.forceSubMenuRender,mn=bt.defaultOpenKeys,On=bt.openKeys,xn=bt.activeKey,Qt=bt.defaultActiveFirst,Bn=bt.selectable,Kn=Bn===void 0?!0:Bn,mr=bt.multiple,Fn=mr===void 0?!1:mr,_r=bt.defaultSelectedKeys,Zr=bt.selectedKeys,Tr=bt.onSelect,$r=bt.onDeselect,xr=bt.inlineIndent,Pr=xr===void 0?24:xr,Yr=bt.motion,ai=bt.defaultMotions,Dr=bt.triggerSubMenuAction,li=Dr===void 0?"hover":Dr,Pi=bt.builtinPlacements,ta=bt.itemIcon,Vi=bt.expandIcon,Ni=bt.overflowedIndicator,Xi=Ni===void 0?"...":Ni,qi=bt.overflowedIndicatorPopupClassName,bi=bt.getPopupContainer,Fi=bt.onClick,jr=bt.onOpenChange,ci=bt.onKeyDown,Ti=bt.openAnimation,ji=bt.openTransitionName,Na=bt._internalRenderMenuItem,Fa=bt._internalRenderSubMenuItem,Aa=(0,Se.Z)(bt,Cr),ua=pe.useMemo(function(){return gi(Pn,Sn,di)},[Pn,Sn]),Yi=pe.useState(!1),Mi=(0,be.Z)(Yi,2),Oa=Mi[0],ki=Mi[1],Jr=pe.useRef(),zi=Tt(jn),ca=ur==="rtl",Ui=(0,zt.Z)(mn,{value:On,postState:function(Da){return Da||di}}),ia=(0,be.Z)(Ui,2),fi=ia[0],pa=ia[1],xa=function(Da){var Xa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function go(){pa(Da),jr==null||jr(Da)}Xa?(0,Ie.flushSync)(go):go()},fa=pe.useState(fi),wa=(0,be.Z)(fa,2),Ea=wa[0],Va=wa[1],ha=pe.useRef(!1),ka=pe.useMemo(function(){return(Jn==="inline"||Jn==="vertical")&&Qn?["vertical",Qn]:[Jn,!1]},[Jn,Qn]),Ja=(0,be.Z)(ka,2),Ga=Ja[0],so=Ja[1],$a=Ga==="inline",Ca=pe.useState(Ga),_i=(0,be.Z)(Ca,2),Ki=_i[0],da=_i[1],Sa=pe.useState(so),Ka=(0,be.Z)(Sa,2),io=Ka[0],ho=Ka[1];pe.useEffect(function(){da(Ga),ho(so),ha.current&&($a?pa(Ea):xa(di))},[Ga,so]);var Oo=pe.useState(0),Ro=(0,be.Z)(Oo,2),lo=Ro[0],Ao=Ro[1],na=lo>=ua.length-1||Ki!=="horizontal"||Pe;pe.useEffect(function(){$a&&Va(fi)},[fi]),pe.useEffect(function(){return ha.current=!0,function(){ha.current=!1}},[]);var Oi=jt(),Ta=Oi.registerPath,_a=Oi.unregisterPath,uo=Oi.refreshOverflowKeys,ao=Oi.isSubPathKey,hs=Oi.getKeyPath,Qo=Oi.getKeys,ps=Oi.getSubPathKeys,aa=pe.useMemo(function(){return{registerPath:Ta,unregisterPath:_a}},[Ta,_a]),Lr=pe.useMemo(function(){return{isSubPathKey:ao}},[ao]);pe.useEffect(function(){uo(na?di:ua.slice(lo+1).map(function(oo){return oo.key}))},[lo,na]);var xi=(0,zt.Z)(xn||Qt&&((qe=ua[0])===null||qe===void 0?void 0:qe.key),{value:xn}),wi=(0,be.Z)(xi,2),Di=wi[0],Ha=wi[1],ja=Ke(function(oo){Ha(oo)}),$o=Ke(function(){Ha(void 0)});(0,pe.useImperativeHandle)(We,function(){return{list:Jr.current,focus:function(Da){var Xa,go=Di!=null?Di:(Xa=ua.find(function(xs){return!xs.props.disabled}))===null||Xa===void 0?void 0:Xa.key;if(go){var yo,Ko,wo;(yo=Jr.current)===null||yo===void 0||(Ko=yo.querySelector("li[data-menu-id='".concat(ce(zi,go),"']")))===null||Ko===void 0||(wo=Ko.focus)===null||wo===void 0||wo.call(Ko,Da)}}}});var Uo=(0,zt.Z)(_r||[],{value:Zr,postState:function(Da){return Array.isArray(Da)?Da:Da==null?di:[Da]}}),ls=(0,be.Z)(Uo,2),va=ls[0],Bo=ls[1],us=function(Da){if(Kn){var Xa=Da.key,go=va.includes(Xa),yo;Fn?go?yo=va.filter(function(wo){return wo!==Xa}):yo=[].concat((0,Ue.Z)(va),[Xa]):yo=[Xa],Bo(yo);var Ko=(0,$e.Z)((0,$e.Z)({},Da),{},{selectedKeys:yo});go?$r==null||$r(Ko):Tr==null||Tr(Ko)}!Fn&&fi.length&&Ki!=="inline"&&xa(di)},cl=Ke(function(oo){Fi==null||Fi(vt(oo)),us(oo)}),As=Ke(function(oo,Da){var Xa=fi.filter(function(yo){return yo!==oo});if(Da)Xa.push(oo);else if(Ki!=="inline"){var go=ps(oo);Xa=Xa.filter(function(yo){return!go.has(yo)})}(0,bn.Z)(fi,Xa,!0)||xa(Xa,!0)}),ms=function(Da,Xa){var go=Xa!=null?Xa:!fi.includes(Da);As(Da,go)},zo=tr(Ki,Di,ca,zi,Jr,Qo,hs,Ha,ms,ci);pe.useEffect(function(){ki(!0)},[]);var Ts=pe.useMemo(function(){return{_internalRenderMenuItem:Na,_internalRenderSubMenuItem:Fa}},[Na,Fa]),Ds=Ki!=="horizontal"||Pe?ua:ua.map(function(oo,Da){return pe.createElement(xt,{key:oo.key,overflowDisabled:Da>lo},oo)}),Ys=pe.createElement(Ft,(0,fe.Z)({id:jn,ref:Jr,prefixCls:"".concat(nn,"-overflow"),component:"ul",itemComponent:or,className:xe()(nn,"".concat(nn,"-root"),"".concat(nn,"-").concat(Ki),Wn,(rt={},(0,et.Z)(rt,"".concat(nn,"-inline-collapsed"),io),(0,et.Z)(rt,"".concat(nn,"-rtl"),ca),rt),Gn),dir:ur,style:fr,role:"menu",tabIndex:hn,data:Ds,renderRawItem:function(Da){return Da},renderRawRest:function(Da){var Xa=Da.length,go=Xa?ua.slice(-Xa):null;return pe.createElement($t,{eventKey:Et,title:Xi,disabled:na,internalPopupClose:Xa===0,popupClassName:qi},go)},maxCount:Ki!=="horizontal"||Pe?Ft.INVALIDATE:Ft.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Da){Ao(Da)},onKeyDown:zo},Aa));return pe.createElement(Kt.Provider,{value:Ts},pe.createElement(Ee.Provider,{value:zi},pe.createElement(xt,{prefixCls:nn,rootClassName:Gn,mode:Ki,openKeys:fi,rtl:ca,disabled:hr,motion:Oa?Yr:null,defaultMotions:Oa?ai:null,activeKey:Di,onActive:ja,onInactive:$o,selectedKeys:va,inlineIndent:Pr,subMenuOpenDelay:wt,subMenuCloseDelay:Ot,forceSubMenuRender:on,builtinPlacements:Pi,triggerSubMenuAction:li,getPopupContainer:bi,itemIcon:ta,expandIcon:Vi,onItemClick:cl,onOpenChange:As},pe.createElement(Nr.Provider,{value:Lr},Ys),pe.createElement("div",{style:{display:"none"},"aria-hidden":!0},pe.createElement(pn.Provider,{value:aa},ua)))))}),Si=Ai,_e=Si;_e.Item=or,_e.SubMenu=$t,_e.ItemGroup=Br,_e.Divider=Kr;var Be=_e},66680:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});var fe=se(67294);function et($e){var Ue=fe.useRef();Ue.current=$e;var be=fe.useCallback(function(){for(var Se,Me=arguments.length,xe=new Array(Me),pe=0;pe<Me;pe++)xe[pe]=arguments[pe];return(Se=Ue.current)===null||Se===void 0?void 0:Se.call.apply(Se,[Ue].concat(xe))},[]);return be}},21770:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Se}});var fe=se(97685),et=se(66680),$e=se(8410),Ue=se(63896);function be(Me){return Me!==void 0}function Se(Me,xe){var pe=xe||{},Te=pe.defaultValue,mt=pe.value,ze=pe.onChange,It=pe.postState,Ct=(0,Ue.Z)(function(){return be(mt)?mt:be(Te)?typeof Te=="function"?Te():Te:typeof Me=="function"?Me():Me}),ht=(0,fe.Z)(Ct,2),Ye=ht[0],De=ht[1],At=mt!==void 0?mt:Ye,Jt=It?It(At):At,nt=(0,et.Z)(ze),lt=(0,Ue.Z)([At]),Ie=(0,fe.Z)(lt,2),ke=Ie[0],je=Ie[1];(0,$e.o)(function(){var Pt=ke[0];Ye!==Pt&&nt(Ye,Pt)},[ke]),(0,$e.o)(function(){be(mt)||De(mt)},[mt]);var Xe=(0,et.Z)(function(Pt,kt){De(Pt,kt),je([At],kt)});return[Jt,Xe]}},91881:function(Cn,Xt,se){"use strict";var fe=se(71002),et=se(80334);function $e(Ue,be){var Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Me=new Set;function xe(pe,Te){var mt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,ze=Me.has(pe);if((0,et.ZP)(!ze,"Warning: There may be circular references"),ze)return!1;if(pe===Te)return!0;if(Se&&mt>1)return!1;Me.add(pe);var It=mt+1;if(Array.isArray(pe)){if(!Array.isArray(Te)||pe.length!==Te.length)return!1;for(var Ct=0;Ct<pe.length;Ct++)if(!xe(pe[Ct],Te[Ct],It))return!1;return!0}if(pe&&Te&&(0,fe.Z)(pe)==="object"&&(0,fe.Z)(Te)==="object"){var ht=Object.keys(pe);return ht.length!==Object.keys(Te).length?!1:ht.every(function(Ye){return xe(pe[Ye],Te[Ye],It)})}return!1}return xe(Ue,be)}Xt.Z=$e},98423:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return et}});var fe=se(1413);function et($e,Ue){var be=(0,fe.Z)({},$e);return Array.isArray(Ue)&&Ue.forEach(function(Se){delete be[Se]}),be}},64217:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return xe}});var fe=se(1413),et=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,$e=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ue="".concat(et," ").concat($e).split(/[\s\n]+/),be="aria-",Se="data-";function Me(pe,Te){return pe.indexOf(Te)===0}function xe(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,mt;Te===!1?mt={aria:!0,data:!0,attr:!0}:Te===!0?mt={aria:!0}:mt=(0,fe.Z)({},Te);var ze={};return Object.keys(pe).forEach(function(It){(mt.aria&&(It==="role"||Me(It,be))||mt.data&&Me(It,Se)||mt.attr&&Ue.includes(It))&&(ze[It]=pe[It])}),ze}},73299:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return Ci}});var fe=se(87462),et=se(1413),$e=se(71002),Ue=se(97685),be=se(4942),Se=se(45987),Me=se(67294),xe=se(73935),pe=se(94184),Te=se.n(pe),mt=se(48555),ze=Me.forwardRef(function(gt,En){var kn=gt.height,Tn=gt.offsetY,sr=gt.offsetX,tr=gt.children,pr=gt.prefixCls,Hn=gt.onInnerResize,Ze=gt.innerProps,at=gt.rtl,Et=gt.extra,jt={},Ke={display:"flex",flexDirection:"column"};if(Tn!==void 0){var dt;jt={height:kn,position:"relative",overflow:"hidden"},Ke=(0,et.Z)((0,et.Z)({},Ke),{},(dt={transform:"translateY(".concat(Tn,"px)")},(0,be.Z)(dt,at?"marginRight":"marginLeft",-sr),(0,be.Z)(dt,"position","absolute"),(0,be.Z)(dt,"left",0),(0,be.Z)(dt,"right",0),(0,be.Z)(dt,"top",0),dt))}return Me.createElement("div",{style:jt},Me.createElement(mt.Z,{onResize:function(Tt){var Wt=Tt.offsetHeight;Wt&&Hn&&Hn()}},Me.createElement("div",(0,fe.Z)({style:Ke,className:Te()((0,be.Z)({},"".concat(pr,"-holder-inner"),pr)),ref:En},Ze),tr,Et)))});ze.displayName="Filler";var It=ze,Ct=function(En){return+setTimeout(En,16)},ht=function(En){return clearTimeout(En)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ct=function(En){return window.requestAnimationFrame(En)},ht=function(En){return window.cancelAnimationFrame(En)});var Ye=0,De=new Map;function At(gt){De.delete(gt)}var Jt=function(En){var kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ye+=1;var Tn=Ye;function sr(tr){if(tr===0)At(Tn),En();else{var pr=Ct(function(){sr(tr-1)});De.set(Tn,pr)}}return sr(kn),Tn};Jt.cancel=function(gt){var En=De.get(gt);return At(En),ht(En)};var nt=Jt;function lt(gt,En){var kn="touches"in gt?gt.touches[0]:gt;return kn[En?"pageX":"pageY"]}var Ie=Me.forwardRef(function(gt,En){var kn,Tn=gt.prefixCls,sr=gt.rtl,tr=gt.scrollOffset,pr=gt.scrollRange,Hn=gt.onStartMove,Ze=gt.onStopMove,at=gt.onScroll,Et=gt.horizontal,jt=gt.spinSize,Ke=gt.containerSize,dt=gt.style,Rt=gt.thumbStyle,Tt=Me.useState(!1),Wt=(0,Ue.Z)(Tt,2),Zt=Wt[0],zn=Wt[1],Sr=Me.useState(null),Yn=(0,Ue.Z)(Sr,2),qn=Yn[0],nr=Yn[1],ar=Me.useState(null),ot=(0,Ue.Z)(ar,2),tt=ot[0],vt=ot[1],rn=!sr,Dn=Me.useRef(),an=Me.useRef(),cn=Me.useState(!1),fn=(0,Ue.Z)(cn,2),In=fn[0],or=fn[1],Ut=Me.useRef(),qr=function(){clearTimeout(Ut.current),or(!0),Ut.current=setTimeout(function(){or(!1)},3e3)},Fr=pr-Ke||0,Ri=Ke-jt||0,Li=Fr>0,pi=Me.useMemo(function(){if(tr===0||Fr===0)return 0;var la=tr/Fr;return la*Ri},[tr,Fr,Ri]),Gi=function(ea){ea.stopPropagation(),ea.preventDefault()},yi=Me.useRef({top:pi,dragging:Zt,pageY:qn,startTop:tt});yi.current={top:pi,dragging:Zt,pageY:qn,startTop:tt};var ii=function(ea){zn(!0),nr(lt(ea,Et)),vt(yi.current.top),Hn(),ea.stopPropagation(),ea.preventDefault()};Me.useEffect(function(){var la=function(pt){pt.preventDefault()},ea=Dn.current,ti=an.current;return ea.addEventListener("touchstart",la),ti.addEventListener("touchstart",ii),function(){ea.removeEventListener("touchstart",la),ti.removeEventListener("touchstart",ii)}},[]);var Bi=Me.useRef();Bi.current=Fr;var Zi=Me.useRef();Zi.current=Ri,Me.useEffect(function(){if(Zt){var la,ea=function(pt){var $t=yi.current,sn=$t.dragging,_n=$t.pageY,cr=$t.startTop;if(nt.cancel(la),sn){var Mr=lt(pt,Et)-_n,Br=cr;!rn&&Et?Br-=Mr:Br+=Mr;var Kr=Bi.current,Rr=Zi.current,Qr=Rr?Br/Rr:0,gi=Math.ceil(Qr*Kr);gi=Math.max(gi,0),gi=Math.min(gi,Kr),la=nt(function(){at(gi,Et)})}},ti=function(){zn(!1),Ze()};return window.addEventListener("mousemove",ea),window.addEventListener("touchmove",ea),window.addEventListener("mouseup",ti),window.addEventListener("touchend",ti),function(){window.removeEventListener("mousemove",ea),window.removeEventListener("touchmove",ea),window.removeEventListener("mouseup",ti),window.removeEventListener("touchend",ti),nt.cancel(la)}}},[Zt]),Me.useEffect(function(){qr()},[tr]),Me.useImperativeHandle(En,function(){return{delayHidden:qr}});var Vr="".concat(Tn,"-scrollbar"),mi={position:"absolute",visibility:In&&Li?null:"hidden"},Wi={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Et?(mi.height=8,mi.left=0,mi.right=0,mi.bottom=0,Wi.height="100%",Wi.width=jt,rn?Wi.left=pi:Wi.right=pi):(mi.width=8,mi.top=0,mi.bottom=0,rn?mi.right=0:mi.left=0,Wi.width="100%",Wi.height=jt,Wi.top=pi),Me.createElement("div",{ref:Dn,className:Te()(Vr,(kn={},(0,be.Z)(kn,"".concat(Vr,"-horizontal"),Et),(0,be.Z)(kn,"".concat(Vr,"-vertical"),!Et),(0,be.Z)(kn,"".concat(Vr,"-visible"),In),kn)),style:(0,et.Z)((0,et.Z)({},mi),dt),onMouseDown:Gi,onMouseMove:qr},Me.createElement("div",{ref:an,className:Te()("".concat(Vr,"-thumb"),(0,be.Z)({},"".concat(Vr,"-thumb-moving"),Zt)),style:(0,et.Z)((0,et.Z)({},Wi),Rt),onMouseDown:ii}))}),ke=Ie;function je(gt){var En=gt.children,kn=gt.setRef,Tn=Me.useCallback(function(sr){kn(sr)},[]);return Me.cloneElement(En,{ref:Tn})}function Xe(gt,En,kn,Tn,sr,tr,pr){var Hn=pr.getKey;return gt.slice(En,kn+1).map(function(Ze,at){var Et=En+at,jt=tr(Ze,Et,{style:{width:Tn}}),Ke=Hn(Ze);return Me.createElement(je,{key:Ke,setRef:function(Rt){return sr(Ze,Rt)}},jt)})}function Pt(gt){return gt instanceof HTMLElement||gt instanceof SVGElement}function kt(gt){return Pt(gt)?gt:gt instanceof Me.Component?xe.findDOMNode(gt):null}var Lt=se(15671),Ge=se(43144),Ht=function(){function gt(){(0,Lt.Z)(this,gt),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,Ge.Z)(gt,[{key:"set",value:function(kn,Tn){this.maps[kn]=Tn,this.id+=1}},{key:"get",value:function(kn){return this.maps[kn]}}]),gt}(),Dt=Ht;function Ln(gt,En,kn){var Tn=Me.useState(0),sr=(0,Ue.Z)(Tn,2),tr=sr[0],pr=sr[1],Hn=(0,Me.useRef)(new Map),Ze=(0,Me.useRef)(new Dt),at=(0,Me.useRef)();function Et(){nt.cancel(at.current)}function jt(){var dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Et();var Rt=function(){Hn.current.forEach(function(Wt,Zt){if(Wt&&Wt.offsetParent){var zn=kt(Wt),Sr=zn.offsetHeight;Ze.current.get(Zt)!==Sr&&Ze.current.set(Zt,zn.offsetHeight)}}),pr(function(Wt){return Wt+1})};dt?Rt():at.current=nt(Rt)}function Ke(dt,Rt){var Tt=gt(dt),Wt=Hn.current.get(Tt);Rt?(Hn.current.set(Tt,Rt),jt()):Hn.current.delete(Tt),!Wt!=!Rt&&(Rt?En==null||En(dt):kn==null||kn(dt))}return(0,Me.useEffect)(function(){return Et},[]),[Ke,jt,Ze.current,tr]}function un(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Rn=un()?Me.useLayoutEffect:Me.useEffect,ir=function(En,kn){var Tn=Me.useRef(!0);Rn(function(){return En(Tn.current)},kn),Rn(function(){return Tn.current=!1,function(){Tn.current=!0}},[])},yr=function(En,kn){ir(function(Tn){if(!Tn)return En()},kn)},Qe=ir;function Le(gt){var En=Me.useRef();En.current=gt;var kn=Me.useCallback(function(){for(var Tn,sr=arguments.length,tr=new Array(sr),pr=0;pr<sr;pr++)tr[pr]=arguments[pr];return(Tn=En.current)===null||Tn===void 0?void 0:Tn.call.apply(Tn,[En].concat(tr))},[]);return kn}function Nt(gt){var En=React.useRef(!1),kn=React.useState(gt),Tn=_slicedToArray(kn,2),sr=Tn[0],tr=Tn[1];React.useEffect(function(){return En.current=!1,function(){En.current=!0}},[]);function pr(Hn,Ze){Ze&&En.current||tr(Hn)}return[sr,pr]}function Nn(gt){return gt!==void 0}function gn(gt,En){var kn=En||{},Tn=kn.defaultValue,sr=kn.value,tr=kn.onChange,pr=kn.postState,Hn=useState(function(){return Nn(sr)?sr:Nn(Tn)?typeof Tn=="function"?Tn():Tn:typeof gt=="function"?gt():gt}),Ze=_slicedToArray(Hn,2),at=Ze[0],Et=Ze[1],jt=sr!==void 0?sr:at,Ke=pr?pr(jt):jt,dt=useEvent(tr),Rt=useState([jt]),Tt=_slicedToArray(Rt,2),Wt=Tt[0],Zt=Tt[1];useLayoutUpdateEffect(function(){var Sr=Wt[0];at!==Sr&&dt(at,Sr)},[Wt]),useLayoutUpdateEffect(function(){Nn(sr)||Et(sr)},[sr]);var zn=useEvent(function(Sr,Yn){Et(Sr,Yn),Zt([jt],Yn)});return[Ke,zn]}var Je=se(31461);function st(gt,En,kn){var Tn=React.useRef({});return(!("value"in Tn.current)||kn(Tn.current.condition,En))&&(Tn.current.value=gt(),Tn.current.condition=En),Tn.current.value}function _t(gt,En){typeof gt=="function"?gt(En):_typeof(gt)==="object"&>&&"current"in gt&&(gt.current=En)}function en(){for(var gt=arguments.length,En=new Array(gt),kn=0;kn<gt;kn++)En[kn]=arguments[kn];var Tn=En.filter(function(sr){return sr});return Tn.length<=1?Tn[0]:function(sr){En.forEach(function(tr){_t(tr,sr)})}}function Bt(){for(var gt=arguments.length,En=new Array(gt),kn=0;kn<gt;kn++)En[kn]=arguments[kn];return useMemo(function(){return en.apply(void 0,En)},En,function(Tn,sr){return Tn.length!==sr.length||Tn.every(function(tr,pr){return tr!==sr[pr]})})}function Ft(gt){var En,kn,Tn=isMemo(gt)?gt.type.type:gt.type;return!(typeof Tn=="function"&&!((En=Tn.prototype)!==null&&En!==void 0&&En.render)||typeof gt=="function"&&!((kn=gt.prototype)!==null&&kn!==void 0&&kn.render))}function zt(gt){return!isValidElement(gt)||isFragment(gt)?!1:Ft(gt)}function Mn(gt,En,kn,Tn){if(!En.length)return kn;var sr=_toArray(En),tr=sr[0],pr=sr.slice(1),Hn;return!gt&&typeof tr=="number"?Hn=[]:Array.isArray(gt)?Hn=_toConsumableArray(gt):Hn=_objectSpread({},gt),Tn&&kn===void 0&&pr.length===1?delete Hn[tr][pr[0]]:Hn[tr]=Mn(Hn[tr],pr,kn,Tn),Hn}function bn(gt,En,kn){var Tn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return En.length&&Tn&&kn===void 0&&!get(gt,En.slice(0,-1))?gt:Mn(gt,En,kn,Tn)}function Ee(gt){return _typeof(gt)==="object"&>!==null&&Object.getPrototypeOf(gt)===Object.prototype}function ce(gt){return Array.isArray(gt)?[]:{}}var le=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function ye(){for(var gt=arguments.length,En=new Array(gt),kn=0;kn<gt;kn++)En[kn]=arguments[kn];var Tn=ce(En[0]);return En.forEach(function(sr){function tr(pr,Hn){var Ze=new Set(Hn),at=get(sr,pr),Et=Array.isArray(at);if(Et||Ee(at)){if(!Ze.has(at)){Ze.add(at);var jt=get(Tn,pr);Et?Tn=bn(Tn,pr,[]):(!jt||_typeof(jt)!=="object")&&(Tn=bn(Tn,pr,ce(at))),le(at).forEach(function(Ke){tr([].concat(_toConsumableArray(pr),[Ke]),Ze)})}}else Tn=bn(Tn,pr,at)}tr([])}),Tn}var ve={},oe=[],He=function(En){oe.push(En)};function xt(gt,En){if(0)var kn}function Yt(gt,En){if(0)var kn}function pn(){ve={}}function dn(gt,En,kn){!En&&!ve[kn]&&(gt(!1,kn),ve[kn]=!0)}function An(gt,En){dn(xt,gt,En)}function tn(gt,En){dn(Yt,gt,En)}An.preMessage=He,An.resetWarned=pn,An.noteOnce=tn;var Nr=null,Wr=10;function Kt(gt,En,kn,Tn,sr,tr,pr,Hn){var Ze=Me.useRef(),at=Me.useState(null),Et=(0,Ue.Z)(at,2),jt=Et[0],Ke=Et[1];return Qe(function(){if(jt&&jt.times<Wr){if(!gt.current){Ke(function(qr){return(0,et.Z)({},qr)});return}tr();var dt=jt.targetAlign,Rt=jt.originAlign,Tt=jt.index,Wt=jt.offset,Zt=gt.current.clientHeight,zn=!1,Sr=dt,Yn=null;if(Zt){for(var qn=dt||Rt,nr=0,ar=0,ot=0,tt=Math.min(En.length-1,Tt),vt=0;vt<=tt;vt+=1){var rn=sr(En[vt]);ar=nr;var Dn=kn.get(rn);ot=ar+(Dn===void 0?Tn:Dn),nr=ot}for(var an=qn==="top"?Wt:Zt-Wt,cn=tt;cn>=0;cn-=1){var fn=sr(En[cn]),In=kn.get(fn);if(In===void 0){zn=!0;break}if(an-=In,an<=0)break}switch(qn){case"top":Yn=ar-Wt;break;case"bottom":Yn=ot-Zt+Wt;break;default:{var or=gt.current.scrollTop,Ut=or+Zt;ar<or?Sr="top":ot>Ut&&(Sr="bottom")}}Yn!==null&&pr(Yn),Yn!==jt.lastTop&&(zn=!0)}zn&&Ke(function(qr){return(0,et.Z)((0,et.Z)({},qr),{},{times:qr.times+1,targetAlign:Sr,lastTop:Yn})})}},[jt,gt.current]),function(dt){if(dt==null){Hn();return}if(nt.cancel(Ze.current),typeof dt=="number")pr(dt);else if(dt&&(0,$e.Z)(dt)==="object"){var Rt,Tt=dt.align;"index"in dt?Rt=dt.index:Rt=En.findIndex(function(zn){return sr(zn)===dt.key});var Wt=dt.offset,Zt=Wt===void 0?0:Wt;Ke({times:0,index:Rt,offset:Zt,originAlign:Tt})}}}function $n(gt,En,kn,Tn){var sr=kn-gt,tr=En-kn,pr=Math.min(sr,tr)*2;if(Tn<=pr){var Hn=Math.floor(Tn/2);return Tn%2?kn+Hn+1:kn-Hn}return sr>tr?kn-(Tn-tr):kn+(Tn-sr)}function ei(gt,En,kn){var Tn=gt.length,sr=En.length,tr,pr;if(Tn===0&&sr===0)return null;Tn<sr?(tr=gt,pr=En):(tr=En,pr=gt);var Hn={__EMPTY_ITEM__:!0};function Ze(Rt){return Rt!==void 0?kn(Rt):Hn}for(var at=null,Et=Math.abs(Tn-sr)!==1,jt=0;jt<pr.length;jt+=1){var Ke=Ze(tr[jt]),dt=Ze(pr[jt]);if(Ke!==dt){at=jt,Et=Et||Ke!==Ze(pr[jt+1]);break}}return at===null?null:{index:at,multiple:Et}}function hi(gt,En,kn){var Tn=Me.useState(gt),sr=(0,Ue.Z)(Tn,2),tr=sr[0],pr=sr[1],Hn=Me.useState(null),Ze=(0,Ue.Z)(Hn,2),at=Ze[0],Et=Ze[1];return Me.useEffect(function(){var jt=ei(tr||[],gt||[],En);(jt==null?void 0:jt.index)!==void 0&&(kn==null||kn(jt.index),Et(gt[jt.index])),pr(gt)},[gt]),[at]}var ut=(typeof navigator=="undefined"?"undefined":(0,$e.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Vt=ut,Vn=function(gt,En){var kn=(0,Me.useRef)(!1),Tn=(0,Me.useRef)(null);function sr(){clearTimeout(Tn.current),kn.current=!0,Tn.current=setTimeout(function(){kn.current=!1},50)}var tr=(0,Me.useRef)({top:gt,bottom:En});return tr.current.top=gt,tr.current.bottom=En,function(pr){var Hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ze=pr<0&&tr.current.top||pr>0&&tr.current.bottom;return Hn&&Ze?(clearTimeout(Tn.current),kn.current=!1):(!Ze||kn.current)&&sr(),!kn.current&&Ze}};function rr(gt,En,kn,Tn,sr){var tr=(0,Me.useRef)(0),pr=(0,Me.useRef)(null),Hn=(0,Me.useRef)(null),Ze=(0,Me.useRef)(!1),at=Vn(En,kn);function Et(Wt,Zt){nt.cancel(pr.current),tr.current+=Zt,Hn.current=Zt,!at(Zt)&&(Vt||Wt.preventDefault(),pr.current=nt(function(){var zn=Ze.current?10:1;sr(tr.current*zn),tr.current=0}))}function jt(Wt,Zt){sr(Zt,!0),Vt||Wt.preventDefault()}var Ke=(0,Me.useRef)(null),dt=(0,Me.useRef)(null);function Rt(Wt){if(gt){nt.cancel(dt.current),dt.current=nt(function(){Ke.current=null},2);var Zt=Wt.deltaX,zn=Wt.deltaY,Sr=Wt.shiftKey,Yn=Zt,qn=zn;(Ke.current==="sx"||!Ke.current&&Sr&&zn&&!Zt)&&(Yn=zn,qn=0,Ke.current="sx");var nr=Math.abs(Yn),ar=Math.abs(qn);Ke.current===null&&(Ke.current=Tn&&nr>ar?"x":"y"),Ke.current==="y"?Et(Wt,qn):jt(Wt,Yn)}}function Tt(Wt){gt&&(Ze.current=Wt.detail===Hn.current)}return[Rt,Tt]}var gr=14/15;function Ir(gt,En,kn){var Tn=(0,Me.useRef)(!1),sr=(0,Me.useRef)(0),tr=(0,Me.useRef)(null),pr=(0,Me.useRef)(null),Hn,Ze=function(Ke){if(Tn.current){var dt=Math.ceil(Ke.touches[0].pageY),Rt=sr.current-dt;sr.current=dt,kn(Rt)&&Ke.preventDefault(),clearInterval(pr.current),pr.current=setInterval(function(){Rt*=gr,(!kn(Rt,!0)||Math.abs(Rt)<=.1)&&clearInterval(pr.current)},16)}},at=function(){Tn.current=!1,Hn()},Et=function(Ke){Hn(),Ke.touches.length===1&&!Tn.current&&(Tn.current=!0,sr.current=Math.ceil(Ke.touches[0].pageY),tr.current=Ke.target,tr.current.addEventListener("touchmove",Ze),tr.current.addEventListener("touchend",at))};Hn=function(){tr.current&&(tr.current.removeEventListener("touchmove",Ze),tr.current.removeEventListener("touchend",at))},Qe(function(){return gt&&En.current.addEventListener("touchstart",Et),function(){var jt;(jt=En.current)===null||jt===void 0||jt.removeEventListener("touchstart",Et),Hn(),clearInterval(pr.current)}},[gt])}var Ur=20;function Gr(){var gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,En=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,kn=gt/En*100;return isNaN(kn)&&(kn=0),kn=Math.max(kn,Ur),kn=Math.min(kn,gt/2),Math.floor(kn)}function Xr(gt,En,kn,Tn){var sr=Me.useMemo(function(){return[new Map,[]]},[gt,kn.id,Tn]),tr=(0,Ue.Z)(sr,2),pr=tr[0],Hn=tr[1],Ze=function(Et){var jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Et,Ke=pr.get(Et),dt=pr.get(jt);if(Ke===void 0||dt===void 0)for(var Rt=gt.length,Tt=Hn.length;Tt<Rt;Tt+=1){var Wt,Zt=gt[Tt],zn=En(Zt);pr.set(zn,Tt);var Sr=(Wt=kn.get(zn))!==null&&Wt!==void 0?Wt:Tn;if(Hn[Tt]=(Hn[Tt-1]||0)+Sr,zn===Et&&(Ke=Tt),zn===jt&&(dt=Tt),Ke!==void 0&&dt!==void 0)break}return{top:Hn[Ke-1]||0,bottom:Hn[dt]}};return Ze}var ui=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],br=[],Ei={overflowY:"auto",overflowAnchor:"none"};function sa(gt,En){var kn=gt.prefixCls,Tn=kn===void 0?"rc-virtual-list":kn,sr=gt.className,tr=gt.height,pr=gt.itemHeight,Hn=gt.fullHeight,Ze=Hn===void 0?!0:Hn,at=gt.style,Et=gt.data,jt=gt.children,Ke=gt.itemKey,dt=gt.virtual,Rt=gt.direction,Tt=gt.scrollWidth,Wt=gt.component,Zt=Wt===void 0?"div":Wt,zn=gt.onScroll,Sr=gt.onVirtualScroll,Yn=gt.onVisibleChange,qn=gt.innerProps,nr=gt.extraRender,ar=gt.styles,ot=(0,Se.Z)(gt,ui),tt=!!(dt!==!1&&tr&&pr),vt=tt&&Et&&(pr*Et.length>tr||!!Tt),rn=Rt==="rtl",Dn=Te()(Tn,(0,be.Z)({},"".concat(Tn,"-rtl"),rn),sr),an=Et||br,cn=(0,Me.useRef)(),fn=(0,Me.useRef)(),In=(0,Me.useState)(0),or=(0,Ue.Z)(In,2),Ut=or[0],qr=or[1],Fr=(0,Me.useState)(0),Ri=(0,Ue.Z)(Fr,2),Li=Ri[0],pi=Ri[1],Gi=(0,Me.useState)(!1),yi=(0,Ue.Z)(Gi,2),ii=yi[0],Bi=yi[1],Zi=function(){Bi(!0)},Vr=function(){Bi(!1)},mi=Me.useCallback(function(Qt){return typeof Ke=="function"?Ke(Qt):Qt==null?void 0:Qt[Ke]},[Ke]),Wi={getKey:mi};function la(Qt){qr(function(Bn){var Kn;typeof Qt=="function"?Kn=Qt(Bn):Kn=Qt;var mr=Gn(Kn);return cn.current.scrollTop=mr,mr})}var ea=(0,Me.useRef)({start:0,end:an.length}),ti=(0,Me.useRef)(),yt=hi(an,mi),pt=(0,Ue.Z)(yt,1),$t=pt[0];ti.current=$t;var sn=Ln(mi,null,null),_n=(0,Ue.Z)(sn,4),cr=_n[0],Mr=_n[1],Br=_n[2],Kr=_n[3],Rr=Me.useMemo(function(){if(!tt)return{scrollHeight:void 0,start:0,end:an.length-1,offset:void 0};if(!vt){var Qt;return{scrollHeight:((Qt=fn.current)===null||Qt===void 0?void 0:Qt.offsetHeight)||0,start:0,end:an.length-1,offset:void 0}}for(var Bn=0,Kn,mr,Fn,_r=an.length,Zr=0;Zr<_r;Zr+=1){var Tr=an[Zr],$r=mi(Tr),xr=Br.get($r),Pr=Bn+(xr===void 0?pr:xr);Pr>=Ut&&Kn===void 0&&(Kn=Zr,mr=Bn),Pr>Ut+tr&&Fn===void 0&&(Fn=Zr),Bn=Pr}return Kn===void 0&&(Kn=0,mr=0,Fn=Math.ceil(tr/pr)),Fn===void 0&&(Fn=an.length-1),Fn=Math.min(Fn+1,an.length-1),{scrollHeight:Bn,start:Kn,end:Fn,offset:mr}},[vt,tt,Ut,an,Kr,tr]),Qr=Rr.scrollHeight,gi=Rr.start,Cr=Rr.end,di=Rr.offset;ea.current.start=gi,ea.current.end=Cr;var Ai=Me.useState({width:0,height:tr}),Si=(0,Ue.Z)(Ai,2),_e=Si[0],Be=Si[1],Ne=function(Bn){Be({width:Bn.width||Bn.offsetWidth,height:Bn.height||Bn.offsetHeight})},We=(0,Me.useRef)(),qe=(0,Me.useRef)(),rt=Me.useMemo(function(){return Gr(_e.width,Tt)},[_e.width,Tt]),bt=Me.useMemo(function(){return Gr(_e.height,Qr)},[_e.height,Qr]),Gt=Qr-tr,nn=(0,Me.useRef)(Gt);nn.current=Gt;function Gn(Qt){var Bn=Qt;return Number.isNaN(nn.current)||(Bn=Math.min(Bn,nn.current)),Bn=Math.max(Bn,0),Bn}var fr=Ut<=0,Wn=Ut>=Gt,vn=Vn(fr,Wn),hn=function(){return{x:rn?-Li:Li,y:Ut}},Sn=(0,Me.useRef)(hn()),Pn=Le(function(){if(Sr){var Qt=hn();(Sn.current.x!==Qt.x||Sn.current.y!==Qt.y)&&(Sr(Qt),Sn.current=Qt)}});function ur(Qt,Bn){var Kn=Qt;Bn?((0,xe.flushSync)(function(){pi(Kn)}),Pn()):la(Kn)}function jn(Qt){var Bn=Qt.currentTarget.scrollTop;Bn!==Ut&&la(Bn),zn==null||zn(Qt),Pn()}var Zn=function(Bn){var Kn=Bn,mr=Tt-_e.width;return Kn=Math.max(Kn,0),Kn=Math.min(Kn,mr),Kn},Jn=Le(function(Qt,Bn){Bn?((0,xe.flushSync)(function(){pi(function(Kn){var mr=Kn+(rn?-Qt:Qt);return Zn(mr)})}),Pn()):la(function(Kn){var mr=Kn+Qt;return mr})}),Qn=rr(tt,fr,Wn,!!Tt,Jn),hr=(0,Ue.Z)(Qn,2),Pe=hr[0],Fe=hr[1];Ir(tt,cn,function(Qt,Bn){return vn(Qt,Bn)?!1:(Pe({preventDefault:function(){},deltaY:Qt}),!0)}),Qe(function(){function Qt(Kn){tt&&Kn.preventDefault()}var Bn=cn.current;return Bn.addEventListener("wheel",Pe),Bn.addEventListener("DOMMouseScroll",Fe),Bn.addEventListener("MozMousePixelScroll",Qt),function(){Bn.removeEventListener("wheel",Pe),Bn.removeEventListener("DOMMouseScroll",Fe),Bn.removeEventListener("MozMousePixelScroll",Qt)}},[tt]),Qe(function(){Tt&&pi(function(Qt){return Zn(Qt)})},[_e.width,Tt]);var wt=function(){var Bn,Kn;(Bn=We.current)===null||Bn===void 0||Bn.delayHidden(),(Kn=qe.current)===null||Kn===void 0||Kn.delayHidden()},it=Kt(cn,an,Br,pr,mi,function(){return Mr(!0)},la,wt);Me.useImperativeHandle(En,function(){return{getScrollInfo:hn,scrollTo:function(Bn){function Kn(mr){return mr&&(0,$e.Z)(mr)==="object"&&("left"in mr||"top"in mr)}Kn(Bn)?(Bn.left!==void 0&&pi(Zn(Bn.left)),it(Bn.top)):it(Bn)}}}),Qe(function(){if(Yn){var Qt=an.slice(gi,Cr+1);Yn(Qt,an)}},[gi,Cr,an]);var Ot=Xr(an,mi,Br,pr),on=nr==null?void 0:nr({start:gi,end:Cr,virtual:vt,offsetX:Li,offsetY:di,rtl:rn,getSize:Ot}),mn=Xe(an,gi,Cr,Tt,cr,jt,Wi),On=null;tr&&(On=(0,et.Z)((0,be.Z)({},Ze?"height":"maxHeight",tr),Ei),tt&&(On.overflowY="hidden",Tt&&(On.overflowX="hidden"),ii&&(On.pointerEvents="none")));var xn={};return rn&&(xn.dir="rtl"),Me.createElement("div",(0,fe.Z)({style:(0,et.Z)((0,et.Z)({},at),{},{position:"relative"}),className:Dn},xn,ot),Me.createElement(mt.Z,{onResize:Ne},Me.createElement(Zt,{className:"".concat(Tn,"-holder"),style:On,ref:cn,onScroll:jn,onMouseEnter:wt},Me.createElement(It,{prefixCls:Tn,height:Qr,offsetX:Li,offsetY:di,scrollWidth:Tt,onInnerResize:Mr,ref:fn,innerProps:qn,rtl:rn,extra:on},mn))),vt&&Qr>tr&&Me.createElement(ke,{ref:We,prefixCls:Tn,scrollOffset:Ut,scrollRange:Qr,rtl:rn,onScroll:ur,onStartMove:Zi,onStopMove:Vr,spinSize:bt,containerSize:_e.height,style:ar==null?void 0:ar.verticalScrollBar,thumbStyle:ar==null?void 0:ar.verticalScrollBarThumb}),vt&&Tt&&Me.createElement(ke,{ref:qe,prefixCls:Tn,scrollOffset:Li,scrollRange:Tt,rtl:rn,onScroll:ur,onStartMove:Zi,onStopMove:Vr,spinSize:rt,containerSize:_e.width,horizontal:!0,style:ar==null?void 0:ar.horizontalScrollBar,thumbStyle:ar==null?void 0:ar.horizontalScrollBarThumb}))}var Ji=Me.forwardRef(sa);Ji.displayName="List";var Qi=Ji,Ci=Qi},66392:function(Cn,Xt){"use strict";var se;var fe=Symbol.for("react.element"),et=Symbol.for("react.portal"),$e=Symbol.for("react.fragment"),Ue=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),Me=Symbol.for("react.context"),xe=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),mt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),It=Symbol.for("react.lazy"),Ct=Symbol.for("react.offscreen"),ht;ht=Symbol.for("react.module.reference");function Ye(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case fe:switch(De=De.type,De){case $e:case be:case Ue:case Te:case mt:return De;default:switch(De=De&&De.$$typeof,De){case xe:case Me:case pe:case It:case ze:case Se:return De;default:return At}}case et:return At}}}se=Me,se=Se,se=fe,se=pe,se=$e,se=It,se=ze,se=et,se=be,se=Ue,se=Te,se=mt,se=function(){return!1},se=function(){return!1},se=function(De){return Ye(De)===Me},se=function(De){return Ye(De)===Se},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},se=function(De){return Ye(De)===pe},se=function(De){return Ye(De)===$e},se=function(De){return Ye(De)===It},se=function(De){return Ye(De)===ze},se=function(De){return Ye(De)===et},se=function(De){return Ye(De)===be},se=function(De){return Ye(De)===Ue},se=function(De){return Ye(De)===Te},se=function(De){return Ye(De)===mt},se=function(De){return typeof De=="string"||typeof De=="function"||De===$e||De===be||De===Ue||De===Te||De===mt||De===Ct||typeof De=="object"&&De!==null&&(De.$$typeof===It||De.$$typeof===ze||De.$$typeof===Se||De.$$typeof===Me||De.$$typeof===pe||De.$$typeof===ht||De.getModuleId!==void 0)},se=Ye},31461:function(Cn,Xt,se){"use strict";se(66392)},84279:function(Cn,Xt,se){"use strict";var fe=Object.defineProperty,et=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,Me=(a,y,b)=>y in a?fe(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,xe=(a,y)=>{for(var b in y||(y={}))be.call(y,b)&&Me(a,b,y[b]);if(Ue)for(var b of Ue(y))Se.call(y,b)&&Me(a,b,y[b]);return a},pe=(a,y)=>et(a,$e(y)),Te=a=>typeof a=="symbol"?a:a+"",mt=(a,y)=>{var b={};for(var E in a)be.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&Ue)for(var E of Ue(a))y.indexOf(E)<0&&Se.call(a,E)&&(b[E]=a[E]);return b};function ze(a){return Array.isArray(a)}var It={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 Ct(){return"window"in globalThis&&"document"in globalThis}function ht(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function Ye(){return typeof navigator.vibrate=="function"}function De(){var a,y;if(!Ct())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 At(){if(!Ct())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 nt={strings:It,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return nt._locale||(nt._locale=Ct()?navigator.language.slice(0,5):"en-US"),nt._locale},set locale(a){nt._locale=a,nt._numberFormatter=void 0,nt.dirty=!0},get numberFormatter(){return nt._numberFormatter||(nt._numberFormatter=new Intl.NumberFormat(nt.locale)),nt._numberFormatter},merge(a,y){if(typeof a=="string"&&y)nt.strings[a]=xe(xe({},nt.strings[a]),y),nt.dirty=!0;else for(const b of Object.keys(a))nt.merge(b,a[b])},get dirty(){return nt._dirty},set dirty(a){nt._dirty||nt._dirty===a||(nt._dirty=!0,setTimeout(()=>{nt._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return nt._subscribers.push(a),nt._subscribers.length-1},unsubscribe(a){a<0||a>=nt._subscribers.length||(nt._subscribers[a]=void 0)},update(a){let y=a.querySelectorAll("[data-l10n-tooltip]");for(const b of y){const E=b.getAttribute("data-l10n-tooltip");if(E){const ee=lt(E);ee&&b.setAttribute("data-tooltip",ee)}}y=a.querySelectorAll("[data-l10n-arial-label]");for(const b of y){const E=b.getAttribute("data-l10n-arial-label");if(E){const ee=lt(E);ee&&b.setAttribute("aria-label",ee)}}}};function lt(a,...y){if(a===void 0)return;let b="";const E=nt.locale;nt.strings[E]&&(b=nt.strings[E][a]);const ee=E.slice(0,2);if(!b&&nt.strings[ee]&&(b=nt.strings[ee][a]),b||(b=nt.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),de=0;for(;ae;){if(y[de++]){const ge=ae[2]?parseInt(ae[2],10)-1:de-1;let we=y[ge];typeof we=="number"&&(we=nt.numberFormatter.format(we)),b=b.replace(ae[1],we)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ie={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},ke={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},je={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},Xe={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},Pt={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"},kt={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 Lt(a){var y,b,E,ee,re,ae;const de=a.split("!");let he,ge,we,Re=255,Ve=255,ft=255,St=-1;const wn=de.length>0&&de[0].startsWith("-");wn&&(de[0]=de[0].slice(1));for(let wr=0;wr<de.length;wr++){he=Re,ge=Ve,we=ft;const yn=(y=de[wr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],er=yn==null?void 0:yn.toLowerCase(),kr=yn&&(ae=(re=(ee=(E=(b=Xe[er])!=null?b:Xe[Pt[yn]])!=null?E:ke[yn])!=null?ee:kt[yn])!=null?re:Ie[yn])!=null?ae:de[wr].trim();let lr=kr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(lr!=null&&lr[1]&&lr[2]&&lr[3])Re=Math.max(0,Math.min(255,Number.parseInt(lr[1],16))),Ve=Math.max(0,Math.min(255,Number.parseInt(lr[2],16))),ft=Math.max(0,Math.min(255,Number.parseInt(lr[3],16)));else if(lr=kr.match(/^#([\da-f]{3})$/i),lr!=null&&lr[1]){const si=Number.parseInt(lr[1][0],16),Ii=Number.parseInt(lr[1][1],16),vi=Number.parseInt(lr[1][2],16);Re=Math.max(0,Math.min(255,si*16+si)),Ve=Math.max(0,Math.min(255,Ii*16+Ii)),ft=Math.max(0,Math.min(255,vi*16+vi))}else if(lr=kr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),lr!=null&&lr[1]&&lr[2]&&lr[3])Re=Math.max(0,Math.min(255,Number.parseInt(lr[1]))),Ve=Math.max(0,Math.min(255,Number.parseInt(lr[2]))),ft=Math.max(0,Math.min(255,Number.parseInt(lr[3])));else return;St>=0&&(Re=(1-St)*Re+St*he,Ve=(1-St)*Ve+St*ge,ft=(1-St)*ft+St*we,St=-1),wr+1<de.length&&(St=Math.max(0,Math.min(100,Number.parseInt(de[++wr])))/100)}return St>=0&&(Re=St*Re+(1-St)*he,Ve=St*Ve+(1-St)*ge,ft=St*ft+(1-St)*we),wn&&(Re=255-Re,Ve=255-Ve,ft=255-ft),"#"+("00"+Math.round(Re).toString(16)).slice(-2)+("00"+Math.round(Ve).toString(16)).slice(-2)+("00"+Math.round(ft).toString(16)).slice(-2)}function Ge(a){var y,b;return a=a.trim(),(b=(y=je[a.toLowerCase()])!=null?y:je[Pt[a]])!=null?b:Lt(a)}function Ht(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 Dt(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 Ln(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*Dt(re,ee,y+2)),g:Math.round(255*Dt(re,ee,y)),b:Math.round(255*Dt(re,ee,y-2))}}function un(a){return a<0?0:a>255?255:Math.round(a)}function Rn(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(un(y)<<16)+(un(b)<<8)+un(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 ir(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 de,he;re===ee?de=0:y===re?de=(b-E)/ae:b===re?de=2+(E-y)/ae:E===re&&(de=4+(y-b)/ae),de=Math.min(de*60,360),de<0&&(de+=360);const ge=(ee+re)/2;return re===ee?he=0:ge<=.5?he=ae/(re+ee):he=ae/(2-re-ee),{h:de,s:he,l:ge}}function yr(a){let y=Ht(a);if(!y)return a;let{h:b,s:E,l:ee}=ir(y);return E+=.1,ee-=.1,Rn(Ln({h:b,s:E,l:ee}))}var Qe={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"},Le={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},Nt=[{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 Nn(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 Nt)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(Le[re]||re)}return a}function gn(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in Le)if(Le[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of Nt)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 Je(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=Qe[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:de,style:he}=gn(ee);switch(re=ae,de){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(he){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function st(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var _t={},en=xe({},Qe),Bt={},Ft={},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}"},Mn={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}},bn={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}},Ee={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:bn},"amsmath.sty":{package:Mn,primitive:!0},"texvc.sty":{package:zt,primitive:!1}},ce={" ":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},le=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,ye,ve;At()?(ye=new RegExp("\\p{Letter}","u"),ve=new RegExp("[0-9\\p{Letter}]","u")):(ye=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,ve=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function oe(a,y,b="mord",E){y!==void 0&&(_t[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},en[y]||(en[y]=a))}function He(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);oe(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)oe(E,ee,re!=null?re:y,ae!=null?ae:b)}function xt(a,y){for(let b=a;b<=y;b++)oe(String.fromCodePoint(b),b)}function Yt(a){var y;return(y=Ft[a])!=null?y:null}function pn(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in Bt)ae.startsWith(y)&&!Bt[ae].infix&&ee.push({match:ae,frequency:(b=Bt[ae].frequency)!=null?b:0});for(const ae in _t)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=_t[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,de)=>{var he,ge;return ae.frequency===de.frequency?ae.match.length===de.match.length?ae.match<de.match?-1:1:ae.match.length-de.match.length:((he=de.frequency)!=null?he:0)-((ge=ae.frequency)!=null?ge:0)}),ee.map(ae=>ae.match)}function dn(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function An(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:dn(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...An(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:dn(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...An(b[E]))}return y}function tn(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 Nr(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)Ft[E]=b}function Wr(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:An(y),createAtom:b};for(const re of a)Ft[re]=ee}function Kt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:An(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")Bt["\\"+a]=re;else for(const ae of a)Bt["\\"+ae]=re}var $n;function ei(a){return $n||($n=ut(Ee)),a?ut(xe(xe({},$n),a)):$n}function hi(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const de=a;return/(^|[^\\])#1/.test(de)&&(ae=1),/(^|[^\\])#2/.test(de)&&(ae=2),/(^|[^\\])#3/.test(de)&&(ae=3),/(^|[^\\])#4/.test(de)&&(ae=4),/(^|[^\\])#5/.test(de)&&(ae=5),/(^|[^\\])#6/.test(de)&&(ae=6),/(^|[^\\])#7/.test(de)&&(ae=7),/(^|[^\\])#8/.test(de)&&(ae=8),/(^|[^\\])#9/.test(de)&&(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:de}}return xe({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 ut(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]=hi(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=hi(E)}return y}function Vt(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=Bt[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=_t[a]:ce[a]&&(b={definitionType:"symbol",type:"mord",codepoint:ce[a]})}else if(y==="math"){if(b=_t[a],!b&&a.length===1){const E=rr("math",a.codePointAt(0));return E.startsWith("\\")?pe(xe({},Vt(E,"math")),{command:E}):null}}else ce[a]?b={definitionType:"symbol",type:"mord",codepoint:ce[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Vn(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function rr(a,y){if(y===void 0)return"";if(a==="math"&&en[y])return en[y];if(a==="text"){const b=Object.keys(ce).find(E=>ce[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var gr=[0,.68889,0,0,.72222],Ir=[0,.68889,0,0,.66667],Ur=[0,.68889,0,0,.77778],Gr=[0,.68889,0,0,.61111],Xr=[.16667,.68889,0,0,.77778],ui=[0,.68889,0,0,.55556],br=[0,0,0,0,.25],Ei=[0,.825,0,0,2.33334],sa=[0,.9,0,0,2.33334],Ji=[0,.68889,0,0,.54028],Qi=[-.03598,.46402,0,0,.5],Ci=[-.13313,.36687,0,0,1],gt=[.01354,.52239,0,0,1],En=[.01354,.52239,0,0,1.11111],kn=[0,.54986,0,0,1],Tn=[0,.69224,0,0,.5],sr=[0,.43056,0,0,1],tr=[.08198,.58198,0,0,.77778],pr=[.19444,.69224,0,0,.41667],Hn=[.1808,.675,0,0,1],Ze=[.19444,.69224,0,0,.83334],at=[.13667,.63667,0,0,1],Et=[-.064,.437,0,0,1.334],jt=[.08167,.58167,0,0,.77778],Ke=[0,.69224,0,0,.72222],dt=[0,.69224,0,0,.66667],Rt=[-.13313,.36687,0,0,.77778],Tt=[.06062,.54986,0,0,.77778],Wt=[0,.69224,0,0,.77778],Zt=[.25583,.75583,0,0,.77778],zn=[.25142,.75726,0,0,.77778],Sr=[.20576,.70576,0,0,.77778],Yn=[.30274,.79383,0,0,.77778],qn=[.22958,.72958,0,0,.77778],nr=[.1808,.675,0,0,.77778],ar=[.13667,.63667,0,0,.77778],ot=[.13597,.63597,0,0,.77778],tt=[.03517,.54986,0,0,.77778],vt=[0,.675,0,0,.77778],rn=[.19444,.69224,0,0,.61111],Dn=[0,.54986,0,0,.76042],an=[0,.54986,0,0,.66667],cn=[.0391,.5391,0,0,.77778],fn=[.03517,.54986,0,0,1.33334],In=[.38569,.88569,0,0,.77778],or=[.23222,.74111,0,0,.77778],Ut=[.19444,.69224,0,0,.77778],qr=[0,.37788,0,0,.5],Fr=[0,.54986,0,0,.72222],Ri=[0,.69224,0,0,.83334],Li=[.11111,.69224,0,0,.66667],pi=[.26167,.75726,0,0,.77778],Gi=[.48256,.98256,0,0,.77778],yi=[.28481,.79383,0,0,.77778],ii=[.08167,.58167,0,0,.22222],Bi=[.08167,.58167,0,0,.38889],Zi=[0,.43056,.04028,0,.66667],Vr=[.41951,.91951,0,0,.77778],mi=[.24982,.74947,0,0,.38865],Wi=[.08319,.58283,0,0,.75623],la=[0,.10803,0,0,.27764],ea=[0,.47534,0,0,.50181],ti=[.18906,.47534,0,0,.50181],yt=[0,.69141,0,0,.50181],pt=[.24982,.74947,0,0,.27764],$t=[0,.69141,0,0,.21471],sn=[.25,.75,0,0,.44722],_n=[0,.64444,0,0,.575],cr=[.08556,.58556,0,0,.89444],Mr=[0,.69444,0,0,.89444],Br=[0,.68611,0,0,.9],Kr=[0,.68611,0,0,.86944],Rr=[.25,.75,0,0,.575],Qr=[.25,.75,0,0,.31944],gi=[0,.69444,0,0,.63889],Cr=[0,.69444,0,0,.31944],di=[0,.44444,0,0,.63889],Ai=[0,.44444,0,0,.51111],Si=[0,.69444,0,0,.575],_e=[.13333,.63333,0,0,.89444],Be=[0,.44444,0,0,.31944],Ne=[0,.69444,0,0,.86944],We=[0,.68611,0,0,.69166],qe=[0,.68611,0,0,.83055],rt=[0,.68611,0,0,.89444],bt=[0,.69444,0,0,.60278],Gt=[.19444,.69444,0,0,.51111],nn=[0,.69444,0,0,.83055],Gn=[-.10889,.39111,0,0,1.14999],fr=[.19444,.69444,0,0,.575],Wn=[.19444,.69444,0,0,1.14999],vn=[.19444,.69444,0,0,.70277],hn=[.05556,.75,0,0,.575],Sn=[0,.68611,0,0,.95833],Pn=[.08556,.58556,0,0,.76666],ur=[-.02639,.47361,0,0,.575],jn=[0,.44444,0,0,.89444],Zn=[0,.55556,0,0,.76666],Jn=[-.10889,.39111,0,0,.89444],Qn=[.00222,.50222,0,0,.89444],hr=[.19667,.69667,0,0,.89444],Pe=[.08556,.58556,0,0,1.14999],Fe=[0,.69444,0,0,.70277],wt=[-.02778,.47222,0,0,.575],it=[.25,.75,0,0,.51111],Ot=[-.13889,.36111,0,0,1.14999],on=[.19444,.69444,0,0,1.02222],mn=[.12963,.69444,0,0,.89444],On=[.19444,.69444,0,0,.44722],xn=[0,.64444,.13167,0,.59111],Qt=[.19444,.64444,.13167,0,.59111],Bn=[0,.68611,.17208,0,.8961],Kn=[.19444,.44444,.105,0,.53222],mr=[0,.44444,.085,0,.82666],Fn=[0,.69444,.06709,0,.59111],_r=[0,.69444,.12945,0,.35555],Zr=[0,.69444,0,0,.94888],Tr=[0,.69444,.11472,0,.59111],$r=[0,.68611,.10778,0,.88555],xr=[0,.69444,.07939,0,.62055],Pr=[0,.69444,.12417,0,.30667],Yr=[0,.64444,.13556,0,.51111],ai=[.19444,.64444,.13556,0,.51111],Dr=[0,.68333,.16389,0,.74333],li=[.19444,.43056,.08847,0,.46],Pi=[0,.43056,.07514,0,.71555],ta=[0,.69444,.06646,0,.51111],Vi=[0,.69444,0,0,.83129],Ni=[0,.69444,.1225,0,.51111],Xi=[0,.68333,.09403,0,.76666],qi=[0,.68333,.11111,0,.76666],bi=[0,.69444,.06961,0,.51444],Fi=[0,.69444,0,0,.27778],jr=[.25,.75,0,0,.38889],ci=[0,.64444,0,0,.5],Ti=[0,.69444,0,0,.77778],ji=[0,.68333,0,0,.75],Na=[0,.68333,0,0,.77778],Fa=[0,.68333,0,0,.68056],Aa=[0,.68333,0,0,.72222],ua=[.25,.75,0,0,.5],Yi=[.25,.75,0,0,.27778],Mi=[0,.69444,0,0,.5],Oa=[0,.69444,0,0,.55556],ki=[0,.43056,0,0,.44445],Jr=[0,.43056,0,0,.5],zi=[.19444,.43056,0,0,.55556],ca=[0,.43056,0,0,.55556],Ui=[.08333,.58333,0,0,.77778],ia=[0,.43056,0,0,.27778],fi=[0,.66786,0,0,.27778],pa=[0,.69444,0,0,.75],xa=[0,.66786,0,0,.5],fa=[0,.68333,0,0,.625],wa=[.19444,.69444,0,0,.44445],Ea=[0,.69444,0,0,.72222],Va=[.19444,.69444,0,0,.5],ha=[.19444,.69444,0,0,1],ka=[.011,.511,0,0,1.126],Ja=[.19444,.69444,0,0,.61111],Ga=[.05556,.75,0,0,.5],so=[0,.68333,0,0,.83334],$a=[.0391,.5391,0,0,.66667],Ca=[-.05555,.44445,0,0,.5],_i=[0,.43056,0,0,.77778],Ki=[0,.55556,0,0,.66667],da=[-.03625,.46375,0,0,.77778],Sa=[-.01688,.48312,0,0,.77778],Ka=[.0391,.5391,0,0,1],io=[0,.69444,0,0,.61111],ho=[-.03472,.46528,0,0,.5],Oo=[.25,.75,0,0,.44445],Ro=[-.14236,.35764,0,0,1],lo=[.244,.744,0,0,.412],Ao=[.19444,.69444,0,0,.88889],na=[.12963,.69444,0,0,.77778],Oi=[.19444,.69444,0,0,.38889],Ta=[.011,.511,0,0,1.638],_a=[.19444,.69444,0,0,0],uo=[0,.44444,0,0,.575],ao=[.19444,.44444,0,0,.575],hs=[0,.68611,0,0,.75555],Qo=[0,.69444,0,0,.66759],ps=[0,.68611,0,0,.80555],aa=[0,.68611,.08229,0,.98229],Lr=[0,.68611,0,0,.76666],xi=[0,.44444,0,0,.58472],wi=[.19444,.44444,0,0,.6118],Di=[.19444,.43056,0,0,.5],Ha=[0,.68333,.02778,.08334,.76278],ja=[0,.68333,.08125,.05556,.83125],$o=[0,.43056,0,.05556,.48472],Uo=[.19444,.43056,0,.08334,.51702],ls=[.25,.75,0,0,.42778],va=[0,.69444,0,0,.55],Bo=[0,.69444,0,0,.73334],us=[0,.69444,0,0,.79445],cl=[0,.69444,0,0,.51945],As=[0,.69444,0,0,.70278],ms=[0,.69444,0,0,.76389],zo=[.25,.75,0,0,.34306],Ts=[0,.69444,0,0,.56111],Ds=[0,.69444,0,0,.25556],Ys=[.19444,.45833,0,0,.56111],oo=[0,.45833,0,0,.56111],Da=[0,.69444,0,0,.30556],Xa=[0,.69444,0,0,.58056],go=[0,.69444,0,0,.67223],yo=[0,.69444,0,0,.85556],Ko=[0,.69444,0,0,.55834],wo=[0,.65556,.11156,0,.5],xs=[0,.69444,.08094,0,.70834],Xl=[.17014,0,0,0,.44445],ql=[0,.69444,.0799,0,.5],vu=[0,.69444,0,0,.73752],Xu=[0,.69444,.09205,0,.5],Ks=[0,.69444,.09031,0,.77778],Is=[0,.69444,.07816,0,.27778],yu=[0,.69444,.00316,0,.5],Yl=[.19444,.69444,0,0,.83334],Ia=[.05556,.75,0,0,.83334],ma=[0,.75,0,0,.5],Ho=[.125,.08333,0,0,.27778],es=[0,.08333,0,0,.27778],ga=[0,.65556,0,0,.5],za=[0,.69444,0,0,.47222],Ra=[0,.69444,0,0,.66667],po=[0,.69444,0,0,.59722],is=[0,.69444,0,0,.54167],Hs=[0,.69444,0,0,.70834],gs=[.25,.75,0,0,.28889],Jl=[0,.69444,0,0,.51667],Zd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],qu=[0,.44444,0,0,.38333],Zc=[0,.44444,0,0,.51667],Yu=[0,.69444,0,0,.83334],jd=[.35001,.85,0,0,.45834],Ju=[.35001,.85,0,0,.57778],Qu=[.35001,.85,0,0,.41667],Vc=[.35001,.85,0,0,.58334],bu=[0,.72222,0,0,.55556],ec=[1e-5,.6,0,0,.66667],jc=[1e-5,.6,0,0,.77778],Ql=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],xu=[.30612,.805,.19445,0,.47222],Zo=[.25001,.75,0,0,.83334],Pl=[.35001,.85,0,0,.47222],Gc=[.25001,.75,0,0,1.11111],Xc=[.65002,1.15,0,0,.59722],vs=[.65002,1.15,0,0,.81111],Za=[.65002,1.15,0,0,.47222],Es=[.65002,1.15,0,0,.66667],Ps=[0,.75,0,0,1],Js=[.55001,1.05,0,0,1.27778],qc=[.862,1.36,.44445,0,.55556],tc=[.86225,1.36,.44445,0,.55556],Ol=[.55001,1.05,0,0,1.11111],nc=[.65002,1.15,0,0,.52778],rc=[.65002,1.15,0,0,.61111],Rl=[.55001,1.05,0,0,1.51112],Yc=[.95003,1.45,0,0,.73611],ic=[.95003,1.45,0,0,1.04445],Qs=[.95003,1.45,0,0,.52778],wu=[.95003,1.45,0,0,.75],Su=[0,.75,0,0,1.44445],ac=[.95003,1.45,0,0,.58334],Cu=[1.25003,1.75,0,0,.79167],oc=[1.25003,1.75,0,0,1.27778],Jc=[1.25003,1.75,0,0,.58334],sc=[1.25003,1.75,0,0,.80556],Mu=[0,.825,0,0,1.8889],lc=[1.25003,1.75,0,0,.63889],uc=[.64502,1.155,0,0,.875],Eu=[1e-5,.6,0,0,.875],cc=[-99e-5,.601,0,0,.66667],dc=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Qc=[.65002,1.15,0,0,.88889],Bl=[.90001,0,0,0,.88889],fc=[-.00499,.605,0,0,1.05556],Nl=[0,.12,0,0,.45],oi=[0,.61111,0,0,.525],ws=[.08333,.69444,0,0,.525],ed=[-.08056,.53055,0,0,.525],qd=[-.05556,.55556,0,0,.525],as=[0,.43056,0,0,.525],To=[.22222,.43056,0,0,.525],ku=[0,0,0,0,.525],Yd={"AMS-Regular":{32:br,65:gr,66:Ir,67:gr,68:gr,69:Ir,70:Gr,71:Ur,72:Ur,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Ur,76:Ir,77:[0,.68889,0,0,.94445],78:gr,79:Xr,80:Gr,81:Xr,82:gr,83:ui,84:Ir,85:gr,86:gr,87:[0,.68889,0,0,1],88:gr,89:gr,90:Ir,107:ui,160:br,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ui,295:Ji,710:Ei,732:sa,770:Ei,771:sa,989:jt,1008:Zi,8245:[0,.54986,0,0,.275],8463:Ji,8487:gr,8498:ui,8502:Ir,8503:[0,.68889,0,0,.44445],8504:Ir,8513:[0,.68889,0,0,.63889],8592:Qi,8594:Qi,8602:Ci,8603:Ci,8606:gt,8608:gt,8610:En,8611:En,8619:kn,8620:kn,8621:[-.13313,.37788,0,0,1.38889],8622:Ci,8624:Tn,8625:Tn,8630:sr,8631:sr,8634:tr,8635:tr,8638:pr,8639:pr,8642:pr,8643:pr,8644:Hn,8646:Hn,8647:Hn,8648:Ze,8649:Hn,8650:Ze,8651:gt,8652:gt,8653:Ci,8654:Ci,8655:Ci,8666:at,8667:at,8669:[-.13313,.37788,0,0,1],8672:Et,8674:Et,8705:[0,.825,0,0,.5],8708:ui,8709:jt,8717:[0,.43056,0,0,.42917],8722:Qi,8724:[.08198,.69224,0,0,.77778],8726:jt,8733:Wt,8736:Ke,8737:Ke,8738:[.03517,.52239,0,0,.72222],8739:ii,8740:[.25142,.74111,0,0,.27778],8741:Bi,8742:[.25142,.74111,0,0,.5],8756:dt,8757:dt,8764:Rt,8765:[-.13313,.37788,0,0,.77778],8769:Rt,8770:da,8774:Yn,8776:Sa,8778:jt,8782:Tt,8783:Tt,8785:tr,8786:tr,8787:tr,8790:Wt,8791:qn,8796:[.08198,.91667,0,0,.77778],8806:Zt,8807:Zt,8808:zn,8809:zn,8812:[.25583,.75583,0,0,.5],8814:Sr,8815:Sr,8816:Yn,8817:Yn,8818:qn,8819:qn,8822:nr,8823:nr,8828:ar,8829:ar,8830:qn,8831:qn,8832:Sr,8833:Sr,8840:Yn,8841:Yn,8842:ot,8843:ot,8847:tt,8848:tt,8858:tr,8859:tr,8861:tr,8862:vt,8863:vt,8864:vt,8865:vt,8872:[0,.69224,0,0,.61111],8873:Ke,8874:[0,.69224,0,0,.88889],8876:Gr,8877:Gr,8878:gr,8879:gr,8882:tt,8883:tt,8884:ar,8885:ar,8888:[0,.54986,0,0,1.11111],8890:zi,8891:rn,8892:rn,8901:[0,.54986,0,0,.27778],8903:jt,8905:jt,8906:jt,8907:Wt,8908:Wt,8909:[-.03598,.46402,0,0,.77778],8910:Dn,8911:Dn,8912:tt,8913:tt,8914:an,8915:an,8916:dt,8918:cn,8919:cn,8920:fn,8921:fn,8922:In,8923:In,8926:ar,8927:ar,8928:Yn,8929:Yn,8934:or,8935:or,8936:or,8937:or,8938:Sr,8939:Sr,8940:Yn,8941:Yn,8994:Ut,8995:Ut,9416:[.15559,.69224,0,0,.90222],9484:Tn,9488:Tn,9492:qr,9496:qr,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:vt,9633:vt,9650:Fr,9651:Fr,9654:tt,9660:Fr,9661:Fr,9664:tt,9674:Li,9733:[.19444,.69224,0,0,.94445],10003:Ri,10016:Ri,10731:Li,10846:[.19444,.75583,0,0,.61111],10877:ar,10878:ar,10885:Zt,10886:Zt,10887:ot,10888:ot,10889:pi,10890:pi,10891:Gi,10892:Gi,10901:ar,10902:ar,10933:zn,10934:zn,10935:pi,10936:pi,10937:pi,10938:pi,10949:Zt,10950:Zt,10955:yi,10956:yi,57350:ii,57351:Bi,57352:jt,57353:Zi,57356:zn,57357:zn,57358:Vr,57359:Yn,57360:Yn,57361:Vr,57366:zn,57367:zn,57368:zn,57369:zn,57370:ot,57371:ot},"Caligraphic-Regular":{32:br,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:br},"Fraktur-Regular":{32:br,33:[0,.69141,0,0,.29574],34:$t,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:mi,41:mi,42:[0,.62119,0,0,.27764],43:Wi,44:la,45:Wi,46:la,47:[.24982,.74947,0,0,.50181],48:ea,49:ea,50:ea,51:ti,52:ti,53:ti,54:yt,55:ti,56:yt,57:ti,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:pt,93:pt,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:br,8216:$t,8217:$t,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:br,33:[0,.69444,0,0,.35],34:bt,35:[.19444,.69444,0,0,.95833],36:hn,37:[.05556,.75,0,0,.95833],38:Mr,39:Cr,40:sn,41:sn,42:[0,.75,0,0,.575],43:_e,44:[.19444,.15556,0,0,.31944],45:qu,46:[0,.15556,0,0,.31944],47:Rr,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,58:Be,59:[.19444,.44444,0,0,.31944],60:cr,61:Jn,62:cr,63:[0,.69444,0,0,.54305],64:Mr,65:Kr,66:[0,.68611,0,0,.81805],67:qe,68:[0,.68611,0,0,.88194],69:hs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Br,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:We,77:[0,.68611,0,0,1.09166],78:Br,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:Kr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Qr,92:Rr,93:Qr,94:Si,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:gi,99:Ai,100:gi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:gi,105:Cr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Cr,109:[0,.44444,0,0,.95833],110:di,111:uo,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:di,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:Ai,123:Rr,124:Qr,125:Rr,126:[.35,.34444,0,0,.575],160:br,163:[0,.69444,0,0,.86853],168:Si,172:[0,.44444,0,0,.76666],176:Ne,177:_e,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:_e,216:[.04861,.73472,0,0,.89444],223:po,230:[0,.44444,0,0,.83055],247:_e,248:[.09722,.54167,0,0,.575],305:Be,338:[0,.68611,0,0,1.16944],339:jn,567:[.19444,.44444,0,0,.35139],710:Si,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Si,715:Si,728:Si,729:Cr,730:Ne,732:Si,733:Si,915:We,916:Sn,920:rt,923:ps,926:Lr,928:Br,931:qe,933:rt,934:qe,936:rt,937:qe,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Cr,8217:Cr,8220:bt,8221:bt,8224:Gt,8225:Gt,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Qo,8465:nn,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:nn,8501:Fe,8592:Gn,8593:fr,8594:Gn,8595:fr,8596:Gn,8597:Rr,8598:Wn,8599:Wn,8600:Wn,8601:Wn,8636:Gn,8637:Gn,8640:Gn,8641:Gn,8656:Gn,8657:vn,8658:Gn,8659:vn,8660:Gn,8661:[.25,.75,0,0,.70277],8704:gi,8706:[0,.69444,.06389,0,.62847],8707:gi,8709:hn,8711:Sn,8712:Pn,8715:Pn,8722:_e,8723:_e,8725:Rr,8726:Rr,8727:wt,8728:ur,8729:ur,8730:[.18,.82,0,0,.95833],8733:jn,8734:[0,.44444,0,0,1.14999],8736:Ke,8739:Qr,8741:Rr,8743:Zn,8744:Zn,8745:Zn,8746:Zn,8747:[.19444,.69444,.12778,0,.56875],8764:Jn,8768:[.19444,.69444,0,0,.31944],8771:Qn,8776:[.02444,.52444,0,0,.89444],8781:Qn,8801:Qn,8804:hr,8805:hr,8810:Pe,8811:Pe,8826:cr,8827:cr,8834:cr,8835:cr,8838:hr,8839:hr,8846:Zn,8849:hr,8850:hr,8851:Zn,8852:Zn,8853:_e,8854:_e,8855:_e,8856:_e,8857:_e,8866:Fe,8867:Fe,8868:Mr,8869:Mr,8900:ur,8901:[-.02639,.47361,0,0,.31944],8902:wt,8968:it,8969:it,8970:it,8971:it,8994:Ot,8995:Ot,9651:on,9657:wt,9661:on,9667:wt,9711:Wn,9824:mn,9825:mn,9826:mn,9827:mn,9837:[0,.75,0,0,.44722],9838:On,9839:On,10216:sn,10217:sn,10815:Br,10927:hr,10928:hr,57376:_a},"Main-BoldItalic":{32:br,33:[0,.69444,.11417,0,.38611],34:xr,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:_r,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:xn,49:xn,50:xn,51:xn,52:Qt,53:xn,54:xn,55:Qt,56:xn,57:xn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Tr,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:Bn,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:Bn,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:Fn,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:Kn,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:Kn,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:br,168:[0,.69444,.11473,0,.59111],176:Zr,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:mr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:mr,567:[.19444,.44444,.04611,0,.385],710:Fn,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:_r,730:Zr,732:Tr,733:Tr,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:Bn,931:[0,.68611,.11431,0,.82666],933:$r,934:[0,.68611,.05632,0,.82666],936:$r,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:_r,8217:_r,8220:[0,.69444,.16772,0,.62055],8221:xr},"Main-Italic":{32:br,33:Pr,34:bi,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Pr,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:Yr,49:Yr,50:Yr,51:Yr,52:ai,53:Yr,54:Yr,55:ai,56:Yr,57:Yr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Ni,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:Dr,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:Dr,79:Xi,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:Dr,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:li,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:li,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:br,168:[0,.66786,.10474,0,.51111],176:Vi,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:Pi,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Pi,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:Vi,732:[0,.66786,.11585,0,.51111],733:Ni,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Xi,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Dr,931:[0,.68333,.12028,0,.71555],933:qi,934:[0,.68333,.05986,0,.71555],936:qi,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Pr,8217:Pr,8220:[0,.69444,.1685,0,.51444],8221:bi,8463:Ji},"Main-Regular":{32:br,33:Fi,34:Mi,35:Yl,36:Ga,37:Ia,38:Ti,39:Fi,40:jr,41:jr,42:ma,43:Ui,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:ua,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,58:ia,59:[.19444,.43056,0,0,.27778],60:cn,61:Rt,62:cn,63:za,64:Ti,65:ji,66:[0,.68333,0,0,.70834],67:Aa,68:[0,.68333,0,0,.76389],69:Fa,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:ji,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Na,76:fa,77:[0,.68333,0,0,.91667],78:ji,79:Na,80:Fa,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Aa,85:ji,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ji,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Yi,92:ua,93:Yi,94:Mi,95:[.31,.12056,.02778,0,.5],97:Jr,98:Oa,99:ki,100:Oa,101:ki,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Oa,105:fi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Fi,109:[0,.43056,0,0,.83334],110:ca,111:Jr,112:zi,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:ca,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:ki,123:ua,124:Yi,125:ua,126:[.35,.31786,0,0,.5],160:br,163:[0,.69444,0,0,.76909],167:wa,168:xa,172:[0,.43056,0,0,.66667],176:pa,177:Ui,182:Ja,184:Xl,198:[0,.68333,0,0,.90278],215:Ui,216:[.04861,.73194,0,0,.77778],223:Mi,230:[0,.43056,0,0,.72222],247:Ui,248:[.09722,.52778,0,0,.5],305:ia,338:[0,.68333,0,0,1.01389],339:_i,567:[.19444,.43056,0,0,.30556],710:Mi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Mi,715:Mi,728:Mi,729:fi,730:pa,732:xa,733:Mi,915:fa,916:so,920:Na,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ji,931:Aa,933:Na,934:Aa,936:Na,937:Aa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Fi,8217:Fi,8220:Mi,8221:Mi,8224:wa,8225:wa,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Ji,8465:Ea,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Ea,8501:io,8592:Ci,8593:Va,8594:Ci,8595:Va,8596:Ci,8597:ua,8598:ha,8599:ha,8600:ha,8601:ha,8614:[.011,.511,0,0,1],8617:ka,8618:ka,8636:Ci,8637:Ci,8640:Ci,8641:Ci,8652:[.011,.671,0,0,1],8656:Ci,8657:Ja,8658:Ci,8659:Ja,8660:Ci,8661:[.25,.75,0,0,.61111],8704:Oa,8706:[0,.69444,.05556,.08334,.5309],8707:Oa,8709:Ga,8711:so,8712:$a,8715:$a,8722:Ui,8723:Ui,8725:ua,8726:ua,8727:ho,8728:Ca,8729:Ca,8730:[.2,.8,0,0,.83334],8733:_i,8734:sr,8736:Ke,8739:Yi,8741:ua,8743:Ki,8744:Ki,8745:Ki,8746:Ki,8747:[.19444,.69444,.11111,0,.41667],8764:Rt,8768:[.19444,.69444,0,0,.27778],8771:da,8773:[-.022,.589,0,0,1],8776:Sa,8781:da,8784:[-.133,.67,0,0,.778],8801:da,8804:ot,8805:ot,8810:Ka,8811:Ka,8826:cn,8827:cn,8834:cn,8835:cn,8838:ot,8839:ot,8846:Ki,8849:ot,8850:ot,8851:Ki,8852:Ki,8853:Ui,8854:Ui,8855:Ui,8856:Ui,8857:Ui,8866:io,8867:io,8868:Ti,8869:Ti,8872:[.249,.75,0,0,.867],8900:Ca,8901:[-.05555,.44445,0,0,.27778],8902:ho,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:Oo,8969:Oo,8970:Oo,8971:Oo,8994:Ro,8995:Ro,9136:lo,9137:lo,9651:Ao,9657:ho,9661:Ao,9667:ho,9711:ha,9824:na,9825:na,9826:na,9827:na,9837:[0,.75,0,0,.38889],9838:Oi,9839:Oi,10216:jr,10217:jr,10222:lo,10223:lo,10229:[.011,.511,0,0,1.609],10230:Ta,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:Ta,10815:ji,10927:ot,10928:ot,57376:_a},"Math-BoldItalic":{32:br,48:uo,49:uo,50:uo,51:ao,52:ao,53:ao,54:_n,55:ao,56:_n,57:ao,65:Kr,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:aa,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:hs,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:Qo,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:xi,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:br,915:[0,.68611,.15972,0,.65694],916:Sn,920:[0,.68611,.03194,0,.86722],923:ps,926:[0,.68611,.07458,0,.84125],928:aa,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Lr,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:xi,960:[0,.44444,.03704,0,.68241],961:wi,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:wi,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:br,48:Jr,49:Jr,50:Jr,51:Di,52:Di,53:Di,54:ci,55:Di,56:ci,57:Di,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:ja,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:Ha,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:$o,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:br,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ha,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:ja,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:$o,960:[0,.43056,.03588,0,.57003],961:Uo,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:Uo,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:br,33:[0,.69444,0,0,.36667],34:Ko,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:Da,40:ls,41:ls,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:va,49:va,50:va,51:va,52:va,53:va,54:va,55:va,56:va,57:va,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:cl,64:Bo,65:Bo,66:Bo,67:As,68:us,69:[0,.69444,0,0,.64167],70:io,71:Bo,72:us,73:[0,.69444,0,0,.33056],74:cl,75:ms,76:Xa,77:[0,.69444,0,0,.97778],78:us,79:us,80:As,81:[.10556,.69444,0,0,.79445],82:As,83:io,84:Bo,85:ms,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Bo,89:[0,.69444,.0275,0,.73334],90:go,91:zo,93:zo,94:va,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Ts,99:[0,.45833,0,0,.48889],100:Ts,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Ts,105:Ds,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Ds,109:[0,.45833,0,0,.86667],110:oo,111:[0,.45833,0,0,.55],112:Ys,113:Ys,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:oo,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:br,168:va,176:Bo,180:va,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:va,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:va,729:Da,730:Bo,732:va,733:va,915:Xa,916:[0,.69444,0,0,.91667],920:yo,923:go,926:Bo,928:us,931:us,933:yo,934:us,936:yo,937:us,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Da,8217:Da,8220:Ko,8221:Ko},"SansSerif-Italic":{32:br,33:[0,.69444,.05733,0,.31945],34:yu,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:Is,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:Ho,45:[0,.44444,.01946,0,.33333],46:es,47:[.25,.75,.13164,0,.5],48:wo,49:wo,50:wo,51:wo,52:wo,53:wo,54:wo,55:wo,56:wo,57:wo,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:Ra,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:xs,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:is,77:[0,.69444,.08094,0,.875],78:xs,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:ql,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:br,168:[0,.67937,.06385,0,.5],176:vu,184:Xl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:ql,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Xu,715:Mi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:vu,732:[0,.67659,.08826,0,.5],733:Xu,915:[0,.69444,.13372,0,.54167],916:Yu,920:[0,.69444,.07555,0,.77778],923:io,926:[0,.69444,.12816,0,.66667],928:xs,931:[0,.69444,.11983,0,.72222],933:Ks,934:[0,.69444,.04603,0,.72222],936:Ks,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Is,8217:Is,8220:[0,.69444,.14205,0,.5],8221:yu},"SansSerif-Regular":{32:br,33:[0,.69444,0,0,.31945],34:Mi,35:Yl,36:Ga,37:Ia,38:[0,.69444,0,0,.75834],39:Fi,40:jr,41:jr,42:ma,43:Ui,44:Ho,45:[0,.44444,0,0,.33333],46:es,47:ua,48:ga,49:ga,50:ga,51:ga,52:ga,53:ga,54:ga,55:ga,56:ga,57:ga,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:za,64:Ra,65:Ra,66:Ra,67:gi,68:[0,.69444,0,0,.72223],69:po,70:[0,.69444,0,0,.56945],71:Ra,72:Hs,73:Fi,74:za,75:[0,.69444,0,0,.69445],76:is,77:[0,.69444,0,0,.875],78:Hs,79:[0,.69444,0,0,.73611],80:gi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Oa,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:Ra,89:[0,.69444,.025,0,.66667],90:io,91:gs,93:gs,94:Mi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Jl,99:Zd,100:Jl,101:Zd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Jl,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:Zc,111:[0,.44444,0,0,.5],112:Vd,113:Vd,114:[0,.44444,.01389,0,.34167],115:qu,116:[0,.57143,0,0,.36111],117:Zc,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:br,168:[0,.67937,0,0,.5],176:Ra,184:Xl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Mi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Mi,715:Mi,728:Mi,729:[0,.67937,0,0,.27778],730:Ra,732:[0,.67659,0,0,.5],733:Mi,915:is,916:Yu,920:Ti,923:io,926:Ra,928:Hs,931:Ea,933:Ti,934:Ea,936:Ti,937:Ea,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Fi,8217:Fi,8220:Mi,8221:Mi},"Script-Regular":{32:br,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:br},"Size1-Regular":{32:br,40:jd,41:jd,47:Ju,91:Qu,92:Ju,93:Qu,123:Vc,125:Vc,160:br,710:bu,732:bu,770:bu,771:bu,8214:[-99e-5,.601,0,0,.77778],8593:ec,8595:ec,8657:jc,8659:jc,8719:Ql,8720:Ql,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:xu,8748:Gd,8749:Gd,8750:xu,8896:Zo,8897:Zo,8898:Zo,8899:Zo,8968:Pl,8969:Pl,8970:Pl,8971:Pl,9168:cc,10216:Pl,10217:Pl,10752:Gc,10753:Gc,10754:Gc,10756:Zo,10758:Zo},"Size2-Regular":{32:br,40:Xc,41:Xc,47:vs,91:Za,92:vs,93:Za,123:Es,125:Es,160:br,710:Ps,732:Ps,770:Ps,771:Ps,8719:Js,8720:Js,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:tc,8748:qc,8749:qc,8750:tc,8896:Ol,8897:Ol,8898:Ol,8899:Ol,8968:nc,8969:nc,8970:nc,8971:nc,10216:rc,10217:rc,10752:Rl,10753:Rl,10754:Rl,10756:Ol,10758:Ol},"Size3-Regular":{32:br,40:Yc,41:Yc,47:ic,91:Qs,92:ic,93:Qs,123:wu,125:wu,160:br,710:Su,732:Su,770:Su,771:Su,8730:[.95003,1.45,0,0,1],8968:ac,8969:ac,8970:ac,8971:ac,10216:wu,10217:wu},"Size4-Regular":{32:br,40:Cu,41:Cu,47:oc,91:Jc,92:oc,93:Jc,123:sc,125:sc,160:br,710:Mu,732:Mu,770:Mu,771:Mu,8730:[1.25003,1.75,0,0,1],8968:lc,8969:lc,8970:lc,8971:lc,9115:uc,9116:Eu,9117:uc,9118:uc,9119:Eu,9120:uc,9121:dc,9122:cc,9123:dc,9124:dc,9125:cc,9126:dc,9127:Xd,9128:Qc,9129:Bl,9130:[0,.3,0,0,.88889],9131:Xd,9132:Qc,9133:Bl,9143:[.88502,.915,0,0,1.05556],10216:sc,10217:sc,57344:fc,57345:fc,57680:Nl,57681:Nl,57682:Nl,57683:Nl},"Typewriter-Regular":{32:ku,33:oi,34:oi,35:oi,36:ws,37:ws,38:oi,39:oi,40:ws,41:ws,42:[0,.52083,0,0,.525],43:ed,44:[.13889,.125,0,0,.525],45:ed,46:[0,.125,0,0,.525],47:ws,48:oi,49:oi,50:oi,51:oi,52:oi,53:oi,54:oi,55:oi,56:oi,57:oi,58:as,59:[.13889,.43056,0,0,.525],60:qd,61:[-.19549,.41562,0,0,.525],62:qd,63:oi,64:oi,65:oi,66:oi,67:oi,68:oi,69:oi,70:oi,71:oi,72:oi,73:oi,74:oi,75:oi,76:oi,77:oi,78:oi,79:oi,80:oi,81:[.13889,.61111,0,0,.525],82:oi,83:oi,84:oi,85:oi,86:oi,87:oi,88:oi,89:oi,90:oi,91:ws,92:ws,93:ws,94:oi,95:[.09514,0,0,0,.525],96:oi,97:as,98:oi,99:as,100:oi,101:as,102:oi,103:To,104:oi,105:oi,106:[.22222,.61111,0,0,.525],107:oi,108:oi,109:as,110:as,111:as,112:To,113:To,114:as,115:as,116:[0,.55358,0,0,.525],117:as,118:as,119:as,120:as,121:To,122:as,123:ws,124:ws,125:ws,126:oi,127:oi,160:ku,176:oi,184:[.19445,0,0,0,.525],305:as,567:To,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:oi,715:oi,728:oi,730:oi,770:oi,771:oi,776:oi,915:oi,916:oi,920:oi,923:oi,926:oi,928:oi,931:oi,933:oi,934:oi,936:oi,937:oi,8216:oi,8217:oi,8242:oi,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Fl=10,os=.25,hc=1.2,el=.431,td={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[el,el,el],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:[os,os,os],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]},pc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],dl=5,nd={"\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 tl(a,y){a===void 0&&(a=77);const b=Yd[y][a];if(b)return{defaultMetrics:!1,depth:b[0],height:b[1],italic:b[2],skew:b[3],width:b[4]};if(a===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const E=String.fromCodePoint(a);if(E in nd)a=nd[E].codePointAt(0);else if(Jd.test(E))return a=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var mc={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]},$l={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 eu(a){if($l[a]){const[ge,we,Re]=$l[a],Ve=`<span class="stretchy" style="height:${Re}em"><svg width="100%" height="${Re}em" viewBox="0 0 ${ge} ${we}" 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">${Ve}</span>`}const[y,b,E,ee]=mc[a];let re,ae;const de=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 he=y.map((ge,we)=>`<span class="${re[we]}" style=height:${de}em><svg width=400em height=${de}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[we]} slice"><path fill="currentcolor" d="${Qd[ge]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${de}em;min-width:${b}em;">${he}</span>`}function ef(a){return mc[a]?mc[a][2]/1e3:$l[a][2]}function tf(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=Il(2,16)+re*Il(2,10)+ae,b++}}y.push(E)}return y}var _u=8205,Lu=[[_u,1],[65038,2],[127995,5],[129456,4],[917536,96]],fl,tu=[127462,127487];function nu(a){var y;if(fl===void 0){fl={};for(const b of Lu)for(let E=b[0];E<=b[0]+b[1]-1;E++)fl[E]=!0}return(y=fl[a])!=null?y:!1}function nf(a){return a>=tu[0]&&a<=tu[1]}function rf(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=tf(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===_u){const ae=E-1;for(E+=2;b[E]===_u;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(nu(re)){const ae=E-1;for(;nu(b[E]);)E+=b[E]===_u?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nf(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var af=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rf(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 hl(a,y){var b,E,ee,re;const ae=[];let de=a.next();if(de&&de!=="\\relax"){if(de==="\\noexpand")de=a.next(),de&&ae.push(de);else if(de==="\\obeyspaces")a.obeyspaces=!0;else if(de==="\\bgroup")ae.push("<{>");else if(de==="\\egroup")ae.push("<}>");else if(de==="\\string"){if(de=a.next(),de)if(de.startsWith("\\"))for(const he of de)ae.push(he==="\\"?"\\backslash":he);else de==="<{>"?ae.push("\\{"):de==="<space>"?ae.push("~"):de==="<}>"&&ae.push("\\}")}else if(de==="\\csname"){for(;a.peek()==="<space>";)a.next();let he="",ge=!1,we=[];do{if(we.length===0)if(/^#[\d?@]$/.test(a.peek())){const Re=a.get().slice(1);we=nl((E=(b=y==null?void 0:y(Re))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),de=we[0]}else de=a.next(),we=de?[de]:[];ge=we.length===0,!ge&&de==="\\endcsname"&&(ge=!0,we.shift()),ge||(ge=de==="<$>"||de==="<$$>"||de==="<{>"||de==="<}>"||typeof de=="string"&&de.length>1&&de.startsWith("\\")),ge||(he+=we.shift())}while(!ge);he&&ae.push("\\"+he),ae.push(...we)}else if(de!=="\\endcsname")if(de.length>1&&de.startsWith("#")){const he=de.slice(1);ae.push(...nl((re=(ee=y==null?void 0:y(he))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(de)}return ae}function nl(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const de=ae.match(/((?:\\%)|[^%])*/);de!==null&&b.push(de[0])}const ee=new af(Je(b.join(""))),re=[];do re.push(...hl(ee,y));while(!ee.end());return re}function ya(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 co(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:ya([a,...y.map(b=>`{${b}}`)])}function pl(a){return ya(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var of=class Ud{constructor(y){Ud._registry[y]=this}static createAtom(y,b,E){return Ud._registry[y].createAtom(b,Vt(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 sf(y)){const ae=Ud._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return ya(ee)}return ya(th(y,b))}static getFont(y,b,E){return Ud._registry[y].getFont(b,E)}};of._registry={};var Ss=of;function sf(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 Eo(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 rd(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of sf(a)){const de=y.defaultMode;for(const he of Eo(ae,"color")){const ge=he[0].computedStyle,we=Ss._registry[he[0].mode].serialize(he,pe(xe({},y),{defaultMode:de==="text"?"text":"math"}));!y.skipStyles&&ge.color&&ge.color!=="none"&&(!E||ee!==ge.color)?re.push(co("\\textcolor",(b=ge.verbatimColor)!=null?b:ge.color,ya(we))):re.push(ya(we))}}return re}function eh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return Eo(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 co("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,ya(rd(ee,pe(xe({},y),{defaultMode:"text"}))))}return ya(rd(ee,y))})}function th(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 Eo(a,"fontSize")){const ae=re[0].computedStyle.fontSize,de=eh(re,y);de&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...de):ee.push(...de))}return ee}function id(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 ru(a){if(a.length===0)return"ord";const y=id(a[0].type),b=id(a[a.length-1].type);return y&&y===b?y:"ord"}function iu(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 Er=class Mp{constructor(y,b){var E,ee,re,ae,de;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:ze(y)?this.children=y.filter(ge=>ge!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ge of this.children)ge.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 he=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(he=(de=Ss.getFont((ae=b.mode)!=null?ae:"math",this,pe(xe({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?de:void 0),he||(he="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(b==null?void 0:b.maxFontSize)!==void 0&&(this.maxFontSize=b.maxFontSize),Au(this,he)}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=iu(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=iu(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"]=iu(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"]=iu(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"]=iu(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=yr(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 ft of this.children)re+=ft.toMarkup();let ae="";if(this.svgBody)ae=eu(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 ft=(b=this.cssProperties)==null?void 0:b.padding;ft?(ae+=`top:${ft};`,ae+=`left:${ft};`,ae+=`width:calc(100% - 2 * ${ft} );`):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 de="";const he=this.classes.split(" ");he.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&he.push("ML__latex-caret"),this.isSelected&&he.push("ML__selected");const ge=he.length===1?he[0]:he.filter((ft,St,wn)=>ft.length>0&&wn.indexOf(ft)===St).join(" ");if(ge.length>0&&(de+=` class="${ge}"`),this.id&&(de+=` data-atom-id=${this.id}`),this.cssId&&(de+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(de+=" "+Object.keys(this.attributes).map(ft=>`${ft}="${this.attributes[ft]}"`).join(" ")),this.htmlData){const ft=this.htmlData.split(",");for(const St of ft){const wn=St.match(/([^=]+)=(.+$)/);if(wn){const wr=wn[1].trim().replace(/ /g,"-");wr&&(de+=` data-${wr}="${wn[2]}" `)}else{const wr=St.trim().replace(/ /g,"-");wr&&(de+=` data-${wr} `)}}}const we=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&we.width===void 0&&(we.width=`${Math.ceil(this._width*100)/100}em`);const Re=Object.keys(we).map(ft=>`${ft}:${we[ft]}`);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 ft=this.htmlStyle.split(";");let St="";for(const wn of ft){const wr=wn.match(/([^=]+):(.+$)/);if(wr){const yn=wr[1].trim().replace(/ /g,"-");yn&&(St+=`${yn}:${wr[2]};`)}}St&&(de+=` style="${St}"`)}Re.length>0&&(de+=` style="${Re.join(";")}"`);let Ve="";return de.length>0||ae.length>0?Ve=`<span${de}>${re}${ae}</span>`:Ve=re,this.caret==="text"?Ve+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Ve+='<span class="ML__caret"></span>'),Ve}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 he of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&he in y.cssProperties||this.cssProperties&&he 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 he of Object.keys(this.cssProperties))if(this.cssProperties[he]!==y.cssProperties[he])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),de=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==de.length)return!1;ae.sort(),de.sort();for(const[he,ge]of ae.entries())if(ge==="vertical-separator"||ge!==de[he])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 ad(a){if(!a||a.length===0)return[];a[0].children=ad(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=ad(a[b].children),y.push(a[b]));return y}function gc(a){return a.children&&(a.children=ad(a.children)),a}function vc(a,y){if(!a)return new Er(null,y);const b=new Er(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 Er(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 Er(E,pe(xe({},y),{type:"lift"}))}function Os(a){const y=ef(a)/2,b=new Er(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function Au(a,y){var b;if(a.type==="latex"){a.height=.9,a.depth=.2,a._width=1;return}if(a.value){a.height=-1/0,a.depth=-1/0,a._width=0,a.skew=-1/0,a.italic=-1/0;for(let E=0;E<a.value.length;E++){const ee=tl(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,de)=>ae+de.width,0),a.maxFontSize=re}}function yc(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 de=y[ae],he=-de.shift-re-de.box.depth,ge=he-(b.box.height+b.box.depth);re=re+he,E.push(ge),E.push(de),b=de}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 Tu(a){var y;const[b,E]=yc(a);if(!b)return[[],0,0];const ee=new Er(null,{classes:"pstrut"});let re=0;for(const St of b)if(typeof St!="number"){const wn=St.box;re=Math.max(re,wn.maxFontSize,wn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let de=E,he=E,ge=E,we=0;for(const St of b){if(typeof St=="number")ge+=St;else{const wn=St.box,wr=(y=St.classes)!=null?y:[],yn=new Er([ee,wn],{classes:wr.join(" "),style:St.style});wn.setStyle("height",wn.height+wn.depth,"em"),wn.setStyle("display","inline-block"),yn.setStyle("top",-re-ge-wn.depth,"em"),St.marginLeft&&yn.setStyle("margin-left",St.marginLeft,"em"),St.marginRight&&yn.setStyle("margin-right",St.marginRight,"em"),ae.push(yn),ge+=wn.height+wn.depth,we=Math.max(we,yn.width)}de=Math.min(de,ge),he=Math.max(he,ge)}ae.forEach(St=>{St.softWidth=we});const Re=new Er(ae,{classes:"vlist"});if(Re.softWidth=we,Re.height=he,Re.setStyle("height",he,"em"),de>=0)return[[new Er(Re,{classes:"vlist-r"})],he,-de];const Ve=new Er(new Er(null),{classes:"vlist"});Ve.height=-de,Ve.setStyle("height",-de,"em");const ft=new Er(8203,{classes:"vlist-s",maxFontSize:0});return ft.softWidth=0,ft.height=0,ft.depth=0,[[new Er([Re,ft],{classes:"vlist-r"}),new Er(Ve,{classes:"vlist-r"})],he,-de]}var Qa=class extends Er{constructor(a,y){var b;const[E,ee,re]=Tu(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,de)=>Math.max(ae,de.width),0)}};function nh(a,y){var b,E,ee,re,ae;const de=a.metrics,he=new Er(y.base),ge=(b=y.baseShift)!=null?b:0,we=(E=y.slant)!=null?E:0;let Re=0,Ve=0;y.above&&(Re=(ee=y.aboveShift)!=null?ee:Math.max(de.bigOpSpacing1,de.bigOpSpacing3-y.above.depth)),y.below&&(Ve=(re=y.belowShift)!=null?re:Math.max(de.bigOpSpacing2,de.bigOpSpacing4-y.below.height));let ft=null;if(y.below&&y.above){const St=de.bigOpSpacing5+y.below.height+y.below.depth+Ve+he.depth+ge;ft=new Qa({bottom:St,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Ve,{box:he,classes:["ML__center"]},Re,{box:y.above,marginLeft:we,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)ft=new Qa({top:he.height-ge,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Ve,{box:he,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const St=he.depth+ge;ft=new Qa({bottom:St,children:[{box:he,classes:["ML__center"]},Re,{box:y.above,marginLeft:we,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else{const St=he.depth+ge;ft=new Qa({bottom:St,children:[{box:he},de.bigOpSpacing5]}).wrap(a)}return new Er(ft,{type:(ae=y.type)!=null?ae:"op"})}var od=7,rl=6,Du=5,ml=4,zl=3,ss=2,ks=1,Vo=0,Ws=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(td).reduce((ee,re)=>pe(xe({},ee),{[re]:td[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Us[[Vo,ks,Vo,ks,ss,zl,ss,zl][this.id]]}get sub(){return Us[[Vo,Vo,Vo,Vo,ss,ss,ss,ss][this.id]]}get fracNum(){return Us[[Vo,ks,Vo,ks,ss,zl,ml,Du][this.id]]}get fracDen(){return Us[[Vo,Vo,Vo,Vo,ss,ss,ml,ml][this.id]]}get cramp(){return Us[[Vo,Vo,ss,ss,ml,ml,rl,rl][this.id]]}get isTight(){return this.sizeDelta<0}},Kl={7:new Ws(od,0,!1),6:new Ws(rl,0,!0),5:new Ws(Du,0,!1),4:new Ws(ml,0,!0),3:new Ws(zl,-3,!1),2:new Ws(ss,-3,!0),1:new Ws(ks,-4,!1),0:new Ws(Vo,-4,!0)},Us=pe(xe({},Kl),{displaystyle:Kl[od],textstyle:Kl[Du],scriptstyle:Kl[zl],scriptscriptstyle:Kl[ks]});function au(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:Fl,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=Il(10,y);return Math.round(a.dimension/Fl*E*ee)/ee}return a.dimension*E}function sd(a,y){if(a===null)return 0;const b=au(a)/Fl;if(Number.isFinite(y)){const E=Il(10,y);return Math.round(b*E)/E}return b}function ld(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function lf(a){let y=ld(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${ld(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${ld(a.shrink)}`),y}function Do(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=lf(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 Zs(a,y){return a==null?null:"number"in a?pe(xe({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?pe(xe({},a),{factor:a.factor*y}):pe(xe({},a),{factor:y}):"dimension"in a?pe(xe({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Zs(a.glue,y),shrink:Zs(a.shrink,y),grow:Zs(a.grow,y)}:a.shrink?{glue:Zs(a.glue,y),shrink:Zs(a.shrink,y)}:a.grow?{glue:Zs(a.glue,y),grow:Zs(a.grow,y)}:{glue:Zs(a.glue,y)}:null}var rh={"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 ou(){return xe({},rh)}function bc(){return{registers:ou(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:nt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Lt,backgroundColorMap:Ge,getMacro:a=>Vn(a,ei())}}var La=class Ep{constructor(y,b){var E,ee,re,ae,de,he,ge,we,Re,Ve,ft,St,wn,wr,yn;let er;y!=null&&y.parent?(this.parent=y.parent,er=y.parent,this.registers={}):(er=xe(xe({},bc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=er.registers),er.atomIdsSettings&&(this.atomIdsSettings=xe({},er.atomIdsSettings)),this.renderPlaceholder=er.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=er.letterShapeStyle,this.minFontScale=er.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(he=(de=this.parent)==null?void 0:de.color)!=null?he:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(we=(ge=this.parent)==null?void 0:ge.backgroundColor)!=null?we:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Re=this.parent)==null?void 0:Re.size)?this.size=b.fontSize:this.size=(ft=(Ve=this.parent)==null?void 0:Ve.size)!=null?ft:dl;let kr=(wn=(St=this.parent)==null?void 0:St.mathstyle)!=null?wn:Us.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(er instanceof Ep)switch(y.mathstyle){case"cramp":kr=kr.cramp;break;case"superscript":kr=kr.sup;break;case"subscript":kr=kr.sub;break;case"numerator":kr=kr.fracNum;break;case"denominator":kr=kr.fracDen;break}switch(y.mathstyle){case"textstyle":kr=Us.textstyle;break;case"displaystyle":kr=Us.displaystyle;break;case"scriptstyle":kr=Us.scriptstyle;break;case"scriptscriptstyle":kr=Us.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=kr,this.smartFence=er.smartFence,this.placeholderSymbol=er.placeholderSymbol,this.colorMap=(wr=er.colorMap)!=null?wr:lr=>lr,this.backgroundColorMap=(yn=er.backgroundColorMap)!=null?yn:lr=>lr,this.getMacro=er.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===od||this.mathstyle.id===rl}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(pc[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 sd(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?pe(xe({},re),{dimension:E*re.dimension}):"glue"in re?pe(xe({},re),{glue:pe(xe({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?pe(xe({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?pe(xe({},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:au(E,b)/Fl}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}},su=["body","above","below","superscript","subscript"];function il(a){return typeof a=="string"&&su.includes(a)}function Iu(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Un=class jl{constructor(y){var b,E,ee,re,ae,de;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=xe({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(de=y.skipBoundary)!=null?de:!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=uf(b),ae=[];for(const he of re){const ge=he[0].style,we=cf(y,he,{style:{color:ge.color,backgroundColor:ge.backgroundColor,fontSize:ge.fontSize}});we&&ae.push(we)}if(ae.length===0)return null;const de=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!de&&!(E!=null&&E.type)?ae[0].wrap(y):new Er(ae,{classes:de,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Ss.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 jl({type:"mord",value:y,mode:"math"}):new jl(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=xe({},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=cd(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=Vt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?ya([co(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Ss.serialize(this.body,pe(xe({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Ss.serialize(this.above,y)}belowToLatex(y){return Ss.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=pe(xe({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Ss.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=Ss.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(il(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of su)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(il(y)),il(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 Iu(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Iu(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=xe(xe({},(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=xe(xe({},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(il(b)),!il(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 jl({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(il(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 su)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=Vt(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new La({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 de=null,he=null;const ge=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let we=0;if(re){const wn=new La({parent:y,mathstyle:"superscript"});de=jl.createBox(wn,re),ge||(we=ee.height-y.metrics.supDrop*wn.scalingFactor)}let Re=0;if(ae){const wn=new La({parent:y,mathstyle:"subscript"});he=jl.createBox(wn,ae),ge||(Re=ee.depth+y.metrics.subDrop*wn.scalingFactor)}let Ve;y.isDisplayStyle?Ve=y.metrics.sup1:y.isCramped?Ve=y.metrics.sup3:Ve=y.metrics.sup2;const ft=.5/Fl/y.scalingFactor;let St=null;if(he&&de){we=Math.max(we,Ve,de.depth+.25*y.metrics.xHeight),Re=Math.max(Re,y.metrics.sub2);const wn=y.metrics.defaultRuleThickness;if(we-de.depth-(he.height-Re)<4*wn){Re=4*wn-(we-de.depth)+he.height;const yn=.8*y.metrics.xHeight-(we-de.depth);yn>0&&(we+=yn,Re-=yn)}const wr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;St=new Qa({individualShift:[{box:he,shift:Re,marginLeft:wr},{box:de,shift:-we}]}).wrap(y)}else he&&!de?(Re=Math.max(Re,y.metrics.sub1,he.height-.8*el),St=new Qa({shift:Re,children:[{box:he,marginRight:ft,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!he&&de&&(we=Math.max(we,Ve,de.depth+.25*el),St=new Qa({shift:-we,children:[{box:de,marginRight:ft}]}));return new Er([ee,new Er(St,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?jl.createBox(new La({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?jl.createBox(new La({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):nh(y,pe(xe({},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 de=(E=this.value)!=null?E:this.body,he=(ee=b==null?void 0:b.boxType)!=null?ee:id(this.type);let ge=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ge+=" ML__text");const we=typeof de=="string"||de===void 0?new Er(de!=null?de:null,{type:he,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:pe(xe({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ge}):(ae=jl.createBox(y,de,{type:he,classes:ge}))!=null?ae:new Er(null);return y.isTight&&(we.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(we.italic=0),we.right=we.italic,this.bind(y,we),this.caret&&!this.superscript&&!this.subscript&&(we.caret=this.caret),we}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 uf(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 cf(a,y,b){var E,ee,re,ae,de;if(!y||y.length===0)return null;const he=new La({parent:a},b.style),ge=!((E=he.atomIdsSettings)!=null&&E.groupNumbers);let we=[];if(y.length===1){const Ve=y[0],ft=Ve.render(he);ft&&(ge&&Ve.isSelected&&ft.selected(!0),we=[ft])}else{let Ve="",ft=!0;for(const St of y){(ee=he.atomIdsSettings)!=null&&ee.groupNumbers&&Ve&&(ft&&St.isDigit()||!ft&&ud(St))&&(he.atomIdsSettings.overrideID=Ve);const wn=St.render(he);he.atomIdsSettings&&(he.atomIdsSettings.overrideID=void 0),wn&&((re=he.atomIdsSettings)!=null&&re.groupNumbers&&((St.isDigit()||ud(St))&&(!Ve||ft!==St.isDigit())&&(ft=St.isDigit(),Ve=(ae=St.id)!=null?ae:""),Ve&&(!(St.isDigit()||ud(St))||!St.hasEmptyBranch("superscript")||!St.hasEmptyBranch("subscript"))&&(Ve="")),ge&&St.isSelected&&wn.selected(!0),we.push(wn))}}if(we.length===0)return null;const Re=new Er(we,pe(xe({isTight:he.isTight},b),{type:(de=b.type)!=null?de:"lift"}));return Re.isSelected=we.every(Ve=>Ve.isSelected),Re.wrap(he)}function ud(a){return a.mode==="text"}function cd(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Un?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var al=class kp extends Un{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new kp(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:rr("text",this.value.codePointAt(0))}};function Pu(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&ih(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function ih(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function jo(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 gl(a){return typeof a=="number"&&!Number.isNaN(a)}function xc(a){return Array.isArray(a)&&a.length===2}function wc(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function ah(a,y){const b=a.at(y);let E;if(b){E=b.mode;let ee=b.parent;for(;!E&ⅇ)ee&&(E=ee.mode),ee=ee.parent}return E}function df(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,de=!1,he=!1,ge=!1,we=!1,Re=!1,Ve=!1,ft=!1,St=!1,wn=!1,wr=!1,yn=a[0],er=0;for(;yn!=null&&yn.type&&/^(subsup|placeholder)$/.test(yn.type);)er+=1,yn=a[er];return b=!yn||yn.type==="first",yn&&(wn=yn.mode==="text",E=!wn&&yn.type==="mord"&&ye.test(yn.value),ee=!wn&&yn.type==="mord"&&/\d+$/.test(yn.value),re=!wn&&yn.isFunction,ae=yn.type==="genfrac",de=yn.type==="surd",he=yn.type==="mbin",ge=yn.type==="mrel",we=yn.type==="mop"||yn.type==="operator"||yn.type==="extensible-symbol",Re=yn.type==="mpunct"||yn.type==="minner",Ve=yn.type==="array",ft=yn.type==="mopen",St=yn.type==="mclose"||yn.type==="leftright",wr=yn.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")&&de||y.after.includes("binop")&&he||y.after.includes("relop")&&ge||y.after.includes("operator")&&we||y.after.includes("punct")&&Re||y.after.includes("array")&&Ve||y.after.includes("openfence")&&ft||y.after.includes("closefence")&&St||y.after.includes("text")&&wn||y.after.includes("space")&&wr?y.value:""}function dd(a,y,b){return b?df(a,b[y]):""}var ff={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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 Ou(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=pf(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",ts(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function ts(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const de=(b=y.inlineShortcuts)!=null?b:ff;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=vl(ae[1],{inlineShortcuts:de,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=ts(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re)if(ae=vl(a,{inlineShortcuts:de,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const he=vl(ae.rest.slice(1),{inlineShortcuts:de,noWrap:!0});he.match&&(a="\\frac{"+ae.match+"}{"+he.match+"}"+ts(he.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+ts(ae.rest,y):ae.match+ts(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+ts(ae[2],y),re=!0)),a}function vl(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,de=1;for(;de<a.length&&ae>0;)a[de]===ee&&ae++,a[de]===re&&ae--,de++;ae===0?(y.noWrap&&ee==="("?b=ts(a.substring(1,de-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+ts(a.substring(1,de-1),y)+"\\right"+re),E=a.slice(Math.max(0,de))):(b=a.substring(1,de),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let de=dd(null,a,y.inlineShortcuts);if(de)return de=de.replace("_{#?}",""),de=de.replace("^{#?}",""),{match:de,rest:a.slice(de.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 hf(a,y){let b=dd(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var fd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function yl(a){const y=a.trim();for(const b of fd)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 pf(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=yl(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 Sc="$$",oh="$$",sh=(a,y,b)=>(fd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${Sc} ${y} ${oh}`),y),mf=class Qf{constructor(y){Qf._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)?Qf._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]:jo(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]:jo(ee.selection);let ae=ee.getAtoms(re);if(ae.every(de=>de.mode==="text"||!de.mode))b.clipboardData.setData("text/plain",ae.filter(de=>de instanceof al).map(de=>de.value).join(""));else if(ae.every(de=>de.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(de=>{var he;return(he=de.value)!=null?he:""}).join(""));else{let de;ae.length===1&&ae[0].verbatimLatex!==void 0?de=ae[0].verbatimLatex:de=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",de);try{b.clipboardData.setData("text/plain",y.options.onExport(y,de,re))}catch(he){}if(ae.length===1){const he=ae[0];(he.type==="root"||he.type==="group")&&(ae=he.body.filter(ge=>ge.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(he=>he.toJson())))}catch(he){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const he=window.MathfieldElement.computeEngine;if(he)try{const ge=he.jsonSerializationOptions;he.jsonSerializationOptions={metadata:["latex"]};const we=he.parse(ee.getValue(re,"latex-unstyled"));he.jsonSerializationOptions=ge;const Re=JSON.stringify(we.json);Re&&b.clipboardData.setData("application/json",Re)}catch(ge){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return Qf._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};mf._modes={};var ra=mf,lh=[{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","^"]}],hd={"\\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 Rs(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function Bs(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 bl(a){const y=Bs(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function pd(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 md(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),de=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:de,bottom:de+re}}function gd(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=gd(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 lu(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?gd(re):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function gf(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 he=Math.floor(re.getBoundingClientRect().width)/ae;he=isNaN(he)?1:he;const ge=md(a,lu(a,ee),he);if(ge){const we=pd(ee);if(E.has(we)){const Re=E.get(we);E.set(we,{left:Math.min(Re.left,ge.left),right:Math.max(Re.right,ge.right),top:Math.min(Re.top,ge.top),bottom:Math.max(Re.bottom,ge.bottom)})}else E.set(we,ge)}}return[...E.values()]}function vd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...gf(a,E,y)),[])}function yd(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function Cc(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 vf=`@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;
|
|
|
}
|
|
|
`,qa=`.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);
|
|
|
}
|
|
|
`,yf=`#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);
|
|
|
}
|
|
|
`,uh=`/* 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;
|
|
|
}
|
|
|
`,uu=`/* 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);*/
|
|
|
}
|
|
|
`,ch=`.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));
|
|
|
}
|
|
|
`,Mc=`: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;
|
|
|
}
|
|
|
`,dh=`.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;
|
|
|
}
|
|
|
`,eo;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=qa;break;case"mathfield":y=vf;break;case"environment-popover":y=yf;break;case"suggestion-popover":y=uh;break;case"keystroke-caption":y=uu;break;case"virtual-keyboard":y=ch;break;case"ui":y=Mc;break;case"menu":y=dh;break;default:debugger}return y}function cu(a){return eo||(eo={}),eo[a]||(eo[a]=new CSSStyleSheet,eo[a].replaceSync(Hl(a))),eo[a]}var ol;function _s(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(ol||(ol={}),((y=ol[a])!=null?y:0)!==0)ol[a]+=1;else{const b=cu(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ol[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ol!=null&&ol[a]&&(ol[a]-=1,ol[a]<=0)){const y=eo[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class _p extends Un{constructor(y){var b;super(pe(xe({},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 _p(y)}toJson(){return pe(xe({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body))!=null?b:new Er("\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,el),de;if(this.svgAccent)de=Os(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ge=new Er(this.accent,{fontFamily:"Main-Regular"});ge.italic=0;const we=this.accent===8407?" ML__accent-vec":"";de=new Er(new Er(ge),{classes:"ML__accent-body"+we})}de=new Qa({shift:0,children:[{box:new Er(ee)},-ae,{box:de,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const he=new Er(de,{type:"lift"});return this.caret&&(he.caret=this.caret),this.bind(E,he.wrap(E)),this.attachSupsub(E,{base:he})}},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 ue(a,y,b,E){var ee;const ae=new Er(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)*os),ae}function me(a,y,b,E,ee){var re,ae;const de=new La({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),he=new Er(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(de);return b&&he.setTop((1-de.scalingFactor)*os),he}function Ce(a,y,b,E,ee){var re;let ae,de,he,ge;ae=he=ge=ie(a),de=null;let we="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?he=ae=ge=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?he=ae=ge=8741:a==="\\uparrow"?he=ge=9168:a==="\\Uparrow"?he=ge=8214:a==="\\downarrow"?ae=he=9168:a==="\\Downarrow"?ae=he=8214:a==="\\updownarrow"?(ae=8593,he=9168,ge=8595):a==="\\Updownarrow"?(ae=8657,he=8214,ge=8659):a==="["||a==="\\lbrack"?(ae=9121,he=9122,ge=9123,we="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,he=9125,ge=9126,we="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(he=ae=9122,ge=9123,we="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,he=ge=9122,we="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(he=ae=9125,ge=9126,we="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,he=ge=9125,we="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,he=9116,ge=9117,we="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,he=9119,ge=9120,we="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,de=9128,ge=9129,he=9130,we="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,de=9132,ge=9133,he=9130,we="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ge=9129,he=9130,we="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ge=9133,he=9130,we="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ge=9133,he=9130,we="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ge=9129,he=9130,we="Size4-Regular"):a==="\\surd"?(ae=57345,ge=9143,he=57344,we="Size4-Regular"):a==="\\ulcorner"?(ae=9484,he=ge=32):a==="\\urcorner"?(ae=9488,he=ge=32):a==="\\llcorner"?(ge=9492,he=ae=32):a==="\\lrcorner"&&(ae=9496,he=ae=32);const Re=tl(ae,we),Ve=Re.height+Re.depth,ft=tl(he,we),St=ft.height+ft.depth,wn=tl(ge,we),wr=wn.height+wn.depth;let yn=0,er=1;if(de!==null){const Yo=tl(de,we);yn=Yo.height+Yo.depth,er=2}const kr=Ve+wr+yn,lr=Math.max(0,Math.ceil((y-kr)/(er*St))),si=kr+lr*er*St;let Ii=os;b&&(Ii=Ii*E.scalingFactor);const vi=si/2-Ii,Pa=.008,Ya=[];Ya.push({box:new Er(ge,{fontFamily:we})}),Ya.push(-Pa);const Or=new Er(he,{fontFamily:we});if(de===null)for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Or});else{for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Or});Ya.push(-Pa),Ya.push({box:new Er(de,{fontFamily:we})}),Ya.push(-Pa);for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Or})}Ya.push(-Pa),Ya.push({box:new Er(ae,{fontFamily:we})});let $s="";we==="Size1-Regular"?$s=" delim-size1":we==="Size4-Regular"&&($s=" delim-size4");const _l=new Qa({bottom:vi,children:Ya},{classes:$s});return new Er(_l,pe(xe({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var Ae=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"]),ct=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Mt=[0,1.2,1.8,2.4,3];function ln(a,y,b,E){return a===void 0||a==="."?ri(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),Ae.has(a)||ct.has(a)?me(a,y,!1,b,E):Oe.has(a)?Ce(a,Mt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var qt=[{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}],Xn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],dr=[{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 Ar(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Hr(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=tl(a,Ar(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let de=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?de*=Math.max(pc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(de*=Math.max(pc[Math.max(1,E.size-1)],E.minFontScale))),de>y)return b[re]}return b[b.length-1]}function ni(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return ri(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;ct.has(y)?ae=qt:Ae.has(y)?ae=dr:ae=Xn;const de=Hr(ie(y),b,ae,ee),he=new La({parent:ee,mathstyle:de.mathstyle},re==null?void 0:re.style);return de.type==="small"?ue(y,he,E,pe(xe({},re),{type:a})):de.type==="large"?me(y,de.size,E,he,pe(xe({},re),{type:a})):(console.assert(de.type==="stack"),Ce(y,b,E,he,pe(xe({},re),{type:a})))}function zr(a,y,b,E,ee,re){if(y===".")return ri(ee,re==null?void 0:re.classes);const ae=os*ee.scalingFactor,de=901,he=5/Fl,ge=Math.max(b-ae,E+ae),we=Math.max(ge/500*de,2*ge-he);return ni(a,y,we,!0,ee,re)}function ri(a,y){const b=new Er(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new La({parent:a,mathstyle:"textstyle"}))}var $i=class Lp extends Un{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{}"}},Hi=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ba=["cases","dcases","rcases"],to=["align","align*","aligned","gather","gathered","split"],Wo=["array","subequations","eqnarray"];function bo(a){return Wo.concat(to).concat(ba).concat(Hi).includes(a)}function cs(a){return Hi.includes(a)}function ds(a){return ba.includes(a)}function Io(a){return to.includes(a)}function fs(a,y,b){let E=0;for(const ge of b)"align"in ge&&(E+=1);let ee=0;const re=[];for(const ge of y){let we=0;for(ee=Math.max(ee,Math.min(ge.length,E));we<ge.length;){const Re=[],Ve=Math.min(ge.length,we+E);for(;we<Ve;){const ft=ge[we];ft.length===0?Re.push([new Un({type:"first",mode:a.mode})]):ft[0].type!=="first"?Re.push([new Un({type:"first",mode:a.mode}),...ft]):(console.assert(!ft.slice(1).some(St=>St.type==="first")),Re.push(ft)),we+=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 ge of re){if(ge.length!==ee)for(let we=ge.length;we<ee;we++)ge.push([new Un({type:"first",mode:a.mode}),new $i]);ae.push(ge)}let de=0,he=0;for(const ge of ae){he=0;for(const we of ge){for(const Re of we)Re.parent=a,Re.parentBranch=[de,he];he+=1}de+=1}return a.isDirty=!0,ae}var oa=class Ap extends Un{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=fs(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 Ap(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=pe(xe({},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(Iu(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return Iu(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(il(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,de;const he=new La({parent:y,mathstyle:this.mathstyleName},this.style),ge=he.getRegisterAsEm("arrayrulewidth"),we=he.getRegisterAsEm("arraycolsep"),Re=he.getRegisterAsEm("doublerulesep"),Ve=(E=(b=this.arraystretch)!=null?b:he.getRegisterAsNumber("arraystretch"))!=null?E:1;let ft=typeof this.arraycolsep=="number"?this.arraycolsep:we;this.colSeparationType==="small"&&(ft=.2778*(new La({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const St=Ve*hc,wn=.7*St,wr=.3*St;let yn=0;const er=[];let kr=0;const lr=this.array.length;for(let ro=0;ro<lr;++ro){const Lo=this.array[ro];kr=Math.max(kr,Lo.length);const Jo=new La({parent:he,mathstyle:this.mathstyleName},this.style);let Ll=wn/Jo.scalingFactor,Al=wr/Jo.scalingFactor;const Tl={cells:[],height:0,depth:0,pos:0};for(const ul of Lo){const e0=(ee=Un.createBox(Jo,ul,{type:"ignore"}))!=null?ee:new Er(null,{type:"ignore"});Al=Math.max(Al,e0.depth),Ll=Math.max(Ll,e0.height),Tl.cells.push(e0)}let Dl=(re=sd(this.rowGaps[ro]))!=null?re:0;Dl>0&&(Dl+=wr,Al=Math.max(Al,Dl),Dl=0),ro<lr-1&&!cs(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Al+=he.getRegisterAsEm("jot")),Tl.height=Ll,Tl.depth=Al,yn+=Ll,Tl.pos=yn,yn+=Al+Dl,er.push(Tl)}const si=yn/2+os,Ii=[];for(let ro=0;ro<kr;ro++){const Lo=[];for(const Jo of er){const Ll=Jo.cells[ro];Ll.depth=Jo.depth,Ll.height=Jo.height,Lo.push({box:Ll,shift:Jo.pos-si})}Lo.length>0&&Ii.push(new Qa({individualShift:Lo}))}const vi=[];let Pa=!1,Ya=!1,Or=0,$s=!this.leftDelim;const{colFormat:_l}=this;for(const ro of _l){if("align"in ro&&Or>=Ii.length)break;if("align"in ro)Pa?vi.push(xo(2*ft)):(Ya||$s)&&vi.push(xo(ft)),vi.push(new Er(Ii[Or],{classes:"col-align-"+ro.align})),Or++,Pa=!0,Ya=!1,$s=!1;else if("gap"in ro){if(typeof ro.gap=="number")vi.push(xo(ro.gap));else{const Lo=Co(y,er,si,ro.gap);Lo&&vi.push(Lo)}Pa=!1,Ya=!1,$s=!1}else if("separator"in ro){const Lo=new Er(null,{classes:"vertical-separator"});Lo.height=yn,Lo.setStyle("height",yn,"em"),Lo.setStyle("border-right",`${ge}em ${ro.separator} currentColor`),Lo.setStyle("vertical-align",-(yn-si),"em");let Jo=0;Ya?Jo=Re-ge:Pa&&(Jo=ft-ge),Lo.left=Jo,vi.push(Lo),Pa=!1,Ya=!0,$s=!1}}Pa&&!this.rightDelim&&vi.push(xo(ft));const Xs=new Er(vi,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Xs.caret=this.caret),this.bind(y,Xs);const Yo=Xs.height,zs=Xs.depth,Ms=this.bind(y,new Er([this.bind(y,zr("open",(ae=this.leftDelim)!=null?ae:".",Yo,zs,he,{isSelected:this.isSelected})),Xs,this.bind(y,zr("close",(de=this.rightDelim)!=null?de:".",Yo,zs,he,{isSelected:this.isSelected}))],{type:"ord"}));return Ms?(Ms.setStyle("display","inline-block"),this.caret&&(Ms.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:Ms}))):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(Un.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}}`),ya(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 Un({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(So(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(So(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,So(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,So(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 So(a){const y=new Un({type:"first",mode:a.mode});y.parent=a;const b=new $i;return b.parent=a,[y,b]}function xo(a){const y=new Er(null,{classes:"arraycolsep"});return y.width=a,y}function Co(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=Un.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Qa({individualShift:ee}).wrap(a)}var ko=class Tp extends Un{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 Tp(y)}toJson(){return pe(xe({},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=Un.createBox(y,this.body,{type:"lift"});if(!ae)return null;const de=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=de,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 he=new La({parent:y},this.style),ge=he.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),we=new Er(null,{classes:"ML__box"});we.height=ae.height+ge,we.depth=ae.depth+ge,we.setStyle("box-sizing","border-box"),we.setStyle("position","absolute"),we.setStyle("top",-ge+.3,"em"),we.setStyle("left",0),we.setStyle("height",we.height+we.depth,"em"),we.setStyle("width","100%"),this.backgroundcolor&&we.setStyle("background-color",(ee=he.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&we.setStyle("border",`${he.getRegisterAsEm("fboxrule",2)}em solid ${(re=he.toColor(this.framecolor))!=null?re:"black"}`),this.border&&we.setStyle("border",this.border);const Re=new Er([we,ae],{type:"lift"});return Re.setStyle("display","inline-block"),Re.setStyle("position","relative"),Re.setStyle("line-height",0),Re.height=ae.height+ge+(de>0?de:0),Re.depth=ae.depth+ge+(de<0?-de:0),Re.setStyle("padding-left",ge,"em"),Re.setStyle("padding-right",ge,"em"),Re.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ge+Math.abs(de)))/100,"em"),Re.setStyle("margin-top",-ge,"em"),Re.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ge-de))/100,"em"),Re.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ge))/100,"em"),this.caret&&(Re.caret=this.caret),this.attachSupsub(y,{base:Re})}_serialize(y){return y.skipStyles?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},Wl=class Dp extends Un{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 Dp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new Er(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},ys=class Ip extends Un{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}},Go=class Pp extends Un{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=Un.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=Vt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Wa=class Op extends Un{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 Op((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"?ya(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?ya(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):ya([!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 La({parent:y},this.style);console.assert(this.body!==void 0);const re=new La({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Un.createBox(ee,this.body,{type:"inner"}))!=null?b:new Er(null,{type:"inner"}),de=ae.height/re.scalingFactor,he=ae.depth/re.scalingFactor,ge=[];if(this.leftDelim&&ge.push(this.bind(re,zr("open",this.leftDelim,de,he,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(No(ae.children,this,ee,de,he),ge.push(ae)),this.rightDelim){let ft=this.containsCaret?" ML__contains-caret":"",St=this.rightDelim;St==="?"&&(ee.smartFence?(St=this.matchingRightDelim(),ft+=" ML__smart-fence__close"):St="."),ge.push(this.bind(re,zr("close",St,de,he,re,{isSelected:this.isSelected,classes:ft+" ML__close",mode:this.mode,style:this.style})))}let we=this.variant==="mleft...mright";const Re=this.leftSibling;Re&&(!we&&Re.isFunction&&(we=!0),!we&&Re.type==="subsup"&&((E=Re.leftSibling)!=null&&E.isFunction)&&(we=!0));const Ve=new Er(ge,{type:we?"close":"inner",classes:"left-right"});return Ve.setStyle("margin-top",`${-ae.depth}em`),Ve.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Ve.caret=this.caret),this.bind(ee,Ve.wrap(ee))}};function No(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,zr("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&&No(ae.children,y,b,E,ee)}}var Ec=class Rp extends Un{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 Rp(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=Un.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},sl=class Bp extends Un{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Bp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},xl=class Np extends Un{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 Np(y.placeholderId,y.correctness,y.locked,y.body,y)}toJson(){const y=super.toJson();return this.placeholderId&&(y.placeholderId=this.placeholderId),this.body||delete y.body,this.body&&(y.body=this.body.filter(b=>b.type!=="first").map(b=>b.toJson())),this.correctness&&(y.correctness=this.correctness),y.locked=this.locked,y}render(y){const b=new La({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Un.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 de=new Er(ae,{type:"ord"});de.setStyle("display","inline-block"),de.setStyle("height",ae.height+ae.depth,"em"),de.setStyle("vertical-align",-re,"em");let he="ML__prompt ";this.locked?he+=" ML__lockedPromptBox ":he+=" ML__editablePromptBox ",this.correctness==="correct"?he+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(he+=" ML__incorrectPromptBox "),this.containsCaret&&(he+=" ML__focusedPromptBox ");const ge=new Er(null,{classes:he,attributes:{part:"prompt"}});ge.height=de.height+re,ge.depth=de.depth+re,ge.width=de.width+2*ee,ge.setStyle("box-sizing","border-box"),ge.setStyle("position","absolute"),ge.setStyle("height",de.height+de.depth+2*re,"em"),ee===0&&ge.setStyle("width","100%"),ee!==0&&(ge.setStyle("width",`calc(100% + ${2*ee}em)`),ge.setStyle("top",E,"em"),ge.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ge.width=3*ee,ge.setStyle("width",`calc(100% + ${3*ee}em)`),ge.setStyle("left",-1.5*ee,"em"));let we="";this.correctness==="incorrect"&&(we+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),we&&(ge.svgOverlay=we);const Re=new Er([ge,de],{classes:"ML__prompt-atom"});return Re.setStyle("position","relative"),Re.setStyle("display","inline-block"),Re.setStyle("line-height",0),Re.height=de.height+re+.2,Re.depth=de.depth+re,Re.left=ee,Re.right=ee,Re.setStyle("height",de.height+re,"em"),Re.setStyle("top",de.depth-de.height,"em"),Re.setStyle("vertical-align",de.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]"),co(ee,E)}},Vs=class Fp extends Un{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Fp(y);for(const E of su)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new La({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new Er(null),ae=new Er(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 Po(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var Ul=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 La&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new La({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:xe({},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(xe({before:pl(this.tokens.slice(this.index,this.index+10)),after:pl(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 xe({},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 Vs({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=Vt(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?Xo(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new $i({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();Po(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(Po(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 de="";for(;this.hasPattern(ae);)de+=this.get();if(!a&&(this.match(".")||this.match(",")))for(de+=".";this.hasPattern(ae);)de+=this.get();const he=a?Number.parseInt(de,re):Number.parseFloat(de);return Number.isNaN(he)?null:{number:E?-he:he,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()||!Po(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=Yt(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const de of y.params)if(de.isOptional)b.push(this.scanOptionalArgument(de.type));else{const he=this.scanArgument(de.type);he||this.onError({code:"missing-argument",arg:a}),b.push(he)}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 de=null;this.skipWhitespace(),this.match("[")&&(de=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(de!=null?de:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(de=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(de)));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=Vt(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 Go(y,this.parseMode,this.style);return b.verbatimLatex=pl(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 Wa("",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(!Po(a)&&!a.startsWith("\\"))return null;this.next();const y=Vt(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 ys("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ys("\\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 ys(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 Wa(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 Un({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Un({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(st(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(Po(a)){const b=Ss.createAtom(this.parseMode,a,xe({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Vt(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new ys(a)];if(b.definitionType==="symbol"){const E=xe({},this.style);b.variant&&(E.variant=b.variant),y=new Un({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 ys(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 de=this.scanOptionalArgument("string"),he=this.scanOptionalArgument("math"),ge=Un.serialize(he,{defaultMode:"math"});let we=[],Re;!Re&&ge==="correct"?Re="correct":!Re&&ge==="incorrect"?Re="incorrect":ge!==""&&(we=he);const Ve=this.scanOptionalArgument("string")==="locked",ft=this.scanArgument("auto");let St;return ft&&Array.isArray(ft)&&ft.length>0?St=ft:ft&&typeof ft=="object"&&"group"in ft?St=ft.group:St=we,de?[new xl(de,Re,Ve,St!=null?St:we,{mode:this.parseMode,style:this.style})]:[new $i({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const de=this.index,he=this.scanLiteralGroup()||this.next();if(!he)return null;if(this.context.registers[he.substring(1)]){const ge=this.scanArgument("string");ge!==null&&(this.context.registers[he.substring(1)]=ge);const we=ya([a,pl(this.tokens.slice(de,this.index))]);return[new Un({type:"text",value:"",verbatimLatex:we})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Vt(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(de=>new Un({type:"text",value:de,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new ys(a)]);const ae=this.index;if(re.definitionType==="symbol"){const de=xe({},this.style);re.variant&&(de.variant=re.variant),ee=new Un({type:re.type,command:a,style:de,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const de=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let he,ge=[];if(re.parse?ge=re.parse(this):[he,ge]=this.scanArguments(re),this.parseMode=de,re.applyMode&&!re.applyStyle&&!re.createAtom)return st(ge[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:ge,style:this.style,mode:this.parseMode}),he&&(ee.body=st(this.scanArgument(he)));else if(typeof re.applyStyle=="function"){const we=xe(xe({},this.style),re.applyStyle(a,ge,this.context)),Re=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),he){const Ve=this.style;this.style=we;const ft=this.scanArgument(he);return this.style=Ve,this.parseMode=Re,st(ft)}this.style=we}else ee=new Un({type:"mord",command:(b=re.command)!=null?b:a,style:xe({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Un&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const de=ya([a,pl(this.tokens.slice(ae,this.index))]);de&&(ee.verbatimLatex=de)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const de=this.scanSmartFence();if(de)return[ee,de]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(Po(a)){const y=Ss.createAtom(this.parseMode,a,xe({},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 al(" "," ",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 de=this.scanLiteralGroup();if(!de){const he=this.index;this.scanExpression(),de=pl(this.tokens.slice(he,this.index))}re[ae]=de}return new Ec(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:pl(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:Xo(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 Xo(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,de=new Ul(nl(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:{}}),he=[];for(;!de.end();)he.push(...de.scan(()=>!1));return he}function t0(a,y){var b;const E=new Ul(nl(a,null),y==null?void 0:y.context,{mathstyle:"displaystyle",parseMode:(b=y==null?void 0:y.parseMode)!=null?b:"math"});for(;!E.end();)E.scan();return E.errors}var n0=class $p extends Un{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=vo.go(vr.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=Xo(E),this._verbatimLatex=y+"{"+b+"}",this.arg=b,this.captureSelection=!0}static fromJson(y){return new $p(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return pe(xe({},super.toJson()),{arg:this.arg})}render(y){const b=Un.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}};Kt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var vr={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 de=vr.stateMachines[y],he=de.transitions[b]||de.transitions["*"];e:for(var ge=0;ge<he.length;ge++){var we=vr.patterns.match_(he[ge].pattern,a);if(we){for(var Re=he[ge].task,Ve=0;Ve<Re.action_.length;Ve++){var ft;if(de.actions[Re.action_[Ve].type_])ft=de.actions[Re.action_[Ve].type_](E,we.match_,Re.action_[Ve].option);else if(vr.actions[Re.action_[Ve].type_])ft=vr.actions[Re.action_[Ve].type_](E,we.match_,Re.action_[Ve].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Re.action_[Ve].type_+")"];vr.concatArray(ae,ft)}if(b=Re.nextState||b,a.length>0){if(Re.revisit||(a=we.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=vr.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 vr.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return vr.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return vr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return vr.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return vr.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return vr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return vr.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return vr.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return vr.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return vr.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return vr.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 vr.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return vr.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return vr.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 vr.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return vr.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return vr.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return vr.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return vr.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=vr.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,de,he,ge){var we=function(yn,er){if(typeof er=="string")return yn.indexOf(er)!==0?null:er;var kr=yn.match(er);return kr?kr[0]:null},Re=function(yn,er,kr){for(var lr=0;er<yn.length;){var si=yn.charAt(er),Ii=we(yn.substr(er),kr);if(Ii!==null&&lr===0)return{endMatchBegin:er,endMatchEnd:er+Ii.length};if(si==="{")lr++;else if(si==="}"){if(lr===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];lr--}er++}return lr>0,null},Ve=we(a,y);if(Ve===null||(a=a.substr(Ve.length),Ve=we(a,b),Ve===null))return null;var ft=Re(a,Ve.length,E||ee);if(ft===null)return null;var St=a.substring(0,E?ft.endMatchEnd:ft.endMatchBegin);if(re||ae){var wn=this.findObserveGroups(a.substr(ft.endMatchEnd),re,ae,de,he);if(wn===null)return null;var wr=[St,wn.match_];return{match_:ge?wr.join(""):wr,remainder:wn.remainder}}else return{match_:St,remainder:a.substr(ft.endMatchEnd)}},match_:function(a,y){var b=vr.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return vr.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 vr.go(y,"text")},"{text}":function(a,y){var b=["{"];return vr.concatArray(b,vr.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return vr.go(y,"tex-math")},"tex-math tight":function(a,y){return vr.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 vr.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 vr.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 de=0;de<ae.action_.length;de++)typeof ae.action_[de]=="string"&&(ae.action_[de]={type_:ae.action_[de]})}else ae.action_=[];for(var he=y.split("|"),ge=0;ge<he.length;ge++)if(E[ee]==="*")for(var we in re)re[we].push({pattern:he[ge],task:ae});else re[E[ee]].push({pattern:he[ge],task:ae})}return re},stateMachines:{}};vr.stateMachines={ce:{transitions:vr.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 vr.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 vr.concatArray(b,this.output(a)),vr.concatArray(b,vr.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=vr.patterns.match_("orbital",a.o||""),ee=vr.patterns.match_("one lowercase greek letter $",a.o||""),re=vr.patterns.match_("one lowercase latin letter $",a.o||""),ae=vr.patterns.match_("$one lowercase latin letter$ $",a.o||""),de=y==="-"&&(E&&E.remainder===""||ee||re||ae);de&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var he=[];return de?(vr.concatArray(he,this.output(a)),he.push({type_:"hyphen"})):(E=vr.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(vr.concatArray(he,vr.actions["d="](a,y)),vr.concatArray(he,this.output(a))):(vr.concatArray(he,this.output(a)),vr.concatArray(he,vr.actions.bond(a,y,"-")))),he},"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:vr.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"&&vr.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:vr.go(a.a,"a"),b:vr.go(a.b,"bd"),p:vr.go(a.p,"pq"),o:vr.go(a.o,"o"),q:vr.go(a.q,"pq"),d:vr.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=vr.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=vr.go(a.rd);var re;a.rqt==="M"?re=vr.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=vr.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 vr.concatArray(b,vr.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:vr.go(y[0]),p2:vr.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:vr.go(y[0]),p2:vr.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:vr.go(y[0]),p2:vr.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:vr.go(y[0]),p2:vr.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:vr.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:vr.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:vr.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:vr.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:vr.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:vr.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:vr.go(y[1],"pq")}}}},bd:{transitions:vr.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:vr.go(y[1],"bd")}}}},oxidation:{transitions:vr.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:vr.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:vr.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:vr.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:vr.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]&&(vr.concatArray(b,vr.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?vr.concatArray(b,vr.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]),vr.concatArray(b,vr.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=vr.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=vr.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:vr.go(a.d,"pu"),q:vr.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_:"/"}),vr.concatArray(y,ee.q))}else y=vr.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:vr.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=vr.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=vr.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:vr.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 vo={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+=vo._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&vo.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:vo._goInner(a.a),b:vo._goInner(a.b),p:vo._goInner(a.p),o:vo._goInner(a.o),q:vo._goInner(a.q),d:vo._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 "+vo._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+vo._goInner(a.p1);break;case"bond":if(y=vo._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{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+vo._goInner(a.p1)+"}_{"+vo._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+vo._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:vo._goInner(a.rd),rq:vo._goInner(a.rq)},ae=vo._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=vo._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 E1(a){}function k1(a){}var r0=class zp extends Un{constructor(y){super(pe(xe({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return pe(xe({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new Er(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Vt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):co(this.command,this.value)}},i0=class Kp extends Un{constructor(y){super(pe(xe({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return pe(xe({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=ln(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=Vt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):co(this.command,this.value)}},bd=class Hp extends Un{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 pe(xe({},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=Vt(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 co(ee,this.bodyToLatex(y))}render(y){const b=new La({parent:y},this.style),E=Un.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 Er(null,{classes:"ML__notation"});let de=E.height+E.depth+2*re;const he=E.width+2*re;let ge="";if(this.notation.horizontalstrike&&(ge+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ge+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ge+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ge+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ge+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const St=.03*Math.sqrt(he*he+de*de)*1,wn=E.width*St,wr=(E.depth+E.height)*St,yn=re+E.width;let er=re;er+wr-.4*wn<0&&(er=.4*wn-wr),ge+='<polygon points="',ge+=`${yn},${er} ${yn-wn-.4*wr},${er+wr-.4*wn} `,ge+=`${yn-.7*wn},${er+.7*wr} ${yn-wn+.4*wr},${er+wr+.4*wn} `,ge+=`${yn},${er}`,ge+=`" stroke='none' fill="${this.strokeColor}"`,ge+="/>"}let we=0;if(this.notation.phasorangle){const Ve=a0(b),ft=(E.height+E.depth+2*Ve+re).toString(),St=(E.height+E.depth)/2;ge+=this.line(re.toString(),ft,(re+St+E.width).toString(),ft),ge+=this.line(re.toString(),ft,(re+St).toString(),(re-Ve).toString()),de+=Ve,we=St,E.left+=de/2-re}if(this.notation.longdiv){const Ve=a0(b);de+=Ve,ge+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const ft=.3;we=ft+Ve,E.left+=ft+Ve,E.setTop(re+Ve),ge+='<path d="',ge+=`M ${re} ${re} a${ft} ${(E.depth+E.height+2*Ve)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Ve} "`,ge+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ge+="/>"}if(ae.width=E.width+2*re+we,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*de)/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),ge){let Ve="";this.shadow==="auto"&&(Ve+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Ve+=`filter: drop-shadow(${this.shadow})`),Ve+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Ve+=' stroke-linecap="round"',this.svgStrokeStyle&&(Ve+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Ve,ae.svgOverlay=ge}const Re=new Er([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="${bf(y)}" y1="${bf(b)}" x2="${bf(E)}" y2="${bf(ee)}" vector-effect="non-scaling-stroke"></line>`}};function bf(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?el:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var kc=class Wp extends Un{constructor(y,b,E){var ee,re;super(pe(xe({},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),xe(xe({},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 La({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new La({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),de=this.numerPrefix?new Er([new Er(this.numerPrefix),Un.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Un.createBox(ae,this.above,{type:"ignore"}))!=null?b:new Er(null,{type:"ignore"}),he=new La({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ge=this.denomPrefix?new Er([new Er(this.denomPrefix),Un.createBox(he,this.below,{type:"ignore"})]):(E=Un.createBox(he,this.below,{type:"ignore"}))!=null?E:new Er(null,{type:"ignore"}),we=this.hasBarLine?re.defaultRuleThickness:0;let Re,Ve=0,ft;ee.isDisplayStyle?(Re=ae.metrics.num1,Ve=we>0?3*we:7*we,ft=he.metrics.denom1):(we>0?(Re=ae.metrics.num2,Ve=we):(Re=ae.metrics.num3,Ve=3*re.defaultRuleThickness),ft=he.metrics.denom2);const St=[];this.isSelected&&St.push("ML__selected");const wn=de.depth,wr=ge.height;let yn;if(we<=0){const vi=Re-wn-(wr-ft);vi<Ve&&(Re+=(Ve-vi)/2,ft+=(Ve-vi)/2),yn=new Qa({individualShift:[{box:de,shift:-Re,classes:[...St,"ML__center"]},{box:ge,shift:ft,classes:[...St,"ML__center"]}]}).wrap(ee)}else{const vi=new Er(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});vi.softWidth=Math.max(de.width,ge.width),vi.height=we/2,vi.depth=we/2;const Pa=os+we/2;Re<Ve+wn+Pa&&(Re=Ve+wn+Pa);const Ya=os-we/2;ft<Ve+wr-Ya&&(ft=Ve+wr-Ya),yn=new Qa({individualShift:[{box:ge,shift:ft,classes:[...St,"ML__center"]},{box:vi,shift:-Ya,classes:St},{box:de,shift:-Re,classes:[...St,"ML__center"]}]}).wrap(ee)}const er=ee.isDisplayStyle?re.delim1:re.delim2,kr=this.leftDelim?this.bind(y,ni("open",this.leftDelim,er,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):ri(ee,"open");let lr=null;this.continuousFraction?lr=new Er(null,{type:"close"}):this.rightDelim?lr=this.bind(y,ni("close",this.rightDelim,er,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):lr=ri(ee,"close");const si=new Er([kr,yn,lr],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Ii=this.bind(y,si);return this.caret&&(Ii.caret=this.caret),this.attachSupsub(y,{base:Ii})}},ns=class Up extends Un{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 Up(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),xe({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new Er(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}},xd=class Zp extends Un{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new ns(b)),this.skipBoundary=!1}static fromJson(y){return new Zp("")}toJson(){return super.toJson()}render(y){const b=Un.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:""}},fh=class Vp extends Un{constructor(y,b){super(pe(xe({},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 Er(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-os*y.scalingFactor,ae=ee.italic;ee.setTop(re);let de=ee;if(this.superscript||this.subscript){const he=(b=this.subsupPlacement)!=null?b:"auto";de=he==="over-under"||he==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new Er(this.bind(y,de),{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=Vt(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)),ya(E)}},Ru=class jp extends Un{constructor(y){const b=y.body;super(pe(xe({},y),{type:"overlap",body:typeof b=="string"?[new Un({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 jp(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),xe(xe({},super.toJson()),y)}render(y){const b=Un.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new Er([b,new Er(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},js=class Gp extends Un{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 Gp(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?Os(this.svgBody):Un.createBox(y,this.body,{type:"ignore"});const E=new La({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Os(this.svgAbove):this.above&&(ee=Un.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=Os(this.svgBelow):this.below&&(re=Un.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new Er([ri(y,"open"),b,ri(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 de=new Er(y.base,{type:y.type});return de.setStyle("position","relative"),de}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 de=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Qa({bottom:de,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 Qa({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Qa({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new Er(E,{type:y.type})}var wd=class Xp extends Un{constructor(y){var b,E,ee,re;super(pe(xe({},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),xe(xe({},super.toJson()),y)}render(y){const b=new La({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Un.createBox(b,this.body,{classes:"inner"});const E=Un.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new Er(null,{classes:"fix"});return new Er([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 Qa({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},Sd=class qp extends Un{constructor(y){var b;super(xe({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new qp(y)}toJson(){const y=super.toJson();return this.width!==void 0&&(y.width=this.width),this._braced&&(y.braced=!0),y}render(y){var b;if(this.command==="space")return new Er(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new Er(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 Er(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=Vt(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}{${Do(this.width)}}`:`${ee}${Do(this.width)}`}},o0=class Yp extends Un{constructor(y){var b;super(pe(xe({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new Yp(pe(xe({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Vt(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")?co(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:co(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 La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body,{type:"inner"}))!=null?b:new Er(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,de=y.isDisplayStyle?el:ae,he=new Er(null,{classes:"ML__sqrt-line",style:this.style});he.height=ae,he.softWidth=ee.width;let ge=re*(ae+de/4);const Re=Math.max(re*2*de,ee.height+ee.depth)+ge+ae,Ve=new La({parent:y},this.style),ft=this.bind(Ve,new Er(ni("inner","\\surd",Re,!1,Ve,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!ft)return null;const St=ft.height+ft.depth-ae;St>ee.height+ee.depth+ge&&(ge=(ge+St-(ee.height+ee.depth))/2),ft.setTop(ft.height-ee.height-ge);const wn=this.bind(y,new Qa({firstBaseline:[{box:new Er(ee)},ge-2*ae,{box:he},ae]})),wr=Un.createBox(new La({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!wr){const kr=new Er([ft,wn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return kr.setStyle("display","inline-block"),kr.setStyle("height",kr.height+kr.depth,"em"),this.caret&&(kr.caret=this.caret),this.bind(y,kr)}const yn=new Qa({shift:-.6*(Math.max(ft.height,wn.height)-Math.max(ft.depth,wn.depth)),children:[{box:wr}]}),er=new Er([new Er(yn,{classes:"ML__sqrt-index",type:"ignore"}),ft,wn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return er.height=ft.height,er.depth=ft.depth,this.caret&&(er.caret=this.caret),this.bind(y,er)}},sm=class extends Er{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 xf(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"){xf(a.parent,y);return}E>0&&b[E-1].type==="skip"?b[E-1].width+=y:b.splice(E,0,new sm(y))}var lm={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},um={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function cm(a){Md(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 Cd(a,y){if(!a.children)return a;const b=a.children;cm(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),re=y.getRegisterAsEm("thickmuskip");return Md(b,(ae,de)=>{var he,ge,we;if(!ae)return;const Re=ae.type,Ve=de.isTight?(he=um[Re])!=null?he:null:(ge=lm[Re])!=null?ge:null,ft=(we=Ve==null?void 0:Ve[de.type])!=null?we:null;ft===3&&xf(de,E),ft===4&&xf(de,ee),ft===5&&xf(de,re)}),a}function Md(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=Md(E.children,y,b):E.type==="ignore"?Md(E.children,y):(y(b,E),Md(E.children,y),b=E);return b}var hh=class Jp extends Un{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Un({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(pe(xe({},y),{tooltip:du(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 pe(xe({},super.toJson()),{tooltip:b})}render(y){const b=Un.createBox(new La,this.body);if(!b)return null;const E=new La({parent:y,mathstyle:"displaystyle"},{fontSize:dl}),ee=gc(Cd(new Er(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new Er([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},Bu=class Qp extends Un{constructor(y,b){super(pe(xe({},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 Er(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 Er(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=Vt(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)),ya(E)}};function du(a){if(ze(a))return a.map(E=>du(E));if(typeof a=="string")return Un.fromJson(a);a=xe({},a);for(const E of su)a[E]&&(a[E]=du(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=du(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=oa.fromJson(a)),y==="box"&&(b=ko.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=Wl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=bd.fromJson(a)),y==="error"&&(b=ys.fromJson(a)),y==="extensible-symbol"&&(b=fh.fromJson(a)),y==="genfrac"&&(b=kc.fromJson(a)),y==="group"&&(b=Go.fromJson(a)),y==="latex"&&(b=ns.fromJson(a)),y==="latexgroup"&&(b=xd.fromJson(a)),y==="leftright"&&(b=Wa.fromJson(a)),y==="macro"&&(b=Ec.fromJson(a)),y==="macro-argument"&&(b=sl.fromJson(a)),y==="operator"&&(b=Bu.fromJson(a)),y==="overlap"&&(b=Ru.fromJson(a)),y==="overunder"&&(b=js.fromJson(a)),y==="placeholder"&&(b=$i.fromJson(a)),y==="prompt"&&(b=xl.fromJson(a)),y==="phantom"&&(b=wd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=Sd.fromJson(a)),y==="subsup"&&(b=Vs.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=al.fromJson(a)),y==="tooltip"&&(b=hh.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=Un.fromJson(a));for(const E of su)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=>du(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>du(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"]},ph={"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]$/,fm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,hm=[/^[a-z]$/,/^[A-Z]$/,l0,fm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Ss{constructor(){super("math")}createAtom(a,y,b){var E,ee,re,ae;if(y===null)return new Un({type:"mord",mode:"math",command:a,value:a,style:b});const de=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ge=new Un({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return de&&(ge.isFunction=!0),a.startsWith("\\")&&(ge.verbatimLatex=a),ge}const he=new Un({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return de&&(he.isFunction=!0),a.startsWith("\\")&&(he.verbatimLatex=a),he}serialize(a,y){const b=gm(a,pe(xe({},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&&hm.forEach((de,he)=>{var ge;de.test(a.value)&&pm[(ge=y.letterShapeStyle)!=null?ge:"tex"][he]==="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 ph[b]&&!ph[b].test(a.value)?(a.value=Nn(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=u0(b);return Eo(a,"variant").map(ee=>{const re=u0(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 de=ya(ee.map(he=>he._serialize(y)));return ae?co(ae,de):de})}function u0(a){if(!a)return"";const{style:y}=a;if(y.variant===void 0)return"";let b=y.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(y.variant)&&y.variantStyle&&y.variantStyle!=="up"&&(b+="-"+y.variantStyle),b}new mm;function vm(a,y){return a.map(b=>b._serialize(y))}function ym(a,y){return Eo(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?`{${co("\\fontshape",ee)}${ya(E)}}`:re?co(re,ya(E)):ya(E)})}function bm(a,y){return Eo(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?`{${co("\\fontseries",ee)}${ya(E)}}`:re?co(re,ya(E)):ya(E)})}function xm(a,y){return Eo(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} ${ya(re)}`:ya(re)})}function wm(a,y,b){return Eo(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),de=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return de?`\\${de}{${ya(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${ya(ae)}}`:b?`\\text{${ya(ae)}}`:ya(ae)})}var c0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Ss{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new al(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,pe(xe({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:de}=y;if(c0[de]?a.classes+=" "+c0[de]:de&&a.setStyle("font-family",de),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 he=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);he&&(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=he[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=he[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Ss{constructor(){super("latex")}createAtom(a){return new ns(a)}serialize(a,y){return a.filter(b=>b instanceof ns&&!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:["","=","","="]}},mh={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:["\\","|","",""]}},f0={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:[")",")",")",")"]}},Em={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},km={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},_m={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:["=","=","=","="]}},Am={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:["<",">","|",""]}},Tm={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:[".",".",".","."]}},Dm={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 h0(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 _c(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 Om={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]"},Ed=[],kd;function gh(){switch(De()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ns(a){(!a.platform||a.platform===gh())&&Ed.push(a)}function Rm(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=Om[a])!=null?b:"",E}function Bm(a){if(a.code)return a;const y=Object.entries(_d().mapping);let b=!1,E=!1,ee="";for(let re=0;re<4;re++){for(const[ae,de]of y)if(de[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,pe(xe({},a),{altKey:b,shiftKey:E,code:ee}))}function Nm(a){var y,b;if(!a||a.key==="Unidentified"||a.key==="Dead")return;const E=a.shiftKey&&a.altKey?3:a.altKey?2:a.shiftKey?1:0;for(const ee of Ed)((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);Ed.sort((ee,re)=>re.score-ee.score)}function Fm(a){kd=Ed.find(y=>a.startsWith(y.locale))}function _d(){return kd!=null?kd:Ed[0]}function $m(){switch(gh()){case"apple":return mh;case"windows":return d0;case"linux":return f0}return mh}switch(gh()){case"apple":Ns(mh),Ns(Em),Ns(Dm),Ns(Lm);break;case"windows":Ns(d0),Ns(km),Ns(Im),Ns(Am);break;case"linux":Ns(f0),Ns(_m),Ns(Pm),Ns(Tm);break}Ns(Mm);function vh(a){var y;const b=/macos|ios/.test(De()),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:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",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 wf(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 Nu(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 Sf(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Cf(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var wl=class Gl{static get scrim(){return Gl._scrim||(Gl._scrim=new Gl),Gl._scrim}static open(y){Gl.scrim.open(y)}static close(){Gl.scrim.close()}static get state(){return Gl.scrim.state}static get element(){return Gl.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=Cf();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:"",Cf()!==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,de=!1;const he=new AbortController,ge=he.signal;return a.addEventListener("keydown",we=>{if(re||we.key==="Process"||we.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(we.code)){E=null;return}E=we,ee=null,b.onKeystroke(we)?a.textContent="":E=null},{capture:!0,signal:ge}),a.addEventListener("keypress",we=>{re||(E&&ee&&b.onKeystroke(E),ee=we)},{capture:!0,signal:ge}),a.addEventListener("compositionstart",we=>{a.textContent="",re=!0,b.onCompositionStart(we.data)},{capture:!0,signal:ge}),a.addEventListener("compositionupdate",we=>{re&&b.onCompositionUpdate(we.data)},{capture:!0,signal:ge}),a.addEventListener("compositionend",we=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(we.data))},{capture:!0,signal:ge}),a.addEventListener("beforeinput",we=>we.stopImmediatePropagation(),{signal:ge}),a.addEventListener("input",we=>{var Re;if(!re&&(a.textContent="",we.inputType!=="insertCompositionText")){if(we.inputType==="insertFromPaste"){we.preventDefault(),we.stopPropagation();return}b.onInput((Re=we.data)!=null?Re:""),we.preventDefault(),we.stopPropagation()}},{signal:ge}),a.addEventListener("paste",we=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(we)||we.preventDefault(),we.stopImmediatePropagation()},{signal:ge}),a.addEventListener("cut",we=>b.onCut(we),{capture:!0,signal:ge}),a.addEventListener("copy",we=>b.onCopy(we),{capture:!0,signal:ge}),a.addEventListener("blur",we=>{var Re,Ve;if(((Ve=(Re=we.relatedTarget)==null?void 0:Re._mathfield)==null?void 0:Ve.element)===y){a.focus({preventScroll:!0}),we.preventDefault(),we.stopPropagation();return}const ft=wl.state;if(ft==="open"||ft==="opening"){we.preventDefault(),we.stopPropagation();return}if(we.relatedTarget===we.target.getRootNode().host){we.preventDefault(),we.stopPropagation();return}de||ae||(de=!0,E=null,ee=null,b.onBlur(),de=!1)},{capture:!0,signal:ge}),a.addEventListener("focus",we=>{de||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ge}),{dispose:()=>he.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:()=>Cf()===a,setAriaLabel:we=>a.setAttribute("aria-label",we),setValue:we=>{var Re;a.textContent=we,a.style.left="-1000px",(Re=window.getSelection())==null||Re.selectAllChildren(a)},moveTo:(we,Re)=>{a.style.top=`${Re}px`,a.style.left=`${we}px`}}}function Lc(a){var y;if(!a||!Sf(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=Bm(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(Ct()){const y=De(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Um(a,y,b){if(a.length===0)return"";const E=_c(h0(p0(b))),ee=_c({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(De()),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 ze(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function Zm(a,y){let b=[];if(typeof y=="string"){const re=hd[y];ze(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(vh)}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=h0(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=De()==="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 pe(xe({},a),{key:_c(b)});const ee=Rm(b.key,y);if(!ee)return pe(xe({},a),{key:_c(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yh(a.command)}) is conflicting with the key combination ${_c(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,pe(xe({},a),{key:_c(ee)})}function yh(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function jm(a,y){const b=[],E=[];for(const ee of a)try{const re=Vm(ee,y);if(!re)continue;const ae=E.find(de=>de.key===re.key&&de.ifMode===re.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yh(ee.command)}) matches ${ae.key} (${yh(ae.command)}) with the ${y.displayName} keyboard layout`);E.push(re)}catch(re){re instanceof Error&&b.push(re.message)}return[E,b]}var Gm=class extends ra{constructor(){super("latex")}createAtom(a){return new ns(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"}),Mo(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(jo(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 he of y)le.test(he)&&re.push(new ns(he));let ae=a.at(a.position);if(ae instanceof xd&&(ae=ae.lastChild),!(ae.parent instanceof xd)){const he=new xd("");ae.parent.addChildAfter(he,ae),ae=he.firstChild}const de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function Ld(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 he=a.at(E);ee=he instanceof ns&&he.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,de=!1;for(;ae<=re&&!de;){const he=a.at(ae);de=!(he instanceof ns&&he.isSuggestion),de||ae++}return[E-1,ae-1]}new Gm;function Mf(a){const y=Ld(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 Ad(a,y){var b;const{model:E}=a;Mf(a);for(const we of Ld(E))we.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){Tc(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof ns&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(we=>we.value).join(""),de=pn(a,ae);if(de.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const we of ee)we.isError=!0;Tc(a);return}const he=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=he<0?de.length-1:he%de.length;const ge=de[a.suggestionIndex];if(ge!==ae){const we=ee[ee.length-1];we.parent.addChildrenAfter([...ge.slice(ae.length-ge.length)].map(Re=>new ns(Re,{isSuggestion:!0})),we),Fu(a,{interactive:!0})}Ym(a,de)}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 Ac(a,y="accept",b){var E,ee;Tc(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const ge=Ld(a.model).filter(we=>we.isSuggestion);if(ge.length!==0){for(const we of ge)we.isSuggestion=!1;a.model.position=a.model.offsetOf(ge[ge.length-1])}if(y==="accept-suggestion")return ge.length!==0}const de=Ld(a.model).filter(ge=>!ge.isSuggestion).map(ge=>ge.value).join(""),he=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(he),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(ra.insert(a.model,de,{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 Ef(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 bh(a){var y;const b=document.getElementById(a);if(!b)return;const E=Number.parseInt((y=b.getAttribute("data-refcount"))!=null?y:"0");E<=1?b.remove():b.dataset.refcount=Number(E-1).toString()}function qm(a,y){const b=new La({from:a.context}),E=new Un({mode:"math",type:"root",body:Xo(y,{context:b})}),ee=gc(Cd(new Er(E.render(b),{classes:"ML__base"}),b));return vc(ee,{classes:"ML__latex"}).toMarkup()}function Ym(a,y){var b;if(y.length===0){Tc(a);return}let E="";for(const[re,ae]of y.entries()){const de=ae,he=qm(a,ae),ge=Zm(a.keybindings,de).join("<br>");E+=`<li role="button" data-command="${de}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${de}</span><span class="ML__popover__command">${he}</span>`,ge&&(E+=`<span class="ML__popover__keybinding">${ge}</span>`),E+="</li>"}const ee=Jm(a,`<ul>${E}</ul>`);xh()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xh()&&(ee.classList.add("is-visible"),kf(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xh(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function kf(a,y){var b;if(!a.element||a.element.mathfield!==a||!xh())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){Tc(a);return}if(y!=null&&y.deferred){setTimeout(()=>kf(a),32);return}const E=bl(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,de=window.innerHeight-document.documentElement.clientHeight,he=window.mathVirtualKeyboard.boundingRect.height,ge=document.getElementById("mathlive-suggestion-popover");E.x+ge.offsetWidth/2>re-ae?ge.style.left=`${re-ge.offsetWidth-ae}px`:E.x-ge.offsetWidth/2<0?ge.style.left="0":ge.style.left=`${E.x-ge.offsetWidth/2}px`;const we=E.y-E.height;ee-de-he-E.y<we?(ge.classList.add("ML__popover--reverse-direction"),ge.classList.remove("top-tip"),ge.classList.add("bottom-tip"),ge.style.top=`${E.y-E.height-ge.offsetHeight-15}px`):(ge.classList.remove("ML__popover--reverse-direction"),ge.classList.add("top-tip"),ge.classList.remove("bottom-tip"),ge.style.top=`${E.y+15}px`)}function Tc(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function Jm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=Ef("mathlive-suggestion-popover"),_s("suggestion-popover"),_s("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(Ac(a,"reject"),ra.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")&&(bh("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 _f=null,y0,b0,wh=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return gu(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(_f===null)try{const y=yield fetch(wh,{method:"HEAD"});y.status===200&&(_f=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wh}")`)}return new URL(a,_f!=null?_f:wh).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Fs="not-loaded";function ng(){return gu(this,null,function*(){return Fs="not-loaded",Lf()})}function Lf(){return gu(this,null,function*(){var a;if(Fs!=="not-loaded")return;if(Fs="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Fs="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))){Fs="ready";return}if(!window.MathfieldElement.fontsDirectory){Fs="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Fs="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(de=>{try{return de.load()}catch(he){}}))).forEach(de=>document.fonts.add(de)),Fs="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")}Fs="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 Mo(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Rs(a)&&a.dirty&&(a.atomBoundsCache=new Map,Fu(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new La({from:pe(xe({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Un.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 vc(Cd(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 Fu(a,y){if(!Rs(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 de=a.element.querySelector("[part=menu-toggle]");if(de&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?de.style.display="none":de.style.display=""),a.model.atoms.length<=1){const he=a.options.contentPlaceholder;he&&(ae+=`<span part=placeholder class="ML__content-placeholder">${qo(he)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Af(a,y.interactive),a.dirty=!1}function Af(a,y){const b=a.field;if(!b)return;for(const de of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))de.remove();!(y!=null&&y)&&Fs!=="error"&&Fs!=="ready"&&setTimeout(()=>{Fs==="ready"?Af(a):setTimeout(()=>Af(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){kf(a,{deferred:!0});let de=E.at(E.position);for(;de&&de.type!=="prompt"&&!(de.containsCaret&&de.displayContainsHighlight);)de=de.parent;if(de!=null&&de.containsCaret&&de.displayContainsHighlight){const he=md(a,lu(a,de),ae);if(he){he.left/=ae,he.right/=ae,he.top/=ae,he.bottom/=ae;const ge=document.createElement("div");ge.classList.add("ML__contains-highlight"),ge.style.position="absolute",ge.style.left=`${he.left+1}px`,ge.style.top=`${Math.ceil(he.top)}px`,ge.style.width=`${Math.ceil(he.right-he.left)}px`,ge.style.height=`${Math.ceil(he.bottom-he.top)}px`,b.insertBefore(ge,b.childNodes[0])}}return}for(const de of ag(vd(a,{excludeAtomsWithBackground:!0}))){de.left/=ae,de.right/=ae,de.top/=ae,de.bottom/=ae;const he=document.createElement("div");he.classList.add("ML__selection"),he.style.position="absolute",he.style.left=`${de.left}px`,he.style.top=`${de.top}px`,he.style.width=`${Math.ceil(de.right-de.left)}px`,he.style.height=`${Math.ceil(de.bottom-de.top-1)}px`,b.insertBefore(he,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,Sl;function Ls(a,y){y=xe({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),Sl||(Sl={});for(const b of Object.keys(a))console.assert(!Sl[b],"Selector already defined: ",b),Sl[b]=pe(xe({},y),{fn:a[b]})}function Sh(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sh(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),Sl[y]}function Dc(a){var y;return(y=Sh(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],re=!1,ae=!1;ze(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ge=>ge[1].toUpperCase());const de=Sl[E],he=de==null?void 0:de.target;if(he==="model"){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Mf(a),Sl[E].fn(a.model,...ee),Ad(a),ae=!0,re=!0}else if(he==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(Sl[E]){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=Sl[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return he!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||de!=null&&de.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),de!=null&&de.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&Mo(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&Ye()&&navigator.vibrate(S0);const E=Sh(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Ls({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return Ad(a,{atIndex:a.suggestionIndex+1}),!1}function ug(a){return Ad(a,{atIndex:a.suggestionIndex-1}),!1}Ls({complete:Ac},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Ls({nextSuggestion:lg,previousSuggestion:ug},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Tf="mathlive#virtual-keyboard-message";function Ch(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Tf}var cg=class em{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new em),this._singleton}set alphabeticLayout(y){this.sendMessage("update-setting",{alphabeticLayout:y})}set layouts(y){this.sendMessage("update-setting",{layouts:y})}get normalizedLayouts(){return[]}set editToolbar(y){this.sendMessage("update-setting",{editToolbar:y})}set actionKeycap(y){this.sendMessage("update-setting",{actionKeycap:y})}set shiftKeycap(y){this.sendMessage("update-setting",{shiftKeycap:y})}set backspaceKeycap(y){this.sendMessage("update-setting",{backspaceKeycap:y})}set tabKeycap(y){this.sendMessage("update-setting",{tabKeycap:y})}set container(y){throw new Error("Container inside an iframe cannot be changed")}show(y){this.sendMessage("show",y)}hide(y){this.sendMessage("hide",y)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(y){y?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(y){return this.sendMessage("execute-command",{command:y}),!0}updateToolbar(y){this.sendMessage("update-toolbar",y)}update(y){this.sendMessage("update-setting",y)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}handleEvent(y){if(Ch(y)){if(!yd(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");this.handleMessage(y.data)}}handleMessage(y){const{action:b}=y;if(b==="execute-command"){const{command:E}=y;Dc(E)==="virtual-keyboard"&&this.executeCommand(E);return}if(b==="synchronize-proxy"){this._boundingRect=y.boundingRect,this._isShifted=y.isShifted;return}if(b==="geometry-changed"){this._boundingRect=y.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(y,b={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(xe({type:Tf,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:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</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>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
|
|
|
.minimalist-backdrop {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.minimalist-container {
|
|
|
--keycap-height: 40px;
|
|
|
--keycap-max-width: 53px;
|
|
|
--keycap-small-font-size: 12px;
|
|
|
background: var(--keyboard-background);
|
|
|
padding: 20px;
|
|
|
border-top-left-radius: 8px;
|
|
|
border-top-right-radius: 8px;
|
|
|
border: 1px solid var(--keyboard-border);
|
|
|
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
|
|
|
}
|
|
|
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Df={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"}]},Td;function M0(a,y){var b,E,ee;const re=fu.singleton;if(!re)return;const ae=Ic(a),de=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof de=="string"&&!E0(de)||Array.isArray(de)&&de.length===0){y==null||y();return}const he={};let ge="";for(const wn of fg(de)){const wr=_0(wn),yn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);he[yn]=wr;const[er,kr]=If(wr);ge+=`<div id=${yn} class="item ${kr}">${er}</div>`}const we=document.createElement("div");we.setAttribute("aria-hidden","true"),we.className="MLK__variant-panel",we.style.height="auto";const Re=Object.keys(he).length;let Ve=5;Re===1?Ve=1:Re===2||Re===4?Ve=2:Re===3||Re===5||Re===6?Ve=3:Re>=7&&Re<14&&(Ve=4),we.style.width=`calc(var(--variant-keycap-length) * ${Ve} + 12px)`,we.innerHTML=vp.createHTML(ge),wl.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:we}),Td=new AbortController;const{signal:ft}=Td,St=a==null?void 0:a.getBoundingClientRect();if(St){St.top-we.clientHeight<0&&(we.style.width="auto",Re<=6?we.style.height="56px":Re<=12?we.style.height="108px":Re<=18?we.style.height="205px":we.classList.add("compact"));const wn=Math.max(0,Math.min(window.innerWidth-we.offsetWidth,(St.left+St.right-we.offsetWidth)/2)),wr=St.top-we.clientHeight+5;we.style.transform=`translate(${wn}px, ${wr}px)`,we.classList.add("is-visible"),requestAnimationFrame(()=>{we.addEventListener("pointerup",yn=>{const er=Ic(yn.target);!(er!=null&&er.id)||!he[er.id]||(Mh(he[er.id]),Dd(),y==null||y(),yn.preventDefault())},{capture:!0,passive:!1,signal:ft}),we.addEventListener("pointerenter",yn=>{const er=Ic(yn.target);!(er!=null&&er.id)||!he[er.id]||er.classList.add("is-active")},{capture:!0,signal:ft}),we.addEventListener("pointerleave",yn=>{const er=Ic(yn.target);!(er!=null&&er.id)||!he[er.id]||er.classList.remove("is-active")},{capture:!0,signal:ft}),window.addEventListener("pointercancel",()=>{Dd(),y==null||y()},{signal:ft}),window.addEventListener("pointerup",()=>{Dd(),y==null||y()},{signal:ft})})}}function Dd(){Td==null||Td.abort(),Td=null,wl.state==="open"&&wl.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(Xe))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Xe[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(je))y.push({class:"swatch-button",label:'<span style="background:'+je[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function E0(a){return Df[a]!==void 0}function fg(a){var y;return typeof a!="string"?a:(Df[a]||(Df[a]=(y=dg(a))!=null?y:[]),Df[a])}function hg(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} {${hg(a[y])}}`).join("")}function Id(a){if(!a)return"";const y=new La,b=new Un({mode:"math",type:"root",body:Xo(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=gc(Cd(new Er(b.render(y),{classes:"ML__base"}),y));return vc(E,{classes:"ML__latex"}).toMarkup()}function Pd(a){var y;if(Array.isArray(a))return a.map(E=>Pd(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=>_0(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 de=_d();de&&(E=de.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[nt.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 de of re){const he=[];for(const ge of de)/[a-z]/.test(ge)?he.push({label:ge,class:"hide-shift",shift:{label:ge.toUpperCase()},variants:E0(ge)?ge:void 0}):ge==="~"?E!=="dvorak"?he.push("[backspace]"):he.push({label:"[backspace]",width:1}):ge==="^"?he.push("[shift]"):ge===" "&&he.push("[separator-5]");ae.push(he)}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:Pd({rows:ae})}}function k0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),k0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=mt(ee,["rows"]);y=pe(xe({},ae),{layers:Pd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=mt(ee,["markup"]);y=pe(xe({},ae),{layers:Pd(a.markup)})}else y=xe({},a),"layers"in a?y.layers=Pd(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()){Pc(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 de=ae,he=[re===y?"selected":"layer-switch"];de.tooltip&&he.push("MLK__tooltip"),de.labelClass&&he.push(...de.labelClass.split(" ")),ee+=`<div class="${he.join(" ")}"`,de.tooltip&&(ee+=" data-tooltip='"+((b=lt(de.tooltip))!=null?b:de.tooltip)+"' "),re!==y&&(ee+=`data-layer="${de.layers[0].id}"`),ee+=`>${(E=de.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='${lt("tooltip.undo")}'>
|
|
|
<svg><use xlink:href='#svg-undo' /></svg>
|
|
|
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
|
|
|
data-command='"redo"'
|
|
|
data-tooltip='${lt("tooltip.redo")}'>
|
|
|
<svg><use xlink:href='#svg-redo' /></svg>
|
|
|
</div>`,cutToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"cutToClipboard"'
|
|
|
data-tooltip='${lt("tooltip.cut to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-cut' /></svg>
|
|
|
</div>
|
|
|
`,copyToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"copyToClipboard"'
|
|
|
data-tooltip='${lt("tooltip.copy to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-copy' /></svg>
|
|
|
</div>
|
|
|
`,pasteFromClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"pasteFromClipboard"'
|
|
|
data-tooltip='${lt("tooltip.paste from clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-paste' /></svg>
|
|
|
</div>
|
|
|
`};return b+=ee.map(ae=>re[ae]).join(""),b}function yg(a){for(const y of a)bg(y)}function bg(a){const y=fu.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]=If(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){_s("virtual-keyboard"),_s("core"),Lf()}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,de)=>Mg(a,ae,de)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",de=>{var he,ge;let we=de.target,Re="";for(;we&&!Re;)Re=(he=we==null?void 0:we.getAttribute("data-command"))!=null?he:"",we=(ge=we==null?void 0:we.parentElement)!=null?ge: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",de=>de.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(Eg(a,ee)),E.push("</div>");return E.join("")}function Eg(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,de]=If(ee);/(^|\s)separator/.test(de)?b+=`<div class="${de}"`:b+=`<div tabindex="-1" id="${re}" class="${de}"`,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 If(a,y={shifted:!1}){var b,E,ee,re,ae,de,he;let ge="",we=(b=a.class)!=null?b:"";if(y.shifted&&Pc(a)&&(we+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ge=Id(a.shift):typeof a.shift=="object"&&(ge=a.shift.label?a.shift.label:(E=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(we=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ge=a.label?a.label:(ae=Id(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Re;typeof a.shift=="string"?Re=Id(a.shift):a.shift.label?Re=a.shift.label:Re=(de=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?de:"",ge+=`<span class="MLK__shift">${Re}</span>`}a.aside&&(ge+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(we)&&(we+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(we)||(we+=" MLK__keycap"),!/\bw[0-9]+\b/.test(we)&&a.width&&(we+=(he={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?he:""),[ge,we||"MLK__keycap"]}var $u={"[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:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<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 _0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!$u[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&$u[a.label]&&(b=pe(xe(xe({},$u[a.label]),a),{label:$u[a.label].label})),"key"in a&&a.key&&$u[a.key]&&(b=pe(xe(xe({},$u[a.key]),a),{key:$u[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=xe(xe({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=xe(xe({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=xe(xe({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=xe(xe({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Od;function kg(a){var y;if(a.button!==0)return;const b=fu.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=Ic(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,de=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointerleave",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointercancel",Pf(ae),{signal:de}),ee.addEventListener("pointerup",Pf(ae),{signal:de}),Pc(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Od&&clearTimeout(Od),Od=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 Pf(a){return y=>{const b=Ic(y.target);if(!(b!=null&&b.id))return;const E=fu.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"),Pc(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"),Pc(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Od&&clearTimeout(Od),Pc(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"}]):Mh(ee.shift):Mh(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mh(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=fu.singleton)==null||y.executeCommand(b)}function _g(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 Ic(a){if(!a)return;let y=a;for(;y&&!_g(y);)y=y.parentElement;return y!=null?y:void 0}function Pc(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var fu=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"&&ht()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>k0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=If(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}),Dd(),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(Ch(y)){if(!yd(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=Dc(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:xe({type:Tf,action:y},b)}));return}if(E)E.postMessage(xe({type:Tf,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=Dc(y);return ze(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=Dc(y)),E=y.slice(1)):b=y,b=b.replace(/-\w/g,re=>re[1].toUpperCase()),ee==="virtual-keyboard"?Sl[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=Cf(),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(Ct()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=fu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>cg.singleton,configurable:!0});function Of(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(ze(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(de=>parseInt(de.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=fu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?nt.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=ut(a.macros);break;default:ze(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=xe({},a[b]):y[b]=a[b]}return y}function zu(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:ze(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=xe({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Rf(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Lt,backgroundColorMap:Ge,letterShapeStyle:nt.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:lh,inlineShortcuts:ff,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sh,value:""}}function A0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function hu(a,y){!a||!y||(ze(a)?a.forEach(b=>hu(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),hu(a.body,y),hu(a.above,y),hu(a.below,y),hu(a.subscript,y),hu(a.superscript,y)))}function Eh(a,y,b,E){function ee(ae,de){for(const he of re)if(he.style[ae]!==de)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=dl),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 Wl(y,{mode:b.mode});ee.caret=E,b.parent.addChildAfter(ee,b),a.position+=1}}function Ag(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}Nr(["math","displaymath"],Gs),Nr("center",Gs),Kt("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 oa("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Wr("array","{columns:colspec}",(a,y,b,E)=>new oa(a,kh(y),b,{columns:E[0],mathstyleName:"textstyle"})),Wr(["equation","equation*","subequations"],"",(a,y,b)=>new oa(a,kh(y),b,{columns:[{align:"c"}]})),Wr(["multline","multline*"],"",Gs),Wr(["align","align*","aligned","eqnarray"],"",Gs),Wr("split","",Gs),Wr(["gather","gathered"],"",Gs),Wr(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Gs),Wr(["smallmatrix","smallmatrix*"],"[columns:colspec]",Gs),Wr(["cases","dcases","rcases"],"",Gs);function Tg(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function kh(a,y=1){return Tg(a)?Array(y).fill([[new Un({type:"first"}),new $i]]):a.map(b=>b.length===0?[[new Un({type:"first"})]]:b.map(E=>E.length===0?[new Un({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Un({type:"first"})),E)))}function Gs(a,y=[[[]]],b=[],E=[]){switch(y=kh(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new oa(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new oa(a,y,b,{mathstyleName:"textstyle"});case"center":return new oa(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new oa(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new oa(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new oa(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Ku(E[0])});case"bmatrix":case"bmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Ku(E[0])});case"Bmatrix":case"Bmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Ku(E[0])});case"vmatrix":case"vmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Ku(E[0])});case"Vmatrix":case"Vmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Ku(E[0])});case"matrix":case"matrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Ku(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new oa(a,y,b,{mathstyleName:"scriptstyle",columns:Ku(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new oa(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 oa(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new oa(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const de of y)ee=Math.max(ee,de.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 oa(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new oa(a,y,b,{mathstyleName:"textstyle"})}function Ku(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 Dg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof oa);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof oa)){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=Ff()),ee.length===0&&(ee=Ff());let ae;return y.endsWith("column")?(ae=Gs("split",[[re,ee]]),a.root=ae,Hu(ae,0,0)?Wu(a,ae,0,0):Hu(ae,0,1)?Wu(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Gs("lines",[[re],[ee]]),a.root=ae,Hu(ae,0,0)?Wu(a,ae,0,0):Hu(ae,1,0)?Wu(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Wa){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=Ff()),re.length===0&&(re=Ff());let de="pmatrix";const he=ee.leftDelim,ge=ee.rightDelim;he==="("&&(ge===")"||ge==="?")?de="pmatrix":(he==="["||he==="\\lbrack")&&(ge==="]"||ge==="\\rbrack"||ge==="?")?de="bmatrix":he==="\\vert"&&ge==="\\vert"?de="vmatrix":he==="\\Vert"&&ge==="\\Vert"?de="Vmatrix":(he==="{"||he==="\\lbrace")&&(ge==="."||ge==="?")&&(de="cases");const we=Gs(de,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(we,ee),ee.parent.removeChild(ee),Hu(we,0,0)?Wu(a,we,0,0):y.endsWith("column")?Hu(we,0,1)?Wu(a,we,0,1):a.position=a.offsetOf(b):Hu(we,1,0)?Wu(a,we,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof oa?[b.parent,b.parentBranch]:[void 0,[0,0]]}function Hu(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 Wu(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Bf(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function Nf(a,y){const[b,[E,ee]]=Dg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Bf(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Bf(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Bf(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Bf(a,b,E,ee,"start");break}}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function D0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Og(a){return a.contentWillChange({inputType:"insertText"})?(Nf(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 oa);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof oa){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 Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Bg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Ls({addRowAfter:T0,addColumnAfter:D0,addRowBefore:Pg,addColumnBefore:Og,removeRow:Rg,removeColumn:Bg,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Ff(){return[new $i]}var O0=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}};O0.maximumDepth=1e3;var Ng=O0;function _h(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(ve.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&ve.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 Oc(a,y,b){var E,ee,re,ae,de,he,ge;const we=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 Ve=a.offsetOf(Re);if(Re instanceof al)Ve=_h(a,Ve,y);else if(Re instanceof ns)if(Re.isSuggestion)for(console.assert(y==="forward");Re&&Re instanceof ns;)Re.isSuggestion=!1,Ve=a.offsetOf(Re),Re=Re.rightSibling;else if(y==="forward"){if(Re=Re.rightSibling,!Re||!(Re instanceof ns))return a.announce("plonk"),!1;for(;Re&&Re instanceof ns&&/[a-zA-Z\*]/.test(Re.value);)Ve=a.offsetOf(Re),Re=Re.rightSibling}else{if(Re=Re.leftSibling,!Re||!(Re instanceof ns))return a.announce("plonk"),!1;for(;Re&&Re instanceof ns&&/[a-zA-Z\*]/.test(Re.value);)Ve=a.offsetOf(Re),Re=Re.leftSibling}else if(y==="forward"&&Re.type==="mopen"){let ft=0;do Re.type==="mopen"?ft+=1:Re.type==="mclose"&&(ft-=1),Re=Re.rightSibling;while(!Re.isLastSibling&&ft!==0);Ve=a.offsetOf(Re.leftSibling)}else if(y==="backward"&&Re.type==="mclose"){let ft=0;do Re.type==="mopen"?ft+=1:Re.type==="mclose"&&(ft-=1),Re=Re.leftSibling;while(!Re.isFirstSibling&&ft!==0);Ve=a.offsetOf(Re)}else if(y==="backward")if(Re.type==="first")for(;Ve>0&&Re.type==="first";)Ve-=1,Re=a.at(Ve);else{const ft=Re.type;Re.type==="subsup"&&(Ve=a.offsetOf(a.at(Ve).leftSibling)),Ve-=1;let St=(ee=a.at(Ve))==null?void 0:ee.type;for(;Ve>=0&&St===ft;)((re=a.at(Ve))==null?void 0:re.type)==="subsup"?Ve=a.offsetOf(a.at(Ve).leftSibling):Ve-=1,St=a.at(Ve).type}else{const{type:ft}=Re;let St=(ae=a.at(Ve))==null?void 0:ae.type;const{lastOffset:wn}=a;for(;Ve<=wn&&(St===ft||St==="subsup");){for(;((de=a.at(Ve).rightSibling)==null?void 0:de.type)==="subsup";)Ve=a.offsetOf(a.at(Ve).rightSibling);Ve+=1,St=(he=a.at(Ve))==null?void 0:he.type}Ve-=1}if((ge=b==null?void 0:b.extend)!=null&&ge){if(!a.setSelection(a.anchor,Ve))return a.announce("plonk"),!1}else{if(Ve===a.position)return a.announce("plonk"),!1;a.position=Ve}return a.announce("move",we),a.mathfield.stopCoalescingUndo(),!0}function Cl(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[de,he]=g0(a);de!==void 0&&he!==void 0&&a.deleteAtoms([de,he])}if(y==="upward")return $g(a,b);if(y==="downward")return zg(a,b);if(b.extend){let de=$f(a,a.position,y);de<0&&(de=0),de>a.lastOffset&&(de=a.lastOffset);const he=a.setSelection(a.anchor,de);return a.mathfield.stopCoalescingUndo(),he}if(a.selectionIsPlaceholder){a.collapseSelection(y);const de=Cl(a,y);return a.mathfield.stopCoalescingUndo(),de}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,R0(a,re)||(re=$f(a,re,y))):re=$f(a,re,y),re<0||re>a.lastOffset){let de=!0;return a.silenceNotifications||(de=(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),de&&a.announce("plonk"),de}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function $f(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||R0(a,y)?y:$f(a,y,b)}function R0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function Fg(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=Cc(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function zf(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(ge=>ge.type==="prompt"&&!ge.captureSelection):b,de=Cc(a.mathfield.getHTMLElement(y)).right,he=a.offsetOf(Fg(a.mathfield,ae,de))-(re?1:0);if(E){const[ge,we]=a.selection.ranges[0];let Re;he<(ee==="up"?ge:we)?Re={ranges:[[he,we]],direction:"backward"}:Re={ranges:[[ge,he]],direction:"forward"},a.setSelection(Re)}else a.setPositionHandlingPlaceholder(he);a.announce(`move ${ee}`)}function $g(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const re=()=>{var he,ge;let we=!0;return a.silenceNotifications||(we=(ge=(he=a.mathfield.host)==null?void 0:he.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(we?"plonk":"line"),we},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="below"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof oa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof oa){const he=de.parent;if(de.parentBranch[0]<1)return re();const ge=de.parentBranch[0]-1,we=he.array[ge][de.parentBranch[1]];if(!we.some(Ve=>Ve.type==="prompt"&&!Ve.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,we,ee,"up")}else if(de){const he=(E=de.parent.branch("above"))!=null?E:de.parent.createBranch("above");if(!he.some(we=>we.type==="prompt"&&we.placeholderId)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,he,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 he,ge;let we=!0;return a.silenceNotifications||(we=(ge=(he=a.mathfield.host)==null?void 0:he.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(we?"plonk":"line"),we},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="above"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof oa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof oa){const he=de.parent;if(de.parentBranch[0]+1>he.array.length-1)return re();const ge=de.parentBranch[0]+1,we=he.array[ge][de.parentBranch[1]];if(!we.some(Ve=>Ve.type==="prompt"&&!Ve.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,we,ee,"down")}else if(de){const he=(E=de.parent.branch("below"))!=null?E:de.parent.createBranch("below");if(!he.some(we=>we.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,he,ee,"down")}else return re();return!0}function B0(a){const y=a.position,b=a.at(y).parent;return b!=null&&b.parent?(a.position=a.offsetOf(b),a.mathfield.stopCoalescingUndo(),a.announce("move",y),!0):(a.announce("plonk"),!1)}function Kg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!1):E=!0,b=b.parent;return E?y:0}function Hg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!0):E=!1,b=b.parent;return E?y:0}function N0(a){var y;if(a.collapseSelection(),Kg(a)>=a.mathfield.options.scriptDepth[1])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=b.rightSibling)==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Vs({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function F0(a){var y;if(a.collapseSelection(),Hg(a)>=a.mathfield.options.scriptDepth[0])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=a.at(a.position+1))==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Vs({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(he){const ge=[],we=[];return[...he.querySelectorAll(`input, select, textarea, a[href], button,
|
|
|
[tabindex], audio[controls], video[controls],
|
|
|
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Ve,ft)=>{const St=E(Ve);St===0?ge.push(Ve):we.push({documentOrder:ft,tabIndex:St,node:Ve})}),we.sort((Ve,ft)=>Ve.tabIndex===ft.tabIndex?Ve.documentOrder-ft.documentOrder:Ve.tabIndex-ft.tabIndex).map(Ve=>Ve.node).concat(ge)}function y(he){return!(!b(he)||ee(he)||E(he)<0)}function b(he){return!(he.disabled||he.type==="hidden"&&he.tagName.toUpperCase()==="INPUT"||de(he))}function E(he){var ge;const we=Number.parseInt((ge=he.getAttribute("tabindex"))!=null?ge:"NaN",10);return Number.isNaN(we)?he.contentEditable==="true"||(he.nodeName==="AUDIO"||he.nodeName==="VIDEO")&&he.getAttribute("tabindex")===null?0:he.tabIndex:we}function ee(he){return he.tagName.toUpperCase()==="INPUT"&&he.type==="radio"&&!ae(he)}function re(he,ge){for(const we of he)if(we.checked&&we.form===ge)return we;return null}function ae(he){var ge;if(!he.name)return!0;const Re=((ge=he.form)!=null?ge:he.ownerDocument).querySelectorAll('input[type="radio"][name="'+he.name+'"]'),Ve=re(Re,he.form);return!Ve||Ve===he}function de(he){if(!Ct()||he===document.activeElement||he.contains(document.activeElement))return!1;if(getComputedStyle(he).visibility==="hidden")return!0;const ge=he.getBoundingClientRect();if(ge.width===0||ge.height===0)return!0;for(;he;){if(getComputedStyle(he).display==="none")return!0;he=he.parentElement}return!1}return Ct()?a(document.body):[]}function bs(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"?bs(a,[y.leftSibling,y]):bs(a,[y,y.leftSibling])}function ll(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 Kf(a,y,b=!0){var E,ee;const re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Cl(a,y);let ae;const de=a.at(a.anchor).parentPrompt;de?y==="forward"?ae=a.offsetOf(de)+1:ae=a.offsetOf(de.leftSibling):ae=Math.max(a.position+re,0);const he=Lh(a,ae,y);if(!he||y==="forward"&&a.offsetOf(he)<ae||y==="backward"&&a.offsetOf(he)>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 we=Wg();if(!document.activeElement||we.length<=1)return a.announce("plonk"),!1;let Re=we.indexOf(document.activeElement)+re;return Re<0&&(Re=we.length-1),Re>=we.length&&(Re=0),we[Re].focus(),a.mathfield.stopCoalescingUndo(),!0}return ll(a,he),!0}function Lh(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)}Ls({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 de=b.subsupPlacement?F0(a):N0(a);return a.mathfield.stopCoalescingUndo(),de}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=>B0(a),moveToNextChar:a=>Cl(a,"forward"),moveToPreviousChar:a=>Cl(a,"backward"),moveUp:a=>Cl(a,"upward"),moveDown:a=>Cl(a,"downward"),moveToNextWord:a=>Oc(a,"forward"),moveToPreviousWord:a=>Oc(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 Kf(a,"forward");const re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let Ve=re;for(;Ve&&Ve.mode==="text";)Ve=Ve.leftSibling;let ft=re;for(;((y=ft.rightSibling)==null?void 0:y.mode)==="text";)ft=ft.rightSibling;if(Ve&&ft)return bs(a,[Ve,ft])}if(re.rightSibling.mode==="text"){let Ve=re;for(;Ve&&Ve.mode==="text";)Ve=Ve.rightSibling;return Ve?(ll(a,(b=Ve.leftSibling)!=null?b:Ve),a.mathfield.switchMode("math"),!0):ll(a,a.lastOffset)}}const de=a.at(a.anchor).parentPrompt,he=de?a.offsetOf(de)+1:Math.max(a.position+1,0),ge=Lh(a,he,"forward");if(ge)return ll(a,ge);const we=$0(a,re,Ve=>Ve.type==="leftright"||Ve.type==="text","forward");if(we){if(we.mode==="text"){let Ve=we;for(;Ve&&Ve.mode==="text";)Ve=Ve.rightSibling;return bs(a,[(E=we.leftSibling)!=null?E:we,(ee=Ve.leftSibling)!=null?ee:Ve])}return bs(a,we)}const Re=re.parent;if(Re){if(Re.type==="leftright"||Re.type==="surd")return bs(a,Re);if(re.parentBranch==="superscript"&&Re.subscript)return bs(a,Re.subscript);if(re.parentBranch==="above"&&Re.below)return bs(a,Re.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return ll(a,Re);if(re.parentBranch==="above"||re.parentBranch==="below")return bs(a,Re)}return ll(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return Kf(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let de=b;for(;de&&de.mode==="text";)de=de.leftSibling;let he=b;for(;((y=he.rightSibling)==null?void 0:y.mode)==="text";)he=he.rightSibling;if(de&&he)return bs(a,[de,he])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?ll(a,b):ll(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lh(a,re,"backward");if(ae)return ll(a,ae);if(E==="math"){const de=$0(a,b,ge=>ge.type==="leftright"||ge.type==="text","backward");if(de){if(de.mode==="text"){let ge=de;for(;ge&&ge.mode==="text";)ge=ge.leftSibling;return bs(a,[de,ge])}return bs(a,de)}const he=b.parent;if(he){if(he.type==="leftright"||he.type==="surd")return bs(a,he);if(b.parentBranch==="subscript"&&he.superscript)return bs(a,he.superscript);if(b.parentBranch==="below"&&he.above)return bs(a,he.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return ll(a,he);if(b.parentBranch==="above"||b.parentBranch==="below")return bs(a,he)}return ll(a,0)}return!1},moveToMathfieldStart:a=>a.selectionIsCollapsed&&a.position===0?(a.announce("plonk"),!1):(a.position=0,a.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:a=>a.selectionIsCollapsed&&a.position===a.lastOffset?(a.announce("plonk"),!1):(a.position=a.lastOffset,a.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:N0,moveToSubscript:F0},{target:"model",changeSelection:!0}),Ls({moveToNextPlaceholder:a=>Kf(a,"forward"),moveToPreviousPlaceholder:a=>Kf(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function $0(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 Hf(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 Uu(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(Un.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Ah(a),a.contentDidChange({data:ya(re),inputType:"insertText"})}function Ah(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 Ug(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 Zg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!Sf(b))return!1;const ee=Lc(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Ug(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&Uu(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:de}=E.at(E.position);if(ae&&de instanceof Wa&&de.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 Uu(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){Uu(E,1);const he=E.at(E.position);return he.value="\u22C5",he.style.variant="normal",he.command="\\cdot",he.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 Uu(E,1),!0;if(/\([a-z][,;]$/.test(re))return Uu(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Ah(E),!0}else{if(y==="[Space]")return Hf(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Hf(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))return Hf(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 Hf(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>"+(vh(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 jg(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=Ef("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(_s("keystroke-caption"),_s("core"),Ef("mathlive-keystroke-caption-panel"))}function Gg(){document.getElementById("mathlive-keystroke-caption-panel")&&(bh("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){Nm(y);const ft=_d();a.keyboardLayout!==ft.id&&(a.keyboardLayout=ft.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let de,he="",ge;const we=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")we.pop();else if(!Sf(y))a.flushInlineShortcutBuffer();else{const ft=Lc(y),St=[...(E=(b=we[we.length-1])==null?void 0:b.keystrokes)!=null?E:[],ft];we.push({state:re.getState(),keystrokes:St,leftSiblings:Xg(a)});let wn=0,wr="";for(;!de&&wn<St.length;)ge=we.length-(St.length-wn),wr=St.slice(wn).join(""),de=dd(we[ge].leftSiblings,wr,a.options.inlineShortcuts),!de&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(wr)&&(de=a.options.onInlineShortcut(a,wr)),wn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(de?a.switchMode("math"):Zg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),he=""))}if(!de){if(he||(he=Um(a.keybindings,re.mode,y)),!he&&(ae==="[Enter]"||ae==="[Return]")){let ft=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(ft=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),ft||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),ft}if((!he||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return ra.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),he="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const ft=re.at(re.position+1),St=re.at(re.position-1);if((ft==null?void 0:ft.mode)==="text"||(St==null?void 0:St.mode)==="text")return ra.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===","&&Lc(y)===","&&(he="insertDecimalSeparator")}}if(!de&&!he){if(re.mathfield.smartFence){if(Dh(re,Lc(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:ft}=re.at(re.position);if(ft instanceof Wa&&ft.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),ft.isDirty=!0,ft.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:Lc(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const St=Lc(y);if(St==="("||St==="{"||St==="["){const wn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[St],wr={"(":")","{":"\\rbrace","[":"\\rbrack"}[St],[yn,er]=jo(re.selection);return a.snapshot(),re.position=er,ra.insert(re,wr,{format:"latex"}),re.position=yn,ra.insert(re,wn,{format:"latex"}),re.setSelection(yn+1,er+1),re.contentDidChange({data:St,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:Ve}=Re;if(he==="moveAfterParent"&&(Ve==null?void 0:Ve.type)==="leftright"&&Re.isLastSibling&&a.options.smartFence&&Dh(re,".",a.defaultStyle)&&(he="",Mo(a)),a.keyboardDelegate.cancelComposition(),he)a.executeCommand(he);else if(de){const ft=a.effectiveStyle;re.setState(we[ge].state);const St=we[we.length-1].keystrokes;for(const wn of St)ra.insert(re,wn,{silenceNotifications:!0,style:ft});a.snapshot("insert-shortcut"),re.setState(we[ge].state),re.deferNotifications({content:!0,selection:!0,data:de,type:"insertText"},()=>(ra.insert(re,de,{format:"latex",style:ft}),Ah(a.model),de.endsWith(" ")&&(a.switchMode("text"),ra.insert(re," ",{style:ft,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Th(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=rf(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(he=>he.toUpperCase())),b.simulateKeystroke){let he=!0;for(const ge of ee)K0(a,new KeyboardEvent("keypress",{key:ge}))&&(he=!1);if(he)return}const ae=E.at(E.position),de=xe(xe({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(jo(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Mf(a);for(const he of ee)ra.insert(E,he);a.snapshot("insert-latex"),Ad(a)});else if(E.mode==="text"){for(const he of ee)ra.insert(E,he,{style:de});a.snapshot("insert-text")}else if(E.mode==="math")for(const he of ee)qg(a,he,de,ae);a.dirty=!0,a.scrollIntoView()}function Xg(a){const y=a.model,b=[];let E=y.at(Math.min(y.position,y.anchor));for(;E.type!=="first";)b.push(E),E=E.leftSibling;return b}function qg(a,y,b,E){const ee=a.model;let 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){Yg(ee),ra.insert(ee,y,{style:b}),a.snapshot(),B0(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=xe({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}ra.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Yg(a){a.selectionIsCollapsed||(a.deleteAtoms(jo(a.selection)),a.mathfield.snapshot("delete"))}function Dh(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],de=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[he,ge]=jo(a.selection),we=a.extractAtoms([he,ge]),Re=ee.addChildrenAfter([new Wa("left...right",we,{leftDelim:re,rightDelim:de})],a.at(he));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 he=ee instanceof Wa?ee.leftDelim+ee.rightDelim:"";if(he==="\\lbrace\\rbrace"||he==="\\{\\}"||he==="\\lbrace?")return a.mathfield.snapshot(),ra.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(de){if(ee instanceof Wa&&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 Wa)){let Re=E;for(;Re&&!(Re.type==="mclose"&&Re.value===de);)Re=Re.rightSibling;if(Re){a.mathfield.snapshot();const Ve=a.extractAtoms([a.offsetOf(E),a.offsetOf(Re)]);return Ve.pop(),ee.addChildrenAfter([new Wa("left...right",Ve,{leftDelim:re,rightDelim:de})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const he=a.offsetOf(E.lastSibling);let ge;for(ge=a.position;ge<=he;ge++){const Re=a.at(ge);if(Re instanceof Wa&&(Re.leftDelim==="?"||Re.leftDelim===".")&&H0(re,Re.rightDelim))break}const we=a.at(ge);if(ge<=he&&we instanceof Wa){we.leftDelim=re,a.mathfield.snapshot();let Re=a.extractAtoms([a.position,ge-1]);return Re=Re.filter(Ve=>Ve.type!=="first"),we.addChildren(Re,we.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Wa&&(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 Ve of Re)ee.parent.addChildBefore(Ve,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Wa&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),ra.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Re=a.offsetOf(E.lastSibling),Ve=a.extractAtoms([a.position,Re]);a.at(a.position).body=Ve,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let he=E;for(;he;){if(he.type==="mopen"&&he.value===ae){a.mathfield.snapshot();const ft=he.leftSibling,St=a.extractAtoms([a.offsetOf(he.leftSibling),a.offsetOf(E)]);St.shift();const wn=new Wa("left...right",St,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([wn],ft),a.position=a.offsetOf(wn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}he=he.leftSibling}if(ee instanceof Wa&&E.isLastSibling&&Ih(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 ge=a.offsetOf(E.firstSibling);let we;for(we=a.position;we>=ge;we--){const ft=a.at(we);if(ft instanceof Wa&&(ft.rightDelim==="?"||ft.rightDelim===".")&&Ih(ft.leftDelim,re))break}const Re=a.at(we);if(we>=ge&&Re instanceof Wa)return a.mathfield.snapshot(),Re.rightDelim=re,Re.addChildren(a.extractAtoms([we,a.position]),Re.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Wa&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Ih(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 Ve=ee.parent;return Ve instanceof Wa&&(Ve.rightDelim==="?"||Ve.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Ve),Dh(a,re,b)):!1}return!1}function Ih(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}Ls({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:jg,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)=>(Th(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}}),Ls({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"}),Ls({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})&&(Ad(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),Mo(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function Jg(a,y){a.flushInlineShortcutBuffer(),a.stopCoalescingUndo();const b=Ph(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=xe(xe({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>Eh(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Ls({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function Ph(a,y){var b,E,ee,re,ae,de,he,ge,we,Re;const Ve={};if(typeof y.color=="string"){const St=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";St!==y.color&&(Ve.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Ve.color=St}if(typeof y.backgroundColor=="string"){const St=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";St!==y.backgroundColor&&(Ve.verbatimBackgroundColor=(de=y.verbatimBackgroundColor)!=null?de:y.backgroundColor),Ve.backgroundColor=St}typeof y.fontFamily=="string"&&(Ve.fontFamily=y.fontFamily),typeof y.series=="string"&&(Ve.fontSeries=y.series),typeof y.fontSeries=="string"&&(Ve.fontSeries=y.fontSeries.toLowerCase()),Ve.fontSeries&&(Ve.fontSeries=(he={bold:"b",medium:"m",normal:"m"}[Ve.fontSeries])!=null?he:Ve.fontSeries),typeof y.shape=="string"&&(Ve.fontShape=y.shape),typeof y.fontShape=="string"&&(Ve.fontShape=y.fontShape.toLowerCase()),Ve.fontShape&&(Ve.fontShape=(ge={italic:"it",up:"n",upright:"n",normal:"n"}[Ve.fontShape])!=null?ge:Ve.fontShape),y.variant&&(Ve.variant=y.variant.toLowerCase()),y.variantStyle&&(Ve.variantStyle=y.variantStyle.toLowerCase());const ft=(we=y.size)!=null?we:y.fontSize;return typeof ft=="number"?Ve.fontSize=Math.max(1,Math.min(10,ft)):typeof ft=="string"&&(Ve.fontSize=(Re={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[ft.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}[ft]),Ve}function Oh(a){let[y,b]=jo(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 de=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!ve.test(ae.value));)y+=de,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+=de,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=de,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=de,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=de,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+de))!=null&&E.isDigit();)y+=de;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let he=(ee=a.at(y))==null?void 0:ee.style;for(;he&&he.variant===ae.style.variant&&he.variantStyle===ae.style.variantStyle;)he=(re=a.at(y+de))==null?void 0:re.style,y+=de;return b==="backward"?y-1:y}return y}return y}Ls({selectGroup:a=>{const y=Oh(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Cl(a,"forward",{extend:!0}),extendSelectionBackward:a=>Cl(a,"backward",{extend:!0}),extendToNextWord:a=>Oc(a,"forward",{extend:!0}),extendToPreviousWord:a=>Oc(a,"backward",{extend:!0}),extendSelectionUpward:a=>Cl(a,"upward",{extend:!0}),extendSelectionDownward:a=>Cl(a,"downward",{extend:!0}),extendToNextBoundary:a=>Oc(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>Oc(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 Zu=null,Rd=0,Wf=class qs{static start(y,b,E,ee){var re;qs.element=y,(re=qs.controller)==null||re.abort(),qs.controller=new AbortController;const ae={signal:qs.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Rh(b)&&(qs.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=qs.controller)==null||y.abort(),qs.controller=void 0,typeof qs.pointerId=="number"&&(qs.element.releasePointerCapture(qs.pointerId),qs.pointerId=void 0)}};function Rh(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function U0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,re=!1,ae=!1,de="none",he=!1,ge=!1;const we=y.clientX,Re=y.clientY,Ve=Date.now(),ft=E.field,St=setInterval(()=>{he?ft.scroll({top:0,left:ft.scrollLeft-16}):ge&&ft.scroll({top:0,left:ft.scrollLeft+16})},32);function wn(){Wf.stop(),re=!1,clearInterval(St),a.element.classList.remove("tracking"),y&&y.preventDefault()}function wr(er){if(!E.hasFocus()){wn();return}const kr=er.clientX,lr=er.clientY,si=Rh(er)&&er.pointerType==="touch"?20:5;if(Date.now()<Ve+500&&Math.abs(we-kr)<si&&Math.abs(Re-lr)<si){er.preventDefault(),er.stopPropagation();return}const Ii=ft.getBoundingClientRect();ge=kr>Ii.right,he=kr<Ii.left;let vi=ee;Rh(er)&&(er.isPrimary||(vi=Bd(E,er.clientX,er.clientY,{bias:0})));const Pa=Bd(E,kr,lr,{bias:kr<=we?kr===we?0:-1:1});vi>=0&&Pa>=0&&(E.model.extendSelectionTo(vi,Pa),Mo(a)),ae&&Oh(E.model)}Zu&&Math.abs(Zu.x-we)<5&&Math.abs(Zu.y-Re)<5&&Date.now()<Zu.time+500?(Rd+=1,Zu.time=Ve):(Zu={x:we,y:Re,time:Ve},Rd=1);const yn=ft.getBoundingClientRect();if(we>=yn.left&&we<=yn.right&&Re>=yn.top&&Re<=yn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Bd(a,we,Re,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const er=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||er?de="all":de="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),de="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),de="selection"):(a.model.position=ee,v0(a.model)?de="all":de="selection");a.defaultStyle={},y.detail===3||Rd>2?(wn(),(y.detail===3||Rd===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},de="all")):re||(re=!0,Wf.start(ft,y,wr,wn),(y.detail===2||Rd===2)&&(ae=!0,Oh(a.model),de="all"))}a.hasFocus()||(de="none",a.focus({preventScroll:!0}))}else Zu=null;a.stopCoalescingUndo(),de!=="none"&&(a.model.selectionIsCollapsed&&(de="all"),Mo(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 Z0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=lu(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 de of b.children){const he=Z0(a,y,de,E,ee);he[0]<=ae[0]&&(ae=he)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=Z0(a,new Map,a.model.root,y,b);return E}function Bd(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 de=[];let he=ae;for(;he;)de.unshift(he),he=he.parent;for(const we of de)if(we.captureSelection){ae=we;break}let ge=a.model.offsetOf(ae);if(ge<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const we=lu(a,ae);we&&y<(we.left+we.right)/2&&(ge=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ge=a.model.offsetOf(ae.leftSibling));return ge}var tv=class extends ra{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=du(re),{model:de}=a;de.selectionIsCollapsed||de.deleteAtoms(jo(de.selection));const he=de.at(de.position);if(he.parent instanceof oa){console.assert(he.parentBranch!==void 0);const ge=[];let we=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const St of ae)St.type==="first"&&we.length>0?(ge.push(we),we=[St]):we.push(St);we.length>0&&ge.push(we);let Re=Number(he.parentBranch[0]),Ve=Number(he.parentBranch[1]);const ft=he.parent.maxColumns;for(;he.parent.colCount-Ve<ge.length&&he.parent.colCount<ft;)he.parent.addColumn();he.parent.addChildrenAfter(ge[0],he);for(let St=1;St<ge.length;St++)Ve++,Ve>=ft&&(Ve=0,he.parent.addRowAfter(Re),Re++),he.parent.setCell(Re,Ve,ge[St])}else he.parent.addChildrenAfter(ae.filter(ge=>ge.type!=="first"),he);return de.position=de.offsetOf(ae[ae.length-1]),de.contentDidChange({inputType:"insertFromPaste"}),Mo(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]=yl(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),Mo(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 de=a.silenceNotifications;a.silenceNotifications=!0;const he={"?":"\\placeholder{}","@":"\\placeholder{}"};he[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(jo(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 ge=-1;he[0]?he["@"]=he[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ge=rv(a),ge>=0&&(he["@"]=a.getValue(ge,a.position,"latex"))),he[0]||(he[0]=he["?"]);let we=!1;const Re=kr=>(we=!0,he[kr]);let[Ve,ft]=V0(a,y,Re,b);if(!ft)return!1;const St=ft.length===1&&ft[0].type==="genfrac";St&&ge>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(he["@"]=he["?"],we=!1,[Ve,ft]=V0(a,y,Re,b)):ge>=0&&a.deleteAtoms([ge,a.position]);const{parent:wn}=a.at(a.position),wr=wn.hasEmptyBranch("body");if(St&&Ve!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&wn instanceof Wa&&wn.leftDelim==="("&&wr){const kr=wn.parent,lr=wn.parentBranch;kr.removeChild(wn),kr.setChildren(ft,lr)}const yn=a.at(a.position);yn.parent.addChildrenAfter(ft,yn),Ve==="latex"&&typeof y=="string"&&(wn==null?void 0:wn.type)==="root"&&wr&&!we&&(wn.verbatimLatex=y),a.silenceNotifications=de;const er=ft[ft.length-1];if(b.selectionMode==="placeholder"){const kr=ft.flatMap(lr=>[lr,...lr.children]).find(lr=>lr.type==="placeholder");if(kr){const lr=a.offsetOf(kr);a.setSelection(lr-1,lr),a.announce("move")}else er&&(a.position=a.offsetOf(er))}else b.selectionMode==="before"||(b.selectionMode==="after"?er&&(a.position=a.offsetOf(er)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(er)));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 de=window.MathfieldElement.computeEngine;if(!de)return["math-json",[]];[re,y]=["latex",de.box(y).latex],ae=Xo(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=Ou(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=Xo(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Uf(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=Ou(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=yl(y)),ae=Xo(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Uf(ae));return hu(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 Wa&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Uf(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof Wa&&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)){Uf(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof oa)for(const b of y.cells)Uf(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||j0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(j0(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 j0(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 ra{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"),Mo(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(jo(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(hu(re,b.style),!re)return!1;const ae=a.at(a.position),de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),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 "),Xo(a,{context:y,parseMode:"text"})}new iv;function Ml(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var fo=4,Cs=20,Fo=2*(Cs+fo),Zf=(a,y)=>`
|
|
|
<line x1="${a+Cs}" y1="${y+Cs}"
|
|
|
x2="${a>y?a+Cs:7*Cs+10*fo}"
|
|
|
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
|
|
|
<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>`,G0=(a,y)=>`
|
|
|
<line x1="${a+Cs}" y1="${y+Cs}"
|
|
|
x2="${a>y?a+Cs:7*Cs+10*fo}"
|
|
|
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
|
|
|
<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>`,Vf=(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*Cs+10*fo+5} ${8*Cs+10*fo+5}">
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background rows"
|
|
|
x="0"
|
|
|
y="${Fo+fo}"
|
|
|
height="${3*Fo}"
|
|
|
width="${Fo}"
|
|
|
rx="${Fo/2}"/>
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background columns"
|
|
|
x="${Fo+fo}"
|
|
|
y="0"
|
|
|
height="${Fo}"
|
|
|
width="${3*Fo}"
|
|
|
rx="${Fo/2}"/>
|
|
|
<g data-command='"moveDown"'>
|
|
|
${Vf(2*(fo+Fo),2*fo+3*Fo,0)}
|
|
|
</g>
|
|
|
<g data-command='"moveUp"'>
|
|
|
${Vf(2*(fo+Fo),2*fo+Fo,180)}
|
|
|
</g>
|
|
|
<g data-command='"moveToNextWord"'>
|
|
|
${Vf(2*fo+3*Fo,2*(fo+Fo),-90)}
|
|
|
</g>
|
|
|
<g data-command='"moveToPreviousWord"'>
|
|
|
${Vf(2*fo+Fo,2*(fo+Fo),90)}
|
|
|
</g>
|
|
|
<g>
|
|
|
|
|
|
<g data-command='"addColumnBefore"'>
|
|
|
${Zf(2*fo+Fo,fo)}
|
|
|
</g>
|
|
|
<g data-command='"removeColumn"'>
|
|
|
${G0(2*fo+2*Fo,fo)}
|
|
|
</g>
|
|
|
<g data-command='"addColumnAfter"'>
|
|
|
${Zf(2*fo+3*Fo,fo)}
|
|
|
</g>
|
|
|
<g data-command='"addRowBefore"'>
|
|
|
${Zf(fo,2*fo+Fo)}
|
|
|
</g>
|
|
|
<g data-command='"removeRow"'>
|
|
|
${G0(fo,2*fo+2*Fo)}
|
|
|
</g>
|
|
|
<g data-command='"addRowAfter"'>
|
|
|
${Zf(fo,2*fo+3*Fo)}
|
|
|
</g>
|
|
|
</svg>`,sv=a=>`
|
|
|
<svg id="matrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","matrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,lv=a=>`
|
|
|
<svg id="pmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","pmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
|
|
|
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,X0=a=>`
|
|
|
<svg id="Bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","Bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,uv=a=>`
|
|
|
<svg id="bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4h-3v16h3"/>
|
|
|
<path class="cls-2" d="m22,4h3v16h-3"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,cv=a=>`
|
|
|
<svg id="vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
|
|
|
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
|
|
|
</svg>`,dv=a=>`
|
|
|
<svg id="Vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
|
|
|
data-command='["setEnvironment","Vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
|
|
|
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
|
|
|
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
|
|
|
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
|
|
|
</svg>`,fv=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>`,hv=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>`,Bh={matrix:sv,pmatrix:lv,bmatrix:uv,Bmatrix:X0,vmatrix:cv,Vmatrix:dv},Nh={cases:fv,rcases:hv,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(St=>{(!ee||St.length>ee)&&(ee=St.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Ef("mathlive-environment-popover"),_s("environment-popover"),_s("core"),re.setAttribute("aria-hidden","true"));let ae;const de=re.querySelector(".MLEP__environment-controls");de?ae=de:(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 he=[],ge="";const we=a.model.parentEnvironment.environmentName;if(cs(we)){const St=gv(we);ge=Bh[St]("active");const wn=Bh,{[St]:wr}=wn,yn=mt(wn,[Te(St)]);he=Object.values(yn).map(er=>er("inactive"))}else if(ds(we)){const St=vv(we);ge=Nh[St]("active");const wn=Nh,{[St]:wr}=wn,yn=mt(wn,[Te(St)]);he=Object.values(yn).map(er=>er("inactive"))}else Io(we)&&(ge=Bh.matrix("active"),he=Object.values(Nh).map(St=>St("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'>
|
|
|
${ge}
|
|
|
${he.join("")}
|
|
|
</div>`,ge&&ae.appendChild(Re),ae.querySelectorAll("[data-command]").forEach(St=>{const wn=St.dataset.command;let wr=wn;try{wr=JSON.parse(wn)}catch(yn){}St.addEventListener("mousedown",yn=>yn.preventDefault()),wr&&St.addEventListener("click",()=>a.executeCommand(wr))});const ft=(b=a.field)==null?void 0:b.getBoundingClientRect();ft&&(re.style.top=`${window.scrollY+(ft.top-re.clientHeight-15)}px`,re.style.left=`${ft.left+20}px`,re.classList.add("is-visible"))}function Fh(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bh("mathlive-environment-popover"),x("environment-popover"),x("core"))}function jf(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&bo(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Fh()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function q0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function Y0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function $h(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=q0(a))!=null?b:"ltr";a.style.position="fixed",a.style.left="",a.style.top="",a.style.right="",a.style.bottom="",a.style.height="",a.style.width="";const ae=a.getBoundingClientRect(),de=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let he=Math.min(de,(E=y.height)!=null?E:ae.height),ge=$h(y.location.y,he,y.verticalPos,re);ge+he>window.innerHeight-8&&(y.alternateLocation?(ge=$h(y.alternateLocation.y,he,y.verticalPos,re),ge+he>window.innerHeight-8&&(ge=void 0)):ge=void 0),Number.isFinite(ge)||(ge=Math.max(8,window.innerHeight-8-he),8+he>window.innerHeight-8&&(a.style.bottom="8px")),he=Math.min(ge+he,window.innerHeight-8)-ge;const we=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Re=Math.min(we,(ee=y.width)!=null?ee:ae.width),Ve=$h(y.location.x,Re,y.horizontalPos,re);Ve+Re>window.innerWidth-8&&(y.alternateLocation?(Ve=yv(y.alternateLocation.x,Re,y.verticalPos,re),Ve+Re>window.innerWidth-8&&(Ve=void 0)):Ve=void 0),Number.isFinite(Ve)||(Ve=Math.max(8,window.innerWidth-8-Re),8+Re>window.innerWidth-8&&(a.style.right="8px")),Re=Math.min(Ve+Re,window.innerWidth-8)-Ve,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Ve-Re).toString()}px`:a.style.left=`${Math.ceil(Ve).toString()}px`,a.style.top=`${Math.ceil(ge).toString()}px`,he!==ae.height&&(a.style.height=`${Math.ceil(he).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 Rc(a){return"submenu"in a}function El(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zh(a){return"type"in a&&a.type==="divider"}function Kh(a){return"type"in a&&a.type==="heading"}var J0={};function Hh(a){let y=J0[a];if(!y){let b;switch(a){case"checkmark":b=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
|
|
|
</span>`;break;case"trailing-chevron":b='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":b='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(b){const E=document.createElement("template");E.innerHTML=b,J0[a]=E,y=E}}if(y){if("content"in y)return y.content.cloneNode(!0);const b=document.createElement("svg");return b.innerHTML=y.innerHTML,b}}var Q0=80,ep=class{constructor(a,y){this._element=null;var b;this.parentMenu=y,this._declaration=a,Rc(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=El(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(zh(ee)){this.enabled=!1,this.checked=!1;return}Kh(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),El(ee)&&(this.checked=El(ee)&&((y=Bc(ee.checked,a))!=null?y:!1)),(El(ee)||Rc(ee))&&(this.enabled=(b=Bc(ee.enabled,a))!=null?b:!0,this.visible=(E=Bc(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(El(ee)||Kh(ee)||Rc(ee))&&(this.label=Bc(ee.label,a),this.tooltip=Bc(ee.tooltip,a),this.ariaLabel=Bc(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(Hh("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hh("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),El(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vh(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hh("trailing-chevron"))}get element(){if(this._element)return this._element;if(zh(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,(El(this._declaration)||Kh(this._declaration)||Rc(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(!El(this._declaration))return;const a=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(a)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(a){var y;if(!(!this.visible||!this.enabled)){if(a.type==="click"){this.rootMenu.state==="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}if(a.type==="pointerenter"){const b=a;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((y=this.parentMenu.activeMenuItem)!=null&&y.movingTowardSubmenu(b))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(a.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(a.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Q0)},Q0)}openSubmenu(a){var y;if(this.type!=="submenu"||!this.element)return;if((y=a==null?void 0:a.withDelay)!=null&&y){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const b=this.element.getBoundingClientRect(),E=q0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Y0(b,"trailing",E),y:b.top-4},alternateLocation:{x:Y0(b,"leading",E),y:b.top-4}})}movingTowardSubmenu(a){if(!this.element||this.type!=="submenu")return!1;const y=this.rootMenu.lastMoveEvent;if(!y)return!1;const b=a.timeStamp-y.timeStamp;if(b>500)return!1;const E=a.clientX-y.clientX;if(wv(E,y.clientY-a.clientY,b)<=.2)return!1;let re="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),de=this.element.getBoundingClientRect();ae.left<de.left+de.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function Bc(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 Uc{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(ge=>ge.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ge=>ge.visible&&ge.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ge=>ge.updateState(y));let ae,de=0;for(const ge of this._menuItems)ge.type==="heading"?(ae&&de===0&&(ae.visible=!1),ae=ge,de=0):ge.type==="divider"&&ae?(ae.visible=de>0,ae=void 0,de=0):ae&&ge.visible&&(de+=1);ae&&(ae.visible=de>0);let he=!0;for(const ge of this._menuItems)ge.type==="divider"?(ge.visible=!he,he=!0):ge.visible&&(he=!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 Uc._collator||(Uc._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Uc._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(de=>de.type!=="divider"&&de.visible&&de.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(de=>de.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(de=>Uc.collator.compare(y,de.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=Nu(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Nu(y));let re=!0;const ae=this.activeSubmenu,de=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":de==null||de.select(Nu(y));break;case"ArrowRight":if((de==null?void 0:de.type)==="submenu")de.select(Nu(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!de)ae.activeMenuItem=ae.firstMenuItem;else{const he=(b=ae.getMenuItemColumn(de))!=null?b:-1;if(he>=0&&he<((E=ae.columnCount)!=null?E:1)-1){const ge=ae.nextMenuItem(1);ge&&(ae.activeMenuItem=ge)}}break;case"ArrowLeft":if(ae===this.rootMenu)de||(ae.activeMenuItem=ae.firstMenuItem);else if((de&&(ee=ae.getMenuItemColumn(de))!=null?ee:-1)<=0||!de){ae.hide();const ge=ae.parentMenu.activeMenuItem;if(ge){const{element:we}=ge;we==null||we.focus(),we==null||we.classList.remove("is-submenu-open")}}else{const ge=ae.nextMenuItem(-1);ge&&(ae.activeMenuItem=ge)}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 he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Sf(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),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 wl.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),wl.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),wl.state==="open"&&wl.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(pe(xe({},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,wl.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 zh(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(El(a)||Rc(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||El(a)&&typeof a.checked=="function"?!0:Rc(a)?a.submenu.some(rp):!1}var Gf=class{};Gf.DELAY=300,Gf.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=wf(a);E||y(!1);let ee=E;const re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Gf.MAX_DISTANCE)},Gf.DELAY),ae=new AbortController,de=ae.signal;for(const he of["pointermove","pointerup","pointercancel"])window.addEventListener(he,ge=>{if(ge.type==="pointerup"||ge.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ge.type==="pointermove"){const we=wf(ge);we&&(ee=we)}},{passive:!0,signal:de})})}function ip(a,y,b){return gu(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:wf(E),modifiers:Nu(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:Nu(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=wf(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};Kt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(pe(xe({},a),{body:st(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),Kt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=tn(st(a.args[0]));return new z(pe(xe({},a),{body:st(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),Kt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(pe(xe({},a),{body:st(a.args[0]),svgAccent:"overarc"}))}),Kt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new js(pe(xe({},a),{body:st(a.args[0]),svgBelow:"underarc"}))}),Kt("utilde","{body:auto}",{createAtom:a=>{const y=st(a.args[0]),b=tn(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new js(pe(xe({},a),{body:y,svgBelow:E,boxType:ru(y)}))}}),Kt("^","{:string}",{createAtom:a=>{var y;return new Un(pe(xe({},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:"^"}))}}),Kt("`","{:string}",{createAtom:a=>{var y;return new Un(pe(xe({},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:"`"}))}}),Kt("'","{:string}",{createAtom:a=>{var y;return new Un(pe(xe({},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:"'"}))}}),Kt('"',"{:string}",{createAtom:a=>{var y,b;return new Un(pe(xe({},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]:'"'}))}}),Kt(".","{:string}",{createAtom:a=>{var y,b;return new Un(pe(xe({},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]:"."}))}}),Kt("=","{:string}",{createAtom:a=>{var y,b;return new Un(pe(xe({},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]:"="}))}}),Kt("~","{:string}",{createAtom:a=>{var y;return new Un(pe(xe({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"}))}}),Kt("c","{:string}",{createAtom:a=>{var y;return new Un(pe(xe({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),Kt("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 de of ae){const he=de.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(he)ee.strokeWidth=he[1],ee.strokeStyle=he[2],ee.strokeColor=he[3];else{const ge=de.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ge&&(ge[1]==="mathbackground"?ee.backgroundcolor=ge[2]:ge[1]==="mathcolor"?ee.strokeColor=ge[2]:ge[1]==="padding"?ee.padding=ge[2]:ge[1]==="shadow"&&(ee.shadow=ge[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 bd(a.command,st(E[2]),re,ee)}}),Kt("cancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,st(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:{}})}}),Kt("bcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,st(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:{}})}}),Kt("xcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,st(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:{}})}}),Kt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new js(pe(xe({},a),{body:st((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),Kt("overbrace","{:auto}",{createAtom:a=>new js(pe(xe({},a),{body:st(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),Kt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new js(pe(xe({},a),{body:st(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),Kt(["underbrace"],"{:auto}",{createAtom:a=>new js(pe(xe({},a),{body:st(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),Kt(["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 js(pe(xe({},a),{svgBody:a.command.slice(1),above:((b=st((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:st((E=a.args)==null?void 0:E[1]),below:(re=st((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)}`}),Kt(["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 Bu(a.command.slice(1),pe(xe({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Kt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new Bu({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],pe(xe({},a),{limits:"over-under",variant:"main"}))}),Kt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new Bu(a.command.slice(1),pe(xe({},a),{limits:"over-under",variant:"main"}))}),Kt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new Bu(a.command.slice(1),pe(xe({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),Kt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Un(pe(xe({},a),{body:st(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 Er("\xB0",{style:pe(xe({},a.style),{variant:"normal",variantStyle:"up"})});return new Er([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),Kt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(pe(xe({},a),{body:st(a.args[1]),index:a.args[0]?st(a.args[0]):void 0}))}),Kt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=xe({},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 kc(E[0]?st(E[0]):[new $i],E[1]?st(E[1]):[new $i],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}`:co(a.command,b,E)}}),Kt(["brace","brack"],"",{infix:!0,createAtom:a=>new kc(st(a.args[0]),st(a.args[1]),pe(xe({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Kt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new kc(st(E[0]),st(E[1]),pe(xe({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Kt(["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 kc(st(E[0]),st(E[1]),pe(xe({},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)}`}),Kt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new kc(st(a.args[0]),st(a.args[1]),pe(xe({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Kt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new fh({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)],pe(xe({},a),{limits:"auto",variant:"main"}))}),Kt("smallint","",{ifMode:"math",createAtom:a=>new Bu("\u222B",pe(xe({},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"};Kt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new fh(b,pe(xe({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),Kt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new Bu({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],pe(xe({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Kt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(pe(xe({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),Kt("the","{:value}",{createAtom:a=>new Un(pe(xe({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new La({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new Er(((b=Do(re))!=null?b:"").split("").map(ae=>new Er(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:xe({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=Do(a.args[0]))!=null?y:"\\relax"}`}}),Kt("mathtip","{:auto}{:math}",{createAtom:a=>new hh(pe(xe({},a),{body:st(a.args[0]),tooltip:st(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Un.serialize([a.tooltip],pe(xe({},y),{defaultMode:"math"}))}}`}),Kt("texttip","{:auto}{:text}",{createAtom:a=>new hh(pe(xe({},a),{body:st(a.args[0]),tooltip:st(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Un.serialize([a.tooltip],pe(xe({},y),{defaultMode:"text"}))}}`}),Kt("error","{:math}",{createAtom:a=>new Un(pe(xe({},a),{body:st(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),Kt("ensuremath","{:math}",{createAtom:a=>new Un(pe(xe({},a),{body:st(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(pe(xe({},y),{defaultMode:"math"}))}}`}),Kt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Kt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Kt("boxed","{content:math}",{createAtom:a=>new ko(pe(xe({},a),{body:st(a.args[0]),framecolor:{string:"black"}}))}),Kt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Do(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),Kt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ko(pe(xe({},a),{body:st(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(pe(xe({},y),{defaultMode:"text"})):co(a.command,(b=Do(a.framecolor))!=null?b:"",(E=Do(a.backgroundcolor))!=null?E:"",a.bodyToLatex(pe(xe({},y),{defaultMode:"text"})))}}),Kt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=st(a.args[1]);return b?new ko(pe(xe({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ko(pe(xe({},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=Do(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Do(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return co(ee,a.bodyToLatex(y))}}),Kt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Un(pe(xe({},a),{body:st(a.args[0])})),render:(a,y)=>{const b=new La({parent:y,mathstyle:a.command.slice(1)},a.style),E=Un.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):`{${ya([a.command,a.bodyToLatex(y)])}}`}),Kt(["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]})}),Kt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),Kt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),Kt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),Kt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Kt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Kt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Un(pe(xe({},a),{body:st(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),Kt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Kt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Kt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Kt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Kt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Kt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Kt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Kt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Kt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Kt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Kt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Kt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Kt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Kt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Kt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Kt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Kt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Kt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Kt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Kt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Kt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Kt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Kt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Kt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Kt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Kt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Kt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Kt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Kt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Kt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Kt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Kt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Un(pe(xe({},a),{type:"mord",body:st(a.args[0]),mode:"math"})),serialize:(a,y)=>co("\\mbox",a.bodyToLatex(pe(xe({},y),{defaultMode:"text"})))}),Kt("text","{:text}",{ifMode:"math",applyMode:"text"}),Kt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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:""})}}),Kt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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}}),Kt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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}}),Kt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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}}),Kt("em","{:rest}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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"})}),Kt("emph","{:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(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}};Kt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(pe(xe({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),Kt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new Sd(pe(xe({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Kt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new Sd(pe(xe({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Kt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Un(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===Du||E===ml)&&(b=1),(E===zl||E===ss)&&(b=2),(E===ks||E===Vo)&&(b=3);const ee=st(a.args[b]);return Un.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Un.serialize(a.args[0],y)}}{${Un.serialize(a.args[1],y)}}{${Un.serialize(a.args[2],y)}}{${Un.serialize(a.args[3],y)}}`}),Kt("mathop","{:auto}",{createAtom:a=>new Un(pe(xe({},a),{type:"mop",body:st(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Un.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 Er(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[co(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)),ya(b)}}),Kt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Un(pe(xe({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:st(a.args[0])}))}),Kt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=st(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 Un(pe(xe({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Un.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 Er(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[co(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)),ya(b)}}),Kt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Un(pe(xe({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Do((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)}}),Kt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Un(a),render:(a,y)=>{var b,E,ee;const re=new La({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),de=re.toEm((E=a.args[1])!=null?E:{dimension:10}),he=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ge=new Er(null,{classes:"rule",type:"ord"});return ge.width=de,ge.height=he+ae,ge.depth=-ae,ge.setStyle("border-right-width",de,"em"),ge.setStyle("border-top-width",he,"em"),ge.setStyle("border-color",a.style.color),ge.setStyle("vertical-align",ae,"em"),a.isSelected&&ge.setStyle("opacity","50%"),a.bind(re,ge),a.caret&&(ge.caret=a.caret),ge.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Do(a.args[0])}]`:""}{${Do(a.args[1])}}{${Do(a.args[2])}}`}),Kt(["overline","underline"],"{:auto}",{createAtom:a=>new Un(pe(xe({},a),{body:st(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new La({parent:y,mathstyle:"cramp"},a.style),ee=Un.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new Er(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let de;return b==="overline"?de=new Qa({shift:0,children:[{box:ee},3*re,{box:ae},re]}):de=new Qa({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(de.caret=a.caret),new Er(de,{classes:b,type:"ignore"})}}),Kt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=st(a.args[1]);return new js(pe(xe({},a),{above:st(a.args[0]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>co(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Kt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=st(a.args[1]);return new js(pe(xe({},a),{below:st(a.args[0]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>co(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Kt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=st(a.args[2]);return new js(pe(xe({},a),{above:st(a.args[0]),below:st(a.args[1]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>co(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Kt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new js(pe(xe({},a),{body:st(a.args[2]),above:st(a.args[1]),below:st(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>co(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Kt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new wd(pe(xe({},a),{body:st(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}))}}),Kt(["vphantom"],"{:auto}",{createAtom:a=>new wd(pe(xe({},a),{body:st(a.args[0]),isInvisible:!0,smashWidth:!0}))}),Kt(["hphantom"],"{:auto}",{createAtom:a=>new wd(pe(xe({},a),{body:st(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Kt(["phantom"],"{:auto}",{createAtom:a=>new wd(pe(xe({},a),{body:st(a.args[0]),isInvisible:!0}))}),Kt("not","{:math}",{createAtom:a=>{const y=st(a.args[0]);return y.length===0?new Un(pe(xe({},a),{type:"mrel",value:"\uE020"})):new Un(pe(xe({},a),{body:[new Ru(pe(xe({},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{${Un.serialize(b.group,y)}}`:`\\not${Un.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":ru(st(a.args[0])),ee=Un.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),Kt(["ne","neq"],"",{createAtom:a=>new Un(pe(xe({},a),{type:"mrel",body:[new Ru(pe(xe({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Un(pe(xe({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),Kt("rlap","{:auto}",{createAtom:a=>new Ru(pe(xe({},a),{body:st(a.args[0]),align:"right"}))}),Kt("llap","{:auto}",{createAtom:a=>new Ru(pe(xe({},a),{body:st(a.args[0]),align:"left"}))}),Kt("mathrlap","{:math}",{createAtom:a=>new Ru(pe(xe({},a),{body:st(a.args[0]),align:"left"}))}),Kt("mathllap","{:math}",{createAtom:a=>new Ru(pe(xe({},a),{body:st(a.args[0]),align:"left"}))}),Kt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ko(pe(xe({},a),{body:st(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return co("\\raisebox",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Kt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ko(pe(xe({},a),{body:st(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return co("\\raise",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Kt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ko(pe(xe({},a),{body:st(a.args[1]),padding:{dimension:0},offset:(y=Zs(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return co("\\lower",(E=Do(Zs((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),He("0123456789/@.?!"),xt(65,90),xt(97,122),He([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),He([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),He([["\\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]]),He([["\\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"),He([["\\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"]]),He([["\\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"]]),He([["\\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"),He([["+",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"),He([["\\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"),He([["\\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]]),He([["=",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"),He([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),He([["\\wp",8472],["\\aleph",8501]]),He([["\\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"),He([["\\ ",160],["~",160]],"space"),Kt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new Sd(a)}),Kt("space","",{createAtom:a=>new Sd(a)}),He([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),He([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),He([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>⁡</mo>",Xf="<mo>⁢</mo>";function qf(a){return a.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function no(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,de,he,ge,we,Re,Ve,ft;let St=!1;y=y!=null?y:a.atoms.length;let wn="",wr="",yn=a.atoms[a.index];const er=(ee=(E=yn.style)==null?void 0:E.variant)!=null?ee:"",kr=(ae=(re=yn.style)==null?void 0:re.variantStyle)!=null?ae:"";let lr="";if(er||kr){const Ii=Nn(yn.value,(de=yn.style)==null?void 0:de.variant,(he=yn.style)==null?void 0:he.variantStyle);if(Ii!==yn.value)return a.index+=1,wn=`<mi${no(yn.id,b)}>${Ii}</mi>`,Zl(wn,a,b)||(a.mathML+=wn,a.lastType="mi"),!0;lr=(ge={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"}[kr+er])!=null?ge:"",lr=` mathvariant="${lr}"`}const si={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(yn.command==="!")return a.index+=1,wn="<mo>!</mo>",Zl(wn,a,b)||(a.mathML+=wn,a.lastType="mo"),!0;if(si[yn.command]){a.index+=1;let Ii=`<mi${no(yn.id,b)}${lr}>${si[yn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Ii=Xf+Ii),Zl(Ii,a,b)||(a.mathML+=Ii,a.lastType="mi"),!0}if(yn.command==="\\operatorname")wr=Nc(yn.body),a.index+=1;else if(er||kr)for(;a.index<y&&(yn.type==="mord"||yn.type==="macro")&&!yn.isDigit()&&er===((Re=(we=yn.style)==null?void 0:we.variant)!=null?Re:"")&&kr===((ft=(Ve=yn.style)==null?void 0:Ve.variantStyle)!=null?ft:"");)wr+=Nc([yn]),a.index+=1,yn=a.atoms[a.index];else(yn.type==="mord"||yn.type==="macro")&&!yn.isDigit()&&(wr+=Nc([yn]),a.index+=1);if(wr.length>0){St=!0,wn=`<mi${lr}>${wr}</mi>`;const Ii=a.lastType;wn.endsWith(">f</mi>")||wn.endsWith(">g</mi>")?(wn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(wn)?"mo":"mi",Zl(wn,a,b)||((Ii==="mi"||Ii==="mn"||Ii==="mtext"||Ii==="fence")&&(wn=Xf+wn),a.mathML+=wn)}return St}function Ev(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function Zl(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=Ua(ee.superscript,b);y.lastType="";const de=Ua(ee.subscript,b);if(y.lastType=re,!ae&&!de)return!1;let he="";return ae&&de?he=`<msubsup>${a}${de}${ae}</msubsup>`:ae?he=`<msup>${a}${ae}</msup>`:de&&(he=`<msub>${a}${de}</msub>`),y.mathML+=he,y.lastType="",!0}function _v(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 ${no(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=kv(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"+no(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&Ev(a)&&(re=a.index,a.index+=1),Zl(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Av(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,de=0;const he=a.index;let ge=-1,we=he+1;for(;we<y&&!ae;)a.atoms[we].type==="mopen"?de+=1:a.atoms[we].type==="mclose"&&(de-=1),de===-1&&(ae=!0,ge=we),we+=1;ae&&(ee="<mrow>",ee+=Vu(a.atoms[he],b),ee+=Ua(a.atoms,b,he+1,ge),ee+=Vu(a.atoms[ge],b),ee+="</mrow>",a.index=ge+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Xf),Zl(ee,a,b)&&(E=!0,a.lastType="",ee=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Tv(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 de={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(de[ae.command]){a.index+=1;const he=`<mo${no(ae.id,b)}>${de[ae.command]}</mo>`;return Zl(he,a,b)||(a.mathML+=he,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wh(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 he=Vu(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+he,ee+=Ua(ae.subscript,b),ee+=Ua(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+he,ee+=Ua(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+he,ee+=Ua(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const he=a.atoms[a.index],ge=he.value==="\\operatorname",we=ge?'<mi class="MathML-Unit"'+no(he.id,b)+">"+Nc(he.value)+"</mi>":Vu(he,b);ee+=we,!ge&&!/^<mo>(.*)<\/mo>$/.test(we)?(ee+=lp,re="applyfunction"):re=ge?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Xf+ee),a.index+=1}return ee.length>0&&(E=!0,Zl(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ua(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 Un)ee.mathML=Wh(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(_v(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Tv(ee,E,y)||Av(ee,E,y))re+=1;else if(ee.index<E){let ae=Wh(ee.atoms[ee.index],y);ee.lastType==="mn"&&ae.length>0&&ee.atoms[ee.index].type==="genfrac"&&(ae="<mo>⁤</mo>"+ae),ee.atoms[ee.index].type==="genfrac"?ee.lastType="mfrac":ee.lastType="",ee.index+=1,Zl(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 Vu(a,y){let b="";const E=Nc(a.value);return E&&(b="<mo"+no(a.id,y)+">"+E+"</mo>"),b}function Nc(a){if(!a)return"";if(typeof a=="string")return qf(a);if(!Array.isArray(a)&&typeof a.body=="string")return qf(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return qf(y)}function Wh(a,y){var b,E,ee,re,ae,de,he,ge,we,Re,Ve,ft,St,wn,wr,yn,er,kr,lr,si,Ii,vi;if(a.mode==="text")return`<mi${no(a.id,y)}>${a.value}</mi>`;const Pa={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"},Ya={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let Or="",$s="",_l,Xs,Yo,zs,Ms,ro;const{command:Lo}=a;if(a.command==="\\error")return`<merror${no(a.id,y)}>${Ua(a.body,y)}</merror>`;const Jo={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Ll={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(a.type){case"first":break;case"group":case"root":Or=Ua(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(Or+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(Or+="<mo>"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>")),Or+="<mtable",a.colFormat){for(Or+=' columnalign="',Yo=0;Yo<a.colFormat.length;Yo++)a.colFormat[Yo].align&&(Or+={l:"left",c:"center",r:"right"}[a.colFormat[Yo].align]+" ");Or+='"'}for(Or+=">",Xs=0;Xs<a.array.length;Xs++){for(Or+="<mtr>",_l=0;_l<a.array[Xs].length;_l++)Or+="<mtd>"+Ua(a.array[Xs][_l],y)+"</mtd>";Or+="</mtr>"}Or+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(Or+="<mo>"+(Jo[a.leftDelim]||a.rightDelim)+"</mo>"),Or+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(Or+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(Or+="<mo"+no(a.id,y)+">"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(Or+="<mfrac>",Or+=Ua(a.above,y)||"<mi> </mi>",Or+=Ua(a.below,y)||"<mi> </mi>",Or+="</mfrac>"):(Or+="<mtable"+no(a.id,y)+">",Or+="<mtr>"+Ua(a.above,y)+"</mtr>",Or+="<mtr>"+Ua(a.below,y)+"</mtr>",Or+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(Or+="<mo"+no(a.id,y)+">"+(Jo[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(Or+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(Or+="<msqrt"+no(a.id,y)+">",Or+=Ua(a.body,y),Or+="</msqrt>"):(Or+="<mroot"+no(a.id,y)+">",Or+=Ua(a.body,y),Or+=Ua(a.above,y),Or+="</mroot>");break;case"leftright":const Al=a,Tl=Al.leftDelim;Or="<mrow>",Tl&&Tl!=="."&&(Or+=`<mo${no(a.id,y)}>${(b=Jo[Tl])!=null?b:Tl}</mo>`),a.body&&(Or+=Ua(a.body,y));const Dl=Al.matchingRightDelim();Dl&&Dl!=="."&&(Or+=`<mo${no(a.id,y)}>${(E=Jo[Dl])!=null?E:Dl}</mo>`),Or+="</mrow>";break;case"sizeddelim":case"delim":Or+=`<mo${no(a.id,y)}>${Jo[a.value]||a.value}</mo>`;break;case"accent":Or+='<mover accent="true"'+no(a.id,y)+">",Or+=Ua(a.body,y),Or+="<mo>"+(Ll[Lo]||a.accent)+"</mo>",Or+="</mover>";break;case"line":case"overlap":break;case"overunder":Ms=a.above,zs=a.below,(a.svgAbove||Ms)&&(a.svgBelow||zs)?ro=a.body:Ms&&Ms.length>0?(ro=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(zs=a.body[0].below,ro=a.body[0].body):((de=(ae=a.body)==null?void 0:ae[0])==null?void 0:de.type)==="first"&&((ge=(he=a.body)==null?void 0:he[1])!=null&&ge.below)&&(zs=a.body[1].below,ro=a.body[1].body)):zs&&zs.length>0&&(ro=a.body,(Re=(we=a.body)==null?void 0:we[0])!=null&&Re.above?(Ms=a.body[0].above,ro=a.body[0].body):((ft=(Ve=a.body)==null?void 0:Ve[0])==null?void 0:ft.type)==="first"&&((wn=(St=a.body)==null?void 0:St[1])!=null&&wn.above)&&(Ms=a.body[1].overscript,ro=a.body[1].body)),(a.svgAbove||Ms)&&(a.svgBelow||zs)?(Or+=`<munderover ${no(a.id,y)}>`,Or+=(wr=Pa[a.svgBody])!=null?wr:Ua(ro,y),Or+=(yn=Pa[a.svgBelow])!=null?yn:Ua(zs,y),Or+=(er=Pa[a.svgAbove])!=null?er:Ua(Ms,y),Or+="</munderover>"):a.svgAbove||Ms?(Or+=`<mover ${no(a.id,y)}>`+((kr=Pa[a.svgBody])!=null?kr:Ua(ro,y)),Or+=(lr=Pa[a.svgAbove])!=null?lr:Ua(Ms,y),Or+="</mover>"):(a.svgBelow||zs)&&(Or+=`<munder ${no(a.id,y)}>`+((si=Pa[a.svgBody])!=null?si:Ua(ro,y)),Or+=(Ii=Pa[a.svgBelow])!=null?Ii:Ua(zs,y),Or+="</munder>");break;case"placeholder":Or+="?";break;case"mord":{Or=typeof a.value=="string"?a.value:Lo,Lo==="\\char"?Or="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":Or.length>0&&Or.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?Or="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?Or=a.value.charAt(0):(console.error("Did not expect this"),Or=""));const ul=/\d/.test(Or)?"mn":"mi";Or=`<${ul}${no(a.id,y)}>${qf(Or)}</${ul}>`;break}case"mbin":case"mrel":case"minner":Or=Vu(a,y);break;case"mpunct":Or='<mo separator="true"'+no(a.id,y)+">"+Lo+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(Or="<mo"+no(a.id,y)+">",Or+=Lo==="\\operatorname"?a.body:Lo||a.body,Or+="</mo>");break;case"box":Or='<menclose notation="box"',a.backgroundcolor&&(Or+=' mathbackground="'+a.backgroundcolor+'"'),Or+=no(a.id,y)+">"+Ua(a.body,y)+"</menclose>";break;case"spacing":Or+='<mspace width="'+((vi=Ya[Lo])!=null?vi:0)+'em"/>';break;case"enclose":Or='<menclose notation="';for(const ul in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ul)&&a.notation[ul]&&(Or+=$s+ul,$s=" ");Or+=no(a.id,y)+'">'+Ua(a.body,y)+"</menclose>";break;case"prompt":Or='<menclose notation="roundexbox""">'+Ua(a.body,y)+"</menclose>";break;case"space":Or+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":Or+=Vu(a,y);break;case"mclose":Or+=Vu(a,y);break;case"macro":{const ul=a.command+Nc(a.macroArgs);ul&&(Or+=`<mo ${no(a.id,y)}>${ul}</mo>`)}break;case"latexgroup":Or+=Ua(a.body,y);break;case"latex":Or+="<mtext"+no(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":Or+=Ua(a.body,y);break;case"text":Or+=`<mtext ${no(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${no(a.id,y)} displaystyle="true">${Ua(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${no(a.id,y)} displaystyle="false">${Ua(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return Or}var Fc={"\\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"},Uh={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 Dv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Nd(a){let y=0;if(ze(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(ze(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function up(a){let y="";if(ze(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 Ma(a,y){var b,E,ee,re,ae;function de(we){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(we)?` <say-as interpret-as="character">${we}</say-as>`:/[A-Z]/.test(we)?`capital <say-as interpret-as="character">${we.toLowerCase()}</say-as>`:we:/[a-z]/.test(we)?" '"+we.toUpperCase()+"'":/[A-Z]/.test(we)?" 'capital "+we.toUpperCase()+"'":we}function he(we){return"<emphasis>"+we+"</emphasis>"}if(!y)return"";let ge="";if(ze(y)){let we=!1,Re=!1;for(let Ve=0;Ve<y.length;Ve++)y[Ve].type!=="first"&&(y[Ve].mode!=="text"&&(Re=!1),Ve<y.length-2&&y[Ve].type==="mopen"&&y[Ve+2].type==="mclose"&&y[Ve+1].type==="mord"?(ge+=" of ",ge+=he(Ma(a,y[Ve+1])),Ve+=2):y[Ve].mode==="text"?Re?ge+=(b=y[Ve].value)!=null?b:" ":(Re=!0,ge+=Ma("text",y[Ve])):y[Ve].isDigit()?we?ge+=y[Ve].asDigit():(we=!0,ge+=Ma(a,y[Ve])):(we=!1,ge+=Ma(a,y[Ve])))}else if(y.mode==="text")y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>'),ge+=y.value;else{y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>');let we="",Re="",Ve="",ft=!1;const{command:St}=y;switch(St){case"\\vec":return"vector "+Ma(a,y.body);case"\\acute":return Ma(a,y.body)+" acute";case"\\grave":return Ma(a,y.body)+" grave";case"\\dot":return"dot over"+Ma(a,y.body);case"\\ddot":return"double dot over"+Ma(a,y.body);case"\\mathring":return"ring over"+Ma(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Ma(a,y.body);case"\\bar":return Ma(a,y.body)+" bar";case"\\breve":return Ma(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Ma(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Ma(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Ma(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Ma(a,y.body)}switch(y.type){case"prompt":const wn=y.body.length>1?'start input . <break time="500ms"/> '+Ma(a,y.body)+'. <break time="500ms"/> end input':"blank";ge+=' <break time="300ms"/> '+wn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const wr=y.array,yn=y.environmentName;if(Object.keys(Uh).includes(yn)){ge+=` begin ${Uh[yn]} `;for(let lr=0;lr<wr.length;lr++){lr>0&&(ge+=","),ge+=` row ${lr+1} `;for(let si=0;si<wr[lr].length;si++)si>0&&(ge+=","),ge+=` column ${si+1}: `,ge+=Ma("math",wr[lr][si])}ge+=` end ${Uh[yn]} `}break;case"group":St==="\\ne"?ge+=" not equal ":(St==="\\not"&&(ge+=" not "),ge+=Ma("math",y.body));break;case"root":ge+=Ma("math",y.body);break;case"genfrac":if(we=Ma("math",y.above),Re=Ma("math",y.below),Nd(y.above)&&Nd(y.below)){const si={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[up(y.above)+"/"+up(y.below)];si?ge=si:ge+=we+" over "+Re}else ge+=' the fraction <break time="150ms"/>'+we+' over <break time="150ms"/>'+Re+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Ve=Ma("math",y.body),y.hasEmptyBranch("above"))ge+=Nd(y.body)?" the square root of "+Ve+" , ":' the square root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End square root';else{let lr=Ma("math",y.above);lr=lr.trim();const si=lr.replace(/<mark([^/]*)\/>/g,"");si==="3"?ge+=' the cube root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End cube root':si==="n"?ge+=' the nth root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End root':ge+=' the root with index: <break time="200ms"/>'+lr+', of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End root'}break;case"leftright":{const lr=y;ge+=(ee=lr.leftDelim?Fc[lr.leftDelim]:void 0)!=null?ee:lr.leftDelim,ge+=Ma("math",y.body),ge+=(re=lr.rightDelim?Fc[lr.rightDelim]:void 0)!=null?re:lr.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const er=St.replace(/^\\/g,""),kr=ei()[er];kr&&(kr!=null&&kr.expand?ge+=Ma("math",y.body):ge+=`${er} `);break;case"placeholder":ge+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(St==="\\mathbin"||St==="\\mathrel"||St==="\\mathopen"||St==="\\mathclose"||St==="\\mathpunct"||St==="\\mathord"||St==="\\mathinner"){ge=Ma(a,y.body);break}let lr=y.isDigit()?y.asDigit():y.value,si=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(si=y.value,lr=si),a==="text")ge+=lr;else{if(y.type==="mbin"&&(ge+='<break time="150ms"/>'),lr){const Ii=Fc[lr]||(si?Fc[si.trim()]:"");if(Ii)ge+=" "+Ii;else{const vi=si?Dv(si.trim()):"";ge+=vi||de(lr)}}else ge+=Ma("math",y.body);y.type==="mbin"&&(ge+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const lr=y.command;if(lr==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the summation from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',ft=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the summation of";else{let si=Ma("math",y.subscript);si=si.trim(),ge+=' the summation from <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',ft=!0}else if(lr==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the product from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',ft=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the product of ";else{let si=Ma("math",y.subscript);si=si.trim(),ge+=' the product from <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',ft=!0}else if(lr==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the integral from <break time="200ms"/>'+he(Ii)+'<break time="200ms"/> to <break time="200ms"/>'+he(si)+' <break time="200ms"/> of ',ft=!0}else ge+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const si=(ae=Fc[y.value])!=null?ae:y.command?Fc[y.command]:void 0;ge+=si||" "+y.value}else y.command&&(y.command==="\\mathop"?ge+=Ma("math",y.body):y.command==="\\operatorname"?ge+=Pv(y.body):ge+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Ve=Ma("math",y.body),ge+=" crossed out "+Ve+". End crossed out.";break;case"space":case"spacing":break}if(!ft&&!y.hasEmptyBranch("superscript")){let wn=Ma(a,y.superscript);wn=wn.trim();const wr=wn.replace(/<[^>]*>/g,"");if(Nd(y.superscript)){if(a==="math"){const yn=Iv(y.superscript);yn&&(ge+='<mark name="'+yn+'"/>')}wr==="\u2032"?ge+=" prime ":wr==="2"?ge+=" squared ":wr==="3"?ge+=" cubed ":Number.isNaN(Number.parseInt(wr))?ge+=" to the "+wn+"; ":ge+=' to the <say-as interpret-as="ordinal">'+wr+"</say-as> power; "}else Number.isNaN(Number.parseInt(wr))?ge+=" raised to the "+wn+"; ":ge+=' raised to the <say-as interpret-as="ordinal">'+wr+"</say-as> power; "}if(!ft&&!y.hasEmptyBranch("subscript")){let wn=Ma("math",y.subscript);wn=wn.trim(),ge+=Nd(y.subscript)?" sub "+wn:" subscript "+wn+". End subscript. "}}return ge}function $c(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ua(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=pe(xe({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=pe(xe({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=pe(xe({},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(de){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",de)}return ae}return""}let E=Ma("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"&&De()==="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 Fd={"\\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"},$d={"\\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 Ov(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 _o(a){var y,b,E,ee,re,ae,de,he,ge,we,Re,Ve,ft;if(!a)return"";if(ze(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(_o).join("");if(a[0].mode==="text"){let kr=0,lr="";for(;((y=a[kr])==null?void 0:y.mode)==="text";)lr+=a[kr].body?_o(a[kr].body):a[kr].value,kr++;return`"${lr}" ${_o(a.slice(kr))}`}let yn=0;const er=[];for(;a[yn]&&a[yn].mode==="math";){let kr="";for(;a[yn]&&a[yn].type==="mord"&&/\d/.test(a[yn].value);)kr+=a[yn++].value;kr?er.push(kr):er.push(_o(a[yn++]))}return er.push(_o(a.slice(yn))),Ov(er)}if(a.mode==="text")return`"${a.value}"`;let St="";const{command:wn}=a;let wr;if(wn==="\\placeholder")return`(${_o(a.body)})`;switch(a.type){case"accent":const yn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[wn];St=`${yn!=null?yn:""} ${_o(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(vi=>vi.value).join("");case"group":case"root":St=(b=Fd[wn])!=null?b:_o(a.body);break;case"genfrac":{const vi=a;(vi.leftDelim||vi.rightDelim)&&(St=vi.leftDelim==="."||!vi.leftDelim?"{:":vi.leftDelim),vi.hasBarLine?(St+="(",St+=_o(vi.above),St+=")/(",St+=_o(vi.below),St+=")"):(St+="("+_o(vi.above)+"),",St+="("+_o(vi.below)+")"),(vi.leftDelim||vi.rightDelim)&&(St+=vi.rightDelim==="."||!vi.rightDelim?"{:":vi.rightDelim)}break;case"surd":St+=a.hasEmptyBranch("above")?"sqrt("+_o(a.body)+")":"root("+_o(a.above)+")("+_o(a.body)+")";break;case"latex":St=a.value;break;case"leftright":{const vi=a,Pa=vi.leftDelim;St+=Pa==="."||!Pa?"{:":Pa,St+=_o(vi.body);const Ya=vi.matchingRightDelim();St+=Ya==="."||!Ya?":}":Ya}break;case"sizeddelim":case"delim":St=a.value;break;case"overlap":break;case"overunder":break;case"mord":St=(ee=(E=Fd[wn])!=null?E:wn)!=null?ee:typeof a.value=="string"?a.value:"",St.startsWith("\\")&&(St+=" "),wr=wn?wn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,wr?St=String.fromCodePoint(Number.parseInt("0x"+wr[1])):St.length>0&&St.startsWith("\\")&&(St=typeof a.value=="string"?a.value.charAt(0):a.command),St=Rv(St,a.style);break;case"mbin":case"mrel":case"minner":St=(ae=(re=Fd[wn])!=null?re:$d[wn])!=null?ae:a.value;break;case"mopen":case"mclose":St=a.value;break;case"mpunct":St=(de=$d[wn])!=null?de:wn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&($d[wn]?St=$d[wn]:St=wn==="\\operatorname"?_o(a.body):(he=a.value)!=null?he:wn,St+=" ");break;case"array":const er=a.array,kr=a.environmentName,lr=(ge={bmatrix:["[","]"],"bmatrix*":["[","]"]}[kr])!=null?ge:["(",")"],si=[];for(const vi of er){const Pa=[];for(const Ya of vi)Pa.push(lr[0]+_o(Ya)+lr[1]);si.push(Pa.join(","))}const Ii=(we={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[kr])!=null?we:["(",")"];St=Ii[0]+si.join(",")+Ii[1];break;case"box":break;case"spacing":St=(Re=Fd[wn])!=null?Re:" ";break;case"enclose":St="("+_o(a.body)+")";break;case"space":St=" ";break;case"subsup":St="";break;case"macro":St=(ft=(Ve=Fd[wn])!=null?Ve:$d[wn])!=null?ft:_o(a.body);break}if(!a.hasEmptyBranch("subscript")){St+="_";const yn=_o(a.subscript);St+=yn.length!==1?`(${yn})`:yn}if(!a.hasEmptyBranch("superscript")){St+="^";const yn=_o(a.superscript);St+=yn.length!==1?`(${yn})`:yn}return St}function Rv(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 qo(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new La({from:pe(xe({},bc()),{renderPlaceholder:()=>new Er(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Un({mode:"math",type:"root",body:Xo(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(gc(Cd(ae,ee)),vc(ae,{classes:"ML__latex"}).toMarkup()):""}function _1(a){return t0(a,{context:bc()})}function Bv(a,y={}){return Ua(Xo(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=Xo(a,{parseMode:"math",mathstyle:"displaystyle"});return $c(y)}var Yf;function Fv(a){var y,b;if(!Yf){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?Yf=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=Yf==null?void 0:Yf.box(a).latex)!=null?b:""}function L1(a,y="math"){return _o(new Un({type:"root",body:Xo(a,{parseMode:y})}))}function A1(a){return Ou(a,{format:"ascii-math"})[1]}function Zh(a){if(typeof a=="string"){const y=$v(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?cp(a):a}function zc(a){return a<0?0:a>255?255:Math.round(a)}function $v(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&typeof y.a=="undefined"&&(y.a=1),y}function Vh(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,de={L:y,C:ee,H:ae};return a.alpha!==void 0&&(de.alpha=a.alpha),de}function jh(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),de=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,he=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ge=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,we=Re=>{const Ve=Math.abs(Re);return Ve<=.0031308?Re*12.92:(Math.sign(Re)||1)*(1.055*Math.pow(Ve,1/2.4)-.055)};return[we(de),we(he),we(ge)]}function Gh(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xh(a,y){let[b,E,ee]=a;return b=zc(b*255),E=zc(E*255),ee=zc(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function cp(a){let[y,b,E]=jh(a);if(Gh([y,b,E]))return Xh([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=jh(Vh(ee)),!Gh([y,b,E]))return Xh([y,b,E],a.alpha);let re=0,ae=a.L,de=(re+ae)/2;ee.C=de;const he=.36/Math.pow(2,12);for(;ae-re>he;)de=(re+ae)/2,ee.C=de,[y,b,E]=jh(Vh(ee)),Gh([y,b,E])?re=de:ae=de;return Xh([y,b,E],a.alpha)}function Kv(a){return cp(Vh(a))}function dp(a,y){const b=Zh(a),E=Zh(y),ee=.56,re=.57,ae=.62,de=.65,he=.022,ge=1.414,we=.1,Re=5e-4,Ve=1.14,ft=.027,St=1.14,wn=.027;function wr(vi){return vi>=he?vi:vi+Il(he-vi,ge)}function yn(vi){return(vi<0?-1:1)*Math.pow(Math.abs(vi),2.4)}const er=wr(yn(E.r/255)*.2126729+yn(E.g/255)*.7151522+yn(E.b/255)*.072175),kr=wr(yn(b.r/255)*.2126729+yn(b.g/255)*.7151522+yn(b.b/255)*.072175);let lr,si,Ii;return Math.abs(kr-er)<Re?si=0:kr>er?(lr=Il(kr,ee)-Il(er,re),si=lr*Ve):(lr=Il(kr,de)-Il(er,ae),si=lr*St),Math.abs(si)<we?Ii=0:si>0?Ii=si-wn:Ii=si+ft,Ii*100}function fp(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=Zh(a);let b=((1<<24)+(zc(y.r)<<16)+(zc(y.g)<<8)+zc(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 mo(a){const y=hp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function hp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=hp(a);if(b.length!==1)return!1;const E=ph[y];return E?!!E.test(b[0].value):!1}function Uv(a,y){return mo(a).length>0}function Zv(a){return[qh(a,"double-struck","mathbb","tooltip.blackboard"),qh(a,"fraktur","mathfrak","tooltip.fraktur"),qh(a,"calligraphic","mathcal","tooltip.caligraphic"),Yh(a,"up","mathrm","tooltip.roman-upright"),Yh(a,"bold","mathbf","tooltip.bold"),Yh(a,"italic","mathit","tooltip.italic")]}function Vv(a){return[{label:()=>qo(`\\vec{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overrightarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overleftarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>qo(`\\dot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>qo(`\\ddot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bar{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overgroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>qo(`\\underline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>qo(`\\undergroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>qo(`\\underbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function jv(a){return[{label:()=>qo(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Gv(a){const y=[];for(const b of Object.keys(je))y.push({class:(Hv(fp(je[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${je[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({backgroundColor:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({backgroundColor:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}function Xv(a){const y=[];for(const b of Object.keys(Xe))y.push({class:(fp(Xe[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Xe[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({color:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({color:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}var qv=class extends ep{constructor(a,y,b,E){super(a,y),this.row=b,this.col=E}set active(a){const y=this.parentMenu.children;if(a)for(const b of y)b.element.classList.toggle("active",b.row<=this.row&&b.col<=this.col);else for(const b of y)b.element.classList.remove("active")}};function Yv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new qv(ee,re,b,E),label:"\u2610",tooltip:()=>lt("tooltip.row-by-col",b,E),data:{row:b,col:E},onMenuSelect:()=>{a.insert(`\\begin{pmatrix}${Array(b).fill(Array(E).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return y}function Jv(a){return[{label:()=>lt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>ju(a)},{label:()=>lt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>ju(a)},{label:()=>lt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>ju(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>lt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>ju(a)},{type:"divider"},{label:()=>lt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>ju(a)},{label:()=>lt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>ju(a)},{type:"divider"},{label:()=>lt("menu.borders"),visible:()=>(Qv(a)||ju(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>zd(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>zd(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>zd(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>zd(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>zd(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>lt("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Yv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>lt("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>lt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Ac(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>lt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Ac(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>lt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>lt("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:Zv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&mo(a).length>0,submenu:jv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>lt("menu.evaluate"),id:"ce-evaluate",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const y=t1(a);if(!y){a.model.announce("plonk");return}a.model.selectionIsCollapsed?(a.model.position=a.model.lastOffset,a.insert(`=${y}`,{insertionMode:"insertAfter",selectionMode:"item"})):a.insert(y,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>lt("menu.simplify"),id:"ce-simplify",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var y,b;if(a.model.selectionIsCollapsed){const E=(y=a.expression)==null?void 0:y.simplify();if(a.model.position=a.model.lastOffset,!E){a.model.announce("plonk");return}a.insert(`=${E.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection)).simplify();if(!E){a.model.announce("plonk");return}a.insert(E.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var y;if(window.MathfieldElement.computeEngine===null)return"";const b=(y=a.expression)==null?void 0:y.unknowns[0];return b?lt("menu.solve-for",qo(b)):lt("menu.solve")},id:"ce-solve",visible:()=>{var y;return a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((y=a.expression)==null?void 0:y.unknowns.length)===1&&a.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var y;const b=a.expression,E=b==null?void 0:b.unknowns[0],ee=(y=b.solve(E))==null?void 0:y.map(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:()=>lt("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>lt("menu.copy"),id:"copy",submenu:[{label:()=>lt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>ra.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>lt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>ra.copyToClipboard(a,"ascii-math")},{label:()=>lt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>ra.copyToClipboard(a,"math-ml")}]},{label:()=>lt("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>lt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function ju(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 zd(a,y){Mf(a),a.flushInlineShortcutBuffer(),I0(a.model,y),Mo(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 qh(a,y,b,E){return{label:()=>qo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Wv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variant:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variant:y},{operation:"toggle"}),a.adoptStyle="none"}}}function Yh(a,y,b,E){return{label:()=>qo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Uv(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 Kc(a,y){return a+$c(y)}Ls({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(we){let Re=null;switch(we){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:Ve}=re.at(re.position);Ve!=null&&Ve.parent?Re=Ve:Re=re.root;break}default:Re=re.root}return Re}function de(we){let Re="";switch(we){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: "'+we+'"');break}return Re}const he=ae(y);if(he===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,de(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ge=$c(he);return Ct()&&b.withHighlighting?(mu().readAloudMathfield=a,Fu(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ge)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ge),!1}function r1(a){var y,b;if(!Ct()){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 de=new Uint8Array(ae.AudioStream),he=new Blob([de.buffer],{type:"audio/mpeg"}),ge=URL.createObjectURL(he);new Audio(ge).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=Kc("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=Kc("",a.model.at(a.model.position));else if(y==="line"){const re=Kc("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?Kc(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 Kc("",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+=Kc("",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=du(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 we=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(we))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(we-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(we-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(we+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(we+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=we,this._position=we,this._selection=re;return}const ae=jo(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const de=this.at(ae[0]+1),he=this.at(ae[1]),ge=Un.commonAncestor(de,he);(ge==null?void 0:ge.type)==="array"&&de.parent===ge&&he.parent===ge?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 ns&&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(wc(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((ge,we)=>[...ge,...this.getAtoms(we,E)],[]);a=a.ranges[0]}let ee,re;if(gl(a)){if(ee=a,!gl(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,de=Math.max(ee,re);if(!E.includeChildren&&ae===1&&de===this.lastOffset)return[this.root];let he=[];for(let ge=ae;ge<=de;ge++){const we=this.atoms[ge];mp(this,we,ae,de)&&he.push(we)}return E.includeChildren||(he=he.filter(ge=>{let we=!1,{parent:Re}=ge;for(;Re&&!we;)we=mp(this,Re,ae,de),Re=Re.parent;return!we})),he}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 Un({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 Un.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 Ua(a);if(b==="spoken")return $c(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=$c(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=$c(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?_o(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(gl(a)&&gl(y)?(E=[this.normalizeRange([a,y])],ee=b):xc(a)?(E=[this.normalizeRange(a)],ee=y):wc(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 ya(E.map(ae=>Un.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&&Jh(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&Jh(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&&Jh(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 de=this.root.changeCounter!==ae,he=E!==this._anchor||ee!==this._position||Pu(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&de&&this.contentDidChange({inputType:a.type}),a.selection&&he&&this.selectionDidChange(),de||he}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(gl(a)){const ee=this.normalizeOffset(a);if(gl(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(xc(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 wc(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(Ml(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",pe(xe({},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(Ml(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 Jh(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 Kd(a,y,b,E){var ee,re,ae,de,he,ge;const we=b.parent;if(we&&b instanceof Wa){const Re=!E&&y==="forward"||E==="body"&&y==="backward";let Ve=Re?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Re?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Ve--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Ve--),a.position=Ve,!0}if(we&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Re=b.leftSibling;b.hasChildren&&we.addChildrenAfter(b.removeBranch("body"),b),we.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),we.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(we&&(b.type==="box"||b.type==="enclose")){const Re=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return we.addChildrenAfter(b.removeBranch("body"),b),we.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=Hd.fractionNavigationOrder==="numerator-denominator"?"above":"below",Ve=Re==="above"?"below":"above";if(we&&(y==="forward"&&E===Re||y==="backward"&&E===Ve)){const ft=b.removeBranch(Re),St=b.removeBranch(Ve);return we.addChildrenAfter([...ft,...St],b),we.removeChild(b),a.position=a.offsetOf(ft.length>0?ft[ft.length-1]:St[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]:(ge=(de=b.subscript)==null?void 0:de[0].lastSibling)!=null?ge:(he=b.superscript)==null?void 0:he[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((we==null?void 0:we.type)==="genfrac"&&!E&&b.type!=="first"){let Re=a.offsetOf(b.leftSibling);return we.removeChild(b),we.hasEmptyBranch("above")&&we.hasEmptyBranch("below")?(Re=a.offsetOf(we.leftSibling),we.parent.removeChild(we),a.announce("delete",void 0,[we]),a.position=Re,!0):(a.announce("delete",void 0,[b]),a.position=Re,!0)}if(y==="backward"&&((we==null?void 0:we.command)==="\\ln"||(we==null?void 0:we.command)==="\\log")&&b.parentBranch!=="body"){const Re=a.offsetOf(we.leftSibling);return we.parent.removeChild(we),a.announce("delete",void 0,[we]),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&&Kd(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Kd(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])}}):kl(a,jo(a.selection),"deleteContentBackward")}function u1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentForward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var y,b;let E=a.at(a.position).rightSibling;if(E&&Kd(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Kd(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Kd(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])}):kl(a,jo(a.selection),"deleteContentForward")}function kl(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 de=E[E.length-1];if(ae===ee&&de===re){const he=E[0].parent;he.parent&&he.type!=="prompt"&&(y=[a.offsetOf(he.leftSibling),a.offsetOf(he)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const he=E[0].parent,ge=E[0].parentBranch==="below"?"above":"below",we=a.offsetOf(he.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Re,Ve;const ft=he.removeBranch(ge);if(ft.length===1&&ft[0].type==="placeholder")(Ve=he.parent)==null||Ve.removeChild(he),a.position=Math.max(0,we);else{const St=he.parent.addChildrenAfter(ft,he);(Re=he.parent)==null||Re.removeChild(he),a.position=a.offsetOf(St)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Ls({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&kl(a,[0,-1],"deleteContent"),deleteForward:a=>u1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&kl(a,[a.anchor,_h(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&kl(a,[a.anchor,_h(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&kl(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&kl(a,[a.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var c1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${lt("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,d1=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${lt("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,f1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=xe(pe(xe({},Rf()),{macros:ei(),registers:ou()}),Of(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 de=A0(this.options),he=new Un({type:"root",mode:de,body:Xo(ae,{context:this.context})});this.model=new s1(this,de,he),this.undoManager=new Ng(this.model);const ge=[];if(ge.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>"),ge.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ge.push("<span part=content class=ML__content>"),ge.push(w0(this)),ge.push("</span>"),window.mathVirtualKeyboard&&(ge.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">`),ge.push(c1),ge.push("</div>")),ge.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ge.push(d1),ge.push("</div>"),ge.push("</span>"),ge.push("<span class=ML__sr-only>"),ge.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ge.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ge.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=nt.subscribe(()=>nt.update(this.element)),nt.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(Ml(this)))},{signal:re}),this._menu=new Sv(Jv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const we=this.element.querySelector("[part=menu-toggle]");we==null||we.addEventListener("pointerdown",Re=>{if(Re.currentTarget!==we||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Ve=we.getBoundingClientRect();this._menu.modifiers=Nu(Re),this._menu.show({target:we,location:{x:Ve.left,y:Ve.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")&&(we.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(()=>Mo(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),kd&&!nt.locale.startsWith(kd.locale)&&Fm(nt.locale),Fs!=="ready"&&document.fonts.ready.then(()=>Af(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(Ml(this)),jf(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Fh())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:bl(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:Lt(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:Ge(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=Un.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=xe({},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=Ph(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 he of Object.keys(y)){const ge=this.queryStyle({[he]:y[he]});if(ge==="none")return"none";if(ge==="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 de=0;for(const he of re){if(he.type==="first"){ae-=1;continue}he.style[E]===ee&&(de+=1)}return de===0?"none":de===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=jm(this.options.keybindings,(a=_d())!=null?a:$m());return((y=_d())==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=xe(xe({},this.options),Of(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=Un.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&ra.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)&&Mo(this)}getOptions(a){return zu(this.options,a)}getOption(a){return zu(this.options,a)}handleEvent(a){return gu(this,null,function*(){var y;if(Rs(this)){if(Ch(a)){if(!yd(a.origin,(y=this.options.originValidator)!=null?y:"none"))throw new DOMException(`Message from unknown origin (${a.origin}) cannot be handled`,"SecurityError");const{action:b}=a.data;if(b==="execute-command"){const E=a.data.command;if(Dc(E)==="virtual-keyboard")return;this.executeCommand(E)}else b==="update-state"||(b==="focus"?this.focus({preventScroll:!0}):b==="blur"&&this.blur());return}switch(a.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&U0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(U0(this,a),a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Wf.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Wf.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&jf(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Rs(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Rs(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Rs(this))return;nt.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,Gg(),Qm(),mv()}flushInlineShortcutBuffer(a){if(a!=null||(a={defer:!1}),!a.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(a){return Dc(a)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(a),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Ml(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=ah(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();ra.insert(this.model,a,y)&&(Mo(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&&Fu(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=bl(this.field);else{const E=vd(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&&Ye()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?T0(this.model):a==="&"?D0(this.model):this.model.selectionIsCollapsed?ra.insert(this.model,a,xe({style:this.model.at(this.model.position).computedStyle},y)):ra.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Mo(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 de=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const he=Xo(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,ge)),de=!0}if(this.model.mode=a,a==="latex"){let he=ae.selectionIsCollapsed;Ac(this,"accept");let ge,we=ae.at(ae.position);if(he)ge="\\";else{const Ve=jo(ae.selection);ge=this.model.getValue(Ve,"latex");const ft=this.model.extractAtoms(Ve);ft.length===1&&ft[0].type==="placeholder"&&(ge=y,he=!0),we=ae.at(Ve[0])}const Re=new xd(ge);we.parent.addChildAfter(Re,we),he?ae.position=ae.offsetOf(Re.lastChild):ae.setSelection(ae.offsetOf(Re.firstChild),ae.offsetOf(Re.lastChild))}else Ld(ae).forEach(he=>{he.isError=!1});if(b){const he=Xo(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,ge)),de=!0}return Mo(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),de}),this.model.mode=a,window.mathVirtualKeyboard.update(Ml(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};xc(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=Ph(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=xe(xe({},this.defaultStyle),re);return}const de=xe({},this.defaultStyle);for(const he of Object.keys(re))de[he]===re[he]?(he==="color"&&delete de.verbatimColor,he==="backgroundColor"&&delete de.verbatimBackgroundColor,delete de[he]):de[he]=re[he];this.defaultStyle=de;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const de of this.model.selection.ranges)Eh(this.model,de,re,{operation:ae});else Eh(this.model,ee.range,re,{operation:ae})}),Mo(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=bl(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=Bd(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),Mo(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,pe(xe({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),Mo(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),Mo(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(Ml(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(Ml(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(Ml(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:A0(this.options);this.model.mode!==ee&&(this.model.mode==="latex"?(Ac(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(Ml(this)),jf(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",pe(xe({},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(),Fu(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="",Tc(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})),Mo(this),this.focusBlurInProgress=!1,Fh();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Rs(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Th(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(jo(this.model.selection));const y=bl(this.field);y&&requestAnimationFrame(()=>{Fu(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),Mo(this)}onCompositionEnd(a){Ag(this.model),Th(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),ra.onCopy(this,a),kl(this.model,jo(this.model.selection),"deleteByCut"),this.snapshot("cut"),Mo(this))}onCopy(a){ra.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=ra.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(),kf(this),jf(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=>Vn(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 Qh(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&&Qh(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qh(E,y)})))}function h1(a,y){var b;if(!Ct())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"]};mu().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 de=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));mu().readAloudMarks=de.split(`
|
|
|
`).map(he=>he?JSON.parse(he):{}),mu().readAloudTokens=[];for(const he of mu().readAloudMarks)he.value&&mu().readAloudTokens.push(he.value);mu().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(he,ge)=>{if(he){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${he}`);return}if(!(ge!=null&&ge.AudioStream))return;const we=new Uint8Array(ge.AudioStream),Re=new Blob([we.buffer],{type:"audio/mpeg"}),Ve=URL.createObjectURL(Re),ft=mu();ft.readAloudAudio?ft.readAloudAudio.pause():(ft.readAloudAudio=new Audio,ft.readAloudAudio.addEventListener("ended",()=>{const St=ft.readAloudMathfield;ft.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),St?(Fu(St),ft.readAloudElement=null,ft.readAloudMathfield=null,ft.readAloudTokens=[],ft.readAloudMarks=[],ft.readAloudCurrentMark=""):gp(ft.readAloudElement)}),ft.readAloudAudio.addEventListener("timeupdate",()=>{let St="";const wn=ft.readAloudAudio.currentTime*1e3+100;for(const wr of ft.readAloudMarks)wr.time<wn&&(St=wr.value);ft.readAloudCurrentMark!==St&&(ft.readAloudCurrentToken=St,St&&St===ft.readAloudFinalToken?ft.readAloudAudio.pause():(ft.readAloudCurrentMark=St,Qh(ft.readAloudElement,ft.readAloudCurrentMark)))})),ft.readAloudAudio.src=Ve,ft.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ft.readAloudAudio.play()})})}Ct()||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 Ba=new WeakMap,p1=.5,pu={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 = ..."},rs=class Gu extends HTMLElement{static get formAssociated(){return Hc()}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 nt.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),nt.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 nt.strings}static set strings(y){nt.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 gu(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 gu(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(pu[E])if(pu[E].startsWith("mf."))if(pu[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${pu[E]}`);else{const ee=pu[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 ${pu[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(Hc()&&(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=[cu("core"),cu("mathfield"),cu("mathfield-element"),cu("ui"),cu("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=Gu.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?zu(this._mathfield.options,y):Ba.has(this)?xe({},zu(xe(xe({},Rf()),Of(Ba.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?zu(this._mathfield.options,y):Ba.has(this)?zu(xe(xe({},Rf()),Of(Ba.get(this).options)),y):null}reflectAttributes(){const y=Rf(),b=this._getOptions();Object.keys(Gu.optionsAttributes).forEach(E=>{const ee=Vl(E);Gu.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Gu.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(Ba.has(this)){const b=xe(xe({},Ba.get(this).options),y);Ba.set(this,pe(xe({},Ba.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Ba.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))pu[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${pu[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(Ba.has(this)){let ae,de,he;if(wc(y)?([ae,de]=y.ranges[0],he=b):xc(y)?([ae,de]=y,he=b):gl(y)&&gl(b)?(ae=y,de=b,he=E):(ae=0,de=-1,he=y),(he===void 0||he==="latex")&&ae===0&&de===-1)return(re=(ee=Ba.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(Ba.has(this)){const ee=Ba.get(this).options;Ba.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Wd(this);Ba.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?Bd(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=lu(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;wl.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,de=re.userSelect!=="none";if(de)ae.host.addEventListener("pointerdown",this,!0);else{const we=ae.querySelector("span");we.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Hc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),de&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const he=ae.querySelector("slot:not([name])");if(he)try{this._style=he.assignedElements().filter(we=>we.tagName.toLowerCase()==="style").map(we=>we.textContent).join("")}catch(we){console.error(we)}if(this._style){const we=document.createElement("style");we.textContent=this._style,ae.appendChild(we)}let ge="";if(this.hasAttribute("value")?ge=this.getAttribute("value"):ge=(y=he==null?void 0:he.assignedNodes().map(we=>we.nodeType===3?we.textContent:"").join("").trim())!=null?y:"",this._mathfield=new f1(ae.querySelector(":host > span"),pe(xe({},(E=(b=Ba.get(this))==null?void 0:b.options)!=null?E:Wd(this)),{eventSink:this,value:ge})),!Ba.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const we of Object.keys(Gu.optionsAttributes))this.upgradeProperty(Vl(we))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Ba.has(this)){const we=this._mathfield,Re=Ba.get(this),Ve=Re.menuItems;we.model.deferNotifications({content:!1,selection:!1},()=>{const ft=Re.value;ft!==void 0&&we.setValue(ft),we.model.selection=Re.selection,Ba.delete(this)}),Ve&&(this.menuItems=Ve)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Lf()}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=zu(this._mathfield.options,Object.keys(Gu.optionsAttributes).map(ee=>Vl(ee)));Ba.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":Mo(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",""),Hc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Hc()?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"),Hc()?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:pe(xe({},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=Ba.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}Ba.has(this)?Ba.set(this,pe(xe({},Ba.get(this)),{menuItems:y})):Ba.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Wd(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:Ba.has(this)?Ba.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,Mo(this._mathfield);return}if(Ba.has(this)){Ba.set(this,pe(xe({},Ba.get(this)),{selection:y}));return}Ba.set(this,{value:void 0,selection:y,options:Wd(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:Ba.has(this)?Ba.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,Mo(this._mathfield)),Ba.has(this)){Ba.set(this,pe(xe({},Ba.get(this)),{selection:{ranges:[[y,y]]}}));return}Ba.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Wd(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}};rs.version="0.98.5",rs._fontsDirectory="./fonts",rs._soundsDirectory="./sounds",rs.keypressVibration=!0,rs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},rs._plonkSound="plonk.wav",rs.audioBuffers={},rs.createHTML=a=>a,rs._speechEngineRate="100%",rs._speechEngineVoice="Joanna",rs._textToSpeechMarkup="",rs._textToSpeechRules="mathlive",rs._textToSpeechRulesOptions={},rs.speakHook=r1,rs.readAloudHook=h1,rs._decimalSeparator=".",rs.fractionNavigationOrder="numerator-denominator",rs._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 Hd=rs;function Vl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Wd(a){const y={readOnly:!1},b=Hd.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[Vl(E)]=!0:b[E]==="on/off"?ee==="on"?y[Vl(E)]=!0:ee==="off"?y[Vl(E)]=!1:y[Vl(E)]=void 0:b[E]==="number"?y[Vl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[Vl(E)]=ee}}),y}function Hc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Hd,yp,bp,xp,wp;if(Ct()&&!((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=Hd,(wp=window.customElements)==null||wp.define("math-field",Hd)}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 Jf(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const de=ae.data;let he=!0,ge=0,we;we=de.indexOf(y),we!==-1&&(ge=we,ge>0&&re.push({type:"text",data:de.slice(0,ge)}),he=!1);let Re=!1;for(;!Re;){if(he){if(we=de.indexOf(y,ge),we===-1){Re=!0;break}ge!==we&&re.push({type:"text",data:de.slice(ge,we)}),ge=we}else{if(we=m1(b,de,ge+y.length),we===-1){Re=!0;break}let Ve=de.slice(ge+y.length,we);ee==="ascii-math"&&([,Ve]=Ou(Ve,{format:"ascii-math"})),re.push({type:"math",data:Ve,rawData:de.slice(ge,we+b.length),mathstyle:E}),ge=we+b.length}he=!he}ge<de.length&&re.push({type:"text",data:de.slice(ge)})}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=Jf(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Jf(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Jf(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Jf(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 Wc(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 de=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&de.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const he=document.createElement("span");he.setAttribute("translate","no");const ge=b.renderToSpeakableText(a);he.innerHTML=window.MathfieldElement.createHTML(ge),he.className="ML__sr-only",de.append(he)}return de.append(re),de}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=Wc(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 de of ae)if(de.type==="text")re.appendChild(document.createTextNode(de.data));else{const he=Wc(de.data,de.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);he&&re.appendChild(he)}}return re}function Cp(a,y){var b,E,ee,re,ae,de,he,ge,we,Re,Ve,ft,St,wn,wr,yn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const er=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(er)){a.textContent="";const lr=Wc(er,"",y,!0);lr&&a.append(lr);return}const kr=Sp(er,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(kr.length===1&&kr[0].type==="math"){a.textContent="";const lr=Wc(kr[0].data,kr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);lr&&a.append(lr);return}if(kr.length===1&&kr[0].type==="text")return}for(let er=a.childNodes.length-1;er>=0;er--){const kr=a.childNodes[er];if(kr.nodeType===3){const lr=y1((ae=kr.textContent)!=null?ae:"",y);lr&&(er+=lr.childNodes.length-1,kr.replaceWith(lr))}else if(kr.nodeType===1){const lr=kr,si=kr.nodeName.toLowerCase();if(si==="script"){const Ii=kr;let vi;if((de=y.processScriptTypePattern)!=null&&de.test(Ii.type))vi=(he=Ii.textContent)!=null?he:"";else if((ge=y.processMathJSONScriptTypePattern)!=null&&ge.test(Ii.type))try{vi=(Re=y.serializeToLatex)==null?void 0:Re.call(y,JSON.parse((we=Ii.textContent)!=null?we:""))}catch(Pa){console.error(Pa)}if(vi){let Pa="textstyle";for(const Or of Ii.type.split(";")){const[$s,_l]=Or.toLowerCase().split("=");$s.trim()==="mode"&&(Pa=_l.trim()==="display"?"displaystyle":"textstyle")}const Ya=Wc(vi,Pa,y,!0);Ya&&Ii.parentNode.replaceChild(Ya,Ii)}}else if(((ft=(Ve=y.processClassPattern)==null?void 0:Ve.test(lr.className))!=null?ft:!1)||!((wn=(St=y.skipTags)==null?void 0:St.includes(si))!=null&&wn||(yn=(wr=y.ignoreClassPattern)==null?void 0:wr.test(lr.className))!=null&&yn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const vi=a.textContent;a.textContent="";const Pa=Wc(vi!=null?vi:"","displaystyle",y,!0);Pa&&a.append(Pa)}else Cp(lr,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=xe(xe({},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:""),Lf(),_s("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=fu.singleton;return b?(b.show(),Dd(),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}Ls({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function mu(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function T1(){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 D1(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 de=y!=null?y:{};(b=de.renderToMarkup)!=null||(de.renderToMarkup=qo),(E=de.renderToMathML)!=null||(de.renderToMathML=Bv),(ee=de.renderToSpeakableText)!=null||(de.renderToSpeakableText=Nv),(re=de.serializeToLatex)!=null||(de.serializeToLatex=Fv),x1(ae,de)}var I1={mathlive:"0.98.5"}},17423:function(Cn,Xt,se){"use strict";se.d(Xt,{Z:function(){return xe}});const fe=pe=>typeof pe=="object"&&pe!=null&&pe.nodeType===1,et=(pe,Te)=>(!Te||pe!=="hidden")&&pe!=="visible"&&pe!=="clip",$e=(pe,Te)=>{if(pe.clientHeight<pe.scrollHeight||pe.clientWidth<pe.scrollWidth){const mt=getComputedStyle(pe,null);return et(mt.overflowY,Te)||et(mt.overflowX,Te)||(ze=>{const It=(Ct=>{if(!Ct.ownerDocument||!Ct.ownerDocument.defaultView)return null;try{return Ct.ownerDocument.defaultView.frameElement}catch(ht){return null}})(ze);return!!It&&(It.clientHeight<ze.scrollHeight||It.clientWidth<ze.scrollWidth)})(pe)}return!1},Ue=(pe,Te,mt,ze,It,Ct,ht,Ye)=>Ct<pe&&ht>Te||Ct>pe&&ht<Te?0:Ct<=pe&&Ye<=mt||ht>=Te&&Ye>=mt?Ct-pe-ze:ht>Te&&Ye<mt||Ct<pe&&Ye>mt?ht-Te+It:0,be=pe=>{const Te=pe.parentElement;return Te==null?pe.getRootNode().host||null:Te},Se=(pe,Te)=>{var mt,ze,It,Ct;if(typeof document=="undefined")return[];const{scrollMode:ht,block:Ye,inline:De,boundary:At,skipOverflowHiddenElements:Jt}=Te,nt=typeof At=="function"?At:gn=>gn!==At;if(!fe(pe))throw new TypeError("Invalid target");const lt=document.scrollingElement||document.documentElement,Ie=[];let ke=pe;for(;fe(ke)&&nt(ke);){if(ke=be(ke),ke===lt){Ie.push(ke);break}ke!=null&&ke===document.body&&$e(ke)&&!$e(document.documentElement)||ke!=null&&$e(ke,Jt)&&Ie.push(ke)}const je=(ze=(mt=window.visualViewport)==null?void 0:mt.width)!=null?ze:innerWidth,Xe=(Ct=(It=window.visualViewport)==null?void 0:It.height)!=null?Ct:innerHeight,{scrollX:Pt,scrollY:kt}=window,{height:Lt,width:Ge,top:Ht,right:Dt,bottom:Ln,left:un}=pe.getBoundingClientRect(),{top:Rn,right:ir,bottom:yr,left:Qe}=(gn=>{const Je=window.getComputedStyle(gn);return{top:parseFloat(Je.scrollMarginTop)||0,right:parseFloat(Je.scrollMarginRight)||0,bottom:parseFloat(Je.scrollMarginBottom)||0,left:parseFloat(Je.scrollMarginLeft)||0}})(pe);let Le=Ye==="start"||Ye==="nearest"?Ht-Rn:Ye==="end"?Ln+yr:Ht+Lt/2-Rn+yr,Nt=De==="center"?un+Ge/2-Qe+ir:De==="end"?Dt+ir:un-Qe;const Nn=[];for(let gn=0;gn<Ie.length;gn++){const Je=Ie[gn],{height:st,width:_t,top:en,right:Bt,bottom:Ft,left:zt}=Je.getBoundingClientRect();if(ht==="if-needed"&&Ht>=0&&un>=0&&Ln<=Xe&&Dt<=je&&Ht>=en&&Ln<=Ft&&un>=zt&&Dt<=Bt)return Nn;const Mn=getComputedStyle(Je),bn=parseInt(Mn.borderLeftWidth,10),Ee=parseInt(Mn.borderTopWidth,10),ce=parseInt(Mn.borderRightWidth,10),le=parseInt(Mn.borderBottomWidth,10);let ye=0,ve=0;const oe="offsetWidth"in Je?Je.offsetWidth-Je.clientWidth-bn-ce:0,He="offsetHeight"in Je?Je.offsetHeight-Je.clientHeight-Ee-le:0,xt="offsetWidth"in Je?Je.offsetWidth===0?0:_t/Je.offsetWidth:0,Yt="offsetHeight"in Je?Je.offsetHeight===0?0:st/Je.offsetHeight:0;if(lt===Je)ye=Ye==="start"?Le:Ye==="end"?Le-Xe:Ye==="nearest"?Ue(kt,kt+Xe,Xe,Ee,le,kt+Le,kt+Le+Lt,Lt):Le-Xe/2,ve=De==="start"?Nt:De==="center"?Nt-je/2:De==="end"?Nt-je:Ue(Pt,Pt+je,je,bn,ce,Pt+Nt,Pt+Nt+Ge,Ge),ye=Math.max(0,ye+kt),ve=Math.max(0,ve+Pt);else{ye=Ye==="start"?Le-en-Ee:Ye==="end"?Le-Ft+le+He:Ye==="nearest"?Ue(en,Ft,st,Ee,le+He,Le,Le+Lt,Lt):Le-(en+st/2)+He/2,ve=De==="start"?Nt-zt-bn:De==="center"?Nt-(zt+_t/2)+oe/2:De==="end"?Nt-Bt+ce+oe:Ue(zt,Bt,_t,bn,ce+oe,Nt,Nt+Ge,Ge);const{scrollLeft:pn,scrollTop:dn}=Je;ye=Yt===0?0:Math.max(0,Math.min(dn+ye/Yt,Je.scrollHeight-st/Yt+He)),ve=xt===0?0:Math.max(0,Math.min(pn+ve/xt,Je.scrollWidth-_t/xt+oe)),Le+=dn-ye,Nt+=pn-ve}Nn.push({el:Je,top:ye,left:ve})}return Nn},Me=pe=>pe===!1?{block:"end",inline:"nearest"}:(Te=>Te===Object(Te)&&Object.keys(Te).length!==0)(pe)?pe:{block:"start",inline:"nearest"};function xe(pe,Te){if(!pe.isConnected||!(It=>{let Ct=It;for(;Ct&&Ct.parentNode;){if(Ct.parentNode===document)return!0;Ct=Ct.parentNode instanceof ShadowRoot?Ct.parentNode.host:Ct.parentNode}return!1})(pe))return;const mt=(It=>{const Ct=window.getComputedStyle(It);return{top:parseFloat(Ct.scrollMarginTop)||0,right:parseFloat(Ct.scrollMarginRight)||0,bottom:parseFloat(Ct.scrollMarginBottom)||0,left:parseFloat(Ct.scrollMarginLeft)||0}})(pe);if((It=>typeof It=="object"&&typeof It.behavior=="function")(Te))return Te.behavior(Se(pe,Te));const ze=typeof Te=="boolean"||Te==null?void 0:Te.behavior;for(const{el:It,top:Ct,left:ht}of Se(pe,Me(Te))){const Ye=Ct-mt.top+mt.bottom,De=ht-mt.left+mt.right;It.scroll({top:Ye,left:De,behavior:ze})}}}}]);
|
|
|
}()); |